{
  "item": "core-savings-migrator",
  "commit": "ff1c192b3798542997f600091f2dc73ff05e4c40",
  "forge": "forge 1.9.0 (6056c5845d 2026-11-02T20:28:32.434285913Z), compiled with --use solar (Solar 0.8.38)",
  "verdict": "holds",
  "findings": [],
  "claims": [
    {
      "id": "C1",
      "result": "holds",
      "evidence": "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, fell<=outstanding) plus my own fuzz test CoreSavingsMigratorAuditTest.testFuzz_roundTripNeverProfits (1-6 repeats, random amount up to 60k, mixed same-block/next-block) RAN, PASS: alice's v1 and imdUSD balances are byte-identical before and after any number of round trips; outstanding and hub.usedOf(MIG) stay exactly equal to the single net amount. No profit beyond the stated fee-base effect was found."
    },
    {
      "id": "C2",
      "result": "holds",
      "evidence": "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 indirectly by test/unit/Savings.t.sol test_sandwichAroundAccrualEarnsNothing (PASS) and the repo's own ImdUSD unit tests of circulating(); code-level confirmation, NOT RUN as a new test (already fully covered by existing passing suite)."
    },
    {
      "id": "C3",
      "result": "holds",
      "evidence": "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 and never lets a same-block fresh deposit raise settledAssets above the pre-block baseline, even when an unrelated withdrawal of OLD stake happens in the same block and zeroes depositedAt: test/unit/CoreSavingsVaultOrderingAudit.t.sol testFuzz_settledAssetsNeverCountsThisBlocksFreshDeposit (256 runs, mixed orderings) RAN, PASS. Also covered by the repo's test_sandwichAroundAccrualEarnsNothing (deposit then accrue in two top-level calls of the same block with `isolate=true`, i.e. two transactions, PASS) and test_donationCannotInflateSharePrice. No deposit/accrual/withdrawal ordering was found that lifts uptake or takes un-vested interest."
    },
    {
      "id": "C4",
      "result": "holds",
      "evidence": "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 test/unit/CoreSavingsMigratorAudit.t.sol test_donationOfImdUSDCreatesNoBurnRoom: donating 5,000 imdUSD straight to the Migrator does not raise `outstanding`, toV1 for more than outstanding reverts, and the donated imdUSD is simply stranded in the contract (no extra burn room created). RAN, PASS."
    },
    {
      "id": "C5",
      "result": "holds",
      "evidence": "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 Migrator.toV2 always reverts OverLine. Added test/unit/CoreSavingsMigratorAudit.t.sol test_toV2RevertsBeforeAddSpoke: a freshly constructed Migrator with no row reverts OverLine on toV2(1). RAN, PASS. NOT RUN as a [fork] test against the real Ethereum deployment (no RPC fork was run for this item; this is a local, non-fork unit test against the audited bytecode)."
    }
  ],
  "holds": [
    {
      "property": "P1 - savers paid only their real, time-weighted, pro-rata share; no flash deposit/round trip/donation skims it",
      "tried": "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 post-first-deposit donation), test_halfOfInterestToSavers / test_tinyVaultGetsTheFloor / test_shareScalesWithUptake (uptake = min(share, max(SAVINGS_FLOOR, saved/circulating))). settledAssets() is the flash-proof uptake figure (see C3). No sequence (single block, consecutive blocks, several accounts) was found that pays savers more than their time-weighted, uptake-capped share of interest actually minted."
    },
    {
      "property": "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",
      "tried": "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 over outstanding), then pulls imdUSD, burns through the hub (open per hub P6: 'no cap, freeze, loss, mark or pending proposal is read'), then pays out v1. test_migratorIsAnOrdinarySpoke (repo, PASS) exercises lowerCap(0)+freeze+lowerTotalCap(0) mid-flow and confirms toV1 is never blocked while toV2 reverts; testFuzz_roundTripNeverProfits (mine, PASS, 256 runs) confirms outstanding and hub.usedOf(MIG) track exactly through repeated round trips. v1's own vault is the only v1 minter and the Migrator code never touches it (grep: no reference to a v1-minting function anywhere in Migrator.sol), so v1 stays the permanent minter."
    },
    {
      "property": "P3 - vault shares cannot be inflated by a first depositor or a donation (virtual shares + 7-day stream)",
      "tried": "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 deposit followed by a 10,000e18 donation does not round the next depositor's shares to zero, and the donor recovers almost none of the gift even after the donation fully vests."
    },
    {
      "property": "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",
      "tried": "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 `mark`, read by unbacked()/exoticUnbacked(), and explicitly never touches `bad` (core bad debt). Confirmed with test_migratorNeverReportsALoss (mine, RAN, PASS): after ordinary toV2/toV1 use, hub.lossOf(migrator) is (bad=0, mark=0); after the Safe calls markLoss, bad stays 0 and only mark rises. A v1 depeg can only ever become a Safe-applied mark on this exotic row, never Migrator-triggered core bad debt."
    }
  ],
  "notRun": [
    "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."
  ]
}
