Lesson 3: withdraw function error #116
-
Hi! I'm getting this error and can't compile. |
Beta Was this translation helpful? Give feedback.
Answered by
davidyuill27
Sep 30, 2021
Replies: 2 comments 4 replies
-
You need to cast msg.sender to address payable. See: https://docs.soliditylang.org/en/v0.6.0/types.html#address |
Beta Was this translation helpful? Give feedback.
3 replies
Answer selected by
PatrickAlphaC
-
You’re casting the wrong variable. You want to cast msg.sender because that is type address not address payable. Write payable(msg.sender).transfer (…) |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You need to cast msg.sender to address payable.
See: https://docs.soliditylang.org/en/v0.6.0/types.html#address