# Audit report

> Security audit of IDM Records, an onchain music label's contracts, before their mainnet deploy on Robinhood Chain 4663, Base 8453 and Arc 5042. Repository root is a Foundry project; read README.md first (scope, money flow, trust model, fixes already made, accepted risks). In scope: src/IDMRecords.sol (ERC-721 cap 1000, EIP-712 voucher mint only by the voucher's `to`, USDG reward pot with per-token and shared-pool accounting, ERC-2981, ERC721-C validator v5, 48 h signer rotation), src/RewardFeeder.sol and src/TreasuryFeeder.sol with src/EthPoolSwap.sol and src/KeeperOwned.sol (keeper-only swaps in the Uniswap v4 ETH/USDG pool inside an owner-set price band), src/RevenueSplitter.sol (ownerless push splitter), src/HolderRewards.sol (USDC Merkle-root rewards with delay and guardian), src/ArcForwarder.sol (ownerless CCTP v2 forwarder), and the security-relevant parameters set by script/*.s.sol. A first swarm pass (job 71b19999 at 6a404a6) found no critical or high issue; its four fixes are in this commit (README 'Fixed after the IMD swarm audit'): check that they hold and look for what it missed. Out of scope: lib/. Focus: loss or lock of holders' USDG/USDC, reward accounting errors and rounding, mint authorization and voucher replay across drops/chains, what a leaked keeper or signer key can take, splitter and feeder ETH/token handling, transfer validator lock risks. Reproduce every finding, with a Foundry test where possible (fork tests skip without FORK_RPC / BASE_FORK_RPC).

| | |
|---|---|
| Repository | https://github.com/discodirector/idm-records-contracts |
| Commit | `3a2e794df8e03afcb6003b5fc4802f6c3ce49b20` |
| Job | `88d4aa11-292b-4c18-95c5-dc9f3083f63b` |
| Judged | 2026-11-13 18:21 UTC |
| Findings | 1 medium · 4 low · 5 info |

Four agents audited the code as it is at `3a2e794`, 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: RewardFeeder.feed swaps the whole ETH balance in the same call that pools the USDG held, so any ETH that cannot clear the floor locks holders' USDG in the feeder

`src/RewardFeeder.sol:96`

```
if (swappedOut * 1e18 < paid * minUsdgPerEth) revert BelowFloor(paid, swappedOut, minUsdgPerEth);
```

feed() does two independent jobs in one transaction: it swaps the feeder's ENTIRE ETH balance (line 88, `_swap(true, ethIn)` at line 92) and then pools the USDG it holds into IDMRecords.depositPool (lines 99-106). The owner's floor is checked on the average price of that whole swap (line 96) and a failure reverts the whole call, including the pooling, although the USDG (the Stations splitter's holders' quarter, released by anyone with releaseToken(USDG)) needs no swap at all. The dust fix of this commit (line 90, README swarm item 3) only exempts ETH worth under 0.01 USDG; every other way the swap can fail the floor has the same effect: (a) the market moved more than the band under the floor since the owner last set it (the comment at line 71 admits feeds then revert), (b) the pool's in-range liquidity is thinner than the ETH held, so v4 fills partially up to MIN_SQRT_PRICE+1 and the average price of the partial fill is under the floor, (c) an oversized balance (keeper downtime, a large royalty, or anyone's ETH transfer since receive() is open) whose price impact passes the band. The keeper has no way to swap part of the ETH or to pool the USDG alone; the owner's only remedy is setFloor() below the price the pool gives for the WHOLE balance, which accepts the full price impact the band exists to prevent and widens what a leaked keeper key may take until the floor is raised again. Impact: holders' USDG already in the feeder is locked until the owner acts or the pool recovers (README 'funds wait in the feeder' covers the fixed-pool case, not the USDG leg); no funds are lost, hence medium. Merged from three specialist reports of the same seam (whole-balance swap, partial fill, market under floor). Fix preserving the design: pool the USDG held independently of the swap (pool first, or skip the swap when it would fail the floor and let the ETH wait), and let the keeper bound the ETH swapped per feed (feed(maxEthIn, minOut) swapping min(balance, maxEthIn), or an owner-set per-feed cap) so a large balance is fed in slices inside the band.

**Reproduction**

Local Uniswap v4 PoolManager (vendored lib/v4-core), ETH/USDG(6 dec) pool fee 500 / spacing 10 at 3000 USDG per ETH, liquidity 1e16 over +-10000 ticks, RewardFeeder floor 2250e6 (the deploy's 25% band), one record minted. State: feeder holds 500e6 USDG and 80 ETH. Keeper calls feed(0). Expected: the 500 USDG is pooled (records.claimable(1) >= 500e6) and ETH the band cannot absorb waits. Actual: the swap takes all 80 ETH for 166,768.142177 USDG (average 2084.6 USDG/ETH) and feed reverts BelowFloor(80000000000000000000, 166768142177, 2250000000); the USDG stays in the feeder and claimable(1) == 0. Same state with 1 ETH succeeds (sanity test in the proof). Partial-fill variant (specialist proof, also run): pool at tick -196280 with one LP position 1e13 over [-202100,-196200], floor = price*3/4 = 2244684774, feeder holding 0.5 ETH + 10e6 USDG: feed(0) reverts BelowFloor(61767388046618528, 138121966, 2244684774) and claimable(1) == 0. Proof: test/scratch/P886.t.sol, test_usdgHeldIsPooledEvenWhenTheEthCannotBeSwappedInsideTheBand fails on this code with 'feed reverted: the ETH balance blocked the whole feed'.

**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 {PoolManager} from "v4-core/src/PoolManager.sol";
import {IPoolManager} from "v4-core/src/interfaces/IPoolManager.sol";
import {IUnlockCallback} from "v4-core/src/interfaces/callback/IUnlockCallback.sol";
import {IHooks} from "v4-core/src/interfaces/IHooks.sol";
import {PoolKey} from "v4-core/src/types/PoolKey.sol";
import {Currency} from "v4-core/src/types/Currency.sol";
import {ModifyLiquidityParams} from "v4-core/src/types/PoolOperation.sol";
import {TickMath} from "v4-core/src/libraries/TickMath.sol";
import {TransientStateLibrary} from "v4-core/src/libraries/TransientStateLibrary.sol";
import {IDMRecords, IERC20Like, IBalanceOf} from "src/IDMRecords.sol";
import {RewardFeeder, IRecordsPot} from "src/RewardFeeder.sol";

/// @dev 6-decimal stand-in for USDG.
contract MockUSD {
    mapping(address => uint256) public balanceOf;
    mapping(address => mapping(address => uint256)) public allowance;

    function mint(address to, uint256 a) external {
        balanceOf[to] += a;
    }

    function approve(address s, uint256 a) external returns (bool) {
        allowance[msg.sender][s] = a;
        return true;
    }

    function transfer(address to, uint256 a) external returns (bool) {
        balanceOf[msg.sender] -= a;
        balanceOf[to] += a;
        return true;
    }

    function transferFrom(address f, address to, uint256 a) external returns (bool) {
        allowance[f][msg.sender] -= a;
        balanceOf[f] -= a;
        balanceOf[to] += a;
        return true;
    }
}

/// @dev Minimal liquidity provider for the local pool: pays ETH from its own balance and the token from the test.
contract LpRouter is IUnlockCallback {
    using TransientStateLibrary for IPoolManager;

    IPoolManager immutable pm;
    MockUSD immutable usd;

    constructor(IPoolManager pm_, MockUSD usd_) {
        pm = pm_;
        usd = usd_;
    }

    receive() external payable {}

    function addLiquidity(PoolKey memory key, int24 lower, int24 upper, int256 amount) external {
        pm.unlock(abi.encode(key, lower, upper, amount));
    }

    function unlockCallback(bytes calldata data) external returns (bytes memory) {
        (PoolKey memory key, int24 lower, int24 upper, int256 amount) =
            abi.decode(data, (PoolKey, int24, int24, int256));
        pm.modifyLiquidity(key, ModifyLiquidityParams(lower, upper, amount, bytes32(0)), "");
        int256 d0 = pm.currencyDelta(address(this), key.currency0);
        int256 d1 = pm.currencyDelta(address(this), key.currency1);
        pm.settle{value: uint256(-d0)}();
        pm.sync(key.currency1);
        usd.transfer(address(pm), uint256(-d1));
        pm.settle();
        return "";
    }
}

/// Finding: RewardFeeder.feed swaps the WHOLE ETH balance or nothing. When the balance is more than the pool absorbs
/// inside the owner's band, the floor check reverts the whole call, and with it the pooling of USDG that needs no swap
/// (the Stations splitter's quarter). The USDG stays in the feeder until the owner lowers the floor to the bad price.
/// Expected: a feed never leaves USDG unpooled because of the ETH held; ETH the band cannot absorb waits instead.
contract FeedAllOrNothingTest is Test {
    uint256 constant SIGNER_KEY = 0xA11CE;
    address owner = makeAddr("owner");
    address keeper = makeAddr("keeper");
    address infra = makeAddr("infra");
    address alice = makeAddr("alice");

    PoolManager pm;
    MockUSD usd;
    IDMRecords nft;
    RewardFeeder feeder;
    PoolKey key;
    /// @dev 3000 USDG per ETH: tick of 3000e6 / 1e18.
    int24 constant START_TICK = -196260;

    function setUp() public {
        pm = new PoolManager(address(this));
        usd = new MockUSD();
        key = PoolKey(Currency.wrap(address(0)), Currency.wrap(address(usd)), 500, 10, IHooks(address(0)));
        pm.initialize(key, TickMath.getSqrtPriceAtTick(START_TICK));

        // Liquidity in a +-10000 tick range (about -63% / +170%): roughly 72 ETH and 215k USDG.
        LpRouter lp = new LpRouter(pm, usd);
        vm.deal(address(lp), 200 ether);
        usd.mint(address(lp), 1_000_000e6);
        lp.addLiquidity(key, START_TICK - 10000, START_TICK + 10000, 1e16);

        nft = new IDMRecords(
            "IDM Records", "RECORDS", address(this), vm.addr(SIGNER_KEY), IERC20Like(address(usd)),
            IBalanceOf(address(usd)), "https://x/", address(0), 0
        );
        nft.setMintableUpTo(1000);
        _mint(alice, 1);

        uint256 price = 3000e6;
        feeder = new RewardFeeder(pm, IRecordsPot(address(nft)), owner, keeper, infra, 500, 10, price * 3 / 4);
    }

    function _mint(address to, uint256 id) internal {
        IDMRecords.Voucher memory v =
            IDMRecords.Voucher(to, id, keccak256(abi.encode(id)), 1, 1, uint64(block.timestamp + 1 hours), 0);
        (uint8 vv, bytes32 r, bytes32 s) = vm.sign(SIGNER_KEY, nft.voucherDigest(v));
        vm.prank(to);
        nft.mint(v, abi.encodePacked(r, s, vv));
    }

    /// The Stations splitter paid 500 USDG to the feeder; royalties left 80 ETH there (more than the pool takes
    /// inside the 25% band: the average price of swapping it all is about 2086 USDG/ETH against a 2250 floor).
    function test_usdgHeldIsPooledEvenWhenTheEthCannotBeSwappedInsideTheBand() public {
        usd.mint(address(feeder), 500e6);
        vm.deal(address(feeder), 80 ether);

        vm.prank(keeper);
        (bool ok,) = address(feeder).call(abi.encodeCall(RewardFeeder.feed, (0)));

        // Expected: the feed goes through (ETH the band cannot absorb may wait) and the USDG is in the pot.
        assertTrue(ok, "feed reverted: the ETH balance blocked the whole feed");
        assertEq(usd.balanceOf(address(feeder)), 0, "USDG the pot could take is still in the feeder");
        assertGe(nft.claimable(1), 500e6, "holder got none of the USDG held");
    }

    /// Sanity: the same USDG is pooled fine when the ETH balance is small enough for the band.
    function test_sanity_smallEthFeedsAndPools() public {
        usd.mint(address(feeder), 500e6);
        vm.deal(address(feeder), 1 ether);
        vm.prank(keeper);
        (uint256 out, uint256 pooled) = feeder.feed(0);
        assertGt(out, 2250e6);
        assertEq(pooled, out + 500e6);
        assertEq(nft.claimable(1), pooled);
    }
}
```

### 2. Low: TreasuryFeeder.swap swaps the whole USDG balance in the same call that forwards the ETH held, so USDG that cannot clear the ceiling holds back ETH from PulseTreasury

`src/TreasuryFeeder.sol:85`

```
if (usdgIn * 1e18 > ethOut * maxUsdgPerEth) revert AboveCeiling(usdgIn, ethOut, maxUsdgPerEth);
```

Mirror of the RewardFeeder finding. swap() swaps the ENTIRE USDG balance (line 77, `_swap(false, usdgIn)` at line 81), checks the average price of the whole swap against the owner's ceiling (line 85) and only then forwards every wei held to PulseTreasury (lines 87-91). When the USDG held cannot clear the ceiling (market more than the band over the static ceiling, thin ETH-side liquidity giving a partial fill at a bad average, or an oversized balance from a large Stations release or anyone's USDG transfer), the whole call reverts AboveCeiling and the ETH already in the feeder (from the Stations splitter's release(), or anyone's transfer) does not reach the treasury until the owner raises the ceiling to the bad price. MIN_SWAP_IN (line 79) covers only the dust edge. Impact is on the label's own buy-and-burn flow, not holders' money, hence low. Merged from three specialist reports (whole-balance swap, partial fill, market over ceiling). Fix: forward the ETH held independently of the swap (forward first, or skip the swap when it would fail), and let the keeper bound the USDG swapped per call.

**Reproduction**

Local v4 pool as in the RewardFeeder reproduction (3000 USDG/ETH, liquidity 1e16 over +-10000 ticks), TreasuryFeeder ceiling 3750e6 (25% band), treasury = a contract that accepts ETH. State: feeder holds 1 ETH and 300,000e6 USDG. Keeper calls swap(0). Expected: the 1 ETH reaches the treasury; USDG the band cannot absorb waits. Actual: the whole 300k USDG swaps at an average above 3750 USDG/ETH and the call reverts AboveCeiling; the 1 ETH stays in the feeder, treasury balance 0. Same state with 3,000e6 USDG succeeds (sanity test in the proof). Partial-fill variant (specialist test, also run): LP liquidity 1e13 over [-196300,-190300], ceiling = price*5/4 = 3741141290, feeder holding 1500e6 USDG + 1 ETH: swap(0) reverts AboveCeiling(190745328, 47238385595012343, 3741141290), tfeeder.balance == 1 ether, treasury.balance == 0. Proof: test/scratch/Pae5.t.sol, test_ethHeldReachesTheTreasuryEvenWhenTheUsdgCannotBeSwappedInsideTheBand fails on this code.

**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 {PoolManager} from "v4-core/src/PoolManager.sol";
import {IPoolManager} from "v4-core/src/interfaces/IPoolManager.sol";
import {IUnlockCallback} from "v4-core/src/interfaces/callback/IUnlockCallback.sol";
import {IHooks} from "v4-core/src/interfaces/IHooks.sol";
import {PoolKey} from "v4-core/src/types/PoolKey.sol";
import {Currency} from "v4-core/src/types/Currency.sol";
import {ModifyLiquidityParams} from "v4-core/src/types/PoolOperation.sol";
import {TickMath} from "v4-core/src/libraries/TickMath.sol";
import {TransientStateLibrary} from "v4-core/src/libraries/TransientStateLibrary.sol";
import {TreasuryFeeder} from "src/TreasuryFeeder.sol";

/// @dev 6-decimal stand-in for USDG.
contract MockUSD {
    mapping(address => uint256) public balanceOf;
    mapping(address => mapping(address => uint256)) public allowance;

    function mint(address to, uint256 a) external {
        balanceOf[to] += a;
    }

    function approve(address s, uint256 a) external returns (bool) {
        allowance[msg.sender][s] = a;
        return true;
    }

    function transfer(address to, uint256 a) external returns (bool) {
        balanceOf[msg.sender] -= a;
        balanceOf[to] += a;
        return true;
    }

    function transferFrom(address f, address to, uint256 a) external returns (bool) {
        allowance[f][msg.sender] -= a;
        balanceOf[f] -= a;
        balanceOf[to] += a;
        return true;
    }
}

contract LpRouter is IUnlockCallback {
    using TransientStateLibrary for IPoolManager;

    IPoolManager immutable pm;
    MockUSD immutable usd;

    constructor(IPoolManager pm_, MockUSD usd_) {
        pm = pm_;
        usd = usd_;
    }

    receive() external payable {}

    function addLiquidity(PoolKey memory key, int24 lower, int24 upper, int256 amount) external {
        pm.unlock(abi.encode(key, lower, upper, amount));
    }

    function unlockCallback(bytes calldata data) external returns (bytes memory) {
        (PoolKey memory key, int24 lower, int24 upper, int256 amount) =
            abi.decode(data, (PoolKey, int24, int24, int256));
        pm.modifyLiquidity(key, ModifyLiquidityParams(lower, upper, amount, bytes32(0)), "");
        int256 d0 = pm.currencyDelta(address(this), key.currency0);
        int256 d1 = pm.currencyDelta(address(this), key.currency1);
        pm.settle{value: uint256(-d0)}();
        pm.sync(key.currency1);
        usd.transfer(address(pm), uint256(-d1));
        pm.settle();
        return "";
    }
}

/// @dev PulseTreasury stand-in: takes ETH.
contract TreasurySink {
    receive() external payable {}
}

/// Finding: TreasuryFeeder.swap swaps the WHOLE USDG balance or nothing. A USDG balance the pool cannot absorb inside
/// the owner's ceiling reverts the whole call, and with it the forwarding of the ETH held (ETH the Stations splitter
/// released, or ETH left by an earlier swap). Expected: the ETH held reaches the treasury; USDG the band cannot absorb waits.
contract TreasuryAllOrNothingTest is Test {
    address owner = makeAddr("owner");
    address keeper = makeAddr("keeper");
    address infra = makeAddr("infra");

    PoolManager pm;
    MockUSD usd;
    TreasurySink treasury;
    TreasuryFeeder feeder;
    PoolKey key;
    int24 constant START_TICK = -196260; // 3000 USDG per ETH

    function setUp() public {
        pm = new PoolManager(address(this));
        usd = new MockUSD();
        treasury = new TreasurySink();
        key = PoolKey(Currency.wrap(address(0)), Currency.wrap(address(usd)), 500, 10, IHooks(address(0)));
        pm.initialize(key, TickMath.getSqrtPriceAtTick(START_TICK));
        LpRouter lp = new LpRouter(pm, usd);
        vm.deal(address(lp), 200 ether);
        usd.mint(address(lp), 1_000_000e6);
        lp.addLiquidity(key, START_TICK - 10000, START_TICK + 10000, 1e16);

        uint256 price = 3000e6;
        feeder = new TreasuryFeeder(pm, address(usd), address(treasury), owner, keeper, infra, 500, 10, price * 5 / 4);
    }

    /// 1 ETH waits in the feeder; 300k USDG arrived (more than the pool takes inside the 25% ceiling).
    function test_ethHeldReachesTheTreasuryEvenWhenTheUsdgCannotBeSwappedInsideTheBand() public {
        vm.deal(address(feeder), 1 ether);
        usd.mint(address(feeder), 300_000e6);

        vm.prank(keeper);
        (bool ok,) = address(feeder).call(abi.encodeCall(TreasuryFeeder.swap, (0)));

        assertTrue(ok, "swap reverted: the USDG balance blocked the whole call");
        assertEq(address(feeder).balance, 0, "ETH the treasury could take is still in the feeder");
        assertGe(address(treasury).balance, 1 ether, "treasury got none of the ETH held");
    }

    function test_sanity_smallUsdgSwapsAndSends() public {
        vm.deal(address(feeder), 1 ether);
        usd.mint(address(feeder), 3000e6);
        vm.prank(keeper);
        (uint256 usdgIn, uint256 ethOut, uint256 sent) = feeder.swap(0);
        assertEq(usdgIn, 3000e6);
        assertGt(ethOut, 0.8 ether);
        assertEq(sent, ethOut + 1 ether);
        assertEq(address(treasury).balance, sent);
    }
}
```

### 3. Low: HolderRewards.claim: OverTotal is a hard revert, so a root that lowers one token's cumulative under what it already claimed locks the other leaves' USDC until the keeper repairs the root

`src/HolderRewards.sol:202`

```
if (paid > r.total) revert OverTotal();
```

The solvency check compares totalClaimed (everything paid under every earlier root) with the new root's total (the sum of the new root's cumulatives). The two are only consistent while every token's cumulative stays >= claimed[tokenId]. proposeRoot cannot check that (it sees only the root hash), and a root that lowers a token under its claimed amount makes the sum of (cumulative - claimed) over the claimable leaves exceed total - totalClaimed, so the last claimants hit OverTotal and are paid nothing while the USDC sits in the contract (received() >= total). The existing test test_Poc_PerTokenDecreaseCannotOverdraw shows exactly this state and treats the revert as the desired 'never overdraw' outcome; on the holder side it is a lock. Neither the owner nor the guardian can help once the root is current (revokePending only acts on a pending root), so a buggy or leaked keeper key stalls every honest holder's claim for one rootDelay plus one more epoch. Requires a keeper-built root that violates the cumulative rule; no USDC is lost; the keeper can repair it, hence low. Fix options: (a) in claim(), pay min(amount, r.total - totalClaimed) and set claimed[tokenId] = done + paidNow so holders get what the pot covers and the rest stays owed; or (b) document in proposeRoot that the keeper must read claimed[tokenId] for every token and never lower a leaf under it, and have the published epoch file (dataHash) include those reads so the guardian can check them during the delay.

**Reproduction**

State (test/scratch/Judge.t.sol test_overTotalLocksTheOtherLeaf, and the repo's test_Poc_PerTokenDecreaseCannotOverdraw): usdc.mint(rewards, 100); root 1 = {alice token1 60, bob token2 40}, total 100; after the delay alice claims 60 (totalClaimed 60); root 2 = {alice token1 20, bob token2 80}, total 100 (accepted: total >= 100 and <= received() == 100); after the delay bob calls claim(2, bob, true, 80, [leafA2]). Expected: bob is paid at least the 40 USDC the contract holds. Actual: revert OverTotal(); totalClaimed stays 60; usdc.balanceOf(rewards) == 40; guardian.revokePending() reverts NoPendingRoot. Nobody can take the 40 until the keeper posts root 3 with alice >= 60 and bob 40, or 40 more USDC arrive and total is raised to 140.

### 4. Low: HolderRewards.claim pushes USDC into a contract account whenever the keeper's leaf says pushable; no on-chain counterpart of the IDMRecords 'holder with code claims only itself' fix

`src/HolderRewards.sol:195`

```
if (!pushable && msg.sender != account) revert NotAccount();
```

Swarm fix 4 made IDMRecords.claim refuse to push USDG into a holder with code (an escrow, a vault, a marketplace), because such a contract may be unable to move the tokens. HolderRewards has no such guard: whether a leaf may be pushed by a third party is decided only by the keeper's off-chain `pushable` flag, and claim() never checks account.code.length. The flag is computed from Robinhood code status, but the payment lands on Base, where the same address may be a different thing (a contract deployed later at that address, an escrow or wrapper whose address held no code when the root was built, or an off-chain code check that is wrong). A keeper mistake or a leaked keeper key then lets anyone push a token's whole cumulative USDC into a contract that cannot spend it; claimed[tokenId] is advanced, so the holder has nothing left on the token. Low: it needs a wrong leaf, and a leaked keeper key can already misdirect money (README trust model), but a one-line on-chain check prevents the stranding case in the same spirit as fix 4. Trade-off to decide: the check also stops pushes to EIP-7702 wallets on Base (they can still claim for themselves, as in IDMRecords). Fix: `if (msg.sender != account && (!pushable || account.code.length != 0)) revert NotAccount();` so a contract account is only paid when it asks itself.

**Reproduction**

State: HolderRewards holds 100e6 USDC; keeper proposes root = leaf(1, escrow, pushable=true, 100e6), total 100e6, where escrow is a contract with no USDC-moving code; warp rootDelay. Input: any address calls claim(1, escrow, true, 100e6, []). Expected (per the IDMRecords rule 'rewards are never pushed to a contract that did not ask'): revert NotAccount, USDC stays on the token. Actual: the call succeeds, usdc.balanceOf(escrow) == 100e6, claimed[1] == 100e6; the USDC is stranded. Proof: test/scratch/P53.t.sol, test_strangerCannotPushUsdcIntoAContractAccount fails on this code with 'next call did not revert as expected'.

**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 {HolderRewards, IERC20Rewards} from "src/HolderRewards.sol";

contract Usdc {
    mapping(address => uint256) public balanceOf;

    function mint(address to, uint256 a) external {
        balanceOf[to] += a;
    }

    function transfer(address to, uint256 a) external returns (bool) {
        balanceOf[msg.sender] -= a;
        balanceOf[to] += a;
        return true;
    }
}

/// A contract that holds a record on Robinhood (an escrow) and has no way to move USDC on Base.
contract Escrow {}

/// Fails on the current code: a leaf the keeper marked pushable lets a stranger push USDC into a contract account.
/// Passes once `claim` refuses a pushed claim (msg.sender != account) for an account with code, as IDMRecords.claim does.
contract PushableIntoContractTest is Test {
    function test_strangerCannotPushUsdcIntoAContractAccount() public {
        Usdc usdc = new Usdc();
        address owner = makeAddr("owner");
        address keeper = makeAddr("keeper");
        address infra = makeAddr("infra");
        HolderRewards hr = new HolderRewards(IERC20Rewards(address(usdc)), owner, keeper, address(0), 1 hours, infra);
        usdc.mint(address(hr), 100e6);
        address escrow = address(new Escrow());
        bytes32 leaf = hr.leaf(1, escrow, true, 100e6);
        vm.prank(keeper);
        hr.proposeRoot(1, leaf, 100e6, bytes32(0));
        vm.warp(block.timestamp + 1 hours);
        bytes32[] memory proof;
        vm.prank(makeAddr("stranger"));
        vm.expectRevert();
        hr.claim(1, escrow, true, 100e6, proof);
        assertEq(usdc.balanceOf(escrow), 0, "USDC was pushed into a contract that cannot move it");
    }
}
```

### 5. Low: The feeders' price band is an absolute USDG/ETH number with no in-contract bound, so the README's 'at most the band's gap' limit on a leaked keeper key holds only at the moment the owner last set it

`src/RewardFeeder.sol:77`

```
if (f == 0) revert ZeroFloor();
```

README trust model: 'a leaked keeper key can lose at most the band's gap on what the feeder holds'. The band is not relative to the market. DeployRecords and DeployStationsSplit compute the floor and ceiling once from the pool's spot price at deploy (FEED_BAND_BPS = 2500 in script/LabelDeployBase.s.sol:45, `_feedFloor` / `_feedCeiling`), store them as absolute numbers, and only the owner moves them (setFloor / setCeiling), with no delay and no bound other than non-zero (RewardFeeder.sol:77, TreasuryFeeder.sol:67); verify()'s 0-50% check runs only when the owner runs it. Two consequences. (1) Staleness: as ETH rises the gap a leaked keeper can take on RewardFeeder grows without limit (and on TreasuryFeeder as ETH falls), while in the other direction every feed stops; the keeper's own minOut is the only protection left and a leaked key sets it to 0. (2) Owner mis-set: setFloor(1) is accepted and from then on any non-zero output passes the floor, restoring the full sandwich exposure of the 2026-11-13 PoC; and since the dust threshold scales with the floor (line 90), a very low floor also classifies large ETH balances as dust and leaves them unswapped (floor 1e6 => anything under 0.01 ETH waits). Merged from two specialist reports (staleness, unbounded setter). Both are owner trust assumptions rather than bypasses, reported so the README states the maintenance assumption with the bound and the operator monitors the band against the pool price. Mitigation inside the design: express the band in bps of the pool's pre-swap spot (StateLibrary.getSlot0) and require the swap's average price within it, keeping the absolute floor as a second bound (the keeper's own sandwich moves the spot), and/or bound setFloor/setCeiling changes (within a factor of the old value, or behind a delay).

**Reproduction**

(1) Arithmetic on the deploy's band: RewardFeeder deployed at 1934.7 USDG/ETH (Robinhood pool at block 26407708) gets minUsdgPerEth = 1451.0e6 and the owner does not touch it. If ETH trades at 3000 USDG, a leaked keeper that pushes the pool down with its own capital and calls feed(0) clears the floor at 1451, so holders lose up to (3000-1451)/3000 = 51.6% of the ETH held, not 25%; for TreasuryFeeder with maxUsdgPerEth = 2418e6 at a 1500 market the keeper may pay 61% over market. If ETH trades at 1400, every feed with non-dust ETH reverts BelowFloor (and, per the RewardFeeder finding, no USDG is pooled) until the owner lowers the floor. (2) test/scratch/Judge.t.sol test_backlogAndFloor: RewardFeeder with minUsdgPerEth 3000e6; owner calls setFloor(1). Expected under 'the band bounds what a leaked keeper can lose': rejected or delayed. Actual: accepted, minUsdgPerEth() == 1, so feed(0) then accepts any output above zero.

### 6. Info: RewardFeeder: money collected before or between mints is pooled at the keeper's chosen moment, so feed timing decides which holders receive it

`src/RewardFeeder.sol:101`

```
if (pooled > 0 && records.totalSupply() > 0) {
```

IDMRecords.depositPool shares a deposit among the tokens minted at that moment and later mints get none (documented design). RewardFeeder holds royalties and Stations fees until the keeper calls feed(); nothing forces a feed before a drop opens or at a particular point in a drop, and everything held is pooled together. So the keeper's timing, not the money's arrival time, decides who is paid: everything collected before the first mint, and everything collected while a drop is being minted, goes entirely to the tokens that exist when feed() lands; with one token minted the first minter gets 100% of the backlog. The README trust model for the keeper ('calls feed / swap only ... at most the band's gap') does not state this allocation power, which a keeper, a leaked keeper key or the label itself can use to direct the whole pre-drop pot to a chosen small set of holders. Not a theft from the contract. Options: document it as a keeper power and have the bot feed before each drop opens and only once all open ids of a drop are minted; or snapshot per-deposit weights in the pot (a larger change).

**Reproduction**

test/scratch/Judge.t.sol test_backlogAndFloor: IDMRecords with totalSupply 0 and mintableUpTo 100; 10_000e6 USDG in RewardFeeder (arrived before the drop). Alice mints id 1; the keeper calls feed(0) (no ETH held, so only the USDG is pooled); Bob mints id 2. Expected by a holder reading 'royalties -> holders': the pre-drop money is shared by the drop's holders. Actual: records.claimable(1) == 10_000e6, records.claimable(2) == 0.

### 7. Info: HolderRewards: nothing stops a root once it has matured, and the deploy's default guardian is zero, so one missed rootDelay window lets a leaked keeper key take the whole pot

`src/HolderRewards.sol:170`

```
if (_pending.root == bytes32(0)) revert NoPendingRoot();
```

Trust assumption documented in the README, stated with its concrete failing state so the launch policy can weigh it. revokePending and setKeeper only act on a pending root (both call _activate() first, which promotes a matured pending root to current). There is no pause, no withdrawal and no way to retire the current root except a new root that itself waits rootDelay. After a malicious root matures the attacker claims every leaf up to total, which it set to received() (the whole pot). DeployLabel sets REWARDS_GUARDIAN to zero by default (script/DeployLabel.s.sol:82) and REWARDS_OWNER to the deployer, so the only defence is a human noticing RootProposed within 12 h. Recommendation (policy): require a guardian in checkInputs or warn loudly when it is zero, and run a watcher that revokes any root whose dataHash does not match a published epoch file. Code option if the design allows: an owner-only retireCurrentRoot() that zeroes _current so claims stop until the next honest root matures.

**Reproduction**

test/scratch/Judge.t.sol test_noStopAfterActivation: HolderRewards(rootDelay 12 h, guardian set) holding 50_000e6 USDC. The keeper key calls proposeRoot(1, leaf(1, attacker, true, 50_000e6), 50_000e6, 0). Nobody revokes for 12 h. Then guardian.revokePending() reverts NoPendingRoot (the root is current); owner.setKeeper(new) succeeds but activates the matured root instead of dropping it; attacker.claim(1, attacker, true, 50_000e6, []) pays 50_000e6 and the contract balance is 0.

### 8. Info: Royalty splitter: an ERC-20 royalty (USDG) sends PulseTreasury's buy-and-burn quarter to the infra wallet, so infra receives 50% of token royalties

`script/DeployRecords.s.sol:230`

```
return Split({holders: feeder, burn: TREASURY, infra: infra, burnEthOnly: true, weth: RH_WETH, tokenSink: infra});
```

Money-flow note, not a code defect: the splitter behaves as its comments say. royaltySplit marks PulseTreasury ethOnly with tokenSink = infra, so RevenueSplitter.releaseToken() (src/RevenueSplitter.sol:117, `address to = _ethOnly[i] ? tokenSink : _accounts[i];`) pays the treasury's quarter of any ERC-20 royalty to infra and nothing is burned. The README money flow states '25% $IDM treasury' without this qualification; marketplaces pay royalties in the sale currency, and USDG is the natural one on Robinhood. The same deploy creates a TreasuryFeeder (USDG -> ETH -> PulseTreasury) for the Stations split, so the royalty splitter could name a TreasuryFeeder as the token sink or token payee and keep the 25% burn for token royalties (deploy order would need the feeder before the splitter, or a second splitter). Merged from two specialist reports. Reported so the owner signs the behaviour off knowingly or routes the quarter.

**Reproduction**

test/scratch/Judge.t.sol test_tokenRoyaltyTreasuryQuarterGoesToInfra: RevenueSplitter as deployed by royaltySplit (payees [RewardFeeder 5000, PulseTreasury 2500 ethOnly, infra 2500], tokenSink infra); 1000e6 USDG arrives; anyone calls releaseToken(USDG). Expected per the README money flow: 500 feeder / 250 treasury / 250 infra. Actual: feeder 500e6, treasury 0, infra 500e6.

### 9. Info: HolderRewards.claimMany is all-or-nothing: one leaf whose account USDC rejects reverts the whole pushed batch

`src/HolderRewards.sol:212`

```
total += claim(c.tokenId, c.account, c.pushable, c.cumulative, c.proof);
```

claim() reverts TransferFailed when usdc.transfer(account, amount) fails (Base USDC reverts for a blacklisted recipient or when paused). claimMany loops over claim() with no try/catch, so the rewards bot's pushed batch fails entirely if any one account is blacklisted, and keeps failing for every batch that includes it until the keeper filters it out off-chain. IDMRecords.claim deliberately takes the other design (ClaimFailed event, the batch goes on). No funds are lost; a liveness and operations gap and a behaviour mismatch between the two claim paths. Fix: in claimMany, skip and emit a leaf whose transfer fails instead of reverting, or document that the bot must exclude blacklisted accounts.

**Reproduction**

test/scratch/Judge.t.sol test_claimManyOneRejectedAccountRevertsTheBatch: current root with two pushable leaves (tokenId 1, A, 100e6) and (tokenId 2, B, 100e6), total 200e6, 200e6 USDC held, mock USDC whose transfer reverts for A. Input: claimMany([leaf1, leaf2]) from any caller. Actual: the whole call reverts TransferFailed at leaf1 and claimed(2) == 0; a single claim for B then pays 100e6. Expected (as IDMRecords.claim does): B is paid in the batch and leaf1 is reported as failed.

### 10. Info: HolderRewards pays the account of the last activated root: a seller can still claim after a sale until the next root matures, which the accepted risks do not state

`src/HolderRewards.sol:197`

```
if (!_verify(proof, r.root, leaf(tokenId, account, pushable, cumulative))) revert BadProof();
```

Leaves name (tokenId, account, cumulative) from Robinhood ownership when the keeper built the root, and a root pays from validFrom = proposal + rootDelay (12 h by default). Between a record's sale on Robinhood and the activation of a root built after it, the previous holder is still the leaf's account and may claim everything accrued to that token, including the per-track sale credits the buyer paid for. The README lists only 'a seller can claim before a sale' (the IDMRecords pot, where rewards follow the NFT atomically); on Base the window extends past the sale by the keeper's cadence plus rootDelay. Inherent to off-chain roots, not a contract bug; reported so the trust model and buyer-facing docs state it.

**Reproduction**

test/scratch/Judge.t.sol test_sellerClaimsAfterSaleUntilNextRootMatures: root 1 names seller S for tokenId 7 with cumulative 50e6 and is active; S sells token 7 to B on Robinhood; the keeper proposes root 2 naming B for tokenId 7 (pending 12 h). Before root 2 matures, claim(7, S, true, 50e6, proof1) pays S 50e6 (claimed[7] = 50e6); after root 2 matures, claim(7, B, true, 50e6, proof2) returns 0. Expected per the stated model 'what is not claimed moves with the NFT': the unclaimed 50e6 reaches B.

---

Judge's submission `3e73efbb608f10f4eb7d4139bb21ae213ab5996d8d2cab52e757e3eb4f26f3fe`, 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.
