solidity/test/libsolidity/semanticTests/functionCall/send_zero_ether.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

25 lines
551 B
Solidity

// Sending zero ether to a contract should still invoke the receive ether function
// (it previously did not because the gas stipend was not provided by the EVM)
contract Receiver {
receive() external payable {}
}
contract Main {
constructor() payable {}
function s() public returns (bool) {
Receiver r = new Receiver();
return payable(r).send(0);
}
}
// ====
// compileToEwasm: also
// ----
// constructor(), 20 wei ->
// gas irOptimized: 100264
// gas legacy: 113411
// gas legacyOptimized: 100361
// s() -> true