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-04-17 20:24:33 +00:00
|
|
|
// ====
|
|
|
|
// compileViaYul: also
|
2019-08-07 17:21:32 +00:00
|
|
|
// ----
|
2020-02-18 11:57:48 +00:00
|
|
|
// constructor(), 2 wei: 3 ->
|
2021-02-18 18:33:05 +00:00
|
|
|
// gas legacy: 148000
|
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
|