Welcome to ExamTopics
ExamTopics Logo
- Expert Verified, Online, Free.
exam questions

Exam CBSA All Questions

View all questions & answers for the CBSA exam

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

Chosen Answer:
This is a voting comment (?) , you can switch to a simple comment.
Switch to a voting comment New
Krisc
4 years, 9 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
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

SaveCancel
Loading ...