solidity/test/libsolidity/semanticTests/various/value_insane.sol
2021-11-15 16:32:45 +01:00

28 lines
548 B
Solidity

contract helper {
function getBalance() public payable returns (uint256 myBalance) {
return address(this).balance;
}
}
contract test {
helper h;
constructor() payable {
h = new helper();
}
function sendAmount(uint256 amount) public returns (uint256 bal) {
return h.getBalance{value: amount + 3, gas: 1000}();
}
}
// ====
// compileViaYul: also
// ----
// constructor(), 20 wei ->
// gas irOptimized: 187835
// gas legacy: 266728
// gas legacyOptimized: 184762
// sendAmount(uint256): 5 -> 8