Skip to content
Discussion options

You must be logged in to vote

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.

Replies: 1 comment 5 replies

Comment options

You must be logged in to vote
5 replies
@cromewar
Comment options

@P1X37s
Comment options

@avikat
Comment options

@P1X37s
Comment options

@cromewar
Comment options

Answer selected by cromewar
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
4 participants