What Specific State Changes (Effects) Should Be Prioritized before an External Call?
The most critical state change to prioritize is updating the balance or entitlement of the caller. For example, in a withdrawal function, the user's balance must be set to zero or reduced before the Ether is transferred.
Other important state changes include updating counters, changing ownership status, or marking a condition as met. Essentially, any variable that the external call's success or failure depends on, or any variable that could be exploited if left unchanged, must be updated before the interaction occurs.
Glossar
External Calls
Call ⎊ External calls, within cryptocurrency derivatives and options trading, represent off-exchange communications impacting price discovery and order flow.
State Change
Transition ⎊ The atomic update of the distributed ledger's state, triggered by the successful validation of a new block, which incorporates all new transactions and modifies account balances or contract storage.
State Changes
Transition ⎊ State changes within cryptocurrency, options, and derivatives represent shifts in the underlying conditions governing contract valuation and risk profiles.