Skip to content

Instantly share code, notes, and snippets.

@andelf
Created August 28, 2020 23:31
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 andelf/f978d2dff97f791ae64d0a507a69623a to your computer and use it in GitHub Desktop.
Save andelf/f978d2dff97f791ae64d0a507a69623a to your computer and use it in GitHub Desktop.
Bug
// Store.sol
pragma solidity >0.5.9;
contract Store {
uint256 internal value;
// 5247 energy
function reset() external {
value = 0;
}
// 20287 energy
function setValue(uint256 v) external {
value = v;
}
// 10323 energy
function setValueFuck(uint256 v) external {
value = 0;
value = v;
}
function getValue() external view returns (uint256) {
return value;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment