Glossary definition

Checks-Effects-Interactions

Checks-Effects-Interactions is a smart contract ordering pattern: validate conditions, commit internal state changes, then call external code.

also: CEI pattern, CEI · reviewed July 22, 2026

The pattern narrows the window in which an external callee can observe or act on inconsistent state. A withdrawal, for example, should validate the balance, reduce that balance, and only then transfer control to the recipient.

CEI is a reasoning tool rather than a universal patch. Cross-contract state, token callbacks, intentionally deferred accounting, and calls made by a later layer can reintroduce the same class of problem. Guards, pull-payment designs, and post-call assertions may still be appropriate. Solidity’s security considerations use the pattern in their reentrancy guidance.

Used in context

Articles using this term.