Why shouldn’t you just send people their ether directly (push)?
The two main reasons that you developers prefer pull over push is because:
- You can run into security issues through having more complex code, which is also harder to read/digest.
- The contract may run out of gas when executing a push function/s to the recipients.
Push sends which are transferred to unknown addresses can implement a fallback function. This is why most reputable blockchain organisations advise for pull sends if a push can be avoided.
What’s the writers argument against the “pull” design?
The writer suggests in a later argument that having a pull design in the contract is detrimental to the user experience.
Particularly with new users who are not familiar with blockchain, they sometimes submit several requests to the contract before their initial call executes. They waste gas and it’s inconvenient in many cases.
As a general rule, the writer argued that the less people have to interact with a contract the better. People will be less likely to make mistakes if they only have to interact with the contract once.
What problem did the writer find with people not withdrawing their money?
The writer found that more than 10% of participants left their money on the contract for more than a week.
When he brought this to the community, users raised the question as to why the contract couldn’t auto-return the funds (or push transfer).
This brought upon the idea of some expiry period where people can withdraw their funds, else it would be put to use in some other way.