DFIELDSOLUTIONS

Free download

LabFoundry invariant starter · for smart contracts

Starter scaffold for invariant testing in Foundry · handlers, ghost variables, 8 patterns with ready code. MIT.

Free download1 sections · 2 min readBy Dezső Mező · Published .mdtemplateSolidity + Markdownblockchainfoundryinvariantaudit

Starter scaffold for invariant testing in Foundry · handlers, ghost variables, 8 patterns with ready code. MIT.

Foundry invariant-test scaffold · base Handler, ghost state, pre/post-delta asserts, cross-function coupling test, conservation, monotonicity, bounded-state. Ready with 200k fuzz runs.

01What the file contains

  • Base Handler contract template
  • 8 invariant patterns with ready Foundry code
  • Ghost-variable pattern for property tracking
  • forge-config + optimal fuzz-run parameters
  • CI integration · GitHub Actions workflow

What to take away

  • Base Handler contract template
  • 8 invariant patterns with ready Foundry code
  • Ghost-variable pattern for property tracking
  • forge-config + optimal fuzz-run parameters
  • CI integration · GitHub Actions workflow

Terms used in this piece

We build this for clientsBlockchain

Read the full write-up

More from the lab

Browse all entries

Want this looked at on your own system?Start a conversation

5.0
“New shop, more orders in the first week.”Müller Márk · GeekCornerManaging Director · Hungary