Skip to content

Instantly share code, notes, and snippets.

@mudgen
Last active January 25, 2022 16:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mudgen/676e96500d9a63abeb18de6f9d49350a to your computer and use it in GitHub Desktop.
Save mudgen/676e96500d9a63abeb18de6f9d49350a to your computer and use it in GitHub Desktop.
// SPDX-License-Identifier: MIT
pragma solidity 0.8.11;
function doIt() external {
uint256 length = myArray.length; // state read
uint b;
for(uint256 i; i < length; i++) { // local reads
b++; // local write
}
mySum = b; // state write
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment