solidity/test/libsolidity/semanticTests/functionCall/send_zero_ether.sol
2020-03-19 14:42:25 +01:00

20 lines
446 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() public payable {}
function s() public returns (bool) {
Receiver r = new Receiver();
return address(r).send(0);
}
}
// ----
// constructor(), 20 wei ->
// s() -> true