# Audit report

> AUDIT the Robinhood Chain (4663) core as it launches: stock tokens (src/stocks/*, MarketHoursFeed, MarketCalendar), the Pulse sequencer grace (Liquidator, Redeemer, new debt), and its never-audited config and deploy (script/DeployConfig.sol RobinhoodConfig, script/DeployRobinhood.s.sol, script/deploy/StageChain.sol, StageCore.sol, DeployBase.sol), at the pinned commit.
>
> imdUSD v2 is a multi-collateral CDP stablecoin. On 12-07 its capped beta launches on Ethereum AND Robinhood Chain (4663, incl. stock tokens), joined by a LayerZero V2 burn-and-mint bridge. README.md gives scope, invariants, trust model and known issues: read it first. Wave 4 findings: GET https://api.imd.fun/jobs/<id>/submissions (0cb1541e prices, ae48df88 keeper, 34e546c2 bridge, 549dae1c stocks).
>
> BUILD AND TEST (required; Foundry, solc 0.8.26 via_ir; never build the whole project with solc: ~49 GB). Run `forge test --match-path 'test/unit/{Stocks,StockLending,StockBadDebt,StockReview,RedeemSequencerGrace,Pulse,AuditW4Stock*,AuditW5StockUsdgFreeze,AuditW5BorrowGrace,AuditW5WriteOffGrace,panel/PanelStockChop}.t.sol'`; Foundry 1.9+ `forge test --use solar --no-match-path 'test/fork/*'` runs all in seconds (confirm a proof with solc). Write each proof as test/unit/Proof<Name>.t.sol in the glob, run it, paste it with its output, then delete it. Fork: `forge test --match-path 'test/fork/{Robinhood,RobinhoodStocks}.t.sol'` with a 4663 RPC (real USDG freeze test included).
>
> PROPERTIES:
> P1 A stock type is priced in session only from an answer printed in the current session, or from the standing answer once OPEN_GRACE (5 min) passes with no new print; never outside the session or while frozen (pauses, blocklist, a multiplier step until sync and a later print).
> P2 No donation, dust deposit, adminBurn, reissue or forfeit lets anyone take existing holders' value; an impaired vault takes no deposit; what an emptied vault leaves belongs to nobody (not the next depositor).
> P3 An auction's price falls only while a take could settle (not while USDG is paused, frozen at the StockJoin or Treasury, or unreadable); across any span in which no take could settle it falls at most TICK_SPAN's worth; the USDG received covers the imdUSD booked as reserve-backed, any shortfall booked as bad debt.
> P4 During a sequencer outage (silence past the 15 min gap) and its 1 h grace: no seizure (writeOff included), no redemption and no new debt (borrow, a withdrawal leaving debt, a charged rate change); repayment and deposits always run.
> P5 The 4663 deploy creates exactly the configured graph: types, mats, lines (IMD 0 at genesis; the raise helper sets only the line, to 3,000), feeds (SGOV maxAge 49 h), Pulse, the Safe as governor (a codeless one refused on every path), no other authority.
> P6 A timelocked calendar change never touches today or a past day; closeDay only sets CLOSED (today to +3 days), so a begun session can only be frozen, never opened or moved.
>
> THREAT MODEL: the issuer controls pause, blocklist, oracle pause, multiplier changes, adminBurn, reissue and beacon upgrades with no delay; Paxos controls USDG's pause, freezes at any address and upgrades; Chainlink's equity feed is the single price leg, prints overnight, and its DON may stall through an open; one sequencer controls ordering, inclusion and outages across blocks (anyone may poke Pulse, so censorship that still includes a poke is NOT detected: accepted); takers and searchers control timing within and across blocks; borrowers choose when to act around the open and the grace; the Safe controls the calendar, closeDay and the IMD raise. The keeper (off-repo) pokes Pulse within 8 min, ticks live auctions within 4 min, syncs after a multiplier step, writes off after 1 h.
>
> PATH: Chainlink -> MarketHoursFeed (+ calendar) -> RateFeed (StockVault share rate) -> Pricer -> LedgerBase._quote (borrowable off in the grace) -> Ledger and Liquidator (Pulse) -> StockJoin auction (USDG) -> Treasury and the borrower's claim; Ledger.writeOff (custody worthless at two reads >= 1 h apart, outside the grace -> Treasury); Redeemer (Pulse; stock types are not redeemable); RobinhoodConfig -> script/deploy/Stage*.sol / DeployRobinhood.
>
> CLAIMS TO CHECK: confirm or refute each with a test.
> C1 OPEN_GRACE 5 min suffices: on opens >= 0.6% from the standing answer the feeds printed within 0.5-2 min (Jun-Nov 2026 rounds); a stalled DON then prices the session from the standing answer up to maxAge (25 h; SGOV 49 h): is that safe?
> C2 counting managed assets with real shares only (no virtual offset) closes every inflation and forfeit path, incl. a partial burn and the first deposit after the vault empties.
> C3 a span with no take possible costs at most TICK_SPAN of descent (0.83% at a 0.9 floor), also under a USDG pause, freeze or unreadable read, and a gas-starved tick cannot erase clock time (incl. via the feed's fail-closed reads).
> C4 blocking new debt in the grace is complete: no path (adjust, rate change, a zap, another module) adds debt inside it.
> C5 every mat covers its measured closed-market gap plus the auction hour, OPEN_GRACE, the 1 h grace and a re-bite after the 2 h lapse (NVDA and TSLA have the least slack).
> C6 DeployRobinhood and the stage steps it shares with the staged launch (script/deploy/Stage*.sol; the stage entries are not public) build the same graph.
>
> SOUNDNESS: the auction clock repeats the seat clock's property (broken in waves 1-3 and 4): can a read-forward clock guarantee P3 when holds leave no timestamp? Has the vault's guard (wave 1, wave 4, now real shares) closed P2 for good? Is the session rule sound at the open for tickers that rarely print in session (SGOV: 0 of 95)? Give the smallest change.
>
> PROOF STANDARD: fuzz over timestamps and print times (DST, holidays, early closes, weekends, outages); invariants over vault deposits, donations, burns, forfeits, reissues; auction fuzz over gaps, pauses, freezes, ticks across blocks.
>
> KNOWN (a case worse than stated IS a finding): after large forfeits a tiny deposit can round to zero shares (the depositor loses at most one share's worth); censorship with a poke (above); if Paxos drops isFrozen or paused, every auction clock stops (a halt).
>
> Answer each numbered question:
> 1. (P1, P6) Find a timestamp, print time or issuer state that misprices a type or freezes it in session for no reason, or a calendar act that changes a begun session.
> 2. (P2) Attack StockVault: first deposit, the empty-vault restart, donations, rounding, the multiplier, adminBurn, reissue, forfeits, writeOff then reissue, impaired states.
> 3. (P3, P4) Attack the auction and the grace: USDG pauses and freezes, gaps, ticks, frozen takers, seizure, redemption or new debt around an outage.
> 4. (P5) Does the 4663 deploy (both paths) build exactly the configured graph with no stray authority, and are its parameters sane?
> 5. (P1, P3, P4) What would you change before 12-07?
>
> Not findings: README 'Known issues' as written (a known issue worse than written IS a finding); test/ and mocks; src/dex, src/earn/LoopVault.sol, and launch files README marks compile-only.
>
> Every finding: severity by impact; file, line, the lines copied; the call sequence; the failing state, expected vs actual; reachable with the deploy config or not; the smallest fix; a test that fails on this commit, RUN as BUILD says and pasted with its output (the judge reruns it). Answer every numbered question, including where nothing is wrong.

| | |
|---|---|
| Repository | https://github.com/imdusd/imdusd-v2-audit.git |
| Commit | `422a3373a78ed6b55d32a943a5481ffcbb8af1bf` |
| Job | `ec9fe0d5-bd7a-4f65-8810-7b6cdf3223cc` |
| Judged | 2026-11-18 22:14 UTC |
| Findings | 3 medium · 3 low |

Four agents audited the code as it is at `422a337`, each in one area (math, permissions, economics, control flow),
and a judge reproduced, merged and ranked what they found, then read the code once more itself. Nothing in the repository was changed or deployed.

## Findings

### 1. Medium: StockVault: 1 wei pins an empty vault at 10^6x its share rate (mint(1) or deposit(1)+redeem(999,999)); the capped RateFeed then values every later deposit at 1e-6 of its worth, bricking each 4663 stoc

`src/stocks/StockVault.sol:61`

```
        if (supply == 0) return Math.mulDiv(shares, 1, 10 ** _decimalsOffset(), rounding);
```

Refutes C2 (merged from three specialists: audit_flow e41d012d, audit_economics d3fc23c6, audit_permissions 3858a844). With no virtual offset, the 10^6 share scale holds only while nobody rounds against it. On an EMPTY vault, mint(1) costs ceil(1/1e6) = 1 wei (line 61 with Ceil), leaving supply = 1 share and managedAssets = 1. The other route is deposit(1) -> 1e6 shares followed by redeem(999_999), which pays floor(999_999*1/1e6) = 0 assets: OZ redeem burns the shares and nothing refuses a zero-asset exit. Either way convertToAssets(1e18) reads 1e18 instead of 1e12. Each type's price is RateFeed(vault, convertToAssets(1e18), cap = RobinhoodConfig CAP = 0.1%/day), which StageChain._stockType builds over the still-empty vault, so checkpointRate = highRate = 1e12. RateFeed.rate() = min(live, max(checkpoint grown at the cap, highRate)) stays ~1e12 while the vault mints later depositors 1 share per wei: 100 tokens at $100 are valued at $0.01, Ledger.open reverts Unhealthy, and the cap needs ~13,800 days to catch up. The attacker keeps its share, so the vault never empties and never restarts at the 1e6 scale. Nobody loses deposited stock (it redeems 1:1), so this is a denial of service: every type stays unusable until the Safe re-points it, through the 48 h timelock, at a new RateFeed built on the pinned vault. Cost: 1 wei plus gas per type. It works against all nine RobinhoodConfig types between their deploy transactions and the first honest deposit (StageChain/DeployRobinhood seed no vault), and against any vault that empties later. This is not the README's known issue (a tiny deposit rounding to zero shares after forfeits). Reachable with the deploy config: yes. Smallest fix: in StockVault, refuse a redeem/withdraw that pays 0 assets for >0 shares, and require totalSupply()==0 || totalAssets() >= MIN_ASSETS (e.g. 1e12 wei) after every deposit, mint, withdraw and redeem, so one rounding step cannot move the rate measurably. Optionally the deploy also seeds each vault with a dead deposit in the transaction that creates it.

**Reproduction**

Empty StockVault; MarketHoursFeed and RateFeed(vault, convertToAssets, true, mhf, 0.001e18/1 days) as StageChain builds them; Mon 2026-10-19 14:00 UTC, answer $100. The attacker calls stock.approve(vault,1); vault.mint(1, attacker), or deposit(1) then redeem(999_999). Alice then deposits 100e18. Expected: shares valued at $10,000. Actual: convertToAssets(1e18)=1e18, price.rate()=1e12, value $0.01, and after 365 daily pokes rate() is still 1.44e12. Run with solc 0.8.26 via_ir: `forge test --match-path test/scratch/ProofStockFirstMint.t.sol` gives [FAIL: 100 tokens at $100 must be valued at $10,000: 10000000000000000 !~= 10000000000000000000000 (max delta: 1.0000000000000000%, real delta: 99.9999000000000000%)] test_firstMintOfOneShare(), the same for test_firstDepositThenZeroAssetRedeem(), and [FAIL: the feed rate reaches the vault's rate within a year: 1440251313198 < 500000000000000000] test_capNeverCatchesUp(). The other two specialists' proofs also fail on this commit: test_mintOneShareBricksTheType 102999999999900 !~= 1e20, and test_oneWeiPinsTheEmptyVault 1e16 !~= 1e22. Their controls pass.

**Proof**: a Foundry test that fails on this code and passes once it is fixed.

```solidity
// SPDX-License-Identifier: MIT
pragma solidity 0.8.26;

import {Test} from "forge-std/Test.sol";
import {ERC20} from "@openzeppelin/contracts/token/ERC20/ERC20.sol";
import {IERC20Metadata} from "@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol";
import {StockVault} from "src/stocks/StockVault.sol";
import {RateFeed} from "src/feeds/RateFeed.sol";
import {MarketCalendar} from "src/feeds/MarketCalendar.sol";
import {MarketHoursFeed} from "src/feeds/MarketHoursFeed.sol";

contract PRegistry {
    function paused() external pure returns (bool) {
        return false;
    }

    function isBlocked(address) external pure returns (bool) {
        return false;
    }
}

contract PStock is ERC20 {
    address public immutable ACCESS_CONTROLLED_REGISTRY;

    constructor(address r) ERC20("SPY", "SPY") {
        ACCESS_CONTROLLED_REGISTRY = r;
    }

    function paused() external pure returns (bool) {
        return false;
    }

    function oraclePaused() external pure returns (bool) {
        return false;
    }

    function uiMultiplier() external pure returns (uint256) {
        return 1e18;
    }

    function newUIMultiplier() external pure returns (uint256) {
        return 1e18;
    }

    function mint(address to, uint256 a) external {
        _mint(to, a);
    }
}

contract PAgg {
    int256 public answer;
    uint256 public at;

    constructor(int256 a) {
        answer = a;
        at = block.timestamp;
    }

    function decimals() external pure returns (uint8) {
        return 8;
    }

    function latestRoundData() external view returns (uint80, int256, uint256, uint256, uint80) {
        return (1, answer, at, at, 1);
    }
}

/// The stock module exactly as script/deploy/StageChain.sol builds it (empty vault, RateFeed over convertToAssets with
/// RobinhoodConfig.CAP = 0.1%/day), on mocks. Property: whatever the first caller does to the empty vault, an honest
/// deposit of 100 tokens at $100 is valued at $10,000 by the type's price feed.
contract ProofStockFirstMint is Test {
    uint256 constant MON_1400 = 1792418400; // Mon 2026-10-19 14:00 UTC, inside the session
    PStock stock;
    StockVault vault;
    RateFeed price;
    address attacker = address(0xA77);
    address alice = address(0xA11CE);

    function setUp() public {
        vm.warp(MON_1400);
        stock = new PStock(address(new PRegistry()));
        PAgg agg = new PAgg(100e8);
        MarketCalendar cal = new MarketCalendar(address(0xBEEF), new uint32[](0), new uint32[](0));
        vault = new StockVault(IERC20Metadata(address(stock)));
        MarketHoursFeed mhf = new MarketHoursFeed(address(agg), address(stock), address(vault), cal, 25 hours);
        price = new RateFeed(
            address(vault), bytes4(keccak256("convertToAssets(uint256)")), true, mhf, uint256(0.001e18) / 1 days
        );
    }

    function _honestDepositIsValued() internal {
        stock.mint(alice, 100e18);
        vm.startPrank(alice);
        stock.approve(address(vault), 100e18);
        uint256 shares = vault.deposit(100e18, alice);
        vm.stopPrank();
        assertApproxEqAbs(vault.convertToAssets(shares), 100e18, 2, "alice's shares redeem for her 100 tokens");
        assertFalse(price.isStale(), "priced");
        (uint256 perShare,) = price.latestValue();
        uint256 value = shares * perShare / 1e18;
        emit log_named_decimal_uint("vault rate (assets per 1e18 shares)", vault.convertToAssets(1e18), 0);
        emit log_named_decimal_uint("feed rate (capped)", price.rate(), 0);
        emit log_named_decimal_uint("USD value the Ledger sees for 100 tokens at $100", value, 18);
        assertApproxEqRel(value, 10_000e18, 0.01e18, "100 tokens at $100 must be valued at $10,000");
    }

    /// 1 wei of stock, one call: mint(1) into the empty vault costs ceil(1 / 1e6) = 1 wei and makes 1 share = 1 wei.
    function test_firstMintOfOneShare() public {
        stock.mint(attacker, 1);
        vm.startPrank(attacker);
        stock.approve(address(vault), 1);
        try vault.mint(1, attacker) {} catch {}
        vm.stopPrank();
        _honestDepositIsValued();
    }

    /// The same through deposit + a redeem that rounds to zero assets: 1e6 shares -> 1 share, still 1 wei held.
    function test_firstDepositThenZeroAssetRedeem() public {
        stock.mint(attacker, 1);
        vm.startPrank(attacker);
        stock.approve(address(vault), 1);
        try vault.deposit(1, attacker) {} catch {}
        try vault.redeem(999_999, attacker, attacker) {} catch {}
        vm.stopPrank();
        _honestDepositIsValued();
    }

    /// The cap never catches up: a year of daily pokes later the feed still values the type at about a millionth.
    function test_capNeverCatchesUp() public {
        stock.mint(attacker, 1);
        vm.startPrank(attacker);
        stock.approve(address(vault), 1);
        try vault.mint(1, attacker) {} catch {}
        vm.stopPrank();
        for (uint256 i; i < 365; ++i) {
            vm.warp(MON_1400 + (i + 1) * 1 days);
            price.poke();
        }
        emit log_named_uint("vault rate", vault.convertToAssets(1e18));
        emit log_named_uint("feed rate after 365 daily pokes", price.rate());
        assertGe(price.rate(), vault.convertToAssets(1e18) / 2, "the feed rate reaches the vault's rate within a year");
    }
}
```

### 2. Medium: writeOff's armed record survives an unreported reissue: a second full burn within 7 days is written off in the same block, seizing borrowers' equity

`src/LedgerSettlement.sol:227`

```
        if (since == 0 || block.timestamp > since + WRITEOFF_WINDOW) {
```

writeOff promises that the custody has been worthless at 'two readings >= WRITEOFF_DELAY apart' and that 'a reissue inside the delay writes nothing off'. But worthlessSince[ilk] is cleared only by a writeOff call that sees the custody worth something (lines 222-226). A reissue clears nothing, and nothing checks that the custody stayed worthless between the two readings. The doc names burn-then-reissue as the issuer's expected pattern for migrations and corporate actions. If one such burn is armed by anyone and reissued before anyone sends a clearing call, a second full adminBurn within WRITEOFF_WINDOW (7 days) is seizable in the block of the burn, before the reissue lands: the record is older than WRITEOFF_DELAY and inside the window. Every position's shares go to the Treasury and its debt becomes bad debt. When the issuer reissues, the Treasury holds the value and each borrower has lost its equity. Reachable with the deploy config: any stock type; the issuer burns (trusted) and a searcher orders around the burn. Smallest fix: also record the last worthless reading, and re-arm (worthlessSince = now) when that reading is older than a short step (e.g. 15 min, inside the keeper cadence). A seizure then needs a chain of worthless readings spanning WRITEOFF_DELAY.

**Reproduction**

test/scratch/ProofWriteOffStickyZero.t.sol, on test/utils/StockSystem (so not attached as a self-contained proof). Alice opens 100e18 SPY ($10,000) against 6,000 imdUSD. stock.adminBurn(vault,100e18); a searcher calls ledger.writeOff(id), which arms; after 10 min stock.mint(vault,100e18) reissues and nobody clears; after 2 h stock.adminBurn(vault,100e18) again; the searcher calls ledger.writeOff(id) in the same block; stock.mint(vault,100e18). Expected: debtOf(id) == 6000e18 (the custody was worthless for 0 s). Actual: `forge test --use solar --match-path test/scratch/ProofWriteOffStickyZero.t.sol` gives [FAIL: alice's position must survive a burn reissued at once: 0 != 6000000000000000000000] test_secondBurnWrittenOffAtOnce(). The position was written off.

### 3. Medium: Stock RateFeed growth cap (0.1%/day) withholds a forfeited reissue from the holders who stayed: their custody is priced at 2/3 of what it redeems for for ~500 days, and liquidation takers capture the

`src/feeds/RateFeed.sol:170`

```
        return live < ceiling ? live : ceiling;
```

StockVault (lines 20-23) gives a reissue to the shares that stayed through an impairment: a holder who leaves while the vault is impaired takes the impaired value, so after the reissue the remaining shares' convertToAssets rises above its pre-burn high. On 4663 those exits are routine, not optional: StockJoin.take redeems the units a taker buys at the impaired rate, and debt-free unwraps also exit. The type is priced through RateFeed (StageChain._stockType, rateCap = RobinhoodConfig CAP = 0.1%/day), which lets a rise above highRate through only at the cap. The stayers' positions are therefore valued at highRate while their custody redeems for 1/(1-f) of it. A position that is bitten in that period sells at the capped price x the auction factor, and the taker redeems the units at the full live rate, keeping value that belongs to the stayer. That is the 'reissue or forfeit lets anyone take existing holders' value' case P2 excludes. On a StockVault the cap protects against nothing: managedAssets already ignores donations. Smallest fix: deploy stock RateFeeds with a cap that cannot bind (StocksSpec.rateCap large), or have RateFeed accept the live rate from a StockVault that is not impaired.

**Reproduction**

Two holders deposit 100e18 each (rate 1e12 per 1e18 shares). The issuer adminBurns 100e18 from the vault (rate 0.5e12). A redeems all its shares (50e18). The issuer reissues 100e18. One day later B's shares redeem for 150e18 and convertToAssets(1e18) = 1.5e12, but RateFeed.rate() after a poke = 1.000999e12. Run on this commit: `forge test --use solar --match-path test/scratch/ProofStockRateCapForfeit.t.sol -vv` gives [FAIL: stock type priced below what its custody redeems for: 100099999999900 < 148500000000000] test_reissueAfterForfeitIsCappedAway(), with logs live rate 1500000000000 and priced rate 1000999999999.

**Proof**: a Foundry test that fails on this code and passes once it is fixed.

```solidity
// SPDX-License-Identifier: MIT
pragma solidity 0.8.26;

import "forge-std/Test.sol";
import {ERC20} from "@openzeppelin/contracts/token/ERC20/ERC20.sol";
import {IERC20Metadata} from "@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol";
import {StockVault} from "src/stocks/StockVault.sol";
import {RateFeed} from "src/feeds/RateFeed.sol";
import {IFeed} from "src/interfaces/IFeed.sol";
import {RobinhoodConfig} from "script/DeployConfig.sol";

contract Stock is ERC20 {
    constructor() ERC20("Robinhood NVDA", "NVDA") {}
    function mint(address to, uint256 a) external { _mint(to, a); } // issuer reissue
    function adminBurn(address from, uint256 a) external { _burn(from, a); } // issuer burn
}

contract AnyCode {}

/// After an issuer burn, holders who leave while the vault is impaired (debt-free withdrawals, auction takers redeeming,
/// any raw-share holder) forfeit their claim on the reissue to the shares that stay (StockVault's design). The reissue then
/// lifts the stayers' share rate ABOVE its pre-burn high, and the stock type's RateFeed (deploy cap 0.1%/day) only lets
/// that rise through at 0.1% a day: the Ledger values the stayers' collateral at 2/3 of what it redeems for for ~500 days.
contract ProofStockRateCapForfeit is Test {

    function test_reissueAfterForfeitIsCappedAway() public {
        Stock stock = new Stock();
        StockVault vault = new StockVault(IERC20Metadata(address(stock)));
        address a = address(0xA);
        address b = address(0xB);
        stock.mint(a, 100e18);
        stock.mint(b, 100e18);
        vm.prank(a);
        stock.approve(address(vault), type(uint256).max);
        vm.prank(b);
        stock.approve(address(vault), type(uint256).max);
        vm.prank(a);
        vault.deposit(100e18, a);
        vm.prank(b);
        vault.deposit(100e18, b); // b: the shares a stock position keeps in the StockJoin

        uint256 CAP = RobinhoodConfig.stocks().rateCap; // the stock types' RateFeed cap as deployed (0.1%/day)
        RateFeed feed = new RateFeed(address(vault), bytes4(keccak256("convertToAssets(uint256)")), true, IFeed(address(new AnyCode())), CAP);
        uint256 r0 = feed.rate();
        assertEq(r0, 1e12);

        // issuer adminBurns half the custody (migration / corporate action), a leaves while impaired, then the reissue
        stock.adminBurn(address(vault), 100e18);
        uint256 sharesA = vault.balanceOf(a);
        vm.prank(a);
        vault.redeem(sharesA, a, a); // gets 50e18: forfeits its claim on the reissue to b
        stock.mint(address(vault), 100e18); // reissue of the burned 100e18
        vm.warp(block.timestamp + 1 days);

        uint256 live = vault.convertToAssets(1e18);
        assertEq(live, 1.5e12, "b's share redeems for 1.5x its pre-burn rate");
        assertEq(vault.previewRedeem(vault.balanceOf(b)), 150e18, "b can redeem 150 stock");
        feed.poke();
        // the Ledger prices b's collateral from feed.rate(): it should follow the redeemable value
        emit log_named_uint("live rate  ", live);
        emit log_named_uint("priced rate", feed.rate());
        assertGe(feed.rate() * 100, live * 99, "stock type priced below what its custody redeems for");
    }
}
```

### 4. Low: A dust donation into a hollowed (impaired) StockVault is counted as value and blocks or clears Ledger.writeOff, sending the seized custody and any later reissue to an auction taker instead of the Trea

`src/LedgerSettlement.sol:222`

```
        if (IERC4626Min(c.token).convertToAssets(1e18) != 0) {
```

StockVault.totalAssets() = min(balance, managedAssets). While the vault is impaired the balance is below managedAssets, so a donation counts in full: the comment at StockVault.sol:17 that 'a donation changes no share's value' holds only while the vault is not impaired. After the issuer burns all the custody, anyone who sends totalSupply/1e18 wei (1e10 wei for 10,000 tokens of custody) makes convertToAssets(1e18) = 1. writeOff then reverts NotWorthless or deletes an armed record, and the griefer can repeat after each re-arm. The type then reads a live rate near zero, so its positions are liquidated for dust USDG: the same bad debt, but the shares go to the taker (typically the donor), so a later burn-then-reissue goes to them and not the Treasury, as writeOff's doc intends. Smallest fix: judge worthlessness against a material threshold, e.g. balanceOf(vault) * 1e6 < managedAssets, or convertToAssets(1e18) * 1e6 < RateFeed.highRate.

**Reproduction**

test/scratch/ProofWriteOffStickyZero.t.sol::test_dustDonationBlocksWriteOff (StockSystem). Alice opens 100e18 against 6,000 imdUSD. stock.adminBurn(vault,100e18) makes convertToAssets(1e18) = 0; a writeOff arms. The griefer transfers totalSupply/1e18+1 wei of stock to the vault. After 2 h writeOff clears the record instead of seizing. `forge test --use solar --match-path test/scratch/ProofWriteOffStickyZero.t.sol` gives [FAIL: a donation must not change a share's value: 1 != 0] test_dustDonationBlocksWriteOff().

### 5. Low: SGOV maxAge 49 h does not cover one missed Sunday heartbeat: the feed never prints Saturday or Sunday daytime, so a skipped Sunday 20:00 NY print leaves SGOV unpriced for the whole Monday session

`script/DeployConfig.sol:984`

```
    uint256 internal constant SGOV_MAX_AGE = 2 days + 1 hours;
```

The config says 49 h 'covers one missed weekday heartbeat (Mon 20:00 -> Wed 16:00 = 44 h)'. I read SGOV feed rounds 1-117 (0xa0DF4ee0fFf975306345875E3548Fcc519577A11, phase 1). The last print before every weekend is Thursday 20:0x NY (11 weeks) or Friday 20:0x NY (6 weeks), and the next is always Sunday 20:00 NY (Monday 20:00 over Labor Day). If the Sunday heartbeat is skipped, the standing answer at Monday 09:40 NY is at least 61.5 h old (Friday) or 85.5 h old (Thursday), past 49 h. Since SGOV almost never prints in session (3 of 114 rounds), the type is unpriced all Monday: no borrow, no withdrawal that leaves debt, no liquidation, and auction clocks stopped. The same applies to the first session after a holiday. This is liveness only (fail closed). Note: one specialist's claim that the feed 'never prints Friday' is wrong (6 of 17 weekends start Friday 20:01), but the conclusion holds for both. Smallest fix: SGOV_MAX_AGE = 4 days + 1 hours (Thu 20:00 -> Mon 16:00 is 92 h), or 5 days to cover a Monday holiday. The 0.02%/day drift argument still holds.

**Reproduction**

test/scratch/ProofSgovMonday.t.sol (StockSystem; a MarketHoursFeed with maxAge 2 days + 1 hours). Print at Sat 2026-10-24 00:01 UTC (Fri 20:01 NY), Sunday missed, warp every 15 min from Mon 10-26 09:40 to 16:00 NY: `forge test --use solar --match-path test/scratch/ProofSgovMonday.t.sol` gives [FAIL: Monday unpriced after one missed Sunday heartbeat] test_missedSundayHeartbeatUnpricesMonday(). The control (a Wed 20:01 print priced at Fri 09:40) passes. Chain data: cast call <feed> getRoundData(2^64+n) for n=1..117 on 4663. The weekend gaps are Thu 20:0x -> Sun 20:00 (71-72 h, 11 weeks), Fri 20:0x -> Sun 20:00 (47 h, 6 weeks), and Thu 09-03 -> Mon 09-07 20:00 (95 h).

### 6. Low: StageChain resume: _calendarIs adopts a recorded MarketCalendar that closes (or early-closes) days the config leaves open

`script/deploy/StageChain.sol:152`

```
        for (uint256 i; i < s.closedDays.length; ++i) if (c.dayStatus(s.closedDays[i]) != c.CLOSED()) return false;
```

P5/C6. On the staged path a recorded calendar is kept whenever _calendarIs holds, but the check reads only the governor and the days RobinhoodConfig lists. Any other day is never read. A recorded calendar seeded from another list (an earlier config revision or a rehearsal) that marks an extra weekday CLOSED or EARLY_CLOSE is therefore accepted as the configured wiring. Every MarketHoursFeed is then built over it, and all nine types are unpriced on that day (no liquidation, no new debt, auctions stopped) until the Safe repairs it through the 48 h timelock. DeployRobinhood with a fresh record always builds the calendar from the config, so the two paths can end with different calendars. Reachable only on the staged path with a stale recorded calendar. Smallest fix: MarketCalendar stores an immutable keccak256(abi.encode(closed, early)) of its constructor lists, and _calendarIs compares it with the config's.

**Reproduction**

test/scratch/ProofCalendarResume.t.sol: a harness `H is StageChain` exposes _calendarIs. cfg.governor = 0x5AFE, cfg.stocks = RobinhoodConfig.stocks(). The recorded calendar is the config's closedDays plus day 20801 (Mon 2026-12-14), with the config's earlyDays. Expected: _calendarIs == false (mismatch, so a fresh calendar is built). Actual: `forge test --use solar --match-path test/scratch/ProofCalendarResume.t.sol` gives [FAIL: a calendar closing a day the config leaves open is not the configured calendar] test_extraClosedDayAccepted(). It returns true.

---

Judge's submission `46e49910265c4b6b88c83cc9f4b4fa97e450d8a2d864457c4e6df21c9bdba91e`, accepted on the IdentityMD network. Acceptance means the report met the job's checks;
it is not a guarantee that the code has no other defects.
