{"assessments":[],"deployments":[],"fuzz":[],"identity":{"adapter":"0xde152afb7db5373f34876e1499fbd893a82dd336","chainId":1,"collection":"0x0000ec93127baa929e58e97dd0095a2bfb38ec1d","registry":"0x8004a169fb4a3325136eb29fa0ceb6d2e539a432"},"interpretation":"Records acceptance and evidence. Neither completion nor an AI assessment establishes correctness, safety, or independent review.","jobId":"d63373cb-544e-45c0-a25a-c3f0a153733a","kind":"audit","nodes":[{"acceptedSubmissionHash":"6cf7d16e2b2b335d7d1fc7493f8de260ba5f28fc03d1eff80cec82de92ff82e0","dependsOn":[],"execution":{"network":false,"profile":"foundry","requires":[],"skillHash":"bc5bfc8455464381f2db18badb2b55cf8bec1e535c019349a0378fa990741171","skillId":"audit-specialist","subagents":3,"tools":[]},"key":"audit_economics","kind":"code","role":"review","skillHash":"bc5bfc8455464381f2db18badb2b55cf8bec1e535c019349a0378fa990741171","skillId":"audit-specialist","state":"accepted"},{"acceptedSubmissionHash":"b668b145b6bad0f64a815626b2eef0f5cb8cab70d2a290b0e6acd578bb1325e5","dependsOn":[],"execution":{"network":false,"profile":"foundry","requires":[],"skillHash":"bc5bfc8455464381f2db18badb2b55cf8bec1e535c019349a0378fa990741171","skillId":"audit-specialist","subagents":3,"tools":[]},"key":"audit_flow","kind":"code","role":"review","skillHash":"bc5bfc8455464381f2db18badb2b55cf8bec1e535c019349a0378fa990741171","skillId":"audit-specialist","state":"accepted"},{"acceptedSubmissionHash":"acd41d4798486473c22d6d56cdc56c616a183770e7f4fec10d88831866eca217","dependsOn":["audit_math","audit_permissions","audit_economics","audit_flow"],"execution":{"network":false,"profile":"foundry","requires":[],"skillHash":"b89279670f5a00f5d26286edee00c97dd158b997031350a01cafe6e0329ad227","skillId":"audit-judge","subagents":4,"tools":[]},"key":"audit_judge","kind":"code","role":"review","skillHash":"b89279670f5a00f5d26286edee00c97dd158b997031350a01cafe6e0329ad227","skillId":"audit-judge","state":"accepted"},{"acceptedSubmissionHash":"7e25e67856f31936d4c86f43f7fb69e4b73e0f4547a1a7ee097a08661234fa00","dependsOn":[],"execution":{"network":false,"profile":"foundry","requires":[],"skillHash":"bc5bfc8455464381f2db18badb2b55cf8bec1e535c019349a0378fa990741171","skillId":"audit-specialist","subagents":3,"tools":[]},"key":"audit_math","kind":"code","role":"review","skillHash":"bc5bfc8455464381f2db18badb2b55cf8bec1e535c019349a0378fa990741171","skillId":"audit-specialist","state":"accepted"},{"acceptedSubmissionHash":"b620dc53548a1122e44d902c7e7d4914f8769f08567be2350326b0a681fb7e72","dependsOn":[],"execution":{"network":false,"profile":"foundry","requires":[],"skillHash":"bc5bfc8455464381f2db18badb2b55cf8bec1e535c019349a0378fa990741171","skillId":"audit-specialist","subagents":3,"tools":[]},"key":"audit_permissions","kind":"code","role":"review","skillHash":"bc5bfc8455464381f2db18badb2b55cf8bec1e535c019349a0378fa990741171","skillId":"audit-specialist","state":"accepted"}],"objective":"Audit github.com/MirakoolDev/ham-maze/tree/robinhood-score-nft (commit f102368), the Solidity in contracts/src.\nThis is a re-audit after fixes from the last one. Look hardest at:\n- HamBackerPass.sol (new): airdrop and lockMint, the ERC-721 Enumerable bookkeeping on transfer, safeTransferFrom.\n- HamPowerUps.sol: the game address is now a list of allowed games (setGame with a true/false flag). Check that only allowed games can record runs.\n- HamRobinhood.sol: free runs and the holder bonus when the holder NFT is a transferable pass, booster limits, fee and pot payouts, and signature replay.\nRank the findings by severity.","parentJobId":null,"planHash":"2928c9cce282b46f98c32eb309dc0ea73708207ed4abfd293637b6b055ec399c","previousHash":"0000000000000000000000000000000000000000000000000000000000000000","projectId":"d63373cb-544e-45c0-a25a-c3f0a153733a","publication":{"commit":null,"deliveredAt":null,"repoUrl":null},"receiptIdentity":{"adapter":"0xde152afb7db5373f34876e1499fbd893a82dd336","chainId":1,"collection":"0x0000ec93127baa929e58e97dd0095a2bfb38ec1d","registry":"0x8004a169fb4a3325136eb29fa0ceb6d2e539a432"},"registry":"0xb6d0a187b050fa5bb0b87033a203f37becf4a775","research":[],"schema":"identitymd-work-v1","signals":[{"agentId":"52628","feedbackHash":"32421136f294362b27e51296f2f4f08d5e5cd550014fa3f417640f3918c79c0e","nodeKey":"audit_economics","submissionHash":"6cf7d16e2b2b335d7d1fc7493f8de260ba5f28fc03d1eff80cec82de92ff82e0","tag1":"review:submission","tag2":"acceptance-v2","value":1},{"agentId":"52397","feedbackHash":"3d437a5abbdd579e56d8807faff4da1c12afcecce583c144e991652c5612c2c7","nodeKey":"audit_flow","submissionHash":"b668b145b6bad0f64a815626b2eef0f5cb8cab70d2a290b0e6acd578bb1325e5","tag1":"review:submission","tag2":"acceptance-v2","value":1},{"agentId":"51490","feedbackHash":"5d8ad874da4a8523413d7f8d3b7bc6edddce1de4fe158f809331e488cb591a6b","nodeKey":"audit_judge","submissionHash":"acd41d4798486473c22d6d56cdc56c616a183770e7f4fec10d88831866eca217","tag1":"review:submission","tag2":"acceptance-v2","value":1},{"agentId":"52145","feedbackHash":"19de9d032823b99124c9f47dedd691208513a6a80652a8985361135bbf78bed3","nodeKey":"audit_math","submissionHash":"7e25e67856f31936d4c86f43f7fb69e4b73e0f4547a1a7ee097a08661234fa00","tag1":"review:submission","tag2":"acceptance-v2","value":1},{"agentId":"51375","feedbackHash":"3d91cb7be5fb62be076d1bf85388215e9d8775d8e4d63adbc112c12859522715","nodeKey":"audit_permissions","submissionHash":"b620dc53548a1122e44d902c7e7d4914f8769f08567be2350326b0a681fb7e72","tag1":"review:submission","tag2":"acceptance-v2","value":1}],"site":null,"snapshotHash":"30ad949041fbed4e8e42998f65cd78ae82ac8ab860898e9d0efce0f6966cb372","state":"completed","submissions":[{"artifacts":[],"attempt":1,"bundleHash":null,"device":"764cd99b4c628a47","findings":[{"citation":"resolved","description":"open() computes kind = _draw(keccak256(blockhash(boughtAt), tokenId)). That random word is fixed once the purchase block is mined, but _draw reduces it with `rnd % (MAX_PACKS - opened)` and then walks the kinds by `cap - minted`. Both `opened` and `minted` change whenever anyone opens any pack, so the same sealed pack maps to a different, effectively fresh draw in every deck state. Because the random word is public from the block after the purchase, a holder can evaluate open(tokenId) with eth_call in each state and send the transaction only when it yields the kind they want. The contract's own guarantee (header, lines 15-18: 'a buyer cannot pick a good pack and a bot cannot re-roll by choosing when to open', and the reason sealed packs are untransferable: 'anyone could read what is inside') does not hold. A buyer of several packs does not even need other people: opening one of their own packs re-rolls all the others, so the opening order alone is a search over outcomes. Economics: with the test lineup (EPIC kinds = 20% of the deck) a pack that is checked against K deck states is EPIC in at least one with probability 1-0.8^K (89% at K=10, 99% at K=20); for a 1% kind, 300 states give 95%. The cost is nothing beyond the pack price and waiting. Rare kinds have a fixed cap, so every one taken this way comes out of the odds of honest buyers, who pay the same escalating price for a deck that is being drained of its rare cards. Fix (keeps the exact caps and the shuffled-deck model): make the deck state at the draw something nobody can choose, e.g. resolve packs strictly in purchase order (open/reveal is permissionless and always deals the lowest unopened id first, so pack i's draw depends only on hashes that existed before anyone could act), or give each pack a deck position at purchase and resolve it through a lazy Fisher-Yates shuffle keyed by the purchase-block hash.","line":197,"path":"contracts/src/HamPowerUps.sol","proof":"// SPDX-License-Identifier: MIT\npragma solidity 0.8.26;\n\nimport {Test} from \"forge-std/Test.sol\";\nimport {HamPowerUps} from \"src/HamPowerUps.sol\";\n\n/// A sealed pack's contents must be fixed once the hash of its purchase block exists: the contract\n/// says \"a bot cannot re-roll by choosing when to open\". Here alice's pack is priced against every\n/// deck state bob's opens produce; a fair draw gives the same gun in all of them.\ncontract PackDrawOrderTest is Test {\n    HamPowerUps pu;\n    address owner = makeAddr(\"owner\");\n    address alice = makeAddr(\"alice\");\n    address bob = makeAddr(\"bob\");\n\n    function setUp() public {\n        vm.warp(20_000 days + 3 hours);\n        vm.roll(1000);\n        pu = new HamPowerUps(owner);\n        vm.startPrank(owner);\n        pu.addKind(\"Marker\", \"COMMON\", 4000);\n        pu.addKind(\"Frost dart\", \"RARE\", 2000);\n        pu.addKind(\"Pulse\", \"RARE\", 2000);\n        pu.addKind(\"Blinker\", \"EPIC\", 1000);\n        pu.addKind(\"Snare\", \"EPIC\", 1000);\n        pu.lock();\n        vm.stopPrank();\n        vm.deal(alice, 100 ether);\n        vm.deal(bob, 100 ether);\n    }\n\n    /// What alice's pack #1 holds if she opens it now (state is rolled back afterwards).\n    function _peek() internal returns (uint256 kind) {\n        uint256 snap = vm.snapshotState();\n        kind = pu.kindOf(1);\n        if (kind == 0) {\n            vm.prank(alice);\n            kind = pu.open(1);\n        }\n        vm.revertToState(snap);\n    }\n\n    function test_sealedPackContentsDoNotDependOnWhenItIsOpened() public {\n        vm.prank(alice);\n        pu.buy{value: 1 ether}(1); // pack #1\n        vm.prank(bob);\n        pu.buy{value: 1 ether}(20); // packs #2..#21, same block\n        vm.roll(1001);\n        vm.setBlockhash(1000, keccak256(\"the purchase block\"));\n\n        uint256 first = _peek(); // the hash of block 1000 is known: the contents should be settled\n        for (uint256 id = 2; id <= 21; ++id) {\n            vm.prank(bob);\n            try pu.open(id) {} catch {} // other people opening their own packs\n            assertEq(_peek(), first, \"pack #1 holds a different gun after someone else opened a pack\");\n        }\n    }\n}","reproduction":"Lineup 4000/2000/2000/1000/1000, lock(). Block 1000: alice buys 1 pack (#1), bob buys 20 (#2..#21). Block 1001 (blockhash(1000) now exists). eth_call alice.open(1) -> kind 1 (Marker, COMMON). Bob opens one of his own packs; eth_call alice.open(1) now -> kind 2 (a different gun), and it keeps changing as further packs are opened. Expected: pack #1 holds the same gun whenever it is opened once block 1000's hash exists. Actual: its contents depend on `opened`/`minted` at the moment of opening, so alice opens only in a state that gives the kind she wants. In a second run with a 9500/500 lineup, alice's single pack showed the 5% kind after 3, 7, 23 and 35 foreign opens out of 40. Run: forge test --match-path test/scratch/PackDrawOrder.t.sol -> FAIL 'pack #1 holds a different gun after someone else opened a pack: 1 != 2'.","severity":"high","snippet":"        uint256 r = rnd % (MAX_PACKS - opened);","title":"HamPowerUps: a sealed pack's gun is re-rolled every time any pack is opened, so the holder picks when to open"},{"citation":"resolved","description":"The free run was tied to the pass id (freeRunUsed[day][passId]), but the holder prize bonus is still decided by `isHolder(player)`, i.e. holderToken.balanceOf(player) > 0 at the moment the run is submitted. With HamBackerPass as the holder NFT (transferable, unlike the FundingWorks pass) a single pass can be moved wallet to wallet, each wallet submitting a paid run while it holds it; every one of those Scores is stored with holder = true and settle() adds HOLDER_BONUS_BPS (10% of the prize) to each, carved out of the treasury share. The pass can also be lent for one transaction to any player (a contract wallet can borrow it, call playRun and return it). The limit the pass model implies, one pass = one holder's perks per day, is enforced for the free run only. Who loses: the treasury/buyback share. One pass can take the bonus on all three places: 7% of the pot instead of at most 4%, and with referral rewards on top (they are computed on the bonus-inflated amount) the treasury's 10% can be emptied. The same rotation applies to booster tokens: boostBps is whatever the referee read with boostOf at signing time and the contract never looks at it again, so if a booster is transferable the only limit is in the referee service, not on chain. Fix that keeps the design (the perk follows whoever holds the pass): mark a run as a holder run only when the caller names a pass it owns and that pass has not already backed a holder run that day (e.g. playRun takes an optional passId; require ownerOf(passId) == msg.sender and a per-day per-pass flag, as playFreeRun does), instead of reading balanceOf.","line":856,"path":"contracts/src/HamRobinhood.sol","reproduction":"holderToken = HamBackerPass; owner airdrops pass #1 to alice; entryFee 0.01 ETH. Same day: alice.playRun(5000 pts); alice transfers pass #1 to bob; bob.playRun(4000 pts); bob transfers it to mallory; mallory.playRun(3000 pts). scores(1..3).holder == true, true, true. After settle (pot 0.03 ETH): prizeOf = 0.0132 / 0.0066 / 0.0033 ETH (each base prize +10%) and treasuryOwed = 0.0009 ETH. Expected: one pass backs one holder bonus (prizes 0.0132 / 0.006 / 0.003, treasuryOwed 0.0018 ETH), the way it backs one free run. Actual: three bonuses from one pass; the treasury receives 0.0009 instead of 0.0018 ETH.","severity":"medium","snippet":"            holder: isHolder(player)","title":"HamRobinhood: one transferable Backer Pass gives the holder bonus to every wallet it passes through (free runs are per pass, the bonus is not)"},{"citation":"resolved","description":"claimFinalize() marks the token claimed but leaves prizeOf[tokenId] at the full amount (sweep() at line 570 zeroes it; claimFinalize does not), and isFrozen() is false again as soon as claimed is set. Existing approvals survive the claim. So the freeze only defeats a same-block front-run: the seller of a winning Score calls claimIntent (a pending purchase reverts), waits CLAIM_DELAY = 10 minutes, calls claimFinalize and collects the prize, and from that second any bid or listing that is still open fills against a Score that carries nothing, while prizeOf(tokenId) still reports the prize. A standing bid on a marketplace cannot check `claimed` at fill time, and a buyer or UI reading prizeOf sees a live prize. The contract header promises 'there is no path to double-dip'; this is that path with a ten-minute wait. Loss: the buyer's whole purchase price; the seller keeps both the prize and the sale price. Fix without re-freezing paid Scores (the earlier audit asked for them to move again): zero prizeOf in claimFinalize as sweep does, so every reader sees 0, and make orders placed before the claim unfillable, e.g. clear _approved[tokenId] at claimIntent and ignore operator approvals for a claimed token until its owner explicitly re-approves it. If stale orders are accepted as the buyer's risk, say so where the header claims no double-dip.","line":550,"path":"contracts/src/HamRobinhood.sol","reproduction":"entryFee 0.01 ETH, alice is the day's only player (Score #1), settle -> prizeOf(1) = 0.004 ETH. Alice has setApprovalForAll(marketplace, true) and bob has an open bid for Score #1. alice.claimIntent(1): marketplace.transferFrom(alice, bob, 1) reverts TokenFrozen. +10 minutes: alice.claimFinalize(1) pays her 0.004 ETH. Now prizeOf(1) == 0.004 ETH, claimed(1) == true, isFrozen(1) == false, and marketplace.transferFrom(alice, bob, 1) succeeds: bob's bid is filled with a Score that can no longer be claimed (claimIntent reverts AlreadyClaimed). Expected: prizeOf(1) == 0 after payout and the pre-claim order cannot fill. Actual: prizeOf still shows 0.004 ETH and the order fills.","severity":"medium","snippet":"        claimed[tokenId] = true;","title":"HamRobinhood: a paid-out Score trades again with prizeOf still set, so an order older than CLAIM_DELAY is filled with an empty ticket"},{"citation":"resolved","description":"If nobody calls buy() or open() in the 256 blocks after a purchase block, _keepSeal never stores that block's hash and blockhash(bought) returns 0, so open() falls back to blockhash(block.number - 1). That value is known before the transaction is sent and changes every block, so the holder simulates open() each block and submits only when the result is the kind they want (or opens through a contract that reverts otherwise; a contract can buy packs). This is a free option: if someone does touch the contract inside the window the attacker simply gets the normal draw, so the only cost is waiting for a quiet stretch, which the daily price climb makes likely late in a day and after sell-out. A buy made after the window does not help either, because _keepSeal can no longer read the old block's hash. The comment calls this 'Rare, and costs the opener waiting', but waiting is exactly what buys the re-roll the header says is impossible. On a chain where block.number advances slowly (an L2 that reports the parent chain's number) one block.number value spans many L2 blocks, which makes hitting the chosen value trivial. Fix: do not hand a lapsed pack a hash the opener can pick. Let anyone store the seal (a public seal() a keeper can call) and, when the hash is truly lost, give no upside to lapsing, e.g. deal the commonest remaining kind.","line":178,"path":"contracts/src/HamPowerUps.sol","reproduction":"Lineup 9500 COMMON / 500 RARE, lock(). Block 1000: alice buys pack #1; nobody buys or opens until block 1257. From block 1300 on, eth_call alice.open(1) each block: the result follows blockhash(block.number - 1); in a 60-block scan it was RARE in 4 blocks (1310, 1321, 1323, 1336) and COMMON in the rest. Alice sends open(1) in one of those blocks and gets the 5% kind with certainty. Expected: the gun is fixed by the purchase block and cannot depend on when the pack is opened. Actual: the opener selects the block that decides it.","severity":"medium","snippet":"        if (h == 0) h = blockhash(block.number - 1);","title":"HamPowerUps: after 256 quiet blocks a pack is drawn from the latest block hash, which the opener chooses"},{"citation":"resolved","description":"claimFinalize pays only the current owner (msg.sender) with a plain ETH call and reverts TransferFailed if it is refused. Once claimIntent has run the Score cannot be transferred, and there is no way to cancel the intent or name another recipient. A Score held by a contract without a payable receive (a vault, an escrow, a multisig module) is therefore stuck after claimIntent: it can neither be paid nor moved to a wallet that can be paid, and after CLAIM_WINDOW anyone sweeps the prize into the day's pot. Fix: let the owner name the recipient (claimFinalize(tokenId, to)), which changes nothing for wallets that can receive ETH.","line":553,"path":"contracts/src/HamRobinhood.sol","reproduction":"Score #1 wins 0.004 ETH and is held by contract N, which has no receive/fallback. N calls claimIntent(1). After 10 minutes N.claimFinalize(1) reverts TransferFailed, and N.transferFrom(N, alice, 1) reverts TokenFrozen. 7 days later sweep(day, 1) succeeds and prizeOf(1) becomes 0. Expected: the owner can redirect the payout or move the Score to a wallet that can claim. Actual: the prize is lost.","severity":"low","snippet":"        _send(holder, amount);","title":"HamRobinhood: claimIntent by a holder that cannot receive ETH freezes the Score for good and the prize is forfeited"},{"citation":"resolved","description":"withdrawTreasury reads treasuryOwed and backersOwed into locals, sends, and only then writes each to 0. The nonReentrant lock covers the claim functions but settle() has no lock and adds to both variables. If the treasury or backers recipient (a buyback vault or payout splitter, both contracts the comments expect here) calls settle() for a pending day while receiving, that day's treasury and backers shares are added and then overwritten with 0. The ETH stays in the contract with no ledger entry pointing at it, so it can never be withdrawn. Only the recipients' own code can trigger it, hence low, but the loss is permanent. Fix: write the owed variable to 0 before the call and restore it if the send fails, or subtract the amount sent instead of assigning 0.","line":590,"path":"contracts/src/HamRobinhood.sol","reproduction":"treasury = contract T whose receive() calls game.settle(d2) once. Day d1: alice plays (fee 0.01 ETH) and d1 is settled: treasuryOwed = backersOwed = 0.001 ETH, 0.004 ETH rolls into d2. Day d2: bob plays (pot 0.014 ETH); d2 is not settled yet. After d2 + 1 day + 16 min anyone calls withdrawTreasury(): T receives 0.001 ETH and, inside receive, settle(d2) adds 0.0014 ETH to treasuryOwed and 0.0014 ETH to backersOwed; on return both are set to 0. Expected: treasuryOwed == 0.0014 ETH and backersOwed == 0.0014 ETH afterwards. Actual: both are 0, d2 is settled, and 0.0028 ETH is stranded in the contract.","severity":"low","snippet":"        if (amount != 0 && _trySend(treasury, amount)) {\n            treasuryOwed = 0;","title":"HamRobinhood: withdrawTreasury clears the owed amounts after the ETH call, erasing shares that a settle() made during the call accrued"},{"citation":"resolved","description":"The repeat-run cut exists because 'the maze is the same all day, so a later run already knows the way'. The attempt counter the referee signs is per wallet, and nothing is paid until a run is submitted. A player can therefore learn the maze on wallet B (any number of signed but never submitted runs, cost zero) and then play once on wallet A, whose signed attempt is 0 and keeps 100% of its points. The same pay-on-submit rule means a run that would not rank is never paid for, so a day's pot is funded only by runs their players expect to place. The contract cannot tell wallets apart, so this is a design limit rather than a code defect; closing it needs a paid commitment before the run starts (which the single-signature design removed on purpose) or identity checks in the referee service. Reported so the trade-off is a decision rather than a surprise.","line":401,"path":"contracts/src/HamRobinhood.sol","reproduction":"Same person, wallets A and B. B plays today's maze 10 times; the referee signs attempts 0..9 for B and B submits none (no fee, attempts[day][B] stays 0). A then plays once: the referee signs attempt 0 for A, playRun accepts it and the Score ranks with attemptShare(0) = 10000 bps. Expected by the rule in REPEAT_STEP_BPS/REPEAT_FLOOR_BPS: an 11th run of the day keeps 60% of its points. Actual: 100%, at no extra cost.","severity":"info","snippet":"        if (attempt < attempts[day][msg.sender]) revert BadAttempt();","title":"HamRobinhood: the repeat-run cut and the entry fee bind only the submitting wallet, so practice runs on a second wallet are free"}],"hash":"6cf7d16e2b2b335d7d1fc7493f8de260ba5f28fc03d1eff80cec82de92ff82e0","nodeId":"e4cf4765-411c-4a86-a156-54ecc26fac5e","outcome":"completed","summary":"The re-audit is written to `.imd-findings.json`: seven findings (one high, three medium, two low, one info), each with a concrete reproduction that I ran as a Foundry test. No repository files were changed and the scratch tests are removed.\n\n## Findings, by severity\n\n| # | Severity | Where | What fails |\n|---|---|---|---|\n| 1 | High | `HamPowerUps.sol:197` (`_draw`) | A sealed pack's gun is re-rolled every time any pack is opened, so the holder picks when to open. |\n| 2 | Medium | `HamRobinhood.sol:856` | One transferable Backer Pass gives the holder bonus to every wallet it passes through. |\n| 3 | Medium | `HamRobinhood.sol:550` (`claimFinalize`) | A paid-out Score trades again with `prizeOf` still set, so an older bid fills with an empty ticket. |\n| 4 | Medium | `HamPowerUps.sol:178` (`open`) | After 256 quiet blocks the draw uses the latest block hash, which the opener chooses. |\n| 5 | Low | `HamRobinhood.sol:553` | A holder that cannot receive ETH is frozen after `claimIntent` and the prize is forfeited. |\n| 6 | Low | `HamRobinhood.sol:590` (`withdrawTreasury`) | The owed amounts are cleared after the ETH call, erasing shares a `settle()` accrued during it. |\n| 7 | Info | `HamRobinhood.sol:401` | Practice runs on a second wallet are free and dodge the repeat-run cut. |\n\n- **1 (pack re-roll):** the random word is fixed at purchase, but it is reduced against `opened` and the remaining caps, which change with every open. With alice holding pack #1 and bob opening one of his own, her pack changed from kind 1 to kind 2. The finding carries a proof test that fails on this code and passes on a copy where packs are dealt strictly in purchase order.\n- **2 (holder bonus):** with pass #1 moved alice → bob → mallory between three paid runs, all three Scores are stored as holder runs. Prizes come out as 0.0132 / 0.0066 / 0.0033 ETH and the treasury gets 0.0009 ETH instead of 0.0018. Free runs are correctly limited per pass; the bonus is not.\n- **3 (paid-out Score):** after `claimFinalize`, `prizeOf(1)` still reads 0.004 ETH, the token is unfrozen, and a marketplace `transferFrom` that reverted during the freeze now succeeds. The freeze only stops a same-block front-run.\n- **4 (fallback hash):** in a 60-block scan with a 5% rare kind, four specific blocks gave the rare gun. Waiting costs the attacker nothing, since any activity inside the window just gives the normal draw.\n- **6 (treasury withdrawal):** with a treasury contract that calls `settle()` on receipt, 0.0028 ETH was left in the contract with no ledger entry. Only the recipients' own code can trigger it.\n\n## Checked and found sound\n\n- **`HamBackerPass`:** `airdrop` rejects duplicate ids and zero addresses, `lockMint` is permanent, and the Enumerable bookkeeping held under a 256-run fuzz of random `transferFrom` / `safeTransferFrom` calls.\n- **`HamPowerUps` game list:** only an allowed game can call `recordRun`; a removed game and a non-owner `setGame` both revert.\n- **Signature replay:** the digest binds chain, contract, day, player and attempt, and the attempt counter makes each signature single-use across both `playRun` and `playFreeRun`.\n- **Pot accounting:** the settle split conserves the pot, rounding dust rolls over, and claim and sweep are mutually exclusive at the window boundary.\n- **Gas starvation:** a sweep of gas limits on `playRun` found no level where the call succeeds with the Power-Ups or HAM Points hook skipped.\n\n## Limits of this review\n\n- Only the economics pass (Economic Security, Invariant, Flow Gap) was done, on the three focus contracts. `HamDailyRun`, `HamPowerUp`, `HamPoints` and the art contracts were read only where the focus contracts call them.\n- Finding 3 is a residue of the earlier fix that let paid Scores move again; the suggested remedy keeps that behaviour.\n- Finding 7 is a design trade-off of pay-on-submit, not a code defect.\n- Boosts are taken entirely from the referee's signature, so a transferable booster token can be rotated between wallet","treeHash":null,"usage":{"cachedInputTokens":966749,"cost":{"source":"runtime","usdMicros":4611381},"inputTokens":21,"model":"claude-fable-5-2","outputTokens":59458,"runtime":"claude","turns":13,"wallClockMs":675948}},{"artifacts":[],"attempt":1,"bundleHash":null,"device":"e02bec63aa9dcaa5","findings":[{"citation":"resolved","description":"The free run was made per pass per day (freeRunUsed[day][passId]), but the holder bonus was not. _mintScore stamps a Score with holder = isHolder(player), a balanceOf read on the player's wallet at the moment of the run, and settle pays +10% (HOLDER_BONUS_BPS) out of the treasury share to every top-3 Score with that flag. Now that the holder NFT is the transferable HamBackerPass, one pass can be handed (or lent, or flash-borrowed by a contract player) from wallet to wallet during the day and every wallet's Score is stamped holder = true. Fixing it means tying the bonus to a pass id the way the free run is tied (one holder-flagged Score, or one bonus, per pass per day), which needs the pass id on the paid path too.","line":856,"path":"contracts/src/HamRobinhood.sol","proof":"// SPDX-License-Identifier: MIT\npragma solidity 0.8.26;\n\nimport {Test} from \"forge-std/Test.sol\";\nimport {HamRobinhood} from \"src/HamRobinhood.sol\";\nimport {HamBackerPass} from \"src/HamBackerPass.sol\";\n\n/// One Backer Pass is handed from wallet to wallet during a day. The free run is already one per pass per\n/// day; the holder bonus is not: every wallet the pass passes through gets a holder-flagged Score, and each\n/// top-3 one is paid +10% out of the treasury share.\ncontract HolderBonusPerPassTest is Test {\n    HamRobinhood game;\n    HamBackerPass pass;\n    uint256 refereeKey = 0xA11CE;\n    address owner = makeAddr(\"owner\");\n    address treasury = makeAddr(\"treasury\");\n    address alice = makeAddr(\"alice\");\n    address bob = makeAddr(\"bob\");\n    address carol = makeAddr(\"carol\");\n    uint256 constant FEE = 0.01 ether;\n\n    function setUp() public {\n        vm.warp(20_000 days + 3 hours);\n        game = new HamRobinhood(\n            owner,\n            vm.addr(refereeKey),\n            treasury,\n            FEE,\n            HamRobinhood.GameConfig({\n                mazeSize: 12,\n                cellSize: 7,\n                sentries: 8,\n                sentryHealth: 60,\n                sentryDamage: 20,\n                playerHealth: 100,\n                magSize: 30,\n                loops: 0\n            })\n        );\n        pass = new HamBackerPass(owner);\n        address[] memory to = new address[](1);\n        uint256[] memory ids = new uint256[](1);\n        to[0] = alice;\n        ids[0] = 3;\n        vm.startPrank(owner);\n        pass.airdrop(to, ids);\n        pass.lockMint();\n        game.setHolderToken(address(pass));\n        vm.stopPrank();\n        vm.deal(bob, 1 ether);\n        vm.deal(carol, 1 ether);\n        vm.deal(address(this), 100 ether);\n    }\n\n    function _signed(address p, uint32 points)\n        internal\n        view\n        returns (HamRobinhood.RunResult memory r, bytes memory sig)\n    {\n        uint256 day = game.currentDay();\n        r = HamRobinhood.RunResult({points: points, timeMs: 90_000, kills: 2, completed: true, attempt: 0, boostBps: 0});\n        bytes32 h = keccak256(\n            abi.encodePacked(\"\\x19Ethereum Signed Message:\\n32\", game.runDigest(day, p, 0, points, 90_000, 2, true, 0))\n        );\n        (uint8 v, bytes32 rr, bytes32 s) = vm.sign(refereeKey, h);\n        sig = abi.encodePacked(rr, s, v);\n    }\n\n    function test_onePassPaysOneHolderBonusADay() public {\n        uint256 day = game.currentDay();\n        game.fundPot{value: 10 ether}(day);\n\n        // alice uses pass #3's free run\n        (HamRobinhood.RunResult memory r, bytes memory sig) = _signed(alice, 9000);\n        vm.prank(alice);\n        uint256 a = game.playFreeRun(r, sig, address(0), 3);\n\n        // the same pass goes to bob, who pays for a run, then to carol, who pays for a run\n        vm.prank(alice);\n        pass.transferFrom(alice, bob, 3);\n        (r, sig) = _signed(bob, 8000);\n        vm.prank(bob);\n        uint256 b = game.playRun{value: FEE}(r, sig, address(0));\n\n        vm.prank(bob);\n        pass.transferFrom(bob, carol, 3);\n        (r, sig) = _signed(carol, 7000);\n        vm.prank(carol);\n        uint256 c = game.playRun{value: FEE}(r, sig, address(0));\n\n        (uint256 pot,,,,,,) = game.dayInfo(day);\n        vm.warp((day + 1) * 1 days + 16 minutes);\n        game.settle(day);\n\n        // there is one pass, so at most one prize may carry the holder bonus\n        uint256 bonuses;\n        if (game.prizeOf(a) > pot * 4000 / 10_000) bonuses++;\n        if (game.prizeOf(b) > pot * 2000 / 10_000) bonuses++;\n        if (game.prizeOf(c) > pot * 1000 / 10_000) bonuses++;\n        assertLe(bonuses, 1, \"one pass paid the holder bonus to more than one wallet's Score in a day\");\n    }\n}","reproduction":"holderToken = HamBackerPass, pass #3 airdropped to alice, entry fee 0.01 ETH, pot seeded with 10 ETH. Alice plays a paid run (9000 pts), transferFrom(alice, bob, 3); Bob plays (8000 pts), transferFrom(bob, carol, 3); Carol plays (7000 pts). All three Scores have holder = true. Pot = 10.03 ETH. Expected with one pass: at most one bonus, so Bob's prize = 20% = 2.006 ETH and the treasury keeps at least 0.6018 ETH. Actual: prizes 4.4132 / 2.2066 / 1.1033 ETH (each +10%), treasuryOwed = 0.3009 ETH instead of 1.003 ETH; the single pass took 0.7021 ETH of the 1.003 ETH buyback share. The attached test uses pass #3's free run for alice's Score and paid runs for bob and carol: all three prizes still carry the bonus.","severity":"medium","snippet":"            holder: isHolder(player)","title":"One transferable Backer Pass gives the holder bonus to every wallet it passes through in a day"},{"citation":"resolved","description":"open draws from blockhash(boughtAt). When that hash has aged out and no later buy or open stored it (_keepSeal runs only inside buy and open, and only for the last buy block), open falls back to blockhash(block.number - 1). That value is known before the transaction is sent, so the holder can compute keccak256(abi.encode(hash, tokenId)) off chain for every new block and send open only in a block that gives the kind they want. The contract's promise that 'a bot cannot re-roll by choosing when to open' does not hold on this path. The code comment calls it rare, but the buyer chooses when to buy: the last purchase before a quiet stretch qualifies (for instance late in a UTC day, once the price has climbed and buyers wait for the reset), and a failed attempt costs nothing because the pack then simply opens fairly. Every rare kind taken this way leaves the 10,000-card deck, so everyone else's odds of it fall. Robinhood Chain's RPC (https://rpc.mainnet.chain.robinhood.com, chain id 4663) returns Arbitrum Nitro blocks carrying an l1BlockNumber field; on Nitro chains block.number inside a contract is, per Arbitrum's documentation, the L1 block number, which makes 256 blocks about 51 minutes and keeps the fallback hash fixed for the roughly 12 seconds one L1 number lasts. Fix: never reveal from a hash that is known when the call is made. When the purchase hash is gone, re-arm instead: set boughtAt[tokenId] to the current block and require a second open in a later block.","line":178,"path":"contracts/src/HamPowerUps.sol","proof":"// SPDX-License-Identifier: MIT\npragma solidity 0.8.26;\n\nimport {Test} from \"forge-std/Test.sol\";\nimport {HamPowerUps} from \"src/HamPowerUps.sol\";\n\n/// A pack bought in block B, with no other buy or open on the contract for the next 256 blocks, has no\n/// stored hash for B. `open` then falls back to blockhash(block.number - 1), which the holder knows before\n/// sending: the same pack opens to a different kind depending on the block the holder picks.\ncontract LateOpenRerollTest is Test {\n    HamPowerUps pu;\n    address owner = makeAddr(\"owner\");\n    address mallory = makeAddr(\"mallory\");\n\n    function setUp() public {\n        vm.warp(20_000 days + 3 hours);\n        vm.roll(1000);\n        pu = new HamPowerUps(owner);\n        vm.startPrank(owner);\n        pu.addKind(\"Marker\", \"Common\", 5000);\n        pu.addKind(\"Snare\", \"Legendary\", 5000);\n        pu.lock();\n        vm.stopPrank();\n        vm.deal(mallory, 1 ether);\n    }\n\n    function test_holderCannotPickTheKindByPickingTheBlock() public {\n        vm.prank(mallory);\n        uint256 id = pu.buy{value: 0.01 ether}(1);\n        uint256 bought = block.number;\n\n        // nobody touches the contract; mallory looks at 40 later blocks and what the pack would be in each\n        uint256 first;\n        bool differs;\n        for (uint256 n = bought + 300; n < bought + 340; ++n) {\n            uint256 snap = vm.snapshotState();\n            vm.roll(n);\n            vm.setBlockhash(n - 1, keccak256(abi.encode(\"block\", n - 1)));\n            vm.prank(mallory);\n            try pu.open(id) returns (uint256 kind) {\n                if (kind != 0) {\n                    if (first == 0) first = kind;\n                    else if (kind != first) differs = true;\n                }\n            } catch {}\n            vm.revertToState(snap);\n        }\n        assertFalse(differs, \"the kind a pack opens to depends on the block its holder chooses\");\n    }\n}","reproduction":"Two kinds of 5,000 packs each. Mallory buys pack #1 in block 1000 and nobody calls buy or open before block 1300, so blockhash(1000) is 0 and blockSeal(1000) is 0. For each block n from 1300 to 1339, with blockhash(n-1) = keccak256(abi.encode(\"block\", n-1)), open(1) sent in block n returns kind 1 in some blocks and kind 2 in others. Expected: one kind whichever block the holder opens in. Actual: the kind follows the block, so she opens in one that gives the kind she wants. With a 9,900 / 100 lineup the same loop reached the 1-in-100 kind on the 19th block tried.","severity":"medium","snippet":"        if (h == 0) h = blockhash(block.number - 1);","title":"A pack left shut for 256 blocks opens from the previous block's hash, so its holder can pick the kind by picking the block"},{"citation":"resolved","description":"withdrawTreasury reads treasuryOwed and backersOwed into locals, sends, and only then writes the counter to 0. settle() has no reentrancy guard and adds to both counters. If the recipient's receive() (or anything it forwards control to, e.g. a payout splitter that pushes ETH on to backers) calls settle(day) for a day that is ready to settle, the share settle just added is overwritten with 0 when the send returns. No function can pay that ETH out afterwards: it is in the contract's balance but in no pot, prize or owed counter. The treasury recipient re-entering loses the new treasury share and, when backersOwed was non-zero, the new backers share too; the backers recipient re-entering loses the new backers share. The fix is to zero each counter before its send and restore it if the send fails (or to put settle behind the same guard).","line":594,"path":"contracts/src/HamRobinhood.sol","proof":"// SPDX-License-Identifier: MIT\npragma solidity 0.8.26;\n\nimport {Test} from \"forge-std/Test.sol\";\nimport {HamRobinhood} from \"src/HamRobinhood.sol\";\n\n/// The backers' payout address settles a finished day when it is paid (as a splitter that pulls in\n/// everything it is due would).\ncontract SettlingBackers {\n    HamRobinhood public game;\n    uint256 public day;\n    bool public armed;\n\n    function arm(HamRobinhood game_, uint256 day_) external {\n        game = game_;\n        day = day_;\n        armed = true;\n    }\n\n    receive() external payable {\n        if (armed) {\n            armed = false;\n            game.settle(day);\n        }\n    }\n}\n\n/// withdrawTreasury sends first and zeroes treasuryOwed / backersOwed afterwards. settle() is not guarded,\n/// so a share it adds while the send is in progress is overwritten with 0 and that ETH can never be paid.\ncontract WithdrawReentrantSettleTest is Test {\n    HamRobinhood game;\n    SettlingBackers backers;\n    uint256 refereeKey = 0xA11CE;\n    address owner = makeAddr(\"owner\");\n    address treasury = makeAddr(\"treasury\");\n    address alice = makeAddr(\"alice\");\n    address bob = makeAddr(\"bob\");\n    uint256 constant FEE = 0.01 ether;\n\n    function setUp() public {\n        vm.warp(20_000 days + 3 hours);\n        game = new HamRobinhood(\n            owner,\n            vm.addr(refereeKey),\n            treasury,\n            FEE,\n            HamRobinhood.GameConfig({\n                mazeSize: 12,\n                cellSize: 7,\n                sentries: 8,\n                sentryHealth: 60,\n                sentryDamage: 20,\n                playerHealth: 100,\n                magSize: 30,\n                loops: 0\n            })\n        );\n        backers = new SettlingBackers();\n        vm.prank(owner);\n        game.setBackers(address(backers));\n        vm.deal(alice, 1 ether);\n        vm.deal(bob, 1 ether);\n        vm.deal(address(this), 100 ether);\n    }\n\n    function _play(address p) internal {\n        uint256 day = game.currentDay();\n        HamRobinhood.RunResult memory r =\n            HamRobinhood.RunResult({points: 9000, timeMs: 90_000, kills: 2, completed: true, attempt: 0, boostBps: 0});\n        bytes32 h = keccak256(\n            abi.encodePacked(\"\\x19Ethereum Signed Message:\\n32\", game.runDigest(day, p, 0, 9000, 90_000, 2, true, 0))\n        );\n        (uint8 v, bytes32 rr, bytes32 s) = vm.sign(refereeKey, h);\n        vm.prank(p);\n        game.playRun{value: FEE}(r, abi.encodePacked(rr, s, v), address(0));\n    }\n\n    /// Everything the contract still owes: unsettled pots, unclaimed prizes, and the two owed shares.\n    function _owed(uint256 fromDay, uint256 toDay) internal view returns (uint256 sum) {\n        for (uint256 d = fromDay; d <= toDay; ++d) {\n            (uint256 pot, uint256 unclaimed, uint256 settledAt,,,,) = game.dayInfo(d);\n            sum += settledAt == 0 ? pot : unclaimed;\n        }\n        sum += game.treasuryOwed() + game.backersOwed();\n    }\n\n    function test_withdrawKeepsWhatAReentrantSettleAdds() public {\n        uint256 dayA = game.currentDay();\n        game.fundPot{value: 10 ether}(dayA);\n        _play(alice);\n        vm.warp((dayA + 1) * 1 days + 16 minutes);\n        game.settle(dayA); // backersOwed and treasuryOwed are now non-zero\n\n        uint256 dayB = game.currentDay();\n        _play(bob);\n        vm.warp((dayB + 1) * 1 days + 16 minutes); // day B can be settled, and has not been\n        uint256 dayC = game.currentDay();\n        assertEq(address(game).balance, _owed(dayA, dayC), \"balanced before the withdrawal\");\n\n        backers.arm(game, dayB);\n        game.withdrawTreasury();\n\n        assertEq(address(game).balance, _owed(dayA, dayC), \"ETH left in the contract that nothing accounts for\");\n    }\n}","reproduction":"backers = a contract whose receive() calls game.settle(dayB) once. Day A: pot 10.01 ETH, one run, settled, backersOwed = 1.001 ETH. Day B: pot 4.014 ETH (rollover + one entry), one run; warp to day B+1 00:16 without settling B. Anyone calls withdrawTreasury(). Expected afterwards: backersOwed = 0.4014 ETH (day B's 10%). Actual: backersOwed = 0; the contract holds 8.018 ETH while pots + unclaimed + treasuryOwed + backersOwed account for 7.6166 ETH, so 0.4014 ETH can never be paid.","severity":"low","snippet":"        if (toBackers != 0 && _trySend(backers, toBackers)) {\n            backersOwed = 0;\n            emit TreasuryWithdrawn(backers, toBackers);\n        }","title":"withdrawTreasury zeroes the owed counters after sending, so a share added by a re-entrant settle() is erased and its ETH stranded"},{"citation":"resolved","description":"Every bonus and referral reward is carved out of the one treasury share (10% of the pot) and clamped with _min to what is left, in place order. The promised amounts do not fit: three holder winners need 7% of the pot in bonuses, and their referrers need 5% (10% with a crew) of the boosted prizes, another 3.85% (7.7%), so the demand is 10.85% to 14.7% against a 10% budget. First place is served in full; the others get whatever remains, down to nothing, and the buyback gets 0. Which holder loses the bonus depends only on rank order. Fixing it needs a decision: either budget the shares so they fit (pro-rata scaling when demand exceeds the share), or state that lower places can lose them.","line":510,"path":"contracts/src/HamRobinhood.sol","reproduction":"Passes #1-#3 held by alice, bob, carol; dave has played and is the referrer of all three (crewSize = 3, so 10%). Pot 10.04 ETH; runs rank alice, bob, carol. Expected: prizes 4.4176 / 2.2088 / 1.1044 ETH (each +10%) and 0.77308 ETH referral to dave. Actual: 4.4176 / 2.16864 / 1.004 ETH (carol's bonus is 0, bob's is 0.16064 instead of 0.2008), dave is credited 0.44176 ETH, treasuryOwed = 0. With plain 5% referrals the third holder still gets 0.7% of the pot instead of 1% and their referrer 0.","severity":"low","snippet":"            uint256 bonus = _min(amount * HOLDER_BONUS_BPS / BPS, remainingTreasury);","title":"Holder bonus and referral rewards can demand more than the 10% treasury share; later places are silently short-paid"},{"citation":"resolved","description":"recordRun adds the run's kills to a uint32 with checked arithmetic. HamRobinhood caps points (MAX_RUN_POINTS, 'caps what any key can sign') and boostBps but passes r.kills through as signed, any uint32. Once a gun's kills reach the top of the range every later recordRun for it reverts with an overflow panic, which HamRobinhood's try/catch swallows: the run is played and paid, but the gun's runs and kills never move again, and the tradeable NFT's metadata shows 4,294,967,295 kills. Needs a signature with an absurd kills value (a leaked or faulty referee key, the case the points cap exists for). Fix: bound r.kills in _play (the maze has at most 64 sentries) or saturate the add.","line":230,"path":"contracts/src/HamPowerUps.sol","proof":"// SPDX-License-Identifier: MIT\npragma solidity 0.8.26;\n\nimport {Test} from \"forge-std/Test.sol\";\nimport {HamRobinhood} from \"src/HamRobinhood.sol\";\nimport {HamPowerUps} from \"src/HamPowerUps.sol\";\n\n/// A signed run's kills are any uint32. One run with kills = 2^32 - 1 fills the equipped gun's counter, and\n/// every later recordRun for that gun overflows and is swallowed by the game's try/catch.\ncontract KillsOverflowTest is Test {\n    HamRobinhood game;\n    HamPowerUps pu;\n    uint256 refereeKey = 0xA11CE;\n    address owner = makeAddr(\"owner\");\n    address alice = makeAddr(\"alice\");\n    uint256 constant FEE = 0.01 ether;\n\n    function setUp() public {\n        vm.warp(20_000 days + 3 hours);\n        vm.roll(1000);\n        game = new HamRobinhood(\n            owner,\n            vm.addr(refereeKey),\n            makeAddr(\"treasury\"),\n            FEE,\n            HamRobinhood.GameConfig({\n                mazeSize: 12,\n                cellSize: 7,\n                sentries: 8,\n                sentryHealth: 60,\n                sentryDamage: 20,\n                playerHealth: 100,\n                magSize: 30,\n                loops: 0\n            })\n        );\n        pu = new HamPowerUps(owner);\n        vm.startPrank(owner);\n        pu.addKind(\"Marker\", \"Common\", 10_000);\n        pu.lock();\n        pu.setGame(address(game), true);\n        game.setPowerUp(address(pu));\n        vm.stopPrank();\n        vm.deal(alice, 10 ether);\n        vm.prank(alice);\n        pu.buy{value: 0.01 ether}(1);\n        vm.roll(block.number + 1);\n        vm.prank(alice);\n        pu.open(1); // equips gun #1\n    }\n\n    function _playRun(uint32 kills) internal returns (bool ok) {\n        uint256 day = game.currentDay();\n        uint32 attempt = game.attempts(day, alice);\n        HamRobinhood.RunResult memory r = HamRobinhood.RunResult({\n            points: 5000, timeMs: 90_000, kills: kills, completed: true, attempt: attempt, boostBps: 0\n        });\n        bytes32 h = keccak256(\n            abi.encodePacked(\n                \"\\x19Ethereum Signed Message:\\n32\", game.runDigest(day, alice, attempt, 5000, 90_000, kills, true, 0)\n            )\n        );\n        (uint8 v, bytes32 rr, bytes32 s) = vm.sign(refereeKey, h);\n        vm.prank(alice);\n        try game.playRun{value: FEE}(r, abi.encodePacked(rr, s, v), address(0)) {\n            ok = true;\n        } catch {}\n    }\n\n    function test_everyAcceptedRunCountsOnTheEquippedGun() public {\n        uint256 accepted;\n        if (_playRun(type(uint32).max)) accepted++; // either refused, or counted without poisoning the gun\n        if (_playRun(2)) accepted++;\n        (uint32 runs,) = pu.stats(1);\n        assertEq(runs, accepted, \"a run the game accepted was not counted on the equipped gun\");\n    }\n}","reproduction":"Alice's equipped gun is token 1. She submits a referee-signed run with kills = 4294967295: stats(1) = (runs 1, kills 4294967295). She then plays a normal run with kills = 2. Expected: runs = 2. Actual: stats(1) is still (1, 4294967295); recordRun reverted inside the try/catch, while HAM Points for both runs were minted.","severity":"low","snippet":"        s.kills += kills;","title":"A signed run's kills are not capped: one run with kills = 2^32-1 freezes the equipped gun's counters for good"},{"citation":"resolved","description":"claimFinalize marks the Score claimed and pays, but leaves prizeOf[tokenId] at the paid amount; sweep, the other way a prize ends, sets it to 0. A paid Score is transferable again (isFrozen is false once claimed), so a seller can claim and then list a Score whose prizeOf() still shows the prize. A buyer or marketplace reading prizeOf alone sees money that is gone; claimIntent then reverts AlreadyClaimed. Fix: zero prizeOf in claimFinalize as sweep does (the PrizeClaimed event keeps the amount).","line":550,"path":"contracts/src/HamRobinhood.sol","reproduction":"Pot 10.01 ETH, alice's Score #1 wins first place: prizeOf(1) = 4.004 ETH. claimIntent(1), wait 10 minutes, claimFinalize(1) pays 4.004 ETH. Expected: prizeOf(1) = 0. Actual: prizeOf(1) = 4004000000000000000, claimed(1) = true, isFrozen(1) = false, so the token can be sold while still reading as a 4.004 ETH prize.","severity":"low","snippet":"        claimed[tokenId] = true;","title":"prizeOf keeps reading the full prize after claimFinalize has paid it and unfrozen the Score"}],"hash":"7e25e67856f31936d4c86f43f7fb69e4b73e0f4547a1a7ee097a08661234fa00","nodeId":"178c6d53-55b0-40f6-b3c6-fd2df3712d76","outcome":"completed","summary":"The review is written to `.imd-findings.json`: six findings, two medium and four low, none critical or high. Four carry a Foundry proof that fails on the code as it is and passes on a patched copy I kept outside the repository. No tracked file was changed.\n\n| # | Severity | Where | Finding |\n|---|---|---|---|\n| 1 | medium | `HamRobinhood.sol:856` | One Backer Pass handed from wallet to wallet gives every wallet's Score the holder bonus. With pass #3 moved alice → bob → carol, all three prizes got +10% and the treasury kept 0.3009 ETH of its 1.003 ETH share. |\n| 2 | medium | `HamPowerUps.sol:178` | A pack left shut for 256 blocks with no other buy or open falls back to the previous block's hash, which the holder knows before sending. They can open only in a block that gives the kind they want; a 1-in-100 kind came up on the 19th block tried. |\n| 3 | low | `HamRobinhood.sol:594` | `withdrawTreasury` zeroes the owed counters after sending. If the recipient calls `settle` while being paid, the share just added is erased; in the test 0.4014 ETH is left in the contract with nothing owing it. |\n| 4 | low | `HamRobinhood.sol:510` | Holder bonuses and referral rewards can ask for 10.85% to 14.7% of the pot from a 10% treasury share. With three holder winners and a crew referrer, third place got no bonus, second a reduced one, and the treasury 0. |\n| 5 | low | `HamPowerUps.sol:230` | A signed run's kills are uncapped. One run with kills = 2^32−1 makes every later `recordRun` for that gun overflow inside the game's try/catch, so its counters never move again. |\n| 6 | low | `HamRobinhood.sol:550` | `prizeOf` still reads the full prize after `claimFinalize` has paid it and unfrozen the Score, so a claimed Score can be sold while showing 4.004 ETH. |\n\nFindings 1, 2, 3 and 5 carry the proofs. Finding 4 has none because the fix needs a decision from you: scale the shares to fit, or state that lower places can lose them.\n\nFinding 2 is outside the three math guides (it is randomness); I included it after the assigned area was covered. Its 51-minute window rests on my recollection of Arbitrum's documented behaviour (in-contract `block.number` is the L1 block number), which I did not test on chain. I did confirm that Robinhood Chain's RPC returns Arbitrum-style blocks with an `l1BlockNumber` field.\n\nWhat I checked in the areas you named and found sound:\n- **HamBackerPass:** `airdrop` rejects duplicates and zero addresses, `lockMint` is permanent, and the Enumerable lists stayed consistent over 256 fuzzed runs of mixed `transferFrom` and `safeTransferFrom`.\n- **HamPowerUps:** only addresses with `isGame` set can call `recordRun`, and removing a game stops it.\n- **HamRobinhood:**\n  - Each signature is usable once, and is bound to chain, contract, day and player.\n  - The free run is one per pass per day.\n  - Settlement shares conserve the pot exactly.\n  - No gas limit made `playRun` succeed with the points mint or run record skipped.\n\nNot done: I did not run the project's own test suite. `forge fmt --check` was run only on my proof files, since the project has no fmt configuration. HamDailyRun, HamPowerUp and the two art contracts got a lighter pass (arithmetic lines and a render fuzz) than the three focus contracts.\n\nFinding paths are from the git root (`contracts/src/...`); the proofs import `src/...` and run from the Foundry project in `contracts/`. The scratch tests are removed; their source is in the findings file.","treeHash":null,"usage":{"cachedInputTokens":1628354,"chain":[{"calls":3,"chainId":4663,"failed":0,"own":3,"public":0,"refused":0}],"cost":{"source":"runtime","usdMicros":6281421},"inputTokens":27,"model":"claude-fable-5-2","outputTokens":79159,"runtime":"claude","turns":23,"wallClockMs":870940}},{"artifacts":[],"attempt":1,"bundleHash":null,"device":"7f1df2a55552de06","findings":[{"citation":"resolved","description":"Merged from audit_economics and audit_flow (same root cause). open() fixes only the random word keccak256(blockhash(boughtAt), tokenId); _draw then reduces it modulo (MAX_PACKS - opened) and walks the kinds by cap - minted. Both change every time any pack is opened, so the same sealed pack maps to a different gun in every deck state. From the block after the purchase the word is public, so the holder can eth_call open() (or check in a contract) and only open when the pack shows the kind they want; otherwise they open one of their other sealed packs (or wait for anyone else's open) to re-deal. This breaks the header's guarantee that 'a bot cannot re-roll by choosing when to open'. Caps are finite, so each rare steered to the attacker is removed from honest buyers' odds; the flow specialist measured 81 EPICs out of 100 packs with selective opening versus 22 in id order, same hashes. Fix (keeps caps and the deck model): make the deck state a pack is dealt against independent of the holder, e.g. resolve packs strictly in tokenId order via a permissionless cursor once each purchase hash exists, or assign each pack a deck position at purchase and resolve via a lazy Fisher-Yates keyed by the purchase-block hash.","line":197,"path":"contracts/src/HamPowerUps.sol","proof":"// SPDX-License-Identifier: MIT\npragma solidity 0.8.26;\n\nimport {Test} from \"forge-std/Test.sol\";\nimport {HamPowerUps} from \"src/HamPowerUps.sol\";\n\n/// A sealed pack's contents must be fixed once the hash of its purchase block exists: the contract\n/// says \"a bot cannot re-roll by choosing when to open\". Here alice's pack is priced against every\n/// deck state bob's opens produce; a fair draw gives the same gun in all of them.\ncontract PackDrawOrderTest is Test {\n    HamPowerUps pu;\n    address owner = makeAddr(\"owner\");\n    address alice = makeAddr(\"alice\");\n    address bob = makeAddr(\"bob\");\n\n    function setUp() public {\n        vm.warp(20_000 days + 3 hours);\n        vm.roll(1000);\n        pu = new HamPowerUps(owner);\n        vm.startPrank(owner);\n        pu.addKind(\"Marker\", \"COMMON\", 4000);\n        pu.addKind(\"Frost dart\", \"RARE\", 2000);\n        pu.addKind(\"Pulse\", \"RARE\", 2000);\n        pu.addKind(\"Blinker\", \"EPIC\", 1000);\n        pu.addKind(\"Snare\", \"EPIC\", 1000);\n        pu.lock();\n        vm.stopPrank();\n        vm.deal(alice, 100 ether);\n        vm.deal(bob, 100 ether);\n    }\n\n    /// What alice's pack #1 holds if she opens it now (state is rolled back afterwards).\n    function _peek() internal returns (uint256 kind) {\n        uint256 snap = vm.snapshotState();\n        kind = pu.kindOf(1);\n        if (kind == 0) {\n            vm.prank(alice);\n            kind = pu.open(1);\n        }\n        vm.revertToState(snap);\n    }\n\n    function test_sealedPackContentsDoNotDependOnWhenItIsOpened() public {\n        vm.prank(alice);\n        pu.buy{value: 1 ether}(1); // pack #1\n        vm.prank(bob);\n        pu.buy{value: 1 ether}(20); // packs #2..#21, same block\n        vm.roll(1001);\n        vm.setBlockhash(1000, keccak256(\"the purchase block\"));\n\n        uint256 first = _peek(); // the hash of block 1000 is known: the contents should be settled\n        for (uint256 id = 2; id <= 21; ++id) {\n            vm.prank(bob);\n            try pu.open(id) {} catch {} // other people opening their own packs\n            assertEq(_peek(), first, \"pack #1 holds a different gun after someone else opened a pack\");\n        }\n    }\n}","reproduction":"Lineup 4000/2000/2000/1000/1000, locked. Block 1000: alice buys pack #1, bob buys #2..#21; roll to 1001 with blockhash(1000) set. Simulated open(1) gives kind 1 (Marker). After bob opens one of his own packs, simulated open(1) gives kind 2. Expected: pack #1's contents fixed once blockhash(1000) exists. Actual: they change with every foreign open. Ran test/scratch/Proof_78dfad91592a.t.sol: FAIL 'pack #1 holds a different gun after someone else opened a pack: 1 != 2'. The flow specialist's 20-pack self-reordering proof also fails ('13 != 0' of 19 orderings change pack 1).","severity":"high","snippet":"        uint256 r = rnd % (MAX_PACKS - opened);","title":"HamPowerUps.open: a sealed pack's gun is re-dealt whenever any pack is opened, so its holder chooses the gun by choosing when (and in what order) to open"},{"citation":"resolved","description":"Merged from audit_math, audit_permissions, audit_economics, audit_flow. _keepSeal only stores blockhash(_lastBuyBlock) and only runs inside buy() and open(). If nobody calls either within 256 blocks after a purchase, blockhash(bought) and blockSeal[bought] are both 0 forever and open() falls back to the previous block's hash, which is public before the opening transaction is built and changes each block. The holder simulates open() per block and sends it only in a block that gives the kind they want; a failed attempt (someone touched the contract inside the window) costs nothing. Once lapsed, the pack stays re-rollable indefinitely. Fix: never deal from a hash known at call time; in the fallback re-commit (set boughtAt[tokenId] = block.number and require a second open in a later block), and/or add a public keepSeal() anyone can call.","line":178,"path":"contracts/src/HamPowerUps.sol","proof":"// SPDX-License-Identifier: MIT\npragma solidity 0.8.26;\n\nimport {Test} from \"forge-std/Test.sol\";\nimport {HamPowerUps} from \"src/HamPowerUps.sol\";\n\n/// A pack bought in block B, with no other buy or open on the contract for the next 256 blocks, has no\n/// stored hash for B. `open` then falls back to blockhash(block.number - 1), which the holder knows before\n/// sending: the same pack opens to a different kind depending on the block the holder picks.\ncontract LateOpenRerollTest is Test {\n    HamPowerUps pu;\n    address owner = makeAddr(\"owner\");\n    address mallory = makeAddr(\"mallory\");\n\n    function setUp() public {\n        vm.warp(20_000 days + 3 hours);\n        vm.roll(1000);\n        pu = new HamPowerUps(owner);\n        vm.startPrank(owner);\n        pu.addKind(\"Marker\", \"Common\", 5000);\n        pu.addKind(\"Snare\", \"Legendary\", 5000);\n        pu.lock();\n        vm.stopPrank();\n        vm.deal(mallory, 1 ether);\n    }\n\n    function test_holderCannotPickTheKindByPickingTheBlock() public {\n        vm.prank(mallory);\n        uint256 id = pu.buy{value: 0.01 ether}(1);\n        uint256 bought = block.number;\n\n        // nobody touches the contract; mallory looks at 40 later blocks and what the pack would be in each\n        uint256 first;\n        bool differs;\n        for (uint256 n = bought + 300; n < bought + 340; ++n) {\n            uint256 snap = vm.snapshotState();\n            vm.roll(n);\n            vm.setBlockhash(n - 1, keccak256(abi.encode(\"block\", n - 1)));\n            vm.prank(mallory);\n            try pu.open(id) returns (uint256 kind) {\n                if (kind != 0) {\n                    if (first == 0) first = kind;\n                    else if (kind != first) differs = true;\n                }\n            } catch {}\n            vm.revertToState(snap);\n        }\n        assertFalse(differs, \"the kind a pack opens to depends on the block its holder chooses\");\n    }\n}","reproduction":"Two kinds of 5000. Mallory buys pack #1 at block 1000; nobody buys or opens. For n = 1300..1339 with blockhash(n-1) = keccak256(abi.encode('block', n-1)), simulated open(1) returns kind 1 in some blocks and kind 2 in others. Expected: one kind regardless of the block. Actual: kind follows the block. Ran test/scratch/Proof_d68613aa4334.t.sol: FAIL 'the kind a pack opens to depends on the block its holder chooses'.","severity":"medium","snippet":"        if (h == 0) h = blockhash(block.number - 1);","title":"HamPowerUps.open: after 256 untouched blocks a pack is dealt from blockhash(block.number - 1), which the opener knows before sending"},{"citation":"resolved","description":"Merged from audit_math, audit_permissions, audit_economics, audit_flow. The free run is bound to the pass id (freeRunUsed[day][passId]), but _mintScore stamps holder = isHolder(player) (holderToken.balanceOf(player) > 0 at that moment) for every run, paid or free, and _settlePlace pays HOLDER_BONUS_BPS (10% of the place) from the treasury share for each top-3 holder-flagged Score. HamBackerPass is freely transferable (and safeTransferFrom calls onERC721Received, so a contract can borrow it for one transaction), so one pass flags any number of wallets per day: one pass can take 7% of the pot (4+2+1%) instead of at most 4%, with referral rewards then computed on the inflated amounts. Fix (keeps the perk following the holder): have the run name a passId with ownerOf(passId) == msg.sender and allow one holder-flagged run (or bonus) per pass per day, as playFreeRun does, or have the referee sign the holder flag. Note: boostBps is likewise only as strong as the referee's off-chain boostOf read at signing time if a booster token is transferable.","line":856,"path":"contracts/src/HamRobinhood.sol","proof":"// SPDX-License-Identifier: MIT\npragma solidity 0.8.26;\n\nimport {Test} from \"forge-std/Test.sol\";\nimport {HamRobinhood} from \"src/HamRobinhood.sol\";\nimport {HamBackerPass} from \"src/HamBackerPass.sol\";\n\n/// One Backer Pass is handed from wallet to wallet during a day. The free run is already one per pass per\n/// day; the holder bonus is not: every wallet the pass passes through gets a holder-flagged Score, and each\n/// top-3 one is paid +10% out of the treasury share.\ncontract HolderBonusPerPassTest is Test {\n    HamRobinhood game;\n    HamBackerPass pass;\n    uint256 refereeKey = 0xA11CE;\n    address owner = makeAddr(\"owner\");\n    address treasury = makeAddr(\"treasury\");\n    address alice = makeAddr(\"alice\");\n    address bob = makeAddr(\"bob\");\n    address carol = makeAddr(\"carol\");\n    uint256 constant FEE = 0.01 ether;\n\n    function setUp() public {\n        vm.warp(20_000 days + 3 hours);\n        game = new HamRobinhood(\n            owner,\n            vm.addr(refereeKey),\n            treasury,\n            FEE,\n            HamRobinhood.GameConfig({\n                mazeSize: 12,\n                cellSize: 7,\n                sentries: 8,\n                sentryHealth: 60,\n                sentryDamage: 20,\n                playerHealth: 100,\n                magSize: 30,\n                loops: 0\n            })\n        );\n        pass = new HamBackerPass(owner);\n        address[] memory to = new address[](1);\n        uint256[] memory ids = new uint256[](1);\n        to[0] = alice;\n        ids[0] = 3;\n        vm.startPrank(owner);\n        pass.airdrop(to, ids);\n        pass.lockMint();\n        game.setHolderToken(address(pass));\n        vm.stopPrank();\n        vm.deal(bob, 1 ether);\n        vm.deal(carol, 1 ether);\n        vm.deal(address(this), 100 ether);\n    }\n\n    function _signed(address p, uint32 points)\n        internal\n        view\n        returns (HamRobinhood.RunResult memory r, bytes memory sig)\n    {\n        uint256 day = game.currentDay();\n        r = HamRobinhood.RunResult({points: points, timeMs: 90_000, kills: 2, completed: true, attempt: 0, boostBps: 0});\n        bytes32 h = keccak256(\n            abi.encodePacked(\"\\x19Ethereum Signed Message:\\n32\", game.runDigest(day, p, 0, points, 90_000, 2, true, 0))\n        );\n        (uint8 v, bytes32 rr, bytes32 s) = vm.sign(refereeKey, h);\n        sig = abi.encodePacked(rr, s, v);\n    }\n\n    function test_onePassPaysOneHolderBonusADay() public {\n        uint256 day = game.currentDay();\n        game.fundPot{value: 10 ether}(day);\n\n        // alice uses pass #3's free run\n        (HamRobinhood.RunResult memory r, bytes memory sig) = _signed(alice, 9000);\n        vm.prank(alice);\n        uint256 a = game.playFreeRun(r, sig, address(0), 3);\n\n        // the same pass goes to bob, who pays for a run, then to carol, who pays for a run\n        vm.prank(alice);\n        pass.transferFrom(alice, bob, 3);\n        (r, sig) = _signed(bob, 8000);\n        vm.prank(bob);\n        uint256 b = game.playRun{value: FEE}(r, sig, address(0));\n\n        vm.prank(bob);\n        pass.transferFrom(bob, carol, 3);\n        (r, sig) = _signed(carol, 7000);\n        vm.prank(carol);\n        uint256 c = game.playRun{value: FEE}(r, sig, address(0));\n\n        (uint256 pot,,,,,,) = game.dayInfo(day);\n        vm.warp((day + 1) * 1 days + 16 minutes);\n        game.settle(day);\n\n        // there is one pass, so at most one prize may carry the holder bonus\n        uint256 bonuses;\n        if (game.prizeOf(a) > pot * 4000 / 10_000) bonuses++;\n        if (game.prizeOf(b) > pot * 2000 / 10_000) bonuses++;\n        if (game.prizeOf(c) > pot * 1000 / 10_000) bonuses++;\n        assertLe(bonuses, 1, \"one pass paid the holder bonus to more than one wallet's Score in a day\");\n    }\n}","reproduction":"HamBackerPass with one pass (#3, airdropped to alice, lockMint), set as holderToken; fee 0.01 ETH; pot funded with 10 ETH. alice plays pass #3's free run (9000 pts), transfers #3 to bob, bob plays a paid run (8000), transfers #3 to carol, carol plays a paid run (7000). settle(day). Expected: at most one prize carries the bonus. Actual: all three prizes exceed their base share by 10%. Ran test/scratch/Proof_e1ff03733fbd.t.sol: FAIL 'one pass paid the holder bonus to more than one wallet's Score in a day: 3 > 1'.","severity":"medium","snippet":"            holder: isHolder(player)","title":"HamRobinhood: the holder bonus is read from a momentary balanceOf, so one transferable Backer Pass gives the +10% bonus to every wallet it passes through in a day"},{"citation":"resolved","description":"From audit_flow. The per-pass fix was applied in HamRobinhood only. HamDailyRun (still in src and in script/Deploy.s.sol) checks isHolder(msg.sender) and a per-wallet flag, and its docs allow an ERC-721 or ERC-20 holder token. With any transferable holder token (HamBackerPass, an ERC-20) one token gives unlimited free entries per day, each competing for the pot paid by others; settle() also reads isHolder(p) at settle time (line 322), so the bonus goes to whoever holds the token then. Severity low because the intended Ethereum deployment uses the non-transferable FundingWorks pass; it becomes medium if configured with a transferable token. Fix: key the free run by token id (ownerOf(passId) == msg.sender, freeRunUsed[day][passId]) and record holder status at run time, or restrict setHolderToken to non-transferable tokens and document it.","line":265,"path":"contracts/src/HamDailyRun.sol","reproduction":"HamDailyRun with HamBackerPass (one pass #3 to alice) as holderToken. alice.enterFree; alice transfers #3 to bob; bob.enterFree; bob transfers to carol; carol.enterFree. Expected: 1 free entry. Actual: dayInfo.entries == 3. Ran test/scratch/Lows.t.sol::test_dailyRunFreePerWallet: FAIL 'one pass gave several free runs in a day: 3 > 1'.","severity":"low","snippet":"        if (freeRunUsed[day][msg.sender]) revert FreeRunUsed();","title":"HamDailyRun.enterFree: free run is still per wallet, so any transferable holder token gives a free entry to every wallet it visits"},{"citation":"resolved","description":"Merged from audit_math, audit_economics, audit_flow. withdrawTreasury caches treasuryOwed/backersOwed, sends with all gas, then assigns 0. settle() is not nonReentrant and adds to both counters, so if the treasury or backers recipient (documented as possibly a buyback vault or payout splitter) calls settle(day) for a due day while receiving, that day's shares are overwritten with 0. The ETH stays in the contract with no ledger entry and no function can ever release it. Only the recipients' own code can trigger it, hence low; the loss is permanent. Fix: subtract what was sent (treasuryOwed -= amount; backersOwed -= toBackers), or mark settle() nonReentrant.","line":590,"path":"contracts/src/HamRobinhood.sol","reproduction":"treasury (= backers) is a contract whose receive() calls settle(d2) once. Day d1: alice plays (0.01 ETH), d1 settled. Day d2: bob plays, pot 0.014 ETH, not settled. After d2+1 day+16 min, withdrawTreasury(). Expected: treasuryOwed + backersOwed = 20% of d2 pot = 0.0028 ETH. Actual: 0, d2 settled. Ran test/scratch/Lows.t.sol::test_withdrawErasesReentrantSettle: FAIL 'settled share erased: 0 != 2800000000000000'.","severity":"low","snippet":"        if (amount != 0 && _trySend(treasury, amount)) {\n            treasuryOwed = 0;","title":"HamRobinhood.withdrawTreasury zeroes the owed counters after the ETH call, erasing shares a re-entrant settle() adds; the ETH is stranded"},{"citation":"resolved","description":"From audit_math. Both the holder bonus and the referral reward are carved from treasuryShare (10% of the pot) and clamped with _min in place order. Three holder winners need 4%+2%+1% = 7% of the pot; their referrers then take 5% (10% with a crew) of the boosted prizes, another 3.85% (7.7%). Demand is 10.85%-14.7% against a 10% budget, so third (and partly second) place lose their promised bonus/reward depending only on rank order. Fix needs a decision: scale pro-rata when demand exceeds the share, or document that lower places can lose them.","line":510,"path":"contracts/src/HamRobinhood.sol","reproduction":"Traced in _settlePlace with pot P, three holder-flagged winners all referred by dave with crewSize >= CREW_SIZE: 1st: bonus 0.04P, reward 0.044P (remaining 0.016P); 2nd: bonus 0.016P (promised 0.02P), reward 0 ; 3rd: bonus 0 (promised 0.01P), reward 0; treasuryOwed += 0. Expected: each holder gets +10%. Actual: 2nd/3rd shortchanged.","severity":"low","snippet":"            uint256 bonus = _min(amount * HOLDER_BONUS_BPS / BPS, remainingTreasury);","title":"HamRobinhood: holder bonuses plus referral rewards can exceed the 10% treasury share; lower places are silently short-paid"},{"citation":"resolved","description":"From audit_math. HamRobinhood caps points and boostBps but passes r.kills (any uint32) to recordRun; s.kills += kills is checked, so once kills reach near 2^32-1 every later recordRun reverts and is swallowed by the try/catch in _notifyRun: runs and kills never move again and the NFT shows ~4.29B kills. Requires a referee-signed absurd kills value (the faulty/leaked-key case the points cap exists for). Fix: bound r.kills in _play (sentries <= 64) or saturate the add.","line":230,"path":"contracts/src/HamPowerUps.sol","reproduction":"Alice's equipped gun is token 1; she submits a signed run with kills = 4294967295, then a normal run with kills = 2. Expected: stats(1).runs == 2. Actual: 1. Ran test/scratch/Lows.t.sol::test_killsOverflowFreezesGun: FAIL 'second run not recorded: 1 != 2'.","severity":"low","snippet":"        s.kills += kills;","title":"HamPowerUps.recordRun: unbounded signed kills overflow the uint32 counter, after which the gun's stats freeze for good"},{"citation":"resolved","description":"Merged from audit_math, audit_economics, audit_flow. sweep() zeroes prizeOf, claimFinalize() does not; once claimed, isFrozen() is false again and pre-existing approvals/operator approvals survive. A seller can claimIntent, wait CLAIM_DELAY, claim, and have an older listing/bid fill against a Score whose prizeOf() still shows the prize, contradicting the header's 'no path to double-dip' for any buyer or marketplace reading prizeOf. Fix: set prizeOf[tokenId] = 0 in claimFinalize (the amount is in PrizeClaimed), and consider clearing _approved[tokenId] at claimIntent.","line":550,"path":"contracts/src/HamRobinhood.sol","reproduction":"alice is the only player (fee 0.01 ETH), settle: prizeOf(1) = 0.004 ETH. claimIntent(1), +10 min, claimFinalize(1) pays 0.004 ETH. Expected: prizeOf(1) == 0. Actual: 4000000000000000, with claimed == true and isFrozen == false. Ran test/scratch/Lows.t.sol::test_prizeOfAfterClaim: FAIL 'prizeOf still shows a paid prize: 4000000000000000 != 0'.","severity":"low","snippet":"        claimed[tokenId] = true;","title":"HamRobinhood.claimFinalize leaves prizeOf at the paid amount and approvals intact, so a paid, now-transferable Score still reads as a live prize"},{"citation":"resolved","description":"From audit_economics. claimFinalize only pays msg.sender (the owner) and reverts TransferFailed if refused; after claimIntent the token is frozen (transferFrom reverts TokenFrozen) and there is no way to cancel the intent or name a recipient. After CLAIM_WINDOW anyone sweeps the prize into the pot. Fix: claimFinalize(tokenId, to) letting the owner choose the recipient, or allow cancelling an intent.","line":553,"path":"contracts/src/HamRobinhood.sol","reproduction":"Traced: Score #1 with prize held by contract N without receive(). N.claimIntent(1); after CLAIM_DELAY N.claimFinalize(1) reverts TransferFailed (line 553 -> _send); N.transferFrom(N, alice, 1) reverts TokenFrozen (isFrozen true since claimed is false). After CLAIM_WINDOW, sweep(day, 1) moves the prize to the pot. Expected: owner can redirect payout. Actual: prize lost.","severity":"low","snippet":"        _send(holder, amount);","title":"HamRobinhood: once claimIntent is called, a Score held by a contract that cannot receive ETH can neither be paid nor moved, and the prize is swept"},{"citation":"resolved","description":"From audit_permissions. withdrawTreasury pays whatever address is current, and setBackers/setTreasury do not settle what is already owed, so the owner can redirect accrued backer payouts. Owner power by design; documented as a trust assumption. If backers should be protected, pay out backersOwed to the old address before switching.","line":755,"path":"contracts/src/HamRobinhood.sol","reproduction":"backersOwed == 1 ether; owner calls setBackers(ownerWallet); anyone calls withdrawTreasury(): 1 ether goes to ownerWallet.","severity":"info","snippet":"    function setBackers(address backers_) external onlyOwner {","title":"Trust assumption: setBackers / setTreasury redirect already-accrued backersOwed / treasuryOwed"}],"hash":"acd41d4798486473c22d6d56cdc56c616a183770e7f4fec10d88831866eca217","nodeId":"ba13b155-4bbe-42c7-85a8-e0a5f638000d","outcome":"completed","summary":"The review is finished. `.imd-findings.json` at the repository root holds 10 findings: 1 high, 2 medium, 6 low and 1 info. I merged the specialists' 23 reports into these 10, and changed no source files.\n\nI checked every finding against the code. The four proofs the specialists attached all fail on the current code for the reasons their findings give. For four of the findings that had no proof I wrote my own Foundry tests, and each failed as described. Three findings were confirmed by tracing the code rather than by a test; they are marked below.\n\n| Severity | Finding | Where | How it was checked |\n|---|---|---|---|\n| High | A sealed Power-Up pack's gun is drawn against the live deck count, which changes every time anyone opens a pack. The holder can check what the pack would give before sending, and open it only when it shows the gun they want. This breaks the contract's promise that \"a bot cannot re-roll by choosing when to open\". Two specialists reported this. | `HamPowerUps.sol:197` | Proof fails: the same pack gives kind 1, then kind 2 after someone else opens a pack. The other specialist's proof also fails: in 13 of 19 opening orders, pack 1 changes. |\n| Medium | If nobody buys or opens a pack for 256 blocks after a purchase, the draw falls back to the previous block's hash. The opener knows that hash before sending, so they can pick the block that gives the gun they want. Four specialists reported this. | `HamPowerUps.sol:178` | Proof fails: the result changes with the block it is opened in. |\n| Medium | The holder bonus is decided by the player's pass balance at the moment of the run, not by pass id. One transferable Backer Pass therefore gives the +10% bonus to every wallet it passes through in a day. The free run is already limited to one per pass per day; the bonus is not. Four specialists reported this. | `HamRobinhood.sol:856` | Proof fails: one pass, 3 bonuses paid. |\n| Low | In `HamDailyRun`, `enterFree` still allows one free run per wallet. A transferable holder token therefore gives a free run to every wallet it visits. | `HamDailyRun.sol:265` | My test: 3 free entries from one pass. |\n| Low | `withdrawTreasury` sets the owed amounts to 0 after sending. If a recipient calls `settle()` while receiving, that day's new shares are wiped and the ETH is stuck in the contract for good. Three specialists reported this. | `HamRobinhood.sol:590` | My test: 0.0028 ETH stranded. |\n| Low | `claimFinalize` leaves `prizeOf` at the paid amount, and the Score can be transferred again. A paid-out Score still looks like a winning one to a buyer. Three specialists reported this. | `HamRobinhood.sol:550` | My test: `prizeOf` still reads 0.004 ETH after payout. |\n| Low | A signed run with a huge kill count overflows the gun's kill counter, and the gun's stats never update again. This needs a faulty or leaked referee key. | `HamPowerUps.sol:230` | My test: the second run is not recorded. |\n| Low | When all three winners hold passes and have referrers, the holder bonuses plus referral rewards come to 10.85–14.7% of the pot. They are all paid out of the 10% treasury share, so second and third place get less than promised. | `HamRobinhood.sol:510` | Traced through the code, not tested. |\n| Low | Once `claimIntent` is called, a Score held by a contract that can't receive ETH can neither be paid nor transferred. Its prize is later swept into the pot. | `HamRobinhood.sol:553` | Traced through the code, not tested. |\n| Info | The owner can redirect treasury and backer amounts already owed by calling `setTreasury` or `setBackers` before anyone withdraws. This is intended owner power, recorded as a trust assumption. | `HamRobinhood.sol:755` | Traced through the code, not tested. |\n\nThe high and both mediums carry the specialists' passing proofs. Every finding includes a description of how to reproduce it.\n\n**Dropped or changed:**\n- **Sybil practice runs:** dropped. Playing the maze for free on a second wallet is a design limit the contract c","treeHash":null,"usage":{"cachedInputTokens":1137455,"cost":{"source":"runtime","usdMicros":1196313},"inputTokens":32,"model":"claude-opus-5-5","outputTokens":14681,"runtime":"claude","turns":18,"wallClockMs":174905}},{"artifacts":[],"attempt":1,"bundleHash":null,"device":"93c37f17670e4d98","findings":[{"citation":"resolved","description":"HamBackerPass is now the holder NFT and is freely transferable. playFreeRun was fixed to bind the free run to the pass id (freeRunUsed[day][passId]) and boosts were moved into the referee's signature so a token borrowed for one transaction cannot boost a run. The holder flag that decides the 10% holder bonus at settle (_settlePlace, line 509-513) was left as a live balanceOf read in _mintScore (isHolder(player), line 856). Nothing ties that flag to a pass id or to the referee's signature, so a single pass tags an unbounded number of runs as holder runs: the holder plays, transfers the pass to a friend who plays, and so on, or a contract borrows the pass inside onERC721Received (HamBackerPass.safeTransferFrom calls the receiver after the transfer), calls playRun while it holds it and hands it back in the same transaction. Each tagged run that lands in the top 3 takes 10% of its place out of the treasury share (line 510). With one pass shared by the three winners the treasury share drops from 10% to 3% of the pot instead of 6% for one legitimate holder, and whoever runs a lending or rental contract for passes can sell the bonus to every player for a fee. The asymmetry is with the free run: one perk of the same pass is 'one per pass per day', the other is 'one per wallet that touched it'. Fix (keeps the design that perks follow the holder): record the holder bonus per pass per day, e.g. have playRun take the passId like playFreeRun does and mark holderBonusUsed[day][passId] (or reuse freeRunUsed), or let the referee sign the holder flag next to boostBps so a pass must be held when the run is played rather than when the transaction is sent.","line":856,"path":"contracts/src/HamRobinhood.sol","proof":"// SPDX-License-Identifier: MIT\npragma solidity 0.8.26;\n\nimport {Test} from \"forge-std/Test.sol\";\nimport {HamRobinhood} from \"src/HamRobinhood.sol\";\nimport {HamBackerPass} from \"src/HamBackerPass.sol\";\n\n/// One HamBackerPass is handed from wallet to wallet during a single day. Every wallet that holds it\n/// for the moment it calls playRun gets `holder = true` on its Score, so a single pass hands out the\n/// 10% holder bonus to three different top-3 places and carves 7% of the pot out of the treasury share\n/// instead of at most 4% (one place). The free run is bound to the pass id (freeRunUsed[day][passId]);\n/// the holder bonus is not.\ncontract HolderBonusPerPassTest is Test {\n    HamRobinhood game;\n    HamBackerPass pass;\n    uint256 refereeKey = 0xA11CE;\n    address owner = makeAddr(\"owner\");\n    address treasury = makeAddr(\"treasury\");\n    address alice = makeAddr(\"alice\");\n    address bob = makeAddr(\"bob\");\n    address carol = makeAddr(\"carol\");\n    uint256 constant FEE = 0.01 ether;\n\n    function setUp() public {\n        vm.warp(20_000 days + 3 hours);\n        game = new HamRobinhood(\n            owner, vm.addr(refereeKey), treasury, FEE,\n            HamRobinhood.GameConfig({mazeSize: 12, cellSize: 7, sentries: 8, sentryHealth: 60, sentryDamage: 20, playerHealth: 100, magSize: 30, loops: 0})\n        );\n        pass = new HamBackerPass(owner);\n        address[] memory to = new address[](1);\n        uint256[] memory ids = new uint256[](1);\n        to[0] = alice;\n        ids[0] = 7;\n        vm.startPrank(owner);\n        pass.airdrop(to, ids);\n        pass.lockMint();\n        game.setHolderToken(address(pass));\n        vm.stopPrank();\n        vm.deal(alice, 1 ether);\n        vm.deal(bob, 1 ether);\n        vm.deal(carol, 1 ether);\n    }\n\n    function play(address p, uint32 points) internal returns (uint256 id) {\n        uint256 day = game.currentDay();\n        HamRobinhood.RunResult memory r =\n            HamRobinhood.RunResult({points: points, timeMs: 90_000, kills: 2, completed: true, attempt: 0, boostBps: 0});\n        bytes32 h = keccak256(\n            abi.encodePacked(\"\\x19Ethereum Signed Message:\\n32\", game.runDigest(day, p, 0, points, 90_000, 2, true, 0))\n        );\n        (uint8 v, bytes32 rr, bytes32 s) = vm.sign(refereeKey, h);\n        vm.prank(p);\n        id = game.playRun{value: FEE}(r, abi.encodePacked(rr, s, v), address(0));\n    }\n\n    function test_onePassGivesAtMostOneHolderBonusPerDay() public {\n        uint256 day = game.currentDay();\n\n        uint256 a = play(alice, 9000); // alice holds pass #7 while she plays\n        vm.prank(alice);\n        pass.transferFrom(alice, bob, 7);\n        uint256 b = play(bob, 8000); // now bob holds it\n        vm.prank(bob);\n        pass.transferFrom(bob, carol, 7);\n        uint256 c = play(carol, 7000); // now carol holds it\n\n        vm.warp((day + 1) * 1 days + 16 minutes);\n        game.settle(day);\n\n        uint256 pot = 3 * FEE;\n        uint256 shares = pot * 7000 / 10_000; // 40% + 20% + 10%\n        uint256 oneBonus = (pot * 4000 / 10_000) * 1000 / 10_000; // 10% of the biggest place: what one pass is worth at most\n        uint256 paid = game.prizeOf(a) + game.prizeOf(b) + game.prizeOf(c);\n\n        // expected: a single pass earns the holder bonus on at most one run that day\n        // actual: all three Scores are flagged holder, 7% of the pot leaves the treasury share instead of at most 4%\n        assertLe(paid, shares + oneBonus, \"one pass handed the holder bonus to three wallets\");\n        assertGe(game.treasuryOwed(), pot * 1000 / 10_000 - oneBonus, \"treasury share carved three times by one pass\");\n    }\n}","reproduction":"Deploy HamRobinhood with entryFee 0.01 ether, HamBackerPass airdropped pass #7 to alice, game.setHolderToken(pass). Same day: alice calls playRun (9000 points) while holding #7; alice transferFrom(alice, bob, 7); bob calls playRun (8000); bob transferFrom(bob, carol, 7); carol calls playRun (7000). Warp past the day and settle(day). Expected: pot 0.03 ETH, prizes 40/20/10% = 0.021 ETH plus at most one holder bonus of 10% of one place (0.0012 ETH) = 0.0222 ETH, treasuryOwed >= 0.0018 ETH. Actual: scores(a).holder, scores(b).holder and scores(c).holder are all true, prizeOf sums to 0.0231 ETH (0.0132 + 0.0066 + 0.0033) and treasuryOwed is 0.0009 ETH: three holder bonuses came from one pass. Test: contracts/test/scratch/HolderBonusPerPass.t.sol, failing with '23100000000000000 > 22200000000000000'.","severity":"medium","snippet":"            holder: isHolder(player)","title":"Holder bonus is read from a momentary balance, so one transferable Backer Pass hands the bonus to every wallet it passes through in a day (free run is bound to the pass id, the bonus is not)"},{"citation":"resolved","description":"A pack's kind is drawn from the hash of the block it was bought in. That hash is only kept (blockSeal) when some buy or open happens in the next 256 blocks, because _keepSeal only ever seals _lastBuyBlock. When nothing touches the contract for 256 blocks after a purchase, open() falls back to blockhash(block.number - 1) (line 178). The previous block's hash is public before the opener's transaction is sent, so the holder of an unsealed pack can compute _draw(keccak256(h, tokenId)) off-chain for every new block and send open() only in a block whose draw lands in the rarest kind. This is exactly the re-roll the header comment says a bot cannot do ('a bot cannot re-roll by choosing when to open'), and it is cheap: on Robinhood Chain block.number is the L1 block number, so the window is about 256 L1 blocks (~51 minutes) of nobody buying or opening, which a $1 base-price mint will see outside peak hours, and the attacker can buy up to 20 packs right before a quiet stretch. Victims are every other buyer: rare kinds are capped (cap per kind), so each re-rolled rare pull removes one from the deck for honest openers, and the attacker's packs are worth more than they paid. The fallback also lets the holder refuse any unlucky result forever (just never open). Fix: do not draw from a hash the opener chooses. Either revert in open() when the seal is missing and let anyone (or the owner) call a public seal() that stores blockhash(_lastBuyBlock) while it is still available, so the fallback is never needed, or seal every purchase block eagerly (store blockhash(block.number - 1) chained into the seal at buy time and require the next-block hash) rather than only _lastBuyBlock; at minimum, bind the fallback to a hash fixed before the opener could act, such as the seal of the first later block that touched the contract.","line":178,"path":"contracts/src/HamPowerUps.sol","proof":"// SPDX-License-Identifier: MIT\npragma solidity 0.8.26;\n\nimport {Test} from \"forge-std/Test.sol\";\nimport {HamPowerUps} from \"src/HamPowerUps.sol\";\n\n/// A pack bought in block B whose hash was never sealed (nobody bought or opened for 256 blocks) is drawn\n/// from blockhash(block.number - 1) when it is finally opened. That hash is known before the opener sends\n/// the transaction, so the opener can compute the draw for each block and open only in a block that gives\n/// the rarest kind: a re-roll the contract's own comment says a bot cannot do.\ncontract OpenRerollTest is Test {\n    HamPowerUps pu;\n    address owner = makeAddr(\"owner\");\n    address alice = makeAddr(\"alice\");\n\n    function setUp() public {\n        pu = new HamPowerUps(owner);\n        vm.startPrank(owner);\n        pu.addKind(\"Marker\", \"legendary\", 100);\n        pu.addKind(\"Pulse\", \"epic\", 400);\n        pu.addKind(\"Blinker\", \"rare\", 1500);\n        pu.addKind(\"Snare\", \"uncommon\", 3000);\n        pu.addKind(\"Zap\", \"common\", 5000);\n        pu.lock();\n        vm.stopPrank();\n        vm.deal(alice, 1 ether);\n        vm.warp(20_000 days + 3 hours);\n        vm.roll(1_000);\n    }\n\n    function test_openerCannotChooseTheDrawByChoosingTheBlock() public {\n        (uint256 cost,) = pu.quote(1);\n        vm.prank(alice);\n        uint256 id = pu.buy{value: cost}(1);\n        uint256 bought = block.number;\n\n        // nobody touches the contract for more than 256 blocks: the purchase block's hash is gone and unsealed\n        vm.roll(bought + 300);\n        assertEq(blockhash(bought), bytes32(0));\n        assertEq(pu.blockSeal(bought), bytes32(0));\n\n        // the holder tries the next 24 blocks: the kind inside the sealed pack must be the same whichever\n        // block they open it in. Expected: one kind. Actual: it changes with blockhash(block.number - 1).\n        uint256 snap = vm.snapshotState();\n        vm.prank(alice);\n        uint256 first = pu.open(id);\n        vm.revertToState(snap);\n        for (uint256 i = 1; i <= 24; ++i) {\n            vm.roll(bought + 300 + i);\n            snap = vm.snapshotState();\n            vm.prank(alice);\n            uint256 kind = pu.open(id);\n            vm.revertToState(snap);\n            assertEq(kind, first, \"the opener re-rolled the pack by picking the block\");\n        }\n    }\n}","reproduction":"Deploy HamPowerUps, add 5 kinds with caps 100/400/1500/3000/5000, lock(). At block 1000 alice buys 1 pack (tokenId 1) for quote(1). Nobody calls buy or open until block 1300: blockhash(1000) is 0 and blockSeal(1000) is 0. alice simulates open(1) at blocks 1300, 1301, ... (snapshot and revert between them). Expected: the kind inside pack 1 is fixed at purchase and is the same in every block. Actual: open(1) returns 5 at block 1300 and 4 at block 1301 (and so on, changing with blockhash(block.number - 1)), so alice sends the transaction only in a block whose simulated result is kind 1 (legendary, 1% of the deck). Test: contracts/test/scratch/OpenReroll.t.sol, failing with '5 != 4'.","severity":"medium","snippet":"        if (h == 0) h = blockhash(block.number - 1);","title":"HamPowerUps.open falls back to blockhash(block.number - 1), which the opener knows before sending: an unsealed pack can be re-rolled by choosing the block to open it in"},{"citation":"resolved","description":"The airdrop mirrors FundingWorks pass holders from Ethereum by address. Backers who minted the Ethereum pass from a Gnosis Safe or another contract wallet have an address that on Robinhood Chain has no code and no key: nobody can sign from it there, and a Safe deployed at the same address on the new chain is only possible for Safes created through a deterministic factory with the same salt and factory bytecode. airdrop (line 71) does a raw mint with no onERC721Received call and no check, each id can only be minted once (line 76), and after lockMint (line 85) nothing can ever create or move a pass that nobody controls. The owner has no way to reassign a never-moved pass to a holder's EOA. Result: the backer loses the free daily run and the holder bonus permanently, which contradicts 'every holder of the FundingWorks backer pass gets this one free' in the contract header. Fix: before lockMint, let the owner re-issue an airdropped pass that has never been transferred (track a per-id 'airdropped, not yet moved' flag and allow owner to move it once), or take the recipient list from a signed claim by each backer rather than copying Ethereum addresses blindly; at minimum document the operational check in the airdrop script.","line":71,"path":"contracts/src/HamBackerPass.sol","reproduction":"Owner calls airdrop([0xSafe], [3]) where 0xSafe is a Safe address on Ethereum with code.length == 0 on Robinhood Chain, then lockMint(). State: ownerOf(3) == 0xSafe, mintLocked == true. Expected: the backer can use pass #3 on Robinhood Chain. Actual: no transaction can ever be sent from 0xSafe on this chain, transferFrom(0xSafe, eoa, 3) reverts NotAuthorized for every other caller, airdrop reverts Locked and AlreadyMinted, so pass #3 (and its free run and holder bonus) is unrecoverable.","severity":"low","snippet":"    function airdrop(address[] calldata to, uint256[] calldata ids) external onlyOwner {","title":"airdrop has no recovery path: a pass sent to an Ethereum-only contract wallet (a Safe) is stuck forever once lockMint is called"},{"citation":"resolved","description":"The backers' 10% of each pot is promised to FundingWorks pass holders and accrues into backersOwed at settle (line 477). withdrawTreasury sends the whole accrued amount to the current `backers` address (line 594) and the treasury share to the current `treasury` (line 590). setBackers (line 757) and setTreasury (line 750) change the destination without first settling what is already owed to the previous recipient, so the owner can at any time point `backers` at their own wallet and collect every backer payout that has accrued since the last withdrawal. This is an owner power by design, so it is documented here as a trust assumption rather than a defect; the unprivileged side is that anyone can call withdrawTreasury, so no accrued amount is ever left to redirect if the backers' splitter is pushed promptly. If the requester wants backers protected from the owner, make setBackers pay out the accrued backersOwed to the old address before switching (or block changes while backersOwed != 0), and consider making `backers` immutable after backersEndDay is set.","line":757,"path":"contracts/src/HamRobinhood.sol","reproduction":"State: backersOwed == 1 ether after several settles, nobody has called withdrawTreasury. Owner calls setBackers(ownerWallet), then anyone calls withdrawTreasury(). Expected by the backers: 1 ether to the FundingWorks splitter. Actual: 1 ether is sent to ownerWallet and backersOwed is set to 0.","severity":"info","snippet":"        backers = backers_;","title":"Trust assumption: setBackers and setTreasury redirect already-accrued backersOwed and treasuryOwed, since withdrawTreasury pays whatever address is current"}],"hash":"b620dc53548a1122e44d902c7e7d4914f8769f08567be2350326b0a681fb7e72","nodeId":"f4da19f4-b2ec-47d6-9080-fc29ab0a132e","outcome":"completed","summary":"The review is complete. Nothing tracked was modified; only the findings file and two scratch tests were written.\n\n**Outcome: 4 findings, none critical or high.** The fixes from the last audit hold up in the assigned permission area. The two issues of substance sit next to those fixes.\n\n**What I verified as sound**\n- HamBackerPass: airdrop and lockMint are owner-only and permanent, each id mints once, the Enumerable swap-and-pop bookkeeping is correct on transfer and self-transfer, and safeTransferFrom calls the receiver only after state is settled.\n- HamPowerUps: recordRun checks the caller against the allowed-games map, and setGame is owner-only. Only allowed games can record runs.\n- HamRobinhood: the referee digest carries chain id, contract, day, player and attempt. A signature is consumed by the attempt counter, so neither entry point can replay it. Booster count and bps are bounded, boosts are referee-signed, pot shares conserve to the pot, and the free run is bound to the pass id.\n\n**Findings, ranked**\n- **Medium, HamRobinhood.sol:856.** The holder flag is a live balance read at play time, not bound to a pass id or the referee's signature. One transferable Backer Pass handed between wallets, or flash-borrowed inside onERC721Received, tags every run as a holder run. Three winners sharing one pass take 7% of the pot from the treasury share instead of at most 4%. Proof test fails on the current code with 0.0231 ETH paid against a 0.0222 ETH ceiling.\n- **Medium, HamPowerUps.sol:178.** When no buy or open happens for 256 blocks after a purchase, open falls back to the previous block hash, which the opener knows before sending. They can simulate each block and open only when the draw lands on the rarest kind. Proof test shows the same pack yielding kind 5 at one block and kind 4 at the next.\n- **Low, HamBackerPass.sol:71.** The airdrop copies Ethereum addresses with no recovery path. A backer who minted from a Safe gets a pass at an address nobody controls on Robinhood Chain, and after lockMint it is lost.\n- **Info, HamRobinhood.sol:757.** Trust assumption: setBackers and setTreasury redirect already-accrued owed amounts because withdrawTreasury pays the current address. Owner power by design, documented not flagged.\n\n**Coverage notes.** All eight files in contracts/src were read, with Access Control, Trust Gap and Asymmetry passes applied in depth to the three named contracts. The pack re-roll finding is outside the permission area and was added after that coverage. Tests do not exercise the holder bonus with a transferred pass, nor the unsealed-pack fallback with a varying block. Slither and fuzzing did not run.","treeHash":null,"usage":{"cachedInputTokens":905100,"cost":{"source":"runtime","usdMicros":4042776},"inputTokens":322,"model":"claude-fable-5-1","outputTokens":32485,"runtime":"claude","turns":21,"wallClockMs":547831}},{"artifacts":[],"attempt":1,"bundleHash":null,"device":"827152cce766ca0d","findings":[{"citation":"resolved","description":"open() fixes only the random word of a pack (keccak(blockhash(boughtAt), tokenId)); the gun is then dealt by _draw against live state: `rnd % (MAX_PACKS - opened)` walked over each kind's `cap - minted`. Both change every time any pack is opened, and a new modulus gives an unrelated remainder, so every sealed pack is re-dealt each time `opened` moves. From the block after the purchase the holder knows the block hash and can compute, off chain or in a contract, exactly what each of their sealed packs would become in the current state (`opened`, `kinds()` are public), then open a pack only when it shows the gun they want and otherwise open a different pack (or wait for anybody else's open) to re-deal the rest. The contract's own statement, \"a buyer cannot pick a good pack and a bot cannot re-roll by choosing when to open\", does not hold. The deck is finite (caps add to 10,000), so every EPIC a bot steers to itself is one fewer for honest buyers who pay the same price. No special rights, capital or timing luck are needed: one buy of up to 20 packs gives 20 packs that each re-roll 19 times just from the holder's own opens. Fixing it needs the state a pack is dealt against to be fixed by purchase order rather than chosen by the holder, for example dealing packs strictly in tokenId order (a cursor that resolves pack N before pack N+1, callable by anyone once the block hash exists, with open() only revealing) so that neither the modulus nor the remaining counts a pack sees can be moved by its holder.","line":197,"path":"contracts/src/HamPowerUps.sol","proof":"// SPDX-License-Identifier: MIT\npragma solidity 0.8.26;\n\nimport {Test} from \"forge-std/Test.sol\";\nimport {HamPowerUps} from \"src/HamPowerUps.sol\";\n\n/// A pack's kind must be fixed by its purchase, not by what its holder opens first.\ncontract PackOrderTest is Test {\n    HamPowerUps pu;\n    address owner = makeAddr(\"owner\");\n    address mallory = makeAddr(\"mallory\");\n\n    function setUp() public {\n        vm.warp(20_000 days);\n        vm.roll(100);\n        pu = new HamPowerUps(owner);\n        vm.startPrank(owner);\n        pu.addKind(\"Marker\", \"COMMON\", 4000);\n        pu.addKind(\"Frost dart\", \"RARE\", 2000);\n        pu.addKind(\"Pulse\", \"RARE\", 2000);\n        pu.addKind(\"Blinker\", \"EPIC\", 1000);\n        pu.addKind(\"Snare\", \"EPIC\", 1000);\n        pu.lock();\n        vm.stopPrank();\n        vm.deal(mallory, 100 ether);\n    }\n\n    function _tryOpen(uint256 id) internal {\n        vm.prank(mallory);\n        try pu.open(id) {} catch {}\n    }\n\n    function test_packKindDoesNotDependOnWhatTheHolderOpensFirst() public {\n        (uint256 cost,) = pu.quote(20);\n        vm.prank(mallory);\n        pu.buy{value: cost}(20); // packs 1..20, all bought in block 100\n        vm.roll(101);\n        vm.setBlockhash(100, keccak256(\"block 100\"));\n\n        // pack 1 opened straight away\n        uint256 snap = vm.snapshotState();\n        _tryOpen(1);\n        uint256 honest = pu.kindOf(1);\n        vm.revertToState(snap);\n\n        // pack 1 opened after the holder's packs 2..k, same block, same block hash\n        uint256 changed;\n        for (uint256 k = 2; k <= 20; ++k) {\n            snap = vm.snapshotState();\n            for (uint256 other = 2; other <= k; ++other) _tryOpen(other);\n            _tryOpen(1);\n            uint256 steered = pu.kindOf(1);\n            vm.revertToState(snap);\n            emit log_named_uint(string.concat(\"pack 1 after opening packs 2..\", vm.toString(k)), steered);\n            if (steered != honest) ++changed;\n        }\n        emit log_named_uint(\"pack 1 opened first\", honest);\n        assertEq(changed, 0, \"the holder changed what pack 1 holds by opening other packs first\");\n    }\n}","reproduction":"Lineup as in the project's tests (Marker 4000, Frost dart 2000, Pulse 2000, Blinker 1000, Snare 1000), locked. Mallory buys 20 packs (ids 1..20) in block 100; block hash of 100 = keccak256(\"block 100\"). In block 101: open(1) with nothing else open gives kind 1 (Marker, COMMON: r = rnd % 10000 = 276). Instead opening packs 2..5 first and then pack 1 gives kind 5 (Snare, EPIC); opening 2..3 first gives kind 3; 2..10 first gives kind 2. Expected: pack 1 holds the same gun whatever its holder opens first. Actual: 13 of the 19 orderings tried change it, and the holder can see each result before sending the transaction. Scale: over five such 20-pack buys (different block hashes), opening the packs in id order gave 22 EPICs out of 100, the expected share; an opener that before each open looks at what every sealed pack would currently become, opens one that shows an EPIC and otherwise opens any other pack to re-deal the rest, got 81 EPICs out of 100 from the same packs and the same block hashes. Run (from contracts/): forge test --match-path test/scratch/PackOrder.t.sol -vv -> FAIL \"the holder changed what pack 1 holds by opening other packs first: 13 != 0\".","severity":"high","snippet":"        uint256 r = rnd % (MAX_PACKS - opened);","title":"HamPowerUps.open: a pack's gun depends on how many packs are open when it is opened, so a holder re-rolls sealed packs at will"},{"citation":"resolved","description":"The free run was bound to the pass (freeRunUsed[day][passId]) so that moving one pass between wallets gives one free run a day. The holder bonus was not: every run, paid or free, records `holder = isHolder(player)`, which is `holderToken.balanceOf(player) > 0` at the moment of the call, and settle() adds HOLDER_BONUS_BPS (10% of the place's prize, taken out of the treasury share) for every top-3 score with that flag. With HamBackerPass as the holder NFT the pass moves with a plain transferFrom, so one pass marks any number of wallets as holders on the same day: play, transfer, play, transfer, play. The transfer can also be a loan inside one transaction (a contract player borrows the pass, calls playRun, returns it), so a single pass can be rented to every likely winner. The treasury's 10% of the pot is what pays: one pass can take 7% of the pot (4% + 2% + 1%) out of it every day instead of at most 4%. The same pattern applies to the signed booster bonus: `r.boostBps` is only range-checked in _play (<= MAX_BOOST_BPS) and the referee reads boostOf(player) when it signs, so one booster balance moved from wallet to wallet between signings boosts every one of those wallets' runs. Fix, keeping the perk transferable: bind the bonus to the pass as the free run is, e.g. have the run name the pass it claims holder status with (ownerOf(passId) == msg.sender) and allow one holder-flagged run per pass per day (or one holder bonus per pass per settled day).","line":856,"path":"contracts/src/HamRobinhood.sol","reproduction":"HamBackerPass with exactly one pass (#3, airdropped to w1, lockMint called) set as holderToken; entry fee 0.01 ETH; pot funded to 100 ETH in total. w1 plays a paid run (9000 points); w1 calls pass.transferFrom(w1, w2, 3); w2 plays a paid run (8000); w2 transfers the pass to w3; w3 plays a paid run (7000). After settle(day): prizeOf = 44 ETH, 22 ETH and 11 ETH (each base prize + 10%), treasuryOwed = 3 ETH. Expected with a single pass in existence: at most one holder bonus (44 / 20 / 10 ETH, treasuryOwed = 6 ETH). Actual: three holder bonuses, 7 ETH of the treasury's 10 ETH paid out on the strength of one pass. (Checked with a Foundry test using the real HamBackerPass and HamRobinhood: `assertGe(game.treasuryOwed(), 6 ether)` fails with 3 ether.)","severity":"medium","snippet":"            holder: isHolder(player)","title":"HamRobinhood: one transferable backer pass gives the holder bonus to every wallet it passes through in a day"},{"citation":"resolved","description":"The draw is meant to be bound to the hash of the block the pack was bought in. That hash is only kept if somebody buys or opens within the next 256 blocks: _keepSeal() saves `blockhash(_lastBuyBlock)` only while it is still readable, and it runs only inside buy() and open(). If nobody touches the contract for 256 blocks after a purchase, `blockhash(bought)` is 0, `blockSeal[bought]` is 0 and can never be filled later, and open() falls back to `blockhash(block.number - 1)`. That value is already known when the opening transaction is built and changes every block, so the pack's holder (a contract can check it in the same transaction, a wallet can simulate) simply waits for a block whose hash deals the gun they want. The comment calls this path \"rare, and costs the opener waiting\", but the opener is the one who benefits and can cause it deliberately: buy, then do nothing for 256 blocks during a quiet period (the daily price curve makes late-day purchases scarce); if someone else buys or opens in that window the attempt costs nothing, the pack is just an ordinary one. Once the window has passed the pack stays re-rollable forever. A fix that keeps the design: never deal from a hash the opener can see in advance. In the fallback, re-commit instead of dealing (set boughtAt[tokenId] = block.number, return, and require another open in a later block), and/or let anyone call a public keepSeal() so the seal can be stored without buying or opening.","line":178,"path":"contracts/src/HamPowerUps.sol","proof":"// SPDX-License-Identifier: MIT\npragma solidity 0.8.26;\n\nimport {Test} from \"forge-std/Test.sol\";\nimport {HamPowerUps} from \"src/HamPowerUps.sol\";\n\n/// A pack left shut for 256 quiet blocks must not be re-rolled by picking the block it is opened in.\ncontract PackStaleTest is Test {\n    HamPowerUps pu;\n    address owner = makeAddr(\"owner\");\n    address mallory = makeAddr(\"mallory\");\n\n    function setUp() public {\n        vm.warp(20_000 days);\n        vm.roll(100);\n        pu = new HamPowerUps(owner);\n        vm.startPrank(owner);\n        pu.addKind(\"Marker\", \"COMMON\", 4000);\n        pu.addKind(\"Frost dart\", \"RARE\", 2000);\n        pu.addKind(\"Pulse\", \"RARE\", 2000);\n        pu.addKind(\"Blinker\", \"EPIC\", 1000);\n        pu.addKind(\"Snare\", \"EPIC\", 1000);\n        pu.lock();\n        vm.stopPrank();\n        vm.deal(mallory, 100 ether);\n    }\n\n    function test_stalePackCannotBeRerolledByChoosingTheOpeningBlock() public {\n        (uint256 cost,) = pu.quote(1);\n        vm.prank(mallory);\n        uint256 id = pu.buy{value: cost}(1); // bought in block 100; nobody touches the contract afterwards\n\n        uint256 first;\n        uint256 distinct;\n        for (uint256 n = 400; n < 412; ++n) {\n            uint256 snap = vm.snapshotState();\n            vm.roll(n); // more than 256 blocks later: blockhash(100) is gone and no seal was kept\n            vm.setBlockhash(n - 1, keccak256(abi.encode(\"block\", n - 1)));\n            vm.prank(mallory);\n            try pu.open(id) {} catch {}\n            uint256 kind = pu.kindOf(id);\n            vm.revertToState(snap);\n            emit log_named_uint(string.concat(\"opened in block \", vm.toString(n)), kind);\n            if (n == 400) first = kind;\n            else if (kind != first) ++distinct;\n        }\n        assertEq(distinct, 0, \"the same pack holds a different gun depending on the block it is opened in\");\n    }\n}","reproduction":"Same lineup, locked. Mallory buys 1 pack in block 100; nobody buys or opens until block 400. Opening the same pack in block 400, 401, ... 411 (previous block's hash = keccak256(abi.encode(\"block\", n-1))) gives kinds 2,2,2,4,2,2,3,2,1,1,5,5: an EPIC (kind 4) by waiting three blocks. Expected: the gun inside a bought pack does not depend on the block it is opened in. Actual: 6 of the 11 later blocks give a different gun than block 400. Run (from contracts/): forge test --match-path test/scratch/PackStale.t.sol -vv -> FAIL \"the same pack holds a different gun depending on the block it is opened in: 6 != 0\".","severity":"medium","snippet":"        if (h == 0) h = blockhash(block.number - 1);","title":"HamPowerUps.open: after 256 quiet blocks a pack is dealt from the previous block's hash, so its holder picks the gun by picking the block"},{"citation":"resolved","description":"The previous audit's fix (free runs per holder NFT per day) was made in HamRobinhood only. HamDailyRun, which is still in contracts/src and still deployed by script/Deploy.s.sol, keeps the old rule: enterFree() asks only that the caller's holder-token balance is above zero and that this wallet has not used its free run today. Any holder token that can be transferred (HamBackerPass, HamPowerUp, any ERC-20) therefore gives one free entry per wallet it is moved through, without limit, and each free entry competes for the pot that paying players funded. Two sibling reads have the same weakness in this contract: settle() pays the holder bonus to whoever holds the token at the moment settle() is called (isHolder(p) at settle, so the token can be handed to a winner just for that call), and submitRun() reads boostOf(msg.sender) on chain at submission, so a booster borrowed for one transaction boosts the run. Fix as in HamRobinhood: key the free run by the holder NFT's id (ownerOf(passId) == msg.sender, freeRunUsed[day][passId]), record holder status with the run, and take the boost from the referee's signature; or state that HamDailyRun must only ever be configured with non-transferable holder and booster tokens and enforce nothing else changes.","line":264,"path":"contracts/src/HamDailyRun.sol","reproduction":"HamDailyRun with HamBackerPass as holderToken, a single pass #3 airdropped to w1, pot funded with 100 ETH. Same day: w1.enterFree(0) and submits 9000 points; w1 transfers pass #3 to w2; w2.enterFree(0) succeeds and submits 8000; w2 transfers it to w3; w3.enterFree(0) succeeds and submits 7000. Expected: the second and third enterFree revert (one free run per pass per day, as HamRobinhood.playFreeRun enforces). Actual: dayInfo(day).entries == 3, all free, all three ranked; after settle(day) w1 (the holder when playing) gets 40 ETH with no bonus while w3, who merely holds the pass when settle is called, gets 11 ETH (10 ETH + the holder bonus). Checked with a Foundry test against the real contracts.","severity":"medium","snippet":"        if (!isHolder(msg.sender)) revert NotHolder();\n        if (freeRunUsed[day][msg.sender]) revert FreeRunUsed();","title":"HamDailyRun.enterFree: the free run is still per wallet, so one transferable holder token (the new pass included) gives a free run to every wallet it visits"},{"citation":"resolved","description":"withdrawTreasury() reads `treasuryOwed` and `backersOwed` once, sends each amount with all gas, and afterwards writes `treasuryOwed = 0` / `backersOwed = 0`. It is nonReentrant, but settle() is not, and settle() is the function that adds to both counters. If settle(day) runs for a due day while a recipient is executing (the treasury is documented as possibly \"a buyback vault\", backers as \"a payout splitter\"; either can run code, or forward to backer addresses that run code, and settle is open to anyone), the shares it adds are overwritten by the zeroing that follows: the ETH stays in the contract, counted in no pot and owed to nobody, and there is no function that can ever release it. During the treasury leg both the new treasury share and the new backers share are lost (the backers leg then pays the stale amount and zeroes); during the backers leg the new backers share is lost. Fix without changing behaviour: subtract what was sent (`treasuryOwed -= amount`, `backersOwed -= toBackers`) or zero each counter before its send and restore it when the send fails; marking settle() nonReentrant also closes it.","line":590,"path":"contracts/src/HamRobinhood.sol","proof":"// SPDX-License-Identifier: MIT\npragma solidity 0.8.26;\n\nimport {Test} from \"forge-std/Test.sol\";\nimport {HamRobinhood} from \"src/HamRobinhood.sol\";\n\n/// A treasury (buyback vault) or backers splitter that, on receiving ETH, settles a day that is due.\ncontract SettlingRecipient {\n    HamRobinhood public game;\n    uint256 public day;\n\n    function arm(HamRobinhood game_, uint256 day_) external {\n        game = game_;\n        day = day_;\n    }\n\n    receive() external payable {\n        if (address(game) != address(0)) {\n            try game.settle(day) {} catch {}\n        }\n    }\n}\n\ncontract TreasuryReenterTest is Test {\n    HamRobinhood game;\n    uint256 refereeKey = 0xA11CE;\n    address owner = makeAddr(\"owner\");\n    address alice = makeAddr(\"alice\");\n    SettlingRecipient vault;\n    uint256 constant FEE = 0.01 ether;\n\n    function setUp() public {\n        vm.warp(20_000 days + 3 hours);\n        vault = new SettlingRecipient();\n        game = new HamRobinhood(\n            owner, vm.addr(refereeKey), address(vault), FEE,\n            HamRobinhood.GameConfig({mazeSize: 12, cellSize: 7, sentries: 8, sentryHealth: 60, sentryDamage: 20, playerHealth: 100, magSize: 30, loops: 0})\n        );\n        vm.deal(alice, 10 ether);\n        vm.deal(address(this), 100 ether);\n    }\n\n    function play(address p, uint32 points) internal returns (uint256) {\n        uint256 day = game.currentDay();\n        uint32 attempt = game.attempts(day, p);\n        HamRobinhood.RunResult memory r =\n            HamRobinhood.RunResult({points: points, timeMs: 90_000, kills: 2, completed: true, attempt: attempt, boostBps: 0});\n        bytes32 h = keccak256(\n            abi.encodePacked(\"\\x19Ethereum Signed Message:\\n32\", game.runDigest(day, p, attempt, points, 90_000, 2, true, 0))\n        );\n        (uint8 v, bytes32 rr, bytes32 s) = vm.sign(refereeKey, h);\n        vm.prank(p);\n        return game.playRun{value: FEE}(r, abi.encodePacked(rr, s, v), address(0));\n    }\n\n    function test_settlingDuringThePayoutDoesNotEraseWhatIsOwed() public {\n        // day 1: one run, a 10 ETH pot -> settled: 1 ETH owed to the treasury, 1 ETH to the backers (both = vault)\n        uint256 d1 = game.currentDay();\n        game.fundPot{value: 10 ether - FEE}(d1);\n        play(alice, 5000);\n        // day 2: one run, a 10 ETH pot (plus day 1's rollover once day 1 settles)\n        vm.warp((d1 + 1) * 1 days + 16 minutes);\n        game.settle(d1);\n        uint256 d2 = game.currentDay();\n        game.fundPot{value: 10 ether}(d2);\n        play(alice, 5000);\n        vm.warp((d2 + 1) * 1 days + 16 minutes);\n        (uint256 pot2,,,,,,) = game.dayInfo(d2);\n\n        uint256 owedBefore = game.treasuryOwed() + game.backersOwed(); // 2 ETH from day 1\n        uint256 day2Shares = pot2 * 2000 / 10_000; // treasury 10% + backers 10% of day 2, once it settles\n\n        // day 2 is due but not settled yet; the vault settles it when the payout reaches it\n        vault.arm(game, d2);\n        game.withdrawTreasury();\n        try game.settle(d2) {} catch {} // in case the vault's settle was refused\n        (,, uint256 settledAt,,,,) = game.dayInfo(d2);\n        assertGt(settledAt, 0, \"day 2 settled\");\n\n        // everything settled for the treasury and the backers is either paid or still owed\n        uint256 paid = address(vault).balance;\n        uint256 stillOwed = game.treasuryOwed() + game.backersOwed();\n        assertEq(paid + stillOwed, owedBefore + day2Shares, \"a settled share was erased and is stuck in the contract\");\n    }\n}","reproduction":"Treasury and backers both set to a contract whose receive() calls game.settle(d2). Day d1: 10 ETH pot, one run, settled -> treasuryOwed = 1 ETH, backersOwed = 1 ETH. Day d2: one run, pot 14.01 ETH (10 ETH funded + 4 ETH rolled over from d1 + the fee), due for settling but not settled. Call withdrawTreasury(). Expected: paid + still owed = 2 ETH + 20% of d2's pot = 4.802 ETH. Actual: the recipient holds 2 ETH, treasuryOwed = 0 and backersOwed = 0; d2's 2.802 ETH of treasury and backers shares is stuck in the contract for good. Run (from contracts/): forge test --match-path test/scratch/TreasuryReenter.t.sol -vv -> FAIL \"a settled share was erased and is stuck in the contract: 2000000000000000000 != 4802000000000000000\".","severity":"low","snippet":"        if (amount != 0 && _trySend(treasury, amount)) {\n            treasuryOwed = 0;","title":"HamRobinhood.withdrawTreasury: a share settled while a recipient is being paid is erased (stale amount, then `= 0`)"},{"citation":"resolved","description":"`prizeOf` is documented as \"tokenId => claimable amount\" and sweep() zeroes it when a prize is removed, but claimFinalize() only sets `claimed[tokenId] = true`. After the payout the token is unfrozen again (isFrozen is false once claimed), its single-token approval and any operator approval are untouched, and prizeOf(tokenId) still returns the amount that was just paid. The claim freeze exists so a seller cannot collect both the prize and the sale price; it covers the ten minutes between intent and payout, but afterwards a listing made before the claim is fillable again and the on-chain prize reading a buyer, marketplace or bot would naturally check still shows a prize. Only a separate read of claimed(tokenId) reveals that the Score is spent. Fix: set `prizeOf[tokenId] = 0` in claimFinalize (as sweep does; the amount is already in the PrizeClaimed event), or expose a single view that returns 0 once claimed, and consider clearing `_approved[tokenId]` at claimIntent.","line":550,"path":"contracts/src/HamRobinhood.sol","reproduction":"Day pot 10.01 ETH, alice plays one run (Score #1), settle(day): prizeOf(1) = 4.004 ETH. alice: approve(bob, 1) (a listing), claimIntent(1), 11 minutes later claimFinalize(1) and receives 4.004 ETH. Expected afterwards: prizeOf(1) == 0, as after sweep. Actual: prizeOf(1) == 4004000000000000000, claimed(1) == true, isFrozen(1) == false, getApproved(1) == bob, so transferFrom(alice, buyer, 1) by the approved marketplace succeeds for a Score that still reads as holding a 4.004 ETH prize. Checked with a Foundry test.","severity":"low","snippet":"        claimed[tokenId] = true;","title":"HamRobinhood.claimFinalize leaves prizeOf(tokenId) at the full prize and the token's approvals in place, so a paid-out Score still reads as a winning one"}],"hash":"b668b145b6bad0f64a815626b2eef0f5cb8cab70d2a290b0e6acd578bb1325e5","nodeId":"85a30f8a-cb6f-4cf2-8f09-7586caf2c768","outcome":"completed","summary":"The review is complete: six findings are in `.imd-findings.json` at the repository root, ranked by severity. No source file was changed; the only files written are the proof tests under `contracts/test/scratch/`.\n\n| # | Severity | Where | Finding |\n|---|---|---|---|\n| 1 | High | `HamPowerUps.sol:197` (`open` / `_draw`) | A pack's gun depends on how many packs are open when it is opened, so a holder can re-roll sealed packs by choosing what to open first. Over five 20-pack buys, opening in id order gave 22 EPICs out of 100; a greedy opener got 81 from the same packs. Proof attached. |\n| 2 | Medium | `HamRobinhood.sol:856` (`_mintScore`) | One transferable backer pass gives the holder bonus to every wallet it passes through in a day. With a single pass and a 100 ETH pot, all three places got the bonus and the treasury kept 3 ETH instead of at least 6. The same wallet-to-wallet sharing applies to the signed booster bonus. |\n| 3 | Medium | `HamPowerUps.sol:178` (`open`) | If nobody buys or opens for 256 blocks after a purchase, the pack is dealt from the previous block's hash, so its holder picks the gun by picking the block. Proof attached. |\n| 4 | Medium | `HamDailyRun.sol:264` (`enterFree`) | The per-pass free-run fix was made only in `HamRobinhood`; here one transferable holder token still gives a free run to every wallet it visits (three free entries from one pass in my test). The holder bonus is also read at settle time and the boost at submit time. This is outside the three contracts you asked me to look hardest at. |\n| 5 | Low | `HamRobinhood.sol:590` (`withdrawTreasury`) | If a recipient contract triggers `settle` while being paid, the shares that settle adds are zeroed afterwards and the ETH is stuck for good. Needs a treasury or backers contract that runs code on receipt. Proof attached. |\n| 6 | Low | `HamRobinhood.sol:550` (`claimFinalize`) | After payout, `prizeOf(tokenId)` still returns the full prize and approvals stay in place, so a spent Score still reads as a winning one. |\n\nThe three attached proofs fail on the current code for the stated reason when run from `contracts/` with `forge test --match-path`. Findings 2, 4 and 6 were checked with Foundry tests too, but carry no proof file. For 2 this is deliberate, since a fix will probably change `playRun`'s signature.\n\nAreas I checked in the focus list and found clean:\n- **`HamBackerPass`**: airdrop and `lockMint`, the Enumerable bookkeeping (256 fuzz runs of random transfers, 60 per run), and `safeTransferFrom`.\n- **`HamPowerUps.recordRun`**: only addresses allowed through `setGame` can record runs.\n- **`HamRobinhood` signatures and payouts**: no signature replay path, the free run holds at one per pass per day, and settle, claim and sweep accounting conserve ETH apart from finding 5.\n- **Run notifications**: no gas limit from 120k upward makes a run succeed with the power-up or points notification skipped.\n\nNot covered in depth: `HamPassArt` and `HamScoreArt` (pure renderers), and the referral and crew economics, which belong to another guide group. I did not review `api/referee.js` beyond confirming it reads `boostOf` when it signs. No static analysers were run.","treeHash":null,"usage":{"cachedInputTokens":2136909,"cost":{"source":"runtime","usdMicros":4673594},"inputTokens":39,"model":"claude-fable-5-2","outputTokens":68369,"runtime":"claude","turns":23,"wallClockMs":872618}}],"verification":[]}