Found Academy useful? A $5 donation by May 14 helps us ship more, faster. Every donor counts (QF matching).

Donate
All glossary terms
Security

Invariant

A condition that must always be true throughout a contract's execution. In Uniswap V2, the key invariant is x * y >= k after every swap. Violations of invariants indicate bugs or exploits. Invariant testing (fuzzing) is a powerful technique for finding vulnerabilities.

Related terms in Security