Why Is a Contract’s State Considered Inconsistent after an Unchecked Failed External Call?
If a contract performs a state change (Effect) before an external call (Interaction) and then the external call fails, the state remains consistent. However, if the external call happens before the state change, and the call fails, the contract might still proceed to execute subsequent logic, leading to an inconsistent state.
For example, a contract might record a withdrawal as successful without the funds actually being sent.
Glossar
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.
Failed External Call
Failure ⎊ A failed external call, within cryptocurrency derivatives and options trading, signifies an unsuccessful attempt by a trading system or application to transmit data or execute an order through an external service.
External Call
Interaction ⎊ This describes a smart contract's necessary communication with an entity outside its immediate execution environment, most commonly an oracle network to fetch real-world asset prices or event outcomes.