solidity/test/libsolidity/semanticTests/smoke/constructor.sol
Daniel Kirchner 44da8507b1 Change default EVM version to Shanghai.
Co-authored-by: Rodrigo Q. Saramago <rodrigoqsaramago@gmail.com>
2023-05-08 16:34:23 +02:00

23 lines
491 B
Solidity

contract C {
uint public state = 0;
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 ->
// gas irOptimized: 106374
// gas legacy: 148308
// gas legacyOptimized: 106727
// state() -> 3
// balance() -> 2
// balance -> 2
// update(uint256): 4
// state() -> 4