How Does This Pattern Relate to the Concept of Atomic Transactions in Blockchains?
Atomic transactions in blockchains mean that a transaction either completes fully or fails entirely; there are no partial executions. The Checks-Effects-Interactions pattern operates within this atomic context.
While the entire function call is atomic, the order of operations inside it is crucial. A reentrancy attack exploits this internal ordering before the transaction is finalized.
The pattern ensures that the critical state changes are committed internally before any external interaction can hijack the execution flow, thus preserving the intended atomicity of the contract's logic.