invariant-gen: open-source invariant harnesses for ERC-4626 and cTokens
Abstract
We have published invariant-gen, an open source toolkit for invariant-based security testing of smart contracts.
Two worked examples
- ERC-4626 vaults: a catalog of economic and safety invariants exercised against purpose-built vulnerable and correct vaults.
- Compound-V2 cTokens: the same approach run against verbatim real Venus Protocol source at pinned historical commits. The generator-produced harness blindly re-discovers the donation / exchange rate inflation bug on the vulnerable commit and stays silent on the official fix (PR #664).
The idea
An invariant is validated by a function body that fuzzing can break, not by prose. MIT licensed.
Repository
github.com/secrypta/invariant
· related: ERC-4626 invariant harness
· upgrade governance.