solidity/test/libsolidity/semanticTests/various/value_complex.sol
2020-05-19 17:42:19 +02:00

26 lines
522 B
Solidity

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