hey guys im doing a simple exercise from Mastering Ethereum. Can someone tell me if I have any strange mistakes in the code? And please tell me if I am using 'payable(msg.sender...' correctly.

pragma solidity >=0.5.0;

contract Faucet {
receive() external payable {}

function withdraw(uint256 withdraw_amount) public {

require(withdraw_amount <= 100000000000000000);

payable(msg.sender).transfer(withdraw_amount);
}
}

Feb 18, 2022, 2:08 AM
it compiled - but i had to make lots of changes from the outdated exercise in the book...
Feb 18, 2022, 2:09 AM

© 2024 Draquery.com All rights reserved.