Contract safety · Invariant testing
Invariant test generator
Generate Foundry, Echidna or Medusa invariant tests and handlers from a contract ABI.
Contract ABI
The generator reads the ABI's function list and scaffolds one handler per state-changing function.
Options
Used for the test contract's name and the commented-out import.
Which runner the generated suite targets.
The JSON array from your build artifact's abi field.
No test suite yet
Paste an ABI and the generated invariants, handlers and view helpers appear here, ready to copy into your test folder.
Framework notes
These follow the framework you picked above.
Best for: Developers already using Foundry ecosystem
Properties: Use invariant_ prefix functions
Run: forge test --match-contract InvariantTest
About this tool
Invariant testing, also called stateful fuzzing, calls a contract's functions in random order and checks properties that must always hold, such as total supply equalling the sum of balances. Paste a contract ABI and this generator scaffolds a Foundry, Echidna or Medusa suite with a handler for every state-changing function and helpers for view functions. You then write the invariants your contract needs.