solidity/test/libsolidity/semanticTests/smoke/constructor.sol

23 lines
491 B
Solidity
Raw Normal View History

contract C {
uint public state = 0;
2020-06-23 12:14:24 +00:00
constructor(uint _state) payable {
state = _state;
}
function balance() public payable returns (uint256) {
return address(this).balance;
}
function update(uint _state) public {
state = _state;
}
}
// ----
// 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
// state() -> 3
// balance() -> 2
// balance -> 2
// update(uint256): 4
// state() -> 4