Secrypta Crypto security lab
RU / EN
Release Project: invariant-gen·open-source · MIT 14 November 2026·2 min read

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.