F FIREPAN × STAKE DAO Case Study
Case Study · Stake DAO

How Firepan found a ~$1,400 reward-skim in Stake DAO lending that a prior audit missed — principal untouched.

An invariant engine flagged a reward-conservation counterexample in contracts that had already passed an audit. Firepan chased it down to REWARD-1: a live, permissionless, repeatable skim from depositors' rewards — reward emissions only, with depositor principal never at risk — sized on-chain at 6,537 CRV (~$1,400 at the sizing block), reproduced by Stake DAO's own engineer on a mainnet fork, and remediated across every affected market since.

Stake DAO is a long-running liquid-locker and yield protocol. Its lending vertical wraps reward-bearing strategies behind a leverage router and a Morpho liquidation path — real value, real depositor rewards, and a wrapper family that had already been through a security audit before Firepan was engaged.

That is the hard setting for an audit: not a greenfield contract, but one another firm has already signed off on. The job is not to re-run the same checklist and arrive at the same clean bill of health — it is to find what the first pass didn't. Matching the incumbent proves nothing. Beating them is the entire point.

01

Engagement at a Glance

1
High a prior audit missed
6,537
CRV drainable · ~$1,400 at sizing block
Reproduced by Stake DAO's engineer
1 line
The fix (per reward path)
Surfaced by an invariant / conservation engine, not a checklist Mainnet-fork PoC · sized against live on-chain state

"The invariant approach surfaced a reward-accounting edge that past audits and reviews had not identified. Firepan reproduced it on a fork before rating it, quantified the real-world impact, and we had a verified fix out the same day. Firepan's AI platform delivered real value to Stake DAO and it's exactly the kind of tool all DeFi founders should be using."

Stake DAO
imqdee
Protocol Engineer · Stake DAO
02

The Challenge

Reward accounting is where DeFi protocols hide their quiet bugs. The headline exploits — flash-loan price manipulations, reentrancy drains — get the attention and the checklists. But the per-user reward-checkpoint math that decides who is owed what, accruing silently every block across thousands of depositors, is exactly the kind of code that passes a review because it looks right and the obvious tests pass.

Stake DAO's StrategyWrapper family is that kind of code, and it had already been audited. So the bar was not "is this contract safe?" — someone had already answered that. The bar was: is there something true about this contract that a careful first pass would not have caught? A checklist re-run was never going to find it. The bug, if it existed, would be in a place a human reading line-by-line would skim past as obviously fine.

That is precisely the kind of bug a machine-checked invariant catches and a checklist does not — if you encode the right invariant, and if you are willing to chase its counterexample instead of explaining it away.

03

How We Found It

Firepan ran the reward-bearing wrappers through an invariant / conservation engine — an analysis that asserts economic conservation laws the contract must always satisfy. The law here is simple and load-bearing: the sum of reward payouts can never exceed the emissions the wrapper actually received. If that ever breaks, someone is being paid with rewards that belong to someone else.

The engine produced a counterexample: a sequence of operations under which payouts exceeded emissions. The honest, easy move at that point is to assume it is a harness artifact — invariant engines produce false alarms, and dismissing them is faster than chasing them. Firepan chased it.

It resolved to a single line. StrategyWrapper._claim advances a depositor's reward checkpoint only when their floored payout is non-zero. Deposit one wei, let a period pass so your tiny pending rounds to zero — your checkpoint never moves. Then deposit a large amount and claim: you apply the old period's per-token rate to your new, large balance, and skim the shared reward pot. Permissionless, profit-motivated, repeatable every period, with the capital fronted for a single block. Firepan wrote a deterministic mainnet-fork proof-of-concept, sized it against live state — 6,537 CRV drainable on one wrapper, with the same code on every deployment — and found the identical defect on the extra-reward path. Then disclosed it to Stake DAO the same day, with the PoC and a verified one-line fix.

04

The Finding

One line of code, one line of fix — but a live, profit-motivated reward skim that the contract's prior audit did not surface.

High · Confirmed Fix Verified REWARD-1 · StrategyWrapper._claim
A stale reward checkpoint lets a 1-wei depositor skim the shared reward pot — reward emissions only, depositor principal untouched.
_claim advances a user's reward checkpoint only inside if (amount != 0). A depositor whose payout floors to zero keeps a stale checkpoint, grows their balance, then claims the old period's rate against the new balance — skimming rewards that belong to other depositors. Depositor principal was never at risk: the wrapped collateral, the Morpho positions, and the LP backing are never touched, and the 1:1 backing invariant holds throughout — the exposure is confined to the shared reward pot. Because the same _claim runs inside withdraw() and claimLiquidation(), a depleted pot could also delay honest users' reward claims on exit. Live and sized on-chain (6,537 CRV — ~$1,400 — on the frxUSD/msUSD wrapper). The fix: always advance the checkpoint, even on a zero payout — verified against the PoC, attacker drops to zero, the pot stays whole.

Alongside REWARD-1, the review surfaced two Mediums, both with one-line or parameter fixes: DUST-1 — a permissionless 1-wei grief that bricks the live leverage-unwind path via Morpho's arbitrary-receiver withdrawCollateral (fork-bounded to a recoverable liveness denial-of-service, so Firepan and Stake DAO jointly locked it at Medium rather than inflating it), and M-1 — a thin depeg buffer on a synthetic-stable market. The full per-finding detail, bounds, and PoCs are in the technical report.

05

The Discipline

Two things about how REWARD-1 was handled matter as much as the finding itself.

Firepan reproduced before it rated. REWARD-1 shipped with a deterministic PoC and live on-chain sizing, and Stake DAO's own engineer reproduced it on a mainnet fork — so there was no severity argument to have. And when the next finding, DUST-1, turned out under fork-testing to be a recoverable griefing nuisance rather than a drain, Firepan locked it at Medium with the client instead of dressing it up as a second High. A report's credibility is its worst overstatement; there wasn't one.

A counterexample is a lead, not a verdict. The value was in chasing the one that turned out real — and not inflating the one that didn't.

That is the difference between a checklist and an adversary. The prior audit was not careless; reward-checkpoint bugs are genuinely easy to read past. What caught this was encoding the conservation law as a machine-checked invariant, and then doing the unglamorous work of running its counterexample to ground instead of assuming it was noise.

06

Why It Matters

"Already audited" is not the same as "safe." A first audit narrows the field; it does not exhaust it — especially in the quiet accounting code where the obvious tests pass and the bug is one branch deep. A second set of eyes is only worth engaging if it can find what the first set missed. That is the bar Firepan holds itself to: not to match the incumbent, but to beat them.

For Stake DAO, that meant a live, profit-motivated reward skim caught before it was exploited, sized against real on-chain value, disclosed the same day with a verified fix, and reproduced by their own engineer — on contracts that had already been signed off. The fix was one line per reward path. The cost of not finding it was every depositor's rewards, every period, on every wrapper.

This is what Firepan was built for: encoding the invariants a checklist can't, chasing the counterexamples a human would explain away, and finding the bug the last audit didn't — in days, not months.

Fully remediated. Stake DAO adopted the one-line fix on both reward paths and has since upgraded every affected market to the corrected wrapper code — the finding is remediated protocol-wide as of publication.

The full technical report is published alongside this case study at firepan.com/reports/stakedao-lending-v1/ (FP-AUDT-2026-0006), with the per-finding detail, the mainnet-fork PoCs, the on-chain sizing, and the verified fixes.

Talk to Firepan

Already audited? Find out what the first pass missed.

Firepan encodes the conservation invariants a checklist can't, chases the counterexamples a human would explain away, and reproduces every finding with a runnable PoC before rating it. Same engine that found REWARD-1 in Stake DAO's already-audited wrappers — a live reward-pot skim (principal never at risk) a prior audit didn't surface.

Book a Review → Continuous coverage available · or compare plans
Read the full audit report → firepan.com/reports/stakedao-lending-v1
Learn more about Stake DAO → stakedao.org
Run a Firepan engagement → firepan.com · contact@firepan.com
FP-AUDT-2026-0006 · Stake DAO lending review · June 2026