-
Beta Was this translation helpful? Give feedback.
Answered by
00Amir00
Jan 29, 2022
Replies: 1 comment 5 replies
-
|
Solution: payable(msg.sender).transfer(address(this).balance); |
Beta Was this translation helpful? Give feedback.
5 replies
Answer selected by
cromewar
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment

Solution: payable(msg.sender).transfer(address(this).balance);
In Solidity, there is a difference between a normal address and a payable address, so the correct way to send ETH to a sender would be payable(msg.sender).transfer(address(this).balance); -> This converts the normal address to a payable address.