Welcome to ExamTopics
ExamTopics Logo
- Expert Verified, Online, Free.
Location Chicago IL, USA

Exam CBSA topic 1 question 74 discussion

Actual exam question from Blockchain's CBSA
Question #: 74
Topic #: 1
[All CBSA Questions]

When writing and considering push and pull in a smart contract that involves "user" funds would it be better to ____________________?

  • A. Withdraw funds rather than pull funds to them automatically
  • B. Withdraw funds rather than push funds to them automatically
  • C. Pull funds rather than push funds to them automatically
  • D. Push funds rather than pull funds to them automatically
Show Suggested Answer Hide Answer

Suggested Answer: B
Withdraw funds rather than push funds to them automatically Favor pull over push for external calls as we've seen, external calls can fail for a number of reasons, including external errors. To minimize the damage caused by such failures, it is often better to isolate each external call into its own transaction that can be initiated by the recipient of the call. This is especially relevant for payments, where it is better to let users withdraw funds rather than push funds to them automatically. (This also reduces the chance of problems with the gas limit.)
Reference:
https://github.com/ethereum/wiki/wiki/Safety#favor-pull-over-push-for-external-calls

Comments

Krisc
1 year, 5 months ago
As far as I can see, B and C are the same. Pull should be the same as withdraw? Indeed pull is a more generic term, as the principle applies to more than just currency. Indeed, the title of the paragraph in the reference is "Favor pull over push for external calls"
upvoted 2 times
...

SaveCancel