# Merge 02: imdUSD v2 day 1, 10 goal items combined - **Commit:** `ff1c192b3798542997f600091f2dc73ff05e4c40` (https://github.com/imdusd/imdusd-v2-audit). All 10 items report this commit. - **Inputs (all present, SHA-256 checked against the brief):** item-core-loss-settlement, item-core-savings-migrator, item-x-event-records, item-stable-refusal-halt, item-stable-gas-starvation, item-stable-exits-liquidity, item-stable-deposits-caps, item-stable-relist-band-gov, item-peg-toll-hook, item-house-ledger-spoke. - **Missing:** none. Every item returned a non-empty result. - **Overall verdict:** `findings`. There are 4 findings, each from a different item with a different root cause: 2 low and reachable at deploy, 1 low and not reachable at deploy, 1 info and not reachable at deploy. No high or medium finding was reported. - **Merger check:** I cloned the repo at the commit and re-read the lines each finding cites: `src/peg/PegHook.sol:130-145,195-205`, `src/peg/StableModule.sol:243-266,340-352,590-596,700-706,978-1000`, `README.md:658-662,865-868,1062-1066`. Each finding's mechanism matches the code as described. I did **not** re-run any item's test. The test results below are as the items reported them. ## Tooling disclosure (per item) | item | forge | tests run? | |---|---|---| | core-savings-migrator | forge 1.9.0 (6056c5845d), `--use solar` (Solar 0.8.38) | yes | | peg-toll-hook | 1.8.3, solc 0.8.38 via_ir (no solar) | yes | | stable-relist-band-gov | 1.8.3, solc 0.8.38 via_ir | yes | | stable-exits-liquidity | 1.8.3, solc 0.8.38 via_ir | yes | | stable-deposits-caps | 1.8.3, solc 0.8.38 via_ir | yes | | house-ledger-spoke | 1.8.3 (cae51ad), solc 0.8.38 via_ir | yes | | core-loss-settlement | 1.8.3 | **no**: reasoned from code | | stable-refusal-halt | 1.8.3 | **no**: reasoned from code | | stable-gas-starvation | 1.8.3 | **no**: reasoned from code | | x-event-records | 1.8.3 | **no**: reasoned from code | The brief said that with forge older than 1.9 an item should report the version and reason from the code. Five items on 1.8.3 compiled with the already-installed solc 0.8.38 and ran tests anyway, which the brief allows when that solc is present. All four findings come from those 1.8.3 + solc 0.8.38 runs. None was run under solar. The four code-only items assert no findings, so their "holds" verdicts are **from code reading, not tests** (marked below). ## Findings, ranked by severity at deploy config | # | id | severity | reachable at deploy | item(s) | title | |---|---|---|---|---|---| | 1 | peg-toll-hook-F1 | low | yes | peg-toll-hook | Splitting a sell at the -1% wall pays ~14% of the toll; README:1064's "about a third" is worse than written | | 2 | SEL-1 | low | yes | stable-exits-liquidity | `quoteRedeem` promises 1 wei more than `redeem` pays on any exit that pulls from a vault whose share rate is not 1; `minOut = quote` reverts `Slippage` | | 3 | SDC-1 | low | no | stable-deposits-caps | `rebalance`'s vault guard is skipped while `booked == 0`; the first deposit into a fresh or emptied vault (or a successor applied by anyone) goes into a vault that releases nothing; releasing 1 wei counts as paying | | 4 | SRBG-1 | info | no | stable-relist-band-gov | `SET_BAND` to a new feed drops the old feed's round history; a matured apply by anyone opens minting over an unpoked <=0 or out-of-band round inside the reopen delay | **Dedup:** none of the four shares a root cause. Related observations that are not separate findings: - stable-refusal-halt (P2, untested info) says `poke` halts on any one-block read dip. stable-deposits-caps C4 and stable-relist-band-gov C2 tie this to the known README:867 line: "A one-block dip of a listed vault (latent): anyone's `poke` at such a dip books a hub loss and halts the leg for 48 h or more ... sUSDS (the only day-1 vault) cannot dip". So it is covered as written, not a finding. - stable-relist-band-gov C2 notes that `SET_YIELD`'s apply does not check what `withdraw(all)` paid (StableModule.sol:981). The next `poke` books the loss and halts, which is the same end state as `_pull`. Not reachable at deploy (sUSDS), not asserted as a finding. It is adjacent to SDC-1(b) (same `SET_YIELD` apply route, :984 sets `booked = 0`), but the root cause differs. --- ### 1. peg-toll-hook-F1 (low, reachable at deploy) - **Property / claim:** P1 / C2 (peg-toll-hook sheet) - **Files:** `src/peg/PegHook.sol:130`, `:142`, `:199`, `:205`, `README.md:1064` - **Known-issue line relied on and exceeded (README.md:1064-1065 at the commit):** "a push split into pieces pays about a third of the toll" - **Sequence:** The pool is at $1 and a seller wants to push it to -1.05%. One exact-in sale ending at -1.05% is tolled at 5.75% (the wall) on its whole output: 5,930.07 USDC. The same sale split into 48 slices (or any 20..100) in one block/tx pays 846.18 USDC, which is 14.26% of the single-swap toll. Each slice is tolled at the curve where it ends. Two swaps (-0.99% then -1.05%) pay 30.2%. - **Expected:** a split pays about a third of the toll or more. - **Actual:** at the -1% wall the curve steps from 1.5% to 5% (`PegHook.sol:199-205`, confirmed by the merger). `afterSwap` tolls at the END price (`:135-136`), so a split avoids almost all of the wall. The stable module (sink) receives ~1/7 of the toll the curve prices. At -2% the split pays 33.95%, as README states. - **Fix (item's):** price the toll along the path, i.e. the integral of the curve between start and end price (start sqrtPrice from beforeSwap or transient storage), or charge the part beyond the wall from max(start, end) deviation. Otherwise amend README:1064. - **Test (ran):** `forge test --match-path test/scratch/Toll.t.sol --match-test 'splitAtWall|F1' -vv (forge 1.8.3, solc 0.8.38)` - **Result:** FAIL both orders. testFuzz_C2_splitAtWall: 'a split pays under a third of the toll: 2538552684 < 5930071304; args=[10, 48]' logs single 5930071304, split 846184228, split/single 1426 bps. test_F1_twoSwapsJumpTheWall: '5367785430 < 5930071304' two/one 3017 bps. test_C2_splitAtCap PASS (3395 bps). ```solidity // test/scratch/Toll.t.sol (excerpt). Base: TollScratch is PegSystem (test/utils/PegSystem.sol): a real v4 PoolManager, the PegHook at a mined // CREATE2 address, the pool opened at $1 with 2e19 liquidity over +/-1000 ticks, sink = a real StableModule (one USDC leg); run for both token // orders (TollScratch0: quote 0xFFfF..; TollScratch1: quote 0x..1001). setUp copies PegHook.t.sol's (MockERC20 etched instead of deployCodeTo, // which forge 1.8.3 refused: 'multiple matching artifacts'). _moveTo(t) = one exact-in swap to `t` ticks from the peg. /// C2: a sell from $1 to just past the -1% wall, one swap vs `n` pieces. README:1064 says a split pays about a third. function testFuzz_C2_splitAtWall(uint8 endT, uint8 n) public { int24 end_ = -int24(uint24(bound(endT, 101, 105))); uint256 pieces = bound(n, 20, 100); uint256 snap = vm.snapshotState(); _moveTo(end_); uint256 single = _tolls(); vm.revertToState(snap); for (uint256 i = 1; i <= pieces; ++i) { int24 t = int24(int256(i)) * end_ / int24(int256(pieces)); _moveTo(t); } _moveTo(end_); uint256 split = _tolls(); emit log_named_uint("single toll (USDC units)", single); emit log_named_uint("split toll (USDC units)", split); emit log_named_uint("split / single (bps)", split * 10_000 / single); assertGe(split * 3, single, "a split pays under a third of the toll"); } /// Finding: two swaps in one block, stop just inside the -1% wall, then step over it. function test_F1_twoSwapsJumpTheWall() public { uint256 snap = vm.snapshotState(); _moveTo(-105); // one sale, $1 -> -1.05% uint256 single = _claims(_quoteCur()); vm.revertToState(snap); _moveTo(-99); // same sale in two: $1 -> -0.99% (soft leg, <1.5%) ... _moveTo(-105); // ... then -0.99% -> -1.05% (the wall, on the small rest only) uint256 split = _claims(_quoteCur()); emit log_named_uint("one swap toll (USDC units)", single); emit log_named_uint("two swaps toll (USDC units)", split); emit log_named_uint("two / one (bps)", split * 10_000 / single); assertGe(split * 3, single, "README:1064 'about a third' broken"); } ``` ### 2. SEL-1 (low, reachable at deploy) - **Property / claim:** P4 ("quoteRedeem and maxRedeem promise exactly what redeem pays in the same state") / C3 - **Files:** `src/peg/StableModule.sol:243-253`, `:265`, `:472-479`, `:719-728`, `src/peg/ERC4626Adapter.sol:39-48` - **Sequence:** The USDS leg has 30k of its 40k in a vault whose share rate is not 1 (as sUSDS's is not). In one block, anyone calls `quoteRedeem(usds, amt)` with amt > idle and gets q. Then `redeem(usds, amt, minOut=q, to)` runs: it pulls `need` (`:248`) and re-snaps (`:249`). The withdraw burned ceil(need) shares, so liquid and reserve read 1 unit lower. `liquidWad` (`:253`) is lower, the fee is higher, and `out = q - 1`. - **Actual:** quote 30041857544185449053999, redeem paid 30041857544185449053998; with `minOut = quote` the exit reverts `Slippage(q-1)`. `maxRedeem` stays executable (testFuzz_P4_maxRedeemAnyRate, 256 runs). The 1-unit loss is borne by the exiter, not the leg. The practical harm is that a quote used as `minOut` reverts. - **Fix (item's):** after a successful pull, price the exit on the pre-pull `liquidWad` and keep only the caps on the post-pull snapshot. Or subtract one unit of vault liquid in `_exitState` when amountIn/scale > idle and document the quote as a lower bound. - **Test (ran):** `forge test --offline --match-path test/unit/ItemSEL.t.sol --match-test P4 -vv (forge 1.8.3, solc 0.8.38, via_ir)` - **Result:** [FAIL: redeem pays the quote: 30041857544185449053998 != 30041857544185449053999; counterexample: args=[8181]] testFuzz_P4_quoteEqRedeem_pull(uint256). [PASS] test_P4_quoteAsMinOutReverts() logs: amountIn 30090000000000000008180, quote 30041857544185449053999, redeem out 30041857544185449053998, liquid lost to the pull's rounding 1, reserve lost to the pull's rounding 1; expectRevert Slippage(q-1) with minOut = quote holds. ```solidity // SPDX-License-Identifier: MIT pragma solidity 0.8.38; import {StableBase, StableViews} from "../utils/StableKit.sol"; import {StableModule} from "../../src/peg/StableModule.sol"; import {IERC20} from "@openzeppelin/contracts/token/ERC20/IERC20.sol"; contract ItemSELTest is StableBase { using StableViews for StableModule; function setUp() public { _setUpStable(); _mint(alice, address(usds), 40_000e18); _mint(alice, address(usdc), 40_000e6); // a share rate that is not 1 (sUSDS-like): withdraw burns ceil shares, previewRedeem floors vault.accrue(31_415_926_535_897_932_384_626); mod.rebalance(address(usds)); // 30k into the vault _pass(1 days); } function testFuzz_P4_quoteEqRedeem_pull(uint256 amt) public { uint256 idle = usds.balanceOf(address(mod)); amt = bound(amt, idle + 1, mod.maxRedeem(address(usds))); (uint256 q,) = mod.quoteRedeem(address(usds), amt); vm.prank(alice); try mod.redeem(address(usds), amt, 0, alice) returns (uint256 out) { assertEq(out, q, "redeem pays the quote"); } catch { assertEq(q, 0, "quoted an exit redeem refuses"); } } function test_P4_quoteAsMinOutReverts() public { uint256 idle = usds.balanceOf(address(mod)); uint256 amt = bound(8181, idle + 1, mod.maxRedeem(address(usds))); (uint256 q,) = mod.quoteRedeem(address(usds), amt); uint256 l0 = mod.liquid(address(usds)); uint256 r0 = mod.reserve(address(usds)); uint256 s0 = vm.snapshotState(); vm.prank(alice); uint256 out = mod.redeem(address(usds), amt, 0, alice); emit log_named_uint("amountIn", amt); emit log_named_uint("quote", q); emit log_named_uint("redeem out", out); vm.revertToState(s0); // what the pull leaves: liquid and reserve after pulling the exit's need, before pricing vm.prank(address(mod)); adapter.withdraw(amt - idle, address(mod)); emit log_named_uint("liquid lost to the pull's rounding", l0 - mod.liquid(address(usds)) - 0); emit log_named_uint("reserve lost to the pull's rounding", r0 - mod.reserve(address(usds))); vm.revertToState(s0); vm.prank(alice); vm.expectRevert(abi.encodeWithSelector(StableModule.Slippage.selector, q - 1)); mod.redeem(address(usds), amt, q, alice); } } ``` ### 3. SDC-1 (low, not reachable at deploy) - **Property / claim:** P1 ("no call moves reserve into a halted leg's vault or one reading short / that cannot pay") / C2 ("rebalance guards the vault, not only the leg") - **Files:** `src/peg/StableModule.sol:347`, `:593`, `:705`, `:984` - **Mechanism (confirmed by the merger in code):** `_snap` reads the adapter only `if (b != 0)` (`:593`). `_sound` requires `s.vault == 0 || s.vaultLiquid != 0` (`:705`), which is vacuously true while nothing is booked. `(l.booked - s.vault) * 1e6 > l.booked` is `0 > 0`. So the guard at `:347` passes. `SET_YIELD`'s apply sets `(l.adapter, l.booked) = (a, 0)` (`:984`). - **README line relied on (README.md:660-661):** "it never deposits into a vault that holds part of the reserve and releases nothing now". That covers only a vault that holds part of the reserve. A vault holding none (booked 0), or one releasing 1 wei, is not covered. - **Sequence:** (a) A leg has `booked == 0` (every leg opens at seed 0, or after `SET_YIELD`'s apply, or after booked is emptied), and its vault accepts deposits but releases nothing. Anyone mints, then anyone calls `rebalance`: 30,000 of 40,000 goes into the vault, `liquid()` is 0, and `maxRedeem` falls to 10,042e18 of 40,000 minted, so 75% of the leg's reserve is locked until the vault pays. (b) The Safe's `SET_YIELD` to successor B matures. B stops paying during the 48 h. In one block a stranger calls `applyPending(SET_YIELD|1)` and then `rebalance`: 30,000 goes into B. (c) With booked > 0, a vault releasing 1 wei passes the guard: booked goes from 30,000 to 36,750. - **reachableAtDeploy:** false. Day 1 lists only sUSDS (USDS leg), whose withdraw does not queue. It is reachable for any vault `SET_YIELD` lists later, by any account ordering apply + rebalance. - **Fix (item's):** after the deposit, re-snap and require the vault to release what was put in (e.g. `if (s.vaultLiquid < dep) revert Impaired();`), so the guard reads the vault even when booked == 0. - **Test (ran):** `forge test --match-path test/scratch/SdcDet.t.sol --match-test C2 --fuzz-runs 1000 -vv` - **Result:** [FAIL: P1/C2: reserve moved into a vault that cannot pay] test_C2_firstDepositIntoVaultThatCannotPay() logs: deposited into a vault releasing 0: 30000e18, adapter.liquid(): 0, idle left: 10000e18, maxRedeem now: 10042e18 | [FAIL: P1/C2: reserve moved into a successor vault that cannot pay] test_C2_maturedSuccessorAppliedThenDepositInSameBlock() logs: deposited into successor releasing 0: 30000e18, successor liquid(): 0 | [FAIL: deposit into a vault releasing 1 wei] test_C2_vaultReleasingOneWeiTakesMore() logs: booked before 30000e18, booked after 36750e18 | [FAIL: deposit into a vault that cannot pay it back: 4145380716279525367043 < 17467773922824880238718] testFuzz_C2_depositLeavesVaultAblePay (runs: 1) ```solidity // SPDX-License-Identifier: MIT pragma solidity 0.8.38; import {IERC20} from "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import {IERC4626} from "@openzeppelin/contracts/interfaces/IERC4626.sol"; import {StableBase, StableViews, TroubleVault} from "../utils/StableKit.sol"; import {StableModule} from "../../src/peg/StableModule.sol"; import {ERC4626Adapter} from "../../src/peg/ERC4626Adapter.sol"; contract SdcDet is StableBase { using StableViews for StableModule; function setUp() public { _setUpStable(); } /// C2 / P1: with nothing booked the vault is never read, so rebalance deposits into a vault that releases nothing. function test_C2_firstDepositIntoVaultThatCannotPay() public { vault.setGate(0); // the vault accepts deposits but releases nothing now (maxWithdraw 0) _mint(alice, address(usds), 40_000e18); assertEq(mod.leg(1).booked, 0); vm.prank(stranger); try mod.rebalance(address(usds)) returns (uint256 inVault) { emit log_named_uint("deposited into a vault releasing 0", inVault); emit log_named_uint("adapter.liquid()", adapter.liquid()); emit log_named_uint("idle left", usds.balanceOf(address(mod))); emit log_named_uint("maxRedeem now", mod.maxRedeem(address(usds))); assertFalse(mod.mintOpen(address(usds)), "minting closed by the deposit"); revert("P1/C2: reserve moved into a vault that cannot pay"); } catch (bytes memory e) { assertEq(bytes4(e), StableModule.Impaired.selector); } } /// The same through a matured SET_YIELD applied by anyone, then anyone's rebalance, in one block. function test_C2_maturedSuccessorAppliedThenDepositInSameBlock() public { TroubleVault v2 = new TroubleVault(IERC20(address(usds))); usds.mint(address(this), 100_000_000e18); usds.approve(address(v2), type(uint256).max); v2.deposit(100_000_000e18, address(0xbeef)); ERC4626Adapter b = new ERC4626Adapter(address(mod), IERC4626(address(v2))); _mint(alice, address(usds), 40_000e18); mod.rebalance(address(usds)); _propose(abi.encode(uint8(SET_YIELD | 1), address(b), uint16(7_500), uint16(2_500), uint128(10_000e18), uint16(2_000))); _pass(48 hours); v2.setGate(0); // the successor stops paying during the 48 h vm.startPrank(stranger); mod.applyPending(SET_YIELD | 1); try mod.rebalance(address(usds)) returns (uint256 inVault) { vm.stopPrank(); emit log_named_uint("deposited into successor releasing 0", inVault); emit log_named_uint("successor liquid()", b.liquid()); revert("P1/C2: reserve moved into a successor vault that cannot pay"); } catch (bytes memory e) { vm.stopPrank(); assertEq(bytes4(e), StableModule.Impaired.selector); } } /// C2 as written: a vault that releases 1 wei counts as releasing. function test_C2_vaultReleasingOneWeiTakesMore() public { _mint(alice, address(usds), 40_000e18); mod.rebalance(address(usds)); vault.setGate(1); _pass(1 days); _mint(bob, address(usds), 9_000e18); uint256 b0 = mod.leg(1).booked; try mod.rebalance(address(usds)) { emit log_named_uint("booked before", b0); emit log_named_uint("booked after", mod.leg(1).booked); revert("deposit into a vault releasing 1 wei"); } catch (bytes memory e) { assertEq(bytes4(e), StableModule.Impaired.selector); } } /// C2 fuzzed: any first mint, any gate, any delay, any caller: a deposit must leave the vault able to pay it. function testFuzz_C2_depositLeavesVaultAblePay(uint256 amt, uint256 gate, uint256 dt, uint256 who) public { amt = bound(amt, 14_000e18, 50_000e18); gate = bound(gate, 0, 50_000e18); address w = [alice, bob, carol, stranger][who % 4]; vault.setGate(gate); _mint(alice, address(usds), amt); _pass(bound(dt, 0, 3 days)); vm.prank(w); try mod.rebalance(address(usds)) returns (uint256 inVault) { assertGe(adapter.liquid(), inVault, "deposit into a vault that cannot pay it back"); } catch {} } } ``` ### 4. SRBG-1 (info, not reachable at deploy) - **Property / claim:** P3, P4 / C1 (a third route that opens minting), C3 - **Files:** `src/peg/StableModule.sol:988`, `:991`, `:627`, `:633`, `:690` - **Mechanism (confirmed by the merger in code):** the class-4 (`SET_BAND`) apply at `:988-993` writes only `feed, maxAge, bandBps, reopenDelay, feedDec`. It touches neither `bandClosed` nor `goodSince`, so `_price` then walks only the new feed's rounds. - **Sequence:** (1) The Safe proposes `SET_BAND|1` to a new feed nf (48 h). (2) The leg's current feed prints 0 (or 0.97), then 1.00 an hour later. Nobody pokes, so `bandClosed` stays false and `mint` reverts `OutOfBand` because the walk still sees the 0 round. (3) Anyone applies `SET_BAND|1`: `mintOpen` becomes true in that block, 1 h after the 0 round, with `reopenDelay` 6 h. - **Bound (item's):** money is at risk only if the new feed does not show the same event, minting at min($1, new answer) up to the daily bucket. A poke before the apply closes the band, and `SET_BAND` keeps it closed (C3 holds). - **Fix (item's):** when the feed changes in `SET_BAND`'s apply, set `(bandClosed, goodSince) = (true, 0)`, or require the old feed's walk to pass at apply. - **Test (ran):** `true` (item's run line, from its forge field: `forge test --offline --match-path test/scratch/RelistBandGov.t.sol`, forge 1.8.3, solc 0.8.38 via_ir) - **Result:** [FAIL: P3: a <=0 round 1 h ago (delay 6 h) no longer holds minting] test_P3_setBandToANewFeedDropsTheOldFeedsZeroRound() (gas: 1142726). Same route with an out-of-band 0.97 old round: test_C1_otherRoutesOpenMinting asserts mintOpen true after the apply [PASS]. ```solidity // test/scratch/RelistBandGov.t.sol, contract RelistBandGovTest is StableBase (test/utils/StableKit.sol), setUp(){ _setUpStable(); USDS = address(usds); } /// minting in the same block: the old feed's history is no longer read and nothing recorded it. function test_P3_setBandToANewFeedDropsTheOldFeedsZeroRound() public { MockLiveAggregator nf = new MockLiveAggregator(8, 1e8); _propose(abi.encode(SET_BAND | 1, address(nf), uint32(25 hours), uint16(100), uint32(6 hours), bytes4(0))); _pass(40 hours); nf.push(1e8); usdsFeed.push(1e8); _pass(7 hours); usdsFeed.push(0); // the leg's feed answers 0 _pass(1 hours); usdsFeed.push(1e8); assertFalse(mod.mintOpen(USDS), "held on the old feed"); vm.prank(stranger); mod.applyPending(SET_BAND | 1); assertFalse(mod.mintOpen(USDS), "P3: a <=0 round 1 h ago (delay 6 h) no longer holds minting"); } ``` --- ## Claims (every claim of every item, verdict kept) Long evidence and "tried" texts are cut at a word boundary and marked "…[cut]" (the full text is in the item result named in the brief). Verdicts, ids and the starts of the texts are kept verbatim. "Code" means reasoned from code with no test run in that item. Claim ids are per sheet: C1 in one item is not C1 in another. | item | claim | result | evidence (item's words) | |---|---|---|---| | core-loss-settlement (code) | C1 | **holds** | grep src/ (core, excluding src/house): badDebt/totalBadDebt written only at src/LedgerSettlement.sol:164-165 (liquidatePosition, += bad) and src/Ledger.sol:356-358 (cover, clamped to s.badDebt, -=). No script writes. Not test-checked (forge 1.8.3). | | core-loss-settlement (code) | C2 | **holds** | src/LedgerBase.sol:222-223 (unbacked) and :325-326 (_checkBrake) read token.balanceOf(treasury), the same balance Treasury.coverBadDebt (src/Treasury.sol:103-112) burns via Ledger.cover. A donation lifts the brake only by an amount anyone can immediately burn with coverBadDebt (permissionless), so it is real cover. Withdrawals while bad debt stands: retireReserve and payNote revert …[cut] | | core-loss-settlement (code) | C3 | **holds** | src/Liquidator.sol:136-147,158-170: the whole sleeve bid runs in try this.standingBid; any revert rolls back liquidatePosition, then the caller path (:149) books bad = debt - min(debt, seized*price) exactly once (LedgerSettlement.sol:141-145). Both paths call the same liquidatePosition with the same price q.low, so the shortfall is identical; _cover runs after either. Not test-checked. | | core-loss-settlement (code) | C4 | **holds** | owedToTreasury written only at src/LedgerBase.sol:413 (_toTreasury: called by harvest :401, redemption fee LedgerSettlement.sol:98, liquidation cut :178, marker fallback :190) and LedgerSettlement.sol:204 (payOwed). payOwed: non-Treasury caller forced to (treasury, owed) (:201); Treasury amount > owed reverts ExcessRepayment (:202). A stranger cannot get paid. _apply token/Join …[cut] | | core-loss-settlement (code) | C5 | **holds** | src/Treasury.sol:189-192: if/else branches are exclusive, so one payload either calls payOwed or transfers, never both. Unwired Treasury (ledger=0): staticcall to address(0) succeeds with empty return, length<32, takes the transfer branch: owed collateral is unreachable, not lost (anyone's payOwed still works). Not test-checked. | | core-loss-settlement (code) | C6 | **holds** | script/deploy/StageGenesis.sol:42-47 calls d.treasury.wireNotes when cfg.pegQuote != 0; README:855-856 states every day-1 config sets notes at genesis (slot spent, AlreadyWired at Treasury.sol:96). Did not verify each DeployConfig value; no reachable post-genesis use found. Not test-checked. | | core-savings-migrator | C1 | **holds** | A fee-free toV1->toV2 round trip (same block or across blocks, repeated) never nets the griefer v1 or imdUSD profit: it only moves ImdUSD.feeBase() for 1-2h, exactly as README:620/854 state. Ran NOT RUN [fork]; local: test/unit/AuditW7JudgeHub.t.sol:204 test_known_L3_migratorRoundTripLowersTheFeeBaseUpToOutstanding (repo test, PASS, confirms fell==100_000e18==the round trip, …[cut] | | core-savings-migrator | C2 | **holds** | ImdUSD.circulating() (src/ImdUSD.sol:184) reads a transient-storage mark set once per transaction by _update on the FIRST mint/burn (src/ImdUSD.sol:232-244): circulating() == totalSupply() before that first mint/burn, and stays pinned at that value for the rest of the transaction. A mint and a burn in one tx therefore cannot move what the savings split divides by. This is also exercised …[cut] | | core-savings-migrator | C3 | **holds** | SavingsVault.settledAssets() (src/SavingsVault.sol:60) subtracts depositAt/depositedAt, which track NET new money added in the current block (reset on the first deposit of a new timestamp, incremented on further same-block deposits, decremented floor-0 by same-block withdrawals regardless of whose shares are redeemed). Proved by fuzz that this net-flow accounting is order-independent …[cut] | | core-savings-migrator | C4 | **holds** | Migrator.toV1 is bounded only by `outstanding` (src/Migrator.sol:57), its own storage slot, not by v1.balanceOf(this) or usd.balanceOf(this). A v1 donation: test/unit/MinterHub.t.sol:984 (repo, PASS) shows hub.room(migrator)==0 after a 50,000 v1 donation and that outstanding v1 cannot be pulled out. An imdUSD donation was not covered by the repo suite, so I added …[cut] | | core-savings-migrator | C5 | **holds** | script/deploy/StageCore.sol:119 deploys the Migrator with no hub row (comment at :113-114: 'inert until the Safe's ADD_SPOKE'); script/launch/SafeBatch.s.sol:223 is the ADD_SPOKE proposal that later gives it a row (exotic=true, cap=config().launch.migratorCap). Before that proposal is applied, MinterHub.room() returns 0 for any address with indexOf==0 (src/hub/MinterHub.sol:324-326), so …[cut] | | x-event-records (code) | C1 | **holds** | Event-record writes in the named files: StableModule.sol:845 halted (in _report, via _pull refusal :789 and poke loss), :907 halted (relist), :999 halted=false (REOPEN), :797/:806/:968 harvestedAt, :301 goodSince; house/backstop/Backstop.sol:638 owedEndedAt, :496 r.at (request), :254 listedAt; backstop/Backstop.sol:402 r.at, :198 listedAt; ImdBridge.sol:861/:1250 _trip (tripped,trips …[cut] | | x-event-records (code) | C2 | **holds** | By code: the probe (:779) precedes the share cut and _report in _pull; harvest clock independent of halt; owedEndedAt gated on bad (house Backstop:638); owedToTreasury is additive and never feeds a halt or window. No interaction found where one fixed site's event satisfies another's condition. Not fuzzed (forge 1.8.3). | | x-event-records (code) | C3 | **holds** | Sites outside the class grep: Pulse.sol:44-52 grace opened by any silence >gap, not only a sequencer halt; documented accepted at Pulse.sol:15 ('A quiet chain with no outage looks the same as a halted one; that is accepted'). StockOracle.sync records syncedAt only when the multiplier changed. No unaccepted miss found. | | x-event-records (code) | C4 | **holds** | Invariant: every event-record write W(X) is preceded in the same frame by a check that excludes each alternative cause (gas >= PULL_GAS, issuer probe success, observed value change v>b, nonzero bad on entry); i.e. for every route R writing a record, revert-or-noop unless pre-state witnesses X. Replacement design: write records only from a positive observation (balance delta, nonzero …[cut] | | x-event-records (code) | sheet-files | **holds** | All named functions exist: StableModule _pull :763, _report :842, _harvest :793; MorphoLender _settle :358, _report :389; LedgerBase _toTreasury :410; Pulse.poke :43; StockOracle frozen :230, sync :247; house Backstop owedEndedAt :166. src/backstop/Backstop.sol has claim windows but no owedEndedAt (sheet attributes owedEndedAt only to house Backstop). | | stable-refusal-halt (code) | C1 | **holds** | Code read: _pull (src/peg/StableModule.sol:763) has exactly 3 callers: redeem pre-pricing pull :248 (only if yieldBps!=0), FROZEN payout :284 (`if (!_pull(l,out,to)) revert VaultStuck();` rolls back the halt), rebalance withdraw :358 (`return 0`). Writers of `halted=true`: _report :845 (called from poke :310, close :377, reportLoss :409, abandonVault :427, _pull :787) and the relisting …[cut] | | stable-refusal-halt (code) | C2 | **holds** | redeem returns 0 at :262 / :274 before usd.safeTransferFrom :276 and before any stable transfer, so no imdUSD taken and no stable sent to the caller (a short-paying vault's partial payment lands in the module's idle, internal). rebalance :358 returns 0 after the pull only. grep of src/ and script/ finds no contract calling StableModule.redeem or rebalance (the .redeem( hits are ERC4626 …[cut] | | stable-refusal-halt (code) | C3 | **holds** | _pull's failure branch :784-787 sets l.yieldBps=0, _clear(SET_YIELD\|i), emits YieldSet, then _report(i,l,0) which _clear(REOPEN\|i) :843 and sets halted. _exitState :727 and redeem :248 stop calling the vault once yieldBps==0. Not tested. | | stable-refusal-halt (code) | C4 | **not-checked** | [fork]/[data] NOT RUN (no fork run; no forge 1.9). From README:651-653 at the commit: 'sUSDS has none of these.' and README:656-659 'A listed stable must accept that probe while not paused (USDC, USDS, USDG do).' Unverified on chain by this worker. ERC4626Adapter.withdraw (src/peg/ERC4626Adapter.sol) calls vault.withdraw directly with no lock of its own. | | stable-refusal-halt (code) | C5 | **holds** | Proposed invariant (not run): for every leg i and every state transition T, halted_after(i) && !halted_before(i) implies one of: (a) T is close/reportLoss/abandonVault by the Safe, (b) T is poke and readable idle+vault < minted after T, (c) T is relisting _addLeg, (d) inside T some adapter.withdraw(a,to) call made with gasleft >= PULL_GAS either reverted or credited `to` < a while …[cut] | | stable-gas-starvation (code) | C1 | **holds** | src/peg/StableModule.sol:768 reads g=gasleft() inside _pull right before the try-call, so outer depth (router, applyPending, harvest, recover) is irrelevant: the 1/64 kept by outer frames is already gone from g. With g>=5.25M the adapter gets ~63/64*g ~5.168M; heavy work two levels down (adapter->vault) needs W*(64/63)^2, three behind a proxy W*(64/63)^3 ~5.055M for W=4.9M, under …[cut] | | stable-gas-starvation (code) | C2 | **not-checked** | [fork] NOT RUN: no mainnet RPC used; forge 1.8.3. | | stable-gas-starvation (code) | C3 | **holds** | A vault burning all gas in withdraw: _pull catches, g>=PULL_GAS, probe+share cut to 0 (777-789); views burning gas read unreadable (614); rebalance reverts Impaired when !readable (337); recover's uncaught withdraw reverts (440). Only abandonVault (418) drops it. Matches README:645 as written. | | stable-gas-starvation (code) | C4 | **holds** | _view (611-617): ok := and(ok, gt(returndatasize(),31)) so <32 bytes or no code reads ok=false; _snap (599-605) then sets vault=0 via readable=false (not a 0 answer used as readable); _harvest (804-805) needs ok. Scratch memory 0..0x20 only, memory-safe. | | stable-gas-starvation (code) | C5 | **holds** | Invariant: every catch of a vault call that continues either (a) writes nothing (views in _snap/_harvest: unreadable => no clock move, rebalance reverts Impaired, mint reverts Impaired, redeem only reprices at feeMax on idle) or (b) writes a refusal only when gasleft() measured in the SAME frame immediately before the call >= PULL_GAS (_pull 768,773). Routes catching vault failure: …[cut] | | stable-exits-liquidity | C1 | **holds** | No inflation/donation attack found. The module issues no shares: imdUSD is minted 1:1 less fee and an exit pays 1:1 less fee, so a donation to the module is owned value P that has no way out (StableModule.sol:20-23, no withdraw). testFuzz_C1_donation (256 runs: donor gives 1..1e6 USDC to the module in front of a depositor, tries to exit past its own imdUSD): donor never recovers it, the …[cut] | | stable-exits-liquidity | C2 | **holds** | Confirmed as described and bounded. A short pay found by an exit leaves `short` computed on the pre-pull snapshot (StableModule.sol:238) so the exit is priced with f0 = feeMin on the idle alone (253-255), not feeMax. testFuzz_C2_shortPayBound (256 runs, shortBy 1..5000 USDS, exits idle+1..idle+25k): the undercharge against feeMax pricing is <= (feeMax - feeMin) x out (observed ~50 USDS …[cut] | | stable-exits-liquidity | C3 | **refuted** | A state exists (finding SEL-1): any successful pull from a vault whose share rate is not 1 (sUSDS's is not) makes redeem pay 1 wei less than quoteRedeem. In the named states the views match: testFuzz_P4_states (256 runs over yield cut, vault dip/loss, gate on liquid, close/halt, a matured SET_CURVE with any valid curve applied by a stranger in front, and after a refusal already met) …[cut] | | stable-exits-liquidity | C4 | **not-checked** | [fork] NOT RUN: no fork RPC used in this run (no USDG 4663 / Base forks at this commit). The mock-side behaviour is what the tests above exercise. | | stable-deposits-caps | C1 | **holds** | Every write of Leg.minted: mint :220 (raise, checked m > l.cap -> OverCap :219), redeem :280 (lower), poke :325 (raise, by hub.restore's return, bounded by c - m :324), _report :850 (lower), _addLeg (new leg, 0). No other writer in src/ or script/. poke's restore checks `good` (band, freeze) and _sound but not l.halted (:321): runs on a halted leg by design (README:676). …[cut] | | stable-deposits-caps | C2 | **refuted** | Finding SDC-1: the guard at :347 reads the vault only through _snap, which skips the adapter when booked == 0 (:593), and accepts vaultLiquid of 1 wei. Deposits of 30,000 into a vault releasing 0 (first deposit, and a successor applied by a stranger then rebalanced in the same block), and 6,750 more into a vault releasing 1 wei. With booked > 0 and a read under booked by > 1 ppm, or on …[cut] | | stable-deposits-caps | C3 | **holds** | abandonVault :418-428 returns without effect when l.adapter != adapter (test: abandonVault(1, 0x1234) left the adapter listed) and never calls the adapter: with the adapter's code etched to INVALID (0xfe) the abandon succeeded, strandedOf set, leg halted, R >= minted (test_C3_abandonNamesAndNeverCalls PASS). It reads only the stable's balanceOf and calls hub.reportLoss. Note: it …[cut] | | stable-deposits-caps | C4 | **holds** | test_C4_dipRestore: a 2% read dip poked by a stranger booked 572.5e18 hub loss and halted the leg; the next poke after the read came back restored it (lossOf 0, minted back to its pre-dip value); the halt stays (as written, README:867). test_C4_dipPaidByOtherLeg: a stranger's poke of the OTHER leg (USDC) paid the USDS dip's 2.5e18 from USDC's owned value (29.48 -> 26.98) and the USDS …[cut] | | stable-deposits-caps | C5 | **holds** | Computed (test_C5_borrowedCaps PASS): EthConfig.get borrowedCaps 36,000 = lines 26,000 + house 5,000 + fixed 3,000 + migrator 2,000 (lender 0); RobinhoodConfig.launch 9,000 = lines 4,000 + lender 5,000; BaseConfig.launch 5,000 = lines 5,000; total 50,000 = BOOTSTRAP; maxBorrowed(0) = 50,000. Module caps: eth 150,000 (USDC 100k + USDS 50k), 4663 50,000, Base 50,000. Bound on the keeper's …[cut] | | stable-relist-band-gov | C1 | **refuted** | The flags halted / bandClosed are cleared only by REOPEN's apply (StableModule.sol:999, after _settle()==0 at :998) and poke (:302-303). But minting also opens with neither: (a) SET_BAND applied by anyone over an unpoked out-of-band or <=0 old feed (SRBG-1; test_C1_otherRoutesOpenMinting PASS asserting the open, test_P3_setBandToANewFeedDropsTheOldFeedsZeroRound FAIL); (b) state checks …[cut] | | stable-relist-band-gov | C2 | **holds** | Other single vault reads: poke's _snap at a one-block dip books a loss and halts (known README:867 'A one-block dip of a listed vault (latent)'); _harvest at a spike books at most maxYieldBps x booked x dt / year (rate cap, :808); REOPEN's _validate _snap dip only reverts BadConfig (slot kept, retried later); mint's liquid read only moves the fee curve (round trip >= feeMin). …[cut] | | stable-relist-band-gov | C3 | **holds** | SET_BAND's apply (:988-993) writes feed/maxAge/band/delay/feedDec only. test_C3_setBandKeepsTheCloseAndWalksTheNewFeed [PASS]: bandClosed and goodSince identical across the apply; poke reopens 6 h after the old-feed goodSince; mint still refused by the NEW feed's 0.98 round inside the delay and opens 6 h later. The converse gap (nothing recorded before the apply) is SRBG-1. | | stable-relist-band-gov | C4 | **not-checked** | [data] NOT RUN: no archive RPC used in this run. From code: _price closes at a 25th round inside reopenDelay (MAX_ROUNDS 24, :635) and at age > maxAge (deploy 1 days + 1 hours, DeployConfig.sol:230/233); a heartbeat late by > 1 h closes minting while the peg holds (liveness only, mint refuses; redeem reads no feed). Early reopen: only an unreadable round (new phase, README:1067) or …[cut] | | stable-relist-band-gov | C5 | **holds** | _price (:634-642) ends as good only at a round with at == 0 (call failed / short returndata / no time, :640) or at the first round at or before cut (the round in force at the window start, itself band-checked); id == 0 and k == MAX_ROUNDS end as OUT of band. test_C5_walkStops [PASS]: the round in force at the cut is checked, exactly at the cut it drops out. A gas-starved getRoundData …[cut] | | stable-relist-band-gov | C6 | **holds** | Known as written (README:861). Bound: test_C6_sequencerGapBound [PASS]: a pre-halt answer 20 h old mints at ~$1 up to the leg's dailyCap (bucket full after the gap, :746), then only the refill dailyCap/24 per hour, and stops at maxAge (25 h). At deploy: USDC (Eth) 25,000/day, USDS 12,500, USDG (4663) 12,500, Base USDC 12,500 (DeployConfig.sol:230,233,576,775); loss <= minted x depeg, <= …[cut] | | peg-toll-hook | C1 | **holds** | test_C1_edges (both token orders) walks sqrtPrice from peg*(1-1.3%) to peg*(1+1.3%) in 0.005% steps (price +/-2.6%) both directions and checks surchargeFor against the NatSpec curve (0 inside dev<=0.25%; 15000*(dev-25bp)/75bp to 1%; below: 50000+150000*(dev-1%)/1% capped at 200000 from -2%; above: flat 15000; 0 toward $1); exact $1 -> 0 and feeFor = 100. PASS. Note the curve is a step …[cut] | | peg-toll-hook | C2 | **refuted** | Split: see F1 (14.26% of the toll at -1.05%, 30% with two swaps): worse than README:1064's 'about a third'. Exact-out vs exact-in: testFuzz_C2_towardAndExactOut (256 runs x2 orders, start -400..400 ticks, 1k-150k USDC) asserts exact-out cost per quote >= 96% of exact-in for the same pool move: PASS (toll on unspecified amount: (1+s) vs 1/(1-s), ratio 1-s^2 >= 0.96). Toward $1 ending …[cut] | | peg-toll-hook | C3 | **holds** | testFuzz_C3_sweepWhole (256 runs x2): 6 random excursions within +/-4%, then sweep of both currencies by a fuzzed caller: hook claims 0, sink (StableModule) balance rises by exactly the claims, hook holds no ERC20, supply unchanged. PASS. Only writers of the hook's claims: afterSwap mint (PegHook.sol:143), unlockCallback burn (:159), and third-party ERC-6909 transfers to the hook (also …[cut] | | peg-toll-hook | C4 | **holds** | testFuzz_P4_notes (256 runs): 24 interleaved ops (revenue, warps up to 40d, buys by 3 accounts incl. at the last second of the 7d window, redeems), tenors 30/90/180d, discount 1..2000bps: maturity stays open+7d+tenor, no redeem before it, outstanding <= 2x trailingRevenue after every successful buy, paid*1e12*1e4 >= face*(1e4-d) and paid >= 1 (priceOf rounds up, FeeNotes.sol:99), imdUSD …[cut] | | peg-toll-hook | C5 | **holds** | testFuzz_C5_onePool (256 runs x2): re-initialising the same key (at peg or any sqrtPrice) reverts (PoolManager PoolAlreadyInitialized, the hook's state write rolls back with it); any other fee/tickSpacing with this hook at any sqrtPrice reverts (WrongPool/NotAtPeg, PegHook.sol:118-124). PASS. | | house-ledger-spoke | C1 | **holds** | grep of src/ and script/: the only hub calls from the house are in Ledger/LedgerBase: hub.mint only in the borrow branch of _adjust (src/house/Ledger.sol:294, reached by open/adjust/execute); hub.burn in _collect (src/house/LedgerBase.sol:343: repay in _adjust, liquidatePosition) and _burnAgainst (src/house/Ledger.sol:456: cover, retire); hub.payReserve in _collect (LedgerBase.sol:355); …[cut] | | house-ledger-spoke | C2 | **holds** | ImdUSD.isMinter is ledger\|bridge\|hub, each set once (src/ImdUSD.sol:101-138); the house deploy never calls usd.wire (script/house/deploy/StageHouse.sol:30 'The house is NOT usd.wire'd and has no hub row'); house SET_BRIDGE is refused (src/house/ParametersRules.sol:47-52, tested as kind 4). The house reaches core state only via hub.reportLoss (hub.unbacked/exoticUnbacked through bad_s), …[cut] | | house-ledger-spoke | C3 | **holds** | `forge inspect` storageLayout of src/house/Ledger.sol:Ledger and src/house/LedgerSettlement.sol:LedgerSettlement: identical (name, slot, offset, bytes): liquidator 0, _positions 1, _ilkList 2, _ilkIndex 3, ilkState 4, reserveBacked 5, totalBadDebt 6, worthlessSince 7, worthlessLast 8, bookedEdge 9, bookedTreasury 10; both inherit LedgerBase and add only immutables (settlement / ledger). | | house-ledger-spoke | C4 | **not-checked** | [fork] NOT RUN (needs the renounced StakedIMD at 0x9Efa934D9fAd4AE28c998a40195646b965a97247 on an Ethereum fork; no RPC used). From code: the hold acts on redeem (maxRedeem 0; test/house/fork/Mainnet.t.sol:279), not on transfer, and no house liquidation or repay path redeems sIMD: the only redeem is Join.unwrap (src/house/Join.sol:63) on a viaAsset withdrawal (README:1076, known). …[cut] | | house-ledger-spoke | C5 | **holds** | test_C5_coverAboveCollectableChargesOnlyCollectable: 10,000 at 50% for 365 days then a full bad-debt liquidation (bad > collectable()); a stranger's cover(ETH, max) is charged exactly collectable(), totalBadDebt -> 0, identity B6 (_checkB6) holds after, and the house lends and a later full repay lands. Fuzz also asserts payer charge <= collectable() on every random cover and retire …[cut] | **Disagreements:** no two items rule on the same claim, so no verdicts conflict. Two items' "holds" sit next to another item's finding: - stable-refusal-halt P2 (code) holds. stable-deposits-caps' SDC-1 concerns deposits (rebalance), not refusal writes, so there is no conflict. - stable-relist-band-gov C3 holds for a `SET_BAND` applied after a poke; the same item's SRBG-1 covers the no-poke gap. ## Properties that hold, with what was tried ### core-loss-settlement (code reading only, no test) - **P1:** Code read of LedgerSettlement.liquidatePosition (solvency before penalty, bad only when collateral < debt, no Treasury cut when bad>0), Liquidator sleeve/caller paths and _cover (gas floor COVER_MIN_GAS, try/catch). cover clamps to booked badDebt so a second cover cannot overpay. No test run (forge 1.8.3). - **P2:** Ledger.cover burns msg.sender's imdUSD (token.burn) clamped to badDebt; no mint on the path. Code read only. - **P3:** Enumerated Treasury exits: coverBadDebt (burns), retireReserve (onlyGovernor, no bad debt), payNote (msg.sender==notes, no bad debt), _apply (timelocked). wireNotes is wirer-only once, spent at genesis. Code read only. - **P4:** _toTreasury keeps refused amount in the Join and increments owed; payOwed is onlyLedger (delegatecall from Ledger.payOwed), stranger path sends all to immutable treasury, Treasury path bounded by owed. Code read only. ### core-savings-migrator - **P1 - savers paid only their real, time-weighted, pro-rata share; no flash deposit/round trip/donation skims it:** Repo suite test/unit/Savings.t.sol (PASS, 13/13): test_sandwichAroundAccrualEarnsNothing (2M-stake front-run of a 365-day accrual, redeem 12s later: attacker gets only 12s/7days of the stream, <0.01% of the accrual), test_donationCannotInflateSharePrice / test_donationBeforeAnyDepositDoesNotBreakFirstDeposit (virtual shares (_decimalsOffset=6) + the 7-day stream absorb a pre- or …[cut] - **P2 - the Migrator swaps v1<->v2 1:1: toV2 mints only through hub.mint inside its room, never without v1 taken in; toV1 bounded by outstanding, never by cap/freeze/donation; the v1 minter is permanent:** src/Migrator.sol:48-54 toV2: room check -> outstanding += amount -> v1.safeTransferFrom (pulls v1 in) -> hub.mint (so the hub call always follows the v1 pull in the same call, atomic; no path mints without taking v1 in first, since any revert in the transferFrom reverts the whole call). toV1:56-62 decrements outstanding first (checked arithmetic reverts on underflow, so it can never go …[cut] - **P3 - vault shares cannot be inflated by a first depositor or a donation (virtual shares + 7-day stream):** ERC4626's _decimalsOffset()=6 (src/SavingsVault.sol:85-87) gives 1e6 virtual shares/assets; SMOOTHING streams every arrival not tied to a deposit over STREAM=7 days (src/SavingsVault.sol:66-83), so totalAssets() does not jump on a donation. Repo tests test_donationCannotInflateSharePrice and test_donationBeforeAnyDepositDoesNotBreakFirstDeposit (PASS) directly fuzz this: a 1-wei first …[cut] - **P4 - the Migrator never reports a loss: a v1 depeg reaches the hub only via the Safe's markLoss on its exotic row, never as core bad debt:** Static check: src/Migrator.sol has exactly 4 external functions (toV2, toV1, assets, and the inherited nonReentrant modifier) and none of them calls hub.reportLoss, hub.markLoss or any loss-reporting entrypoint (grep -n 'reportLoss\|markLoss' src/Migrator.sol -> no matches). The only loss path for its row is MinterHub.markLoss, onlyGovernor (src/hub/MinterHub.sol:399-409), which sets …[cut] ### x-event-records (code reading only, no test) - **P1:** Code reading of every writer/reader listed in C1 against issuer pause, blocklisted recipient, caller lock, one-block dip, zero-amount/zero-loss calls, gas starvation and stranger frames; no fuzz/invariant run because the local forge is 1.8.3 (brief requires 1.9+ --use solar). ### stable-refusal-halt (code reading only, no test) - **P1:** Code review only (forge 1.8.3, no test run): every _pull failure path writes cut+drop+halt; redeem's refusal path never reverts for size (:261-262) or price/slippage (:272-273) once `refused`; rebalance returns 0; the only reverting caller is the FROZEN payout (known README:674). Halt can be undone if the caller's own later step reverts (transferFrom of imdUSD, stable transfer to a …[cut] - **P2:** Code review only: issuer pause -> probe t.safeTransfer(this,0) :776 reverts (no write); 0-amount: redeem pulls only if need>0 (upper>idle), rebalance reverts NothingToDo on wd==0; starved gas -> PullGas :774. Observation (untested, info): poke :310 halts on any readable idle+vault vault counted 0, idle still served (liquidWad uses s.idle, 253) at feeMax since short=true. _harvest moves harvestedAt only if ok && v>b (805-806). A caller-starved view (gasleft= minted after. testFuzz_P1_refusalIdleMaxIn (256 runs): every exit up to the idle-only maxRedeem (measured under lowerYield(1,0) in a snapshot) is served when the vault refuses the pull first (the pull is attempted because amountIn/scale > idle counts the fee). …[cut] - **P2 (no mint/redeem sequence across legs, blocks or a share-rate move extracts more than fees allow):** testFuzz_P2_noExtraction (256 runs x 8 actions): any order of mint USDC/USDS, redeem either leg, rebalance, vault accrue (share-rate rise up to 1M USDS), harvest and time jumps up to 2 days; bob's USDC+USDS+imdUSD value never rises, both legs keep R x scale >= minted. Analytically the round trip on one leg pays the integral of g + f >= min(feeMax, feeMin + mintFeeMax) > 0 per unit; a …[cut] - **P3 (rounding favours the module):** testFuzz_P3_slices (256 runs, 6-decimal USDC leg, 2..12 slices of up to 30k): slices never pay more than one exit, and R x 1e12 >= minted after every slice. Code: _exitFee rounds up (506, 511: ceil minus floor), out floors by scale (265), _exitOut verifies against the exact rounded cost (555-567), _most ceils what stays (740), mint fee rounds up (518-521) and out floors (710). The 1-wei …[cut] - **P4 (views exactly as redeem):** Fails by 1 wei on pull exits (SEL-1). Holds otherwise in testFuzz_P4_states, testFuzz_P4_maxRedeemAnyRate, test_P4_maxRedeemExecutes (see C3). - **Writers/readers of the state the properties name:** Writers of minted/booked/yieldBps/idle (src only; script/launch/SafeBatch.s.sol:263-280 only reads leg()): mint 197-225, redeem 229-289 (minted, booked via _pull), poke 292-327 (_report, restore), rebalance 330-365, harvest/_harvest 368, 793-815, lowerYield 395-402, reportLoss 406-410, abandonVault 418-428, recover 433-441 (idle), _pull 763-789, _apply SET_CURVE/SET_YIELD/REOPEN …[cut] ### stable-deposits-caps - **P1 No call moves reserve into a halted leg's vault or one reading short:** Only rebalance :350-351 moves idle into an adapter (SET_YIELD apply :981 and recover :438 and _pull move out). testFuzz_seq 3000 runs x 60 steps (mint, redeem, poke, rebalance by 4 accounts; vault gain/loss/dip/gate; lowerCaps, close, SET_CAPS and REOPEN proposed and applied by a stranger; donations; feed out of band; warps 0 s/1 s/12 s/1 h/1 d/2 d): every step that grew the adapter's …[cut] - **P2 No call raises minted_i past cap_i; a lowered cap stops both:** test_P2_lowerCapsStopsBoth: lowerCaps to minted-1 after a dip, poke after recovery restores nothing (c > m false :321), mint reverts OverCap. Fuzz asserts every rise ends <= cap, with lowerCaps to 50/100/150% of minted and matured SET_CAPS applied by a stranger in any order: holds. Mints served from held imdUSD (:223) do not raise minted. sum(minted) == hub row outstanding asserted …[cut] - **P3 poke's restore pays a row's loss from owned value only, never minting past the hub room:** Fuzz asserts after each poke: hub.usedOf(row) never rises, each leg's minted rise <= its pre-poke owned value; restore leaves used_s = outstanding+bad+covered unchanged (MinterHub.restore :213-233), covered mint-back stops on a frozen row. test_C4_dipPaidByOtherLeg: another leg's owned value pays, within that leg's cap room: holds. - **P4 launch peg rule caps total 50,000 (36,000 / 9,000 / 5,000):** test_C5_borrowedCaps computes LaunchPegRule.borrowedCaps on EthConfig.get, RobinhoodConfig.launch, BaseConfig.launch: 36,000 / 9,000 / 5,000 = 50,000 with the stated split: holds. No contract enforces it (as stated); keeper over-read bound in C5. ### stable-relist-band-gov - **P1:** testFuzz_P1_relistOrderings (256 runs x 24 random steps): after reportLoss(0,all), ADD_LEG relisting, REOPEN\|0, SET_BAND\|0, SET_CAPS\|0, SET_CURVE\|0, SET_YIELD\|0 all queued BEFORE the relisting, applied by a stranger in any order interleaved with exits (held imdUSD), pokes (settle), mints and 0-3 h steps; invariants: every successful REOPEN left owed==0; every USDC mint was on a leg with …[cut] - **P2:** test_P2_nothingReentersDuringSetYieldApply: an adapter whose withdraw re-enters mint, redeem, poke, rebalance, harvest, recover, applyPending(SET_CAPS\|1, SET_CURVE\|1, SET_YIELD\|1, SET_BAND\|1, REOPEN\|1, ADD_LEG) and applyPending() with matured proposals queued: 13 tries, 0 succeeded; the whole 30,000 came home. Lock taken at :980 around the only mutating external call (:981); …[cut] - **P3:** testFuzz_P3_nonPositiveRoundHolds (256 runs): 0-10 in-band rounds at random 1 s-3 h gaps, a round answering any value <= 0, 1-12 later in-band rounds at random gaps, optionally a matured SET_BAND (same feed) applied by a stranger in front; whenever the bad round is still in force after now - reopenDelay, mintOpen false and mint reverts OutOfBand. PASS. Fails only when the feed itself is …[cut] - **P4:** Same fuzzes with every kind applied in front (P1 fuzz: six kinds in random order; P3 fuzz: SET_BAND in front; C3 test: SET_BAND over a closed band), from an empty relisted leg and a fresh one. Holds except SET_BAND to a new feed (SRBG-1). ### peg-toll-hook - **P2:** testFuzz_C3_sweepWhole (fuzzed excursions, fuzzed sweeper, double sweep). Sink fixed at construction (StageGenesis._tollSink = StableModule, Treasury only if no module); the module counts idle reserve by balanceOf (StableModule._snap), so swept USDC is reserve and swept imdUSD is held. Hook has no other token path; a direct ERC20 donation to the hook would be stuck but is the donor's …[cut] - **P3:** testFuzz_C5_onePool; constructor requires address bits == FLAGS exactly (PegHook.sol:79), getHookPermissions matches; PoolManager validates the address at initialize. Unused callbacks revert but their flags are not set, so they are never called. - **P4:** testFuzz_P4_notes and testFuzz_meter (256 runs: 30 interleaved revenue/warp ops up to 50d; Treasury.trailingRevenue equals a model sum of the last 90 UTC days incl. today after every op). Revenue is only interest the Ledger mints to the Treasury (LedgerBase.sol:297-299); payNote transfers, never mints (Treasury.sol:170-175); open is Parameters-only after 48h with tenor in {30,90,180}d …[cut] - **P1 (except the split level in F1):** test_C1_edges, testFuzz_C2_towardAndExactOut, test_C2_splitAtCap; afterSwap tolls the unspecified currency (specifiedIs0 = amountSpecified<0 == zeroForOne, PegHook.sol:136) at the END price and direction; no liquidity/donate flags, module mint/redeem never touch the pool. A swap crossing $1 is tolled on its whole amount (known, README:1064). ### house-ledger-spoke - **P1 (mints only by borrow via hub.mint; interest booked; B6 identity; no burn above outstanding):** testFuzz_P1_P4_orderings: 1000 runs x 24 random steps over ETH (plain) and SIMD (edge type with sleeve): borrow (random rate/amount), full and partial repayFor, 0 / 1 h / 37 d time steps (several txs per block included), liquidatePosition at random price incl. reserve=true, reportLoss, stranger cover, Treasury.coverBadDebt, retire, lift, hub states (cap 0, freeze, Safe mark, total cap …[cut] - **P2 (cap 0, frozen, braked: repay+withdraw, liquidation, cover need no hub.mint):** testFuzz_P2_exitsAtCapZeroFrozenBraked (1000 runs): unreported bad debt booked (brake on), hub state fuzzed over none/cap 0/frozen/Safe mark/total cap 0/others full, plus freeze and lowerCap(0); then a full repay + full withdrawal, a Liquidator.liquidate at a lower price, a stranger cover and reportLoss all succeed, B6 holds, and a new borrow reverts. hub.burn/payReserve/reportLoss read …[cut] - **P3 (non-redeemable; collateral leaves only by owner or liquidation; kinds 3,6,7 retired and 4,14,19 refused alone and in BATCH):** test_P3_retiredAndNotHouseKindsRefusedAloneAndInBatch: each of 3,6,7,4,14,19 refused UnknownKind at propose alone and inside a BATCH as first or second item (ParametersRules.sol:47-52,130,158). Redeemable types refused at ADD_ILK (src/house/ParametersBase.sol:412); the house Ledger/LedgerSettlement have no redeem entry and no Redeemer is wired (Ledger.wire takes only the liquidator). …[cut] - **P4 (lends nothing new while owing the hub or holding unreported bad debt):** _checkBrake (src/house/LedgerBase.sol:383) reverts on lossOf.bad (bad_s + covered_s), the Safe's mark, or totalBadDebt, and runs before hub.mint in every borrow and in setRate's charged premium. Fuzz counts any borrow that succeeded while braked (brokeP4 == 0 over 1000x24 steps, incl. reserve-paid (covered) losses and stranger hub.cover); P2 test shows a borrow refused after …[cut] - **P5 (lift adds no debt, changes no health):** testFuzz_P5_liftAddsNoDebtChangesNoHealth (1000 runs): positions at 0.01 and 0.6, 0-400 days, a floor raise (SET_RISK) proposed and applied by a stranger after 48 h, then lift x2 and lift on the above-floor position in one block: debtOf, healthy(), ilkDebt and hub used unchanged, rate == floor, above-floor untouched, B6 holds, full repays in the next block land. Also lift in random …[cut] ## NOT RUN (fork / data / other) - core-loss-settlement: All Foundry tests: local forge is 1.8.3 (<1.9 required by brief); verdicts are from code reading, no findings asserted - core-loss-settlement: No [fork]/[data] claims in sheet: NOT RUN - core-loss-settlement: Earlier submissions 5937da4b..., d9aa6add... not fetched - core-savings-migrator: No [fork] claim applies to this item's FILES; all checks were run against the commit's local source with Foundry (forge 1.9.0, Solar 0.8.38), not a mainnet/L2 fork. Where the sheet or README ties a line to the real Ethereum deployment (C5, the ADD_SPOKE route), the deploy/launch scripts were read statically; no RPC fork test was run. - x-event-records: All Foundry tests: forge 1.8.3 installed, brief requires 1.9+ - x-event-records: [fork]/[data] claims: NOT RUN - stable-refusal-halt: All Foundry tests: forge 1.8.3 installed, brief requires 1.9+ with --use solar - stable-refusal-halt: C4 fork checks (sUSDS lock/hold, USDC/USDS/USDG 0-amount self-transfer) - stable-gas-starvation: C2 fork measurement (no RPC) - stable-gas-starvation: all Foundry tests: installed forge 1.8.3 lacks --use solar (brief requires 1.9+ else reason from code) - stable-exits-liquidity: C4 [fork]: USDG (4663 ~128,334,220) and Base USDC (~65,212,173) fork suites NOT RUN at this commit - stable-exits-liquidity: Invariant (stateful) campaigns: property tests here are stateless fuzz over action sequences (256 runs each) - stable-deposits-caps: [fork] sUSDS cannot dip (C4): NOT RUN (no RPC used); reasoned from README:867 - stable-deposits-caps: forge --use solar: forge 1.8.3 has no solar; compiled with solc 0.8.38 instead - stable-deposits-caps: Off-chain keeper code (not in the commit): bound reasoned from SafeBatch.liquidReserve's identical formula - stable-relist-band-gov: C4 [data]: the four stable feeds' round histories (no archive RPC run) - stable-relist-band-gov: --use solar (forge 1.8.3 has no solar; compiled with solc 0.8.38) - peg-toll-hook: No [fork]/[data] claims in this sheet; no fork run (NOT RUN). forge 1.8.3: --use solar unavailable; compiled with solc 0.8.38 via foundry.toml. Builder/sequencer ordering covered only by same-block multi-swap sequences in tests, not by a mempool simulation. - house-ledger-spoke: C4 [fork]: sIMD one-block hold on a mainnet fork (StakedIMD 0x9Efa934D9fAd4AE28c998a40195646b965a97247): NOT RUN, no RPC used - house-ledger-spoke: Earlier submissions ad4f75ab-8d61-4951-bc65-214951e52ac1 and 4d56c477-4266-4883-bf12-a7783bc8b0c8 (api.imd.fun) not fetched: no finding here to de-duplicate - house-ledger-spoke: forge 1.9 --use solar: not available (forge 1.8.3 installed); tests ran with solc 0.8.38 ## Notes for the requester - **No findings from the four code-only items.** core-loss-settlement, stable-refusal-halt, stable-gas-starvation and x-event-records ran no test, so their "holds" verdicts are weaker evidence than tested ones. They are worth re-running with forge >= 1.9 `--use solar`. stable-refusal-halt C5 and stable-gas-starvation C5 each propose an invariant handler that was not built. - **Untested residuals flagged as info by items (not findings, no test):** - stable-gas-starvation C1: a vault whose 4.9M gas is spent 4+ call levels deep needs ~5.218M, more than the ~5.168M the adapter receives at `PULL_GAS`. README:645's rule measures gas at the adapter and does not bound nesting depth. - stable-exits-liquidity C1: `MIN_DEPTH` measures `totalAssets` (donor-raisable), not `totalSupply`, which matters only for a fresh vault governance chooses to list. - stable-deposits-caps C5: the keeper/Safe reserve read over-counts under an issuer pause, after a cut share until anyone's rebalance, and for a parked deposit. The item judged this a Safe/keeper procedure (README:678), not a finding. - **Earlier submissions:** core-loss-settlement and house-ledger-spoke say they did not fetch the earlier submissions (api.imd.fun). The other items do not mention fetching them. I did not fetch them either.