Receive
Receive()
It cannot have arguments.
It cannot return data.
It has
external
visibility and is markedpayable
.
The receive
method is used as a fallback function in a contract and is called when ether is sent to a contract with no calldata. If the receive
method does not exist, it will use the fallback
function.
receive() external payable
— for empty calldatafallback() external payable
— when no other function matches (not even the receive function). Optionallypayable
.
Links:
Last updated