Invariant fuzzing audits for smart contracts
An invariant fuzzing audit turns your protocol’s safety properties into executable invariants, then fuzzes every reachable state against them. At Guardian it runs inside every smart contract audit, and the suite stays in your repository.
Smart contract audits for




Jupiter

Olympus
Limit Break
Dolomite
Onchain · Invariant Fuzzing
What has to hold, whatever order the calls arrive in.
- Solvency What the protocol holds covers what it owes. In MUX’s report: “Collateral pool’s aum is always greater or equal to reservedUsd.”
- Caps and limits Limits hold under any sequence of calls. MUX’s “Total open interest in USD for a market must not exceed its configured cap” broke under fuzzing.
- Accounting Balances, shares and claims add up. In Nashpoint’s report: “Escrow Asset Balance Must Be >= Sum Of All claimableAssets.”
- Fees and rewards No one is paid more than was earned. In Gamma’s limit orders report: “The sum of user fees for a position never exceeds the total fees.”
- Rounding and math Formulas behave at the edges, where AI is weakest. MUX’s “Filling a position should not fail due to rounding” broke.
- Liquidations The checks that keep the protocol solvent never fail. In Synthetix’s BFP Market report: “isPositionLiquidatable never reverts.”
- State machines Orders, requests and positions move only through allowed states. Gamma: “An order that is executed should not be able to be executed again.”
- Pools and liquidity Liquidity never goes negative or overflows. In Poolshark’s Limit report: “Pool liquidity never underflows.”
50 of Guardian’s public reports list the suite’s invariants and mark each one Held or Broken, so you can read what was asserted before you book. The examples above are from MUX, Nashpoint, Gamma, Synthetix and Poolshark.
How it runs
From properties to a suite you keep
- 01
Properties
Guardian’s fuzzing researchers write down what must always hold: solvency, accounting, limits, and what each role may do.
- 02
Harness
Each property becomes an executable invariant in a stateful harness that fuzzes beneath both teams’ review.
- 03
Fuzz and triage
Each invariant meets random call sequences, often millions of times. A broken one is worked back to its cause, and only human-verified findings reach the report.
- 04
Hand over
The suite stays in your repository as a regression harness for fixes, retesting and every change you ship afterwards.
The suite is one of three passes over the same code. Team A pairs expert manual review with it, Team B runs Helix, Guardian’s AI auditor, and Guardian’s Head of Fuzzing leads the practice that builds it.
Public findings
Bugs Guardian’s fuzzing caught.
Each card links a finding in a public Guardian report that the GMX client story or the Umami and Orderly case studies credit to fuzzing. All were resolved.
-
C-01GMX GLV · Critical
Above the PnL cap, GLV valued GM tokens differently on deposit and withdrawal, so an attacker could mint low and redeem high, repeatedly. It is the kind of bug invariant fuzzing catches and a manual read passes over.
Accounting Read the finding C-01 in the GMX GLV report
-
AV-1Umami · Critical
A request made in one asset vault could be cancelled in the other, refunding USDC for an ETH deposit.
State machines Read the finding AV-1 in the Umami GMI Index report
-
ATPH-2Orderly · Medium
Half-up rounding returned −1 for 10 divided by 11, because a zero quotient took the negative branch.
Rounding Read the finding ATPH-2 in the Orderly Perpetuals Protocol report
“Having seen many audits over many years, no one even comes close to Guardian’s approach, and the quality of the audit is unmatched.”
KalebSynthetixPublished work
Suites that stayed with the code.
- Client storyGMX13,279 lines of Guardian proof-of-concept tests, running in GMX’s CI on every change.
- Case studySynthetix BFP Market22 invariants, 140M+ runs, and an Echidna harness for future updates.
- Case studyPoolshark Limit22 invariants, over half a billion runs, and a harness Poolshark still uses.
- Client storyEthena timelockSeven contest entries attacked a mechanism fuzzed as an invariant. It held.
- Case studySynthetix LP Vault20M+ runs, and a hardened suite for continued assurance.
- Case studyGMX keeperA fuzzing harness that checks keeper math against the contracts, which GMX can keep running.
- ReportGamma GMX V2 vault16 invariants, and a public fuzzing suite built for the vault.
- Client storyJupiter Lend referralA Solana fuzzing suite with full coverage of the program.
Questions
Invariant fuzzing questions
What is invariant fuzzing?
Invariant testing checks a property instead of single cases. Each invariant states something that must always hold, such as “isPositionLiquidatable never reverts”, and the fuzzer drives random sequences of calls through the reachable states, looking for one that breaks it.
Is invariant fuzzing included in a Guardian audit?
Yes. Every smart contract audit and every Vanguard engagement includes an invariant suite. Team A pairs manual review with it, and the suite stays with you for every later change.
Which protocols need smart contract fuzzing most?
Every Guardian smart contract audit includes a suite, but it matters most for new lending markets, AMMs and stablecoins, and for pricing and math cores. If you upgrade often, rerun the suite in CI on every change.
Does fuzzing replace manual review?
No. Manual review and AI both depend on asking the right question, and AI is weakest on the rounding cases that matter. Fuzzing starts from a property that broke and works back to the bug, so Guardian runs all three on the same scope.
Which fuzzers do you use?
Guardian’s public case studies describe Echidna harnesses for Synthetix’s BFP Market and Poolshark’s Limit. Our Foundry invariant testing guide shows how handlers, ghost variables and actors work in practice.
How is fuzzing different from formal verification?
Fuzzing hunts for call sequences that break a property you wrote. Formal verification checks whether it holds for every input, and needs specialists writing specs. Formal verification vs fuzzing vs audit suggests fuzzing for accounting-heavy code, and formal verification for a few critical properties in stable, high-value code.
Resource Hub
Before you book an audit.
- GuideFoundry invariant testingHandlers, ghost variables and actors, with code.
- ComparisonFuzzing vs formal verificationWhich one your code needs, and when.
- GuidePrepare for an auditDocs, code freeze, coverage and design habits that shrink the scope.
- GuideChoose an auditorThe questions to ask, the evidence to request and the red flags.
Smart Contract Audit
Other engagements
- Featured · Onchain Vanguard Audit A security audit designed to protect onchain teams facing unprecedented cyber risk. Explore Vanguard
- Managed services Managed Security Dedicated response team, red team, 24/7 attack and defense across every surface you run, onchain and off. Explore Managed Security
- OnchainPerp DEX AuditFunding, liquidations, oracles, auto-deleveraging and keepers.
- OnchainLending Protocol AuditInterest math, liquidations, oracles, bad debt, forks and credit.
- OnchainYield Vault AuditERC-4626 share math, strategies, fees and withdrawal queues.
- OnchainAMM and DEX AuditSwap math, ticks, rounding, fees, MEV, routers and order books.
- OnchainStablecoin AuditMint limits, roles, freezes, oracles and multichain deployments.
- OnchainDeFi Protocol AuditAccounting, oracles, liquidations and integrations.
- OffchainOffchain Automation PentestKeepers, relayers, bots and the automation-to-chain boundary.
- Smart contract auditAll auditsTwo independent teams, Helix AI and an invariant suite you keep.
Start now