Open-sourcing an ERC-4626 invariant harness

Open-sourceMIT Invariant testingNovember 13, 2026

We published a small, MIT-licensed security toolkit for Ethereum vaults: a catalog of invariants every ERC-4626 vault should uphold, plus a Foundry fuzzing harness that automatically throws thousands of operations at a vault and flags any broken rule.

To prove it works, it ships with toy vaults — some deliberately broken, some correct. The harness catches the donation/inflation bug on the broken ones and stays quiet on the fixed one, with zero false positives.

On a naive vault an attacker drains 100% of a victim's deposit; with OpenZeppelin's offset ≥ 3 the loss is dust.

Useful if you build vaults (point it at your own contract) or you're learning how invariant testing works in practice. Code and full write-up on GitHub.