solidity/test/libsolidity/semanticTests/smoke/constructor.sol
Daniel Kirchner 4b9c01752d Test updates.
2022-03-16 15:34:38 +01:00

25 lines
522 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;
}
}
// ====
// compileViaYul: also
// ----
// constructor(), 2 wei: 3 ->
// gas irOptimized: 107627
// gas legacy: 151416
// gas legacyOptimized: 108388
// state() -> 3
// balance() -> 2
// balance -> 2
// update(uint256): 4
// state() -> 4