solidity/test/libsolidity/semanticTests/functionCall/send_zero_ether.sol

22 lines
470 B
Solidity
Raw Normal View History

// 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 {
2020-06-23 12:14:24 +00:00
constructor() payable {}
function s() public returns (bool) {
Receiver r = new Receiver();
return address(r).send(0);
}
}
// ====
// compileViaYul: also
// ----
// constructor(), 20 wei ->
// s() -> true