State Update Ordering
State update ordering is the logical sequence in which a smart contract modifies its internal data. In secure contract design, state updates must be finalized before any external calls are made to prevent reentrancy and other logic-based exploits.
If a contract updates a balance only after sending funds to an external entity, that entity could call back into the contract to withdraw funds again before the first balance update is registered. Proper ordering ensures that the contract's internal view of the world is always accurate and consistent.
This practice is a core tenet of secure programming in Solidity and other blockchain languages. By strictly controlling the order of operations, developers prevent attackers from exploiting the time gap between a transaction initiation and its completion.