Skip to content

Instantly share code, notes, and snippets.

@tumf
Created February 13, 2022 02:57
Show Gist options
  • Save tumf/5bce3d0abad122aeb67185cd0f7c8b4c to your computer and use it in GitHub Desktop.
Save tumf/5bce3d0abad122aeb67185cd0f7c8b4c to your computer and use it in GitHub Desktop.
//SPDX-License-Identifier: AGPL-3.0-or-later
pragma solidity 0.8.11;
contract Consumer{
uint256 public counter;
function counter1() public {
for(uint256 i; i<1000; i++){
counter = counter+i;
}
}
function counter2() public {
uint256 j = counter;
for(uint256 i; i<1000; i++){
j = j+i;
}
counter = j;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment