2

I am reading this article : https://medium.com/@jgm.orinoco/why-use-the-withdrawal-pattern-d5255921ca2a

It seems interesting. Could anyone explain the idea of the Withdrawal pattern in a simple way ?

1 Answer 1

1

The withdrawal pattern places the responsibility for claiming funds, on the recipient of the funds: the recipient has to send a transaction to withdraw and obtain their funds.

This can simplify a smart contract that is sending funds to recipients, because the contract does not have to handle the cases of what to do if sending the funds fail. A smart contract does not know whether sending the funds failed due to an actual error, or whether the recipient is a malicious smart contract that deliberately refuses to accept the funds.

2
  • How could a smart contract is able to refuse to accept the funds? @eth♦
    – alper
    Jan 8, 2020 at 22:09
  • @alper The classic example is a fallback function whose only code is revert().
    – eth
    Jan 18, 2020 at 7:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.