-
hey so i've been doing the FundMe contract but whenever i try to withdraw this happens TypeError: "send" and "transfer" are only available for objects of type "address payable", not "address".
--> Fund.sol:42:9:
|
42 | msg.sender.transfer(address(this).balance);
| ^^^^^^^^^^^^^^^^^^^ ``` //from the code function withdraw() public payable{
msg.sender.transfer(address(this).balance);
} i did the exact same steps as shown in the video but still |
Beta Was this translation helpful? Give feedback.
Answered by
mattjaf
Jul 25, 2022
Replies: 2 comments 2 replies
-
Let me know if the following fixes your problem:
|
Beta Was this translation helpful? Give feedback.
2 replies
-
oh, in solidity compiler version 8 we gotta specify that the address is a payable address for "send" and "transfer"
|
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
alymurtazamemon
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
oh, in solidity compiler version 8 we gotta specify that the address is a payable address for "send" and "transfer"
payable(msg.sender).transfer(address(this).balance);