Skip to content

Instantly share code, notes, and snippets.

@a2468834
Last active March 16, 2022 08:58
Show Gist options
  • Save a2468834/a33c70a7eabb9910fed808808599a684 to your computer and use it in GitHub Desktop.
Save a2468834/a33c70a7eabb9910fed808808599a684 to your computer and use it in GitHub Desktop.
// SPDX-License-Identifier: GPL-3.0
pragma solidity >=0.8.0 <0.9.0;
contract D1 {
function A() public pure { // 21437, MAX
uint256 x;
x+=1;
}
function B() public pure { // 21333, min
uint256 x;
x++;
}
function C() public pure { // 21350, mid
uint256 x;
++x;
}
}
contract D2 {
uint256 x = 1; // Avoid the assignment case from zero to non-zero
function A() public { // 26451, MAX
x+=1;
}
function B() public { // 26346, min
x++;
}
function C() public { // 26362, mid
++x;
}
}
contract D3 {
uint256 x = 1; // Avoid the assignment case from zero to non-zero
function A() external { // 26451, MAX
x+=1;
}
function B() external { // 26346, min
x++;
}
function C() external { // 26362, mid
++x;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment