Skip to content

Lesson 3 (FundMe): why is withdraw() payable? #1453

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

You must be logged in to vote

Hello @xavierdmello
The reason si because you are transferring Ethereum to the msg.sender.

As you are transferring the balance of the contract, the function is payable as you are "paying" to the wallet which si doing the withdraw.

Replies: 1 comment 2 replies

Comment options

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