Skip to content

Lesson 3: "send" and "transfer" are only available for objects of type "address payable", not "address". #1415

Answered by cromewar
MartinSoka asked this question in Q&A
Discussion options

You must be logged in to vote

Hello @MartinSoka the reason is because in solidity 0.8.x the payable identifier is not added automatically so the solution is this:
msg.sender.transfer(payable(address(this).balance)
Give it a try ;)

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@MartinSoka
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
2 participants