I try example from book Mastering Ethereum:
contract Faucet {
function withdraw(uint withdraw_amount) public {
require(withdraw_amount<=10000000000000000);
msg.sender.transfer(withdraw_amount);
}
function () public payable {}
}
Is error:
Error: Expected a state variable declaration. If you intended this as a fallback function or a function to handle plain ether transactions, use the "fallback" keyword or the "receive" keyword instead.
--> Faucet.sol:6:32:
|
6 | function () public payable {}
| ^
Compiler solc is in version 0.7.4. How correct it?