Why is withdraw function payable? #134
jasjyotsinghjaswal
started this conversation in
Ideas
Replies: 2 comments 2 replies
-
Great question! Let me answer with another question... does your code compile when you remove the |
Beta Was this translation helpful? Give feedback.
2 replies
-
From what i have learned, smart contracts are like banks,(not exactly) but let's assume it. When you withdraw,transfer ETH, it needs to be payable like any other banks you would find. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Do we really need to make withdraw function payable? Because based on what you explained earlier payable is only required when sending ETH to contract but here we are transferring eth from contract balance to senders account?
Beta Was this translation helpful? Give feedback.
All reactions