2019-08-07 17:21:32 +00:00
|
|
|
contract C {
|
|
|
|
uint public state = 0;
|
2020-06-23 12:14:24 +00:00
|
|
|
constructor(uint _state) payable {
|
2019-08-07 17:21:32 +00:00
|
|
|
state = _state;
|
|
|
|
}
|
|
|
|
function balance() public payable returns (uint256) {
|
|
|
|
return address(this).balance;
|
|
|
|
}
|
|
|
|
function update(uint _state) public {
|
|
|
|
state = _state;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
// ----
|
2020-02-18 11:57:48 +00:00
|
|
|
// constructor(), 2 wei: 3 ->
|
2022-05-23 10:54:18 +00:00
|
|
|
// gas irOptimized: 107003
|
2021-11-15 15:19:33 +00:00
|
|
|
// gas legacy: 151416
|
|
|
|
// gas legacyOptimized: 108388
|
2019-08-07 17:21:32 +00:00
|
|
|
// state() -> 3
|
|
|
|
// balance() -> 2
|
2021-02-18 18:33:05 +00:00
|
|
|
// balance -> 2
|
2019-08-07 17:21:32 +00:00
|
|
|
// update(uint256): 4
|
|
|
|
// state() -> 4
|