ExamGecko
Question list
Search
Search

Question 74 - CBSA discussion

Report
Export

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
Answers
A.
Withdraw funds rather than pull funds to them automatically
B.
Withdraw funds rather than push funds to them automatically
Answers
B.
Withdraw funds rather than push funds to them automatically
C.
Pull funds rather than push funds to them automatically
Answers
C.
Pull funds rather than push funds to them automatically
D.
Push funds rather than pull funds to them automatically
Answers
D.
Push funds rather than pull funds to them automatically
Suggested answer: B

Explanation:

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

asked 16/09/2024
Albaladejo Joffrey
37 questions
User
Your answer:
0 comments
Sorted by

Leave a comment first