Hi all,
Trying to learn somethings as shown on the video, but having an error.
Can you please advise why am I having this and what should I do to resolve it?
function withdraw() payable public {
msg.sender.transfer(address(this).balance);
}
TypeError: "send" and "transfer" are only available for objects of type "address payable", not "address".
--> contracts/FundMe.sol:35:9:
|
35 | msg.sender.transfer(address(this).balance);
| ^^^^^^^^^^^^^^^^^^^
Apr 17, 2023, 2:00 AM
add payable to the function
Apr 17, 2023, 3:14 AM