Lesson 3: "send" and "transfer" are only available for objects of type "address payable", not "address". #1415
-
Hi all, TypeError: "send" and "transfer" are only available for objects of type "address payable", not "address". This was not needed with 0.6.x. Any ideas where can i find the compiler release notes/key changes where its described that i need to type cast the address ? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
Hello @MartinSoka the reason is because in solidity 0.8.x the payable identifier is not added automatically so the solution is this: |
Beta Was this translation helpful? Give feedback.
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 ;)