Skip to main content

Contract Invariants

Definition

Contract Invariants are conditions or properties within a smart contract that must remain true before and after any transaction execution. These unchangeable rules are fundamental to the contract’s intended behavior and security. Developers specify invariants to ensure the integrity of the contract’s state and its stored assets. Verification of these invariants is critical for preventing logic errors and potential exploits.