Skip to content
This repository has been archived by the owner on May 24, 2022. It is now read-only.

Commit

Permalink
feat: playground for optimization
Browse files Browse the repository at this point in the history
  • Loading branch information
transmissions11 committed Dec 13, 2021
1 parent 0d763d7 commit 9daccc6
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 4 deletions.
4 changes: 2 additions & 2 deletions .gas-snapshot
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
testFunc2() (gas: 792)
testFunc1() (gas: 824)
testFunc2() (gas: 553851)
testFunc1() (gas: 553883)
22 changes: 20 additions & 2 deletions src/SampleContract.sol
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,25 @@
pragma solidity 0.8.10;

contract SampleContract {
function func1(uint256 num) external {}
uint256 num2;

function func2(uint256 num) external {}
function func1(uint256 num) external {
num2 = num;

for (uint256 i = 0; i < num; i++) {
num2--;
}

assert(num2 == 0);
}

function func2(uint256 num) external {
num2 = num;

for (uint256 i = 0; i < num; i++) {
num2--;
}

assert(num2 == 0);
}
}

0 comments on commit 9daccc6

Please sign in to comment.