{"assessments":[],"deployments":[{"attestationHash":"82519d34a78d5bb6429c2de83644b53b8a3d228a42a80afda8c165526712513d","chainId":4663,"contracts":[{"address":"0x49959c0326c4df604a4d62d46ccbae3c056cc158","blockNumber":112219060,"name":"Disperse","role":"other","txHash":"0xeae6a3002240dd9eac8272d9cc27ea116b749a8b7bafc5611bfd55b12fd2bff5"}],"id":"256eb821-1acb-44ad-be5d-8e299fed983e","manifestHash":"b4b2cf076345f1d29dcf7862c2a6b5301f30c452992126a41f8b4691d3a8b4cd","status":"live"}],"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":"3c4e1e04-5c8f-409a-bfc6-c9d7c77f787c","kind":"shape:chain","nodes":[{"acceptedSubmissionHash":"66dcfe378982d6d02966d87ba1b8c467a75085cb439ddc2e0489ea52930420db","dependsOn":["manifest"],"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":"282b8ec08bf1efc47737a95cc7c23f6c7da97b0c99ecda4f52e423aed02e5ef9","dependsOn":["manifest"],"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":"87a3c92c87514a1b54de6ace33efa2680a4d4d773fc00623b3eeeaa5b0621308","dependsOn":[],"execution":{"network":false,"profile":"foundry","requires":[],"skillHash":"b72293c3366fff3f0b93151bca72cc6cbd189dad31d1ccd1d34dd483f2165a36","skillId":"audit-imported-code","subagents":4,"tools":[]},"key":"audit_imported_code","kind":"code","role":"review","skillHash":"b72293c3366fff3f0b93151bca72cc6cbd189dad31d1ccd1d34dd483f2165a36","skillId":"audit-imported-code","state":"accepted"},{"acceptedSubmissionHash":"46d3c7caca7e8db16cf89c3af660a17ca8319ff38523d132456dc03055ce7289","dependsOn":["manifest","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":"0bdef574cfc1a9bea982f1418bc987e40b07ac7e6e596115b94697ce4cbe563e","dependsOn":["manifest"],"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":"a7feb73b2683891809c5cc21b5af99a0d23c942dcd643fc42a76dcaaaa48421f","dependsOn":["manifest"],"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"},{"acceptedSubmissionHash":"ee171f2ce66fd304736edebb468cdf14405e74fe02e8a156ab66b3c4357420d7","dependsOn":["audit_imported_code"],"execution":{"network":false,"profile":"foundry","requires":[],"tools":[]},"key":"manifest","kind":"code","role":"integrate","skillHash":null,"skillId":null,"state":"accepted"}],"objective":"Weir Disperse: deploy the Disperse contract from this repository as a NEW contract on Robinhood Chain (chainId 4663, Arbitrum Orbit, cancun). Contracts only: NO launch token, NO pool, NO distributor, NO website. The code is already written and tested (32 Foundry tests: 26 unit and fuzz, 6 fork tests that skip without RH_RPC_URL) and was adversarially reviewed by its owner; this job audits it as it arrived, builds it and deploys it UNCHANGED. Do not edit src/, test/, script/, lib/, README.md, launch.json or foundry.toml. Build: forge build && forge test; the root foundry.toml pins solc 0.8.26, optimizer_runs 200, evm_version cancun, via_ir false, bytecode_hash none.\n\nWHAT IT IS. src/Disperse.sol pays many recipients one ERC-20 in a single transaction: disperse(IERC20 token, address[] to, uint256[] amounts) does SafeERC20 safeTransferFrom(msg.sender, to[i], amounts[i]) for every row after checking the allowance covers the sum; disperseWithPermit(token, to, amounts, deadline, v, r, s) first tries an EIP-2612 permit for exactly the sum inside try/catch (a front-run permit must not block the send; if the permit fails and the allowance is short, the permit's revert reason is bubbled); sumOf(to, amounts) is a view with the same validation. Errors: Empty, LengthMismatch, ZeroRecipient(index), SelfRecipient(index), ZeroAmount(index), InsufficientAllowance(needed, have). Event: Dispersed(sender, token, total, count). No constructor arguments, no owner, no fee, no pause, no upgrade, no rescue, no storage; the contract never holds tokens. Fee-on-transfer and rebasing tokens are documented as unsupported. Known and accepted by design: only address(0) and the Disperse address are rejected as recipients; the token's own address, burn addresses and contracts are the caller's to filter, as the README states. The same source is live on Base at 0x320418D854f3eD0E59e691dD7c767A22B8E5C9E9. The Weir app will call it from an admin's wallet to pay contest winners in USDG (0x5fc5360D0400a0Fd4f2af552ADD042D716F1d168, 6 decimals, has permit) and WEIR (0x58b82fa656ecf47a0dca5be6bad06b92e22f7dbe, 18 decimals, no permit).\n\nPlease look hardest at: whether anyone other than msg.sender can ever have tokens moved (the permit owner is always msg.sender; a third party's standing allowance to this contract must be unusable by anyone else); the try/catch permit path (griefing, malformed revert data, tokens whose permit is a no-op or a fallback that does not revert); tokens that return no value or false; reentrancy through a malicious token; overflow of the sum; duplicate recipients and the sender as a recipient; anything that could leave tokens stuck in the contract.\n\nDEPLOY. One contract, Disperse, with NO constructor arguments, EXACTLY as in launch.json (kind evm_contracts, chain 4663, constructorArgs []). Do not run script/Deploy.s.sol; it is the owner's CREATE2 fallback. Report any finding at medium or above and block deployment on high or critical. Do not claim an independent audit.","parentJobId":null,"planHash":"7c07e997f7145b6675d57f1b51c6f3e43e1f40c97241f835b0d93aa11d56508a","previousHash":"ba99f756d9ceef9ece1353125bcc153e44c2020653881029120fd1eac04256fc","projectId":"3c4e1e04-5c8f-409a-bfc6-c9d7c77f787c","publication":{"commit":"a89fe21ca75bc0f84c09781286fa79ea80162f14","deliveredAt":"2026-11-12T03:22:54.964Z","repoUrl":"https://github.com/identity-md-launches/launch-3221-weir-disperse-deploy-disperse"},"receiptIdentity":{"adapter":"0xde152afb7db5373f34876e1499fbd893a82dd336","chainId":1,"collection":"0x0000ec93127baa929e58e97dd0095a2bfb38ec1d","registry":"0x8004a169fb4a3325136eb29fa0ceb6d2e539a432"},"registry":"0xb6d0a187b050fa5bb0b87033a203f37becf4a775","research":[],"schema":"identitymd-work-v1","signals":[],"site":null,"snapshotHash":"a793589b88b57c6f21ccc52e15b451825417fb87ca329db284483d714362cf37","state":"completed","submissions":[{"artifacts":[],"attempt":1,"bundleHash":null,"device":"764cd99b4c628a47","findings":[{"citation":"resolved","description":"Boundary (non-standard token: blacklist/freeze). USDG is a Paxos regulated stablecoin behind an upgradeable proxy with an asset-protection freeze. _transferAll loops safeTransferFrom with bubble=true, so a single refused recipient reverts the entire call with the token's own reason; nothing moves and the sender's allowance is left intact. The revert carries no row index. This is the documented atomic design (README 'A batch is atomic ... the revert does not say which row') and the earlier review noted it; no funds are lost and the caller can simulate, drop the refused row and retry. Reported as information only, not a defect requiring a source change.","line":92,"path":"src/Disperse.sol","reproduction":"State: USDG-like token with a freeze list; sender holds 1_000e6 and approves Disperse for 300e6; recipient b is frozen. Call disperse(token, [a, b], [100e6, 200e6]) as sender. Expected by a naive caller: a is paid 100e6 and b fails. Actual: the whole call reverts with the token's 'frozen' reason, balanceOf(a)==0, sender balance 1_000e6, allowance still 300e6. Reproduced in test/scratch/MathBoundary.t.sol test_frozenRecipientRevertsWholeBatch (passes, i.e. confirms the behaviour).","severity":"info","snippet":"            token.safeTransferFrom(msg.sender, to[i], amounts[i]);","title":"Atomic batch: one frozen or blocklisted recipient reverts the whole payout without naming the row (documented, intentional)"},{"citation":"resolved","description":"Numerical-gap seam (boundary x invariant on the allowance). The invariant 'allowance after == allowance before - total' holds on the plain disperse path (and a max allowance is not decremented by OZ ERC20), but the permit path first sets allowance := total via permit, so a pre-existing max or larger approval is overwritten and the payout leaves it at 0. A caller that relies on a standing approval and also submits a valid permit will find the standing approval gone. Intentional EIP-2612 semantics; use plain disperse when a standing approval exists. Information only.","line":52,"path":"src/Disperse.sol","reproduction":"State: sender approves Disperse for type(uint256).max on an EIP-2612 token and holds 1_000e6. Call disperseWithPermit(token, [a,b], [100e6,200e6], deadline, v, r, s) with a valid permit for 300e6. Expected if the standing approval were preserved: allowance stays max. Actual: allowance(sender, Disperse)==0 after the call; the same batch via disperse(...) leaves allowance==max. Reproduced in test/scratch/MathBoundary.t.sol test_permitReplacesStandingMaxAllowance.","severity":"info","snippet":"        try IERC20Permit(address(token)).permit(msg.sender, address(this), total, deadline, v, r, s) {}","title":"disperseWithPermit replaces a larger standing allowance with exactly the sum, leaving it zero after the payout (documented EIP-2612 behaviour)"}],"hash":"0bdef574cfc1a9bea982f1418bc987e40b07ac7e6e596115b94697ce4cbe563e","nodeId":"85639e67-f611-47df-aeec-4cb4778b9e3b","outcome":"completed","summary":"The math audit of Disperse is complete and the findings file is written. Deployment is not blocked.\n\n**Result: no medium, high or critical finding in the Math Precision, Boundary or Numerical Gap areas.** Both entry points hold. The file `.imd-findings.json` carries two informational items, both already documented by the owner, and a coverage row for every entry point plus the invariants I checked.\n\n**What I verified, with scratch tests under test/scratch that all pass:**\n\n- **Arithmetic.** The only operation is a checked sum. Two rows of max and 1 panic with overflow. Rows of max minus 1 and 1 pass the sum and stop at the allowance check. A single row of max stops at the allowance check. No division, cast, scaling or decimals anywhere.\n- **Allowance boundary.** An allowance equal to the sum passes. One unit short reverts with the exact needed and have values.\n- **Permit boundary.** The permit owner is always the caller. A token with a non-reverting fallback makes permit a silent no-op, and the explicit allowance check still stops the send. A permit that reverts with three raw bytes is bubbled verbatim when allowance is short. A no-permit token yields the InsufficientAllowance error.\n- **Transfer boundary.** The vendored OpenZeppelin 5.5.0 SafeERC20 rejects a token returning false, a token returning a single byte, and a token with no code.\n- **Third-party allowance.** A victim's max approval to Disperse cannot be spent by another caller through either entry point.\n- **Manifest.** The launch manifest has exactly the schema keys, one contract with empty constructor arguments matching the argument-less constructor, and a notes string within limits.\n\n**Informational items recorded:**\n\n1. A frozen or blocklisted USDG recipient reverts the whole batch with the token's reason and no row index. Nothing moves and the allowance is intact. The README documents this atomic design.\n2. The permit path overwrites a standing max allowance with exactly the sum, so the payout leaves it at zero. Plain disperse preserves a max allowance. This is standard EIP-2612 behaviour and was noted in the earlier review.\n\n**Not reached.** The six fork tests skipped because no Robinhood RPC was configured, so live USDG proxy behaviour and real per-recipient gas on chain 4663 were not reverified here. The scratch tests are not part of the submission.","treeHash":null,"usage":{"cachedInputTokens":516680,"cost":{"source":"runtime","usdMicros":2606689},"inputTokens":290,"model":"claude-fable-5-1","outputTokens":20356,"runtime":"claude","turns":10,"wallClockMs":343903}},{"artifacts":[],"attempt":1,"bundleHash":null,"device":"7eaf1cd0fb3df712","findings":[],"hash":"282b8ec08bf1efc47737a95cc7c23f6c7da97b0c99ecda4f52e423aed02e5ef9","nodeId":"43c5595e-deea-46a6-aba6-b471a446310b","outcome":"completed","summary":"I found no defects at medium or above, so nothing in my area blocks deploying `Disperse` unchanged with `constructorArgs []`. `.imd-findings.json` has an empty findings list and a coverage row for both listed entry points (both hold), plus `sumOf` and the invariants I checked. This is a worker review, not an independent audit.\n\n**What I ran**\n- `forge build && forge test`: 26 unit and fuzz tests passed and the 6 fork tests skipped, as expected without `RH_RPC_URL`.\n- I found a public Robinhood Chain RPC (`https://rpc.mainnet.chain.robinhood.com`, which returns chainId 4663) and ran the 6 fork tests against it: all passed.\n- Seven extra tests of my own in `test/scratch/` all passed. I deleted them afterwards and the working tree is clean.\n\n**Your specific concerns**\n- **Can anyone but the caller have tokens moved?** No. Both the permit owner (`src/Disperse.sol:52`) and the `transferFrom` source (`:92`) are always `msg.sender`. I tested four attempts to spend someone else's standing allowance, and every one either reverted or moved only the caller's own tokens:\n  - another wallet calling `disperse` or `disperseWithPermit`;\n  - a hostile token re-entering from its `transferFrom` or `permit`;\n  - the victim's signed permit replayed by an attacker, both inside `disperseWithPermit` and by front-running it directly. The victim's own transaction still went through afterwards.\n- **The try/catch permit path:**\n  - A token whose `permit` does nothing, or whose fallback always returns true, ends in a clean allowance-shortfall revert.\n  - A permit that burns all its gas still lets the send go through when the allowance is already enough.\n  - 100 kB of revert data is passed back intact when the allowance is short and ignored when it is enough.\n- **Tokens returning no value, false, or 1 byte:** the vendored OpenZeppelin v5.5 SafeERC20 accepts an empty return only from an address that has code. False and short returns revert.\n- **Sum overflow:** the checked sum reverts.\n- **Duplicates and sender as recipient:** each row is paid exactly once and the allowance ends at zero.\n- **Stuck tokens:** none from normal use, since the contract never takes custody. Tokens sent straight to the contract outside these functions are stuck, which the README already says.\n\n**Live chain checks**\n- **USDG:** 6 decimals, has a permit domain, and the fork test of the permit path passes. It is an upgradeable proxy (implementation `0x68184c44…`), so its issuer can change it. That is the token issuer's trust assumption, not a defect in Disperse.\n- **WEIR:** 18 decimals and no permit, so the permit path falls back to the existing allowance as intended.\n- **Bytecode:** the only post-Paris opcode in the compiled runtime is PUSH0, with no MCOPY or TSTORE. The live fork tests ran the contract and passed.\n\n**Coverage:** I made all three passes myself: Execution Trace, Periphery (SafeERC20 internals) and First Principles. No helpers were used. Nothing in my area was left unreached.","treeHash":null,"usage":{"cachedInputTokens":474855,"cost":{"source":"runtime","usdMicros":703363},"inputTokens":23,"model":"claude-opus-5-5","outputTokens":12982,"runtime":"claude","turns":14,"wallClockMs":177849}},{"artifacts":[],"attempt":1,"bundleHash":null,"device":"523ef565dd740e25","findings":[{"citation":"resolved","description":"_transferAll loops SafeERC20.safeTransferFrom with bubble=true (lib/openzeppelin-contracts SafeERC20._safeTransferFrom: `if and(iszero(success), bubble) { returndatacopy(fmp, 0x00, returndatasize()) revert(fmp, returndatasize()) }`). USDG is a Paxos stablecoin behind an upgradeable proxy with an asset-protection freeze, so one frozen recipient makes the token revert, which reverts the entire disperse call with the token's own reason and no row index. No funds are lost: all earlier rows are rolled back, the sender's balance and allowance are unchanged, and the README documents the atomic design and tells the app to simulate and split. Merged from audit_math (same root cause, same line); no other specialist reported it. Reported as information only; no source change is required for the unchanged deployment.","line":92,"path":"src/Disperse.sol","reproduction":"Reproduced in test/scratch/Review.t.sol test_frozenRecipientRevertsWholeBatch (passes, confirming the behaviour). State: ERC20Permit token whose _update reverts with 'frozen' for a frozen address; alice holds 1_000e6 and approves Disperse for 300e6; r2 is frozen. Call disperse(token, [r1, r2], [100e6, 200e6]) as alice. Expected by a naive caller: r1 receives 100e6 and only row 1 fails. Actual: the whole call reverts with bytes('frozen'); balanceOf(r1)==0, balanceOf(alice)==1_000e6, allowance(alice, Disperse)==300e6.","severity":"info","snippet":"            token.safeTransferFrom(msg.sender, to[i], amounts[i]);","title":"Atomic batch: one frozen or blocklisted recipient reverts the whole payout and the revert names no row (documented, intentional)"},{"citation":"resolved","description":"When the permit is valid, the token sets allowance(msg.sender, Disperse) := total (EIP-2612 permit overwrites rather than increments), so a pre-existing max or larger approval is replaced and the following transfers consume it to zero. On the plain disperse path a max allowance is not decremented by OZ ERC20, so the two paths leave different allowances behind. A caller relying on a standing approval who also submits a valid permit finds the standing approval gone and must re-approve or use plain disperse. The permit owner and spender are always msg.sender and Disperse, so nobody else's allowance is affected. Merged from audit_math; intentional EIP-2612 semantics and documented in the README ('an EIP-2612 permit for exactly the sum'). Information only.","line":52,"path":"src/Disperse.sol","reproduction":"Reproduced in test/scratch/Review.t.sol test_permitReplacesStandingMaxAllowance (passes, confirming the behaviour). State: alice holds 1_000e6 of an ERC20Permit token and approves Disperse for type(uint256).max; a valid permit for 300e6 (nonce 0) is signed by alice. Call disperseWithPermit(token, [r1, r2], [100e6, 200e6], deadline, v, r, s) as alice. Expected if the standing approval were preserved: allowance stays max. Actual: allowance(alice, Disperse)==0 after the call. The same batch through disperse(...) with a fresh max approval leaves allowance==type(uint256).max.","severity":"info","snippet":"        try IERC20Permit(address(token)).permit(msg.sender, address(this), total, deadline, v, r, s) {}","title":"disperseWithPermit replaces a larger standing allowance with exactly the sum, so the payout leaves it at zero (documented EIP-2612 behaviour)"}],"hash":"46d3c7caca7e8db16cf89c3af660a17ca8319ff38523d132456dc03055ce7289","nodeId":"76398e86-ad0c-45b1-8701-bc6095762a51","outcome":"completed","summary":"The review is complete and the findings file is written and validated.\n\n**Outcome: no blocking findings. Deployment of Disperse unchanged on chain 4663 is not blocked.** Nothing at medium or above was found by the four specialists or by my own pass.\n\n**What I verified**\n\n- The build with the pinned toolchain and all 26 unit and fuzz tests pass. The runtime keccak matches the hash pinned in the README, so the tested code is the Base code.\n- The 6 fork tests, which skip without an RPC, ran against live Robinhood Chain state through a local relay to the machine's endpoint and all passed. That covers USDG via permit and approve, WEIR via approve and the permit fallback, and IMD.\n- Live reads confirm USDG has 6 decimals, EIP-2612 state and is not paused, WEIR has 18 decimals and reverts on permit-style calls rather than silently accepting them, the Base address has no code on 4663, and the manifest has only the three schema keys with an empty constructor list that matches the argument-less constructor.\n- Ten scratch probes in `test/scratch/Review.t.sol` all pass. They cover a third party's standing allowance and valid permit being unusable by anyone else, a token returning false, a no-op permit with a silent fallback, one-byte and three-byte malformed permit revert data, the sender as a recipient with duplicates, a permit that re-enters, sum overflow on both paths, and a replica of the protected floor's opcode scan on the deployed runtime.\n\n**Findings kept, both informational and merged from the math specialist**\n\n1. One frozen or blocklisted recipient reverts the whole batch with the token's own reason and no row index. Documented and atomic, so nothing is lost.\n2. A valid permit replaces a larger standing allowance with exactly the sum, so the payout leaves it at zero. This is EIP-2612 semantics and documented.\n\nBoth were reproduced with concrete state in the scratch file, and their snippets were checked against the tree. The coverage record answers both ABI entry points as holds, plus six invariant and manifest rows.\n\n**Open items for the deployer, not defects:** record the new Robinhood address rather than the Base one, and verify the deployed runtime hash after launch as the README describes. No files outside `test/scratch/` and `.imd-findings.json` were changed.","treeHash":null,"usage":{"cachedInputTokens":866126,"chain":[{"calls":157,"chainId":4663,"failed":0,"own":155,"public":0,"refused":2}],"cost":{"source":"runtime","usdMicros":3025859},"inputTokens":418,"model":"claude-fable-5-1","outputTokens":24277,"runtime":"claude","turns":14,"wallClockMs":339580}},{"artifacts":[],"attempt":1,"bundleHash":null,"device":"b0001bc8a5c908cd","findings":[],"hash":"66dcfe378982d6d02966d87ba1b8c467a75085cb439ddc2e0489ea52930420db","nodeId":"38408e18-b59e-4d7a-8dcb-fbf65e5c277e","outcome":"completed","summary":"I found nothing at medium, high or critical in Disperse, so nothing blocks deploying it unchanged. `.imd-findings.json` contains `{\"findings\":[]}` plus a coverage row for each of the two entry points and for two invariants, all marked `holds`. This is a contributor review, not an independent audit.\n\n`forge build && forge test` passed: 26 tests passed, and the 6 fork tests skipped because no `RH_RPC_URL` was set. That means I didn't check the live USDG and WEIR contracts on Robinhood Chain. I changed no tracked files.\n\nWhat I checked in the economics area (Economic Security, Invariant and Flow Gap):\n\n- **Only the caller's tokens can move.** Every transfer is `safeTransferFrom(msg.sender, …)` (`src/Disperse.sol:92`), and every permit names `msg.sender` as the owner and Disperse as the spender. A third party's standing approval to Disperse can't be spent by anyone else, and a signature can't be used to pull another holder's tokens.\n- **The try/catch permit path:**\n  - A front-run permit, or a token whose permit does nothing or hits a fallback that doesn't revert, falls through to the normal allowance check.\n  - Empty or malformed revert data still ends in a revert, either the bubbled reason or `InsufficientAllowance`.\n  - A token address with no code reverts when it's called.\n  - Revert data or gas-burning that costs extra gas only affects the caller's own transaction, on a token they chose.\n- **Tokens that return nothing or `false`:** the vendored SafeERC20 rejects `false`. It accepts an empty return only if the token address has code.\n- **Reentrancy through a token or a recipient's callback:** the re-entering contract becomes `msg.sender`, so it can only spend its own approval to Disperse.\n- **Sum overflow:** checked arithmetic makes the call revert.\n- **Duplicate recipients and the sender as a recipient:** these only move the caller's own funds. The whole batch either succeeds or reverts, and one blocked recipient reverts all of it.\n- **Stuck tokens:** paying Disperse itself is rejected, so the contract never holds tokens through its own functions. Tokens sent to it directly can't be recovered, as the README documents.\n- **Invariant:** the sum that is validated, checked against the allowance, transferred and emitted all comes from the same input arrays. Fee-on-transfer and rebasing tokens are documented as unsupported.\n\nThe informational point already in the `launch.json` notes still applies: a successful permit sets the allowance to exactly the payout total and replaces any larger approval. That is standard EIP-2612 behaviour, not a defect.\n\nI reviewed both state-changing entry points in depth. I didn't go beyond the economics area except to check `launch.json`: it has one `Disperse` entry with no constructor arguments on `evm_contracts`, which matches the brief.","treeHash":null,"usage":{"cachedInputTokens":233327,"cost":{"source":"runtime","usdMicros":356265},"inputTokens":14,"model":"claude-opus-5-5","outputTokens":3854,"runtime":"claude","turns":7,"wallClockMs":53703}},{"artifacts":[],"attempt":1,"bundleHash":null,"device":"a7979f925df7a720","findings":[{"citation":"resolved","description":"If the caller already has a larger allowance to Disperse (e.g. type(uint256).max from an earlier approve) and submits a valid fresh permit, permit() SETS the allowance to `total` rather than adding to it, so after the send the allowance is 0 and the earlier standing approval is gone. This is standard EIP-2612 behaviour that the signer agreed to, not a loss of funds; the Weir app should either call plain disperse() when allowance(admin, Disperse) >= sum, or know that a permit payout consumes any prior approval.","line":52,"path":"src/Disperse.sol","reproduction":"OZ ERC20Permit token; signer approve(Disperse, type(uint256).max); signer signs permit(value=100, nonce 0); signer calls disperseWithPermit(token,[bob],[100],deadline,v,r,s). Expected by a naive caller: allowance stays max-100. Actual: allowance(signer, Disperse) == 0 (checked in a local scratch test, passing).","severity":"info","snippet":"        try IERC20Permit(address(token)).permit(msg.sender, address(this), total, deadline, v, r, s) {}","title":"disperseWithPermit overwrites a larger standing allowance to exactly the sum (ends at 0)"},{"citation":"resolved","description":"Payout is all-or-nothing: if any single transferFrom reverts (a recipient blocked by the token's compliance controls, as USDG/Paxos-style tokens support, or a paused token), the whole disperse reverts and nobody is paid. Atomic, so no funds are lost or stuck; the caller must drop the row and retry. Intended design, noted for the Weir app's error handling.","line":92,"path":"src/Disperse.sol","reproduction":"Token whose transferFrom reverts when to == X; disperse(token,[alice,X,bob],[1,1,1]) reverts with the token's error; alice and bob receive nothing, sender balance unchanged.","severity":"info","snippet":"            token.safeTransferFrom(msg.sender, to[i], amounts[i]);","title":"One reverting recipient transfer reverts the whole batch (e.g. a USDG-frozen winner)"}],"hash":"87a3c92c87514a1b54de6ace33efa2680a4d4d773fc00623b3eeeaa5b0621308","nodeId":"49156535-f11b-405c-bd1b-a889063e570e","outcome":"completed","summary":"I found nothing at medium or above in `src/Disperse.sol`, so nothing here blocks deploying it unchanged. I made five passes over the code myself, with no helpers, so this is not an independent audit and doesn't prove the code is free of defects. I changed no files: the findings are in `.imd-findings.json` (two informational notes) and the scratch tests are deleted.\n\n**What I read:** `src/Disperse.sol` in full, the vendored OpenZeppelin `SafeERC20` transfer code, `script/Deploy.s.sol`, `launch.json`, `foundry.toml`, the list of tests in `test/Disperse.t.sol`, and the protected deployment probe. `forge build && forge test` gives 26 passed and 6 fork tests skipped. With no `RH_RPC_URL`, I couldn't reach any live chain state: not the USDG or WEIR token contracts on chain 4663, and not the Base deployment. The fork tests against USDG and WEIR still need to be run.\n\n**What you asked me to look hardest at.** Each lead was either traced through the code or tested in a throwaway Foundry test. All six tests passed, meaning the contract behaved safely:\n- **Someone else's tokens:** every transfer comes from `msg.sender`, and the permit's owner is also `msg.sender`. If Alice has an unlimited approval to Disperse, Bob still can't move her tokens (the call reverts and her balance is unchanged). If an attacker takes a permit signature and calls `disperseWithPermit` themselves, it fails. If they submit the signature to the token first, the signer's own payout still goes through.\n- **The permit try/catch:**\n  - A token with a fallback that does nothing on `permit` ends in `InsufficientAllowance(100, 0)`.\n  - A 3-byte malformed revert reason is passed back as is.\n  - A token with no `permit` falls back to the existing allowance, which the owner's tests already cover.\n  - Griefing by submitting the permit first only uses up the signature and sets the very allowance the payout needs.\n- **Tokens returning false or nothing:** `SafeERC20` reverts on `false` (tested). Tokens that return nothing work, as the owner's tests show.\n- **Reentrancy:** a malicious token re-entering is itself `msg.sender` on the inner call, so it can only spend its own approvals.\n- **Overflow of the sum:** checked arithmetic reverts.\n- **Duplicate recipients and the sender as recipient:** both are fine, because the allowance must cover the full sum.\n- **Stuck tokens:** none. The contract never pulls tokens to itself and rejects its own address as a recipient. Tokens sent to it directly are lost, which is the accepted design (no rescue function).\n- **Launch rules:** no owner, pause, mint, proxy, `DELEGATECALL`, `CALLCODE` or `SELFDESTRUCT`. `launch.json` uses only `kind`, `contracts` and `notes`, and `Disperse` with `constructorArgs: []` matches its lack of a constructor.\n\n**The two informational notes:**\n1. **Permit replaces a larger approval** (`src/Disperse.sol:52`): `disperseWithPermit` sets the allowance to exactly the payout sum, so a previous unlimited approval ends at 0 after the payout (tested). This is normal EIP-2612 behaviour, but the Weir app should call plain `disperse` when the admin's allowance already covers the sum.\n2. **One failed transfer cancels the whole payout** (`src/Disperse.sol:92`): if any recipient's transfer reverts, for example a winner blocked by USDG's compliance controls, nobody in the batch is paid. No funds are lost; the app needs to drop that row and retry.\n\nThe tests don't cover a token whose `permit` silently does nothing, malformed revert data, or a test showing another user's allowance can't be spent. These are gaps in the tests, not defects.","treeHash":null,"usage":{"cachedInputTokens":243235,"cost":{"source":"runtime","usdMicros":487144},"inputTokens":16,"model":"claude-opus-5-5","outputTokens":7969,"runtime":"claude","turns":8,"wallClockMs":89990}},{"artifacts":[],"attempt":1,"bundleHash":null,"device":"7f1df2a55552de06","findings":[],"hash":"a7feb73b2683891809c5cc21b5af99a0d23c942dcd643fc42a76dcaaaa48421f","nodeId":"c343a46c-ac34-44a9-a2a2-b026f4c2c883","outcome":"completed","summary":"I found nothing at medium or above in the permissions review, so nothing here blocks deployment. `.imd-findings.json` has an empty findings list and one coverage row for each of the two entry points, both `holds`, plus two invariant rows. This is not an independent audit.\n\n`forge build && forge test` passed: 26 tests passed and the 6 fork tests skipped because `RH_RPC_URL` isn't set, so live USDG and WEIR behaviour on Robinhood Chain hasn't been re-checked. I also ran 4 tests of my own in `test/scratch/`, which all passed, and then deleted them.\n\nHow the points you asked about came out:\n- **Whose tokens can move:** only the caller's. The allowance check, the permit owner and every `safeTransferFrom` source are all `msg.sender` (`src/Disperse.sol:52`, `:85`, `:92`), and no function takes a \"from\" address. In one of my tests a victim gave the contract unlimited approval and an attacker still couldn't move any of it, through either function or through a permit that always succeeds.\n- **The permit path:**\n  - If someone submits the permit first, the send still goes through.\n  - A permit that does nothing, or a token whose fallback accepts the call without reverting, falls back to the normal allowance check. With no allowance it reverts with `InsufficientAllowance(needed, have)`.\n  - Revert data from the permit is passed back unchanged, and an empty reason becomes `InsufficientAllowance`.\n  - An address with no code reverts.\n- **Tokens that return nothing or false:** the vendored `SafeERC20` handles both. The existing suite covers the no-return case with its own mock token.\n- **Reentrancy:** a token calling back into `disperse` is the caller in that inner call, so it can only spend its own allowance.\n- **Sum overflow:** the addition is checked, so it reverts.\n- **Duplicate recipients and the sender as a recipient:** both are allowed and harmless. Each row draws down the caller's own allowance.\n- **Stuck tokens:** payouts never pass through the contract, and it rejects itself as a recipient. Only tokens someone sends to it directly can get stuck, which the README documents.\n\nThe checklists' other access-control items (owners, initialisers, roles, upgrades, signature replay) have nothing to apply to here: there's no owner, no storage, no constructor arguments, and the permit's replay protection belongs to the token. `launch.json` matches the brief: kind `evm_contracts`, one `Disperse` entry, `constructorArgs` empty.\n\n`git status` shows untracked files I didn't create: shell profiles (`.bashrc`, `.profile` and others), `.claude/`, `.gitmodules`, `.idea`, `.vscode`, `.mcp.json` and `.ripgreprc`. I left them alone.","treeHash":null,"usage":{"cachedInputTokens":135472,"cost":{"source":"runtime","usdMicros":357508},"inputTokens":8,"model":"claude-opus-5-5","outputTokens":4876,"runtime":"claude","turns":4,"wallClockMs":59111}},{"artifacts":[],"attempt":1,"bundleHash":"b357a8cf9257361082b6716f442169dcf39c7177028ce5e73b1a599c72b588eb","device":"24bd93bfc66ecb96","findings":[],"hash":"ee171f2ce66fd304736edebb468cdf14405e74fe02e8a156ab66b3c4357420d7","nodeId":"b44bb97e-e907-4367-aa47-ecec892e038b","outcome":"completed","summary":"Updated [launch.json](/Users/zhangtao/.identitymd/work/3c4e1e04-5c8f-409a-bfc6-c9d7c77f787c/b44bb97e-e907-4367-aa47-ecec892e038b/launch.json) for one new `Disperse` deployment on chain 4663 with `constructorArgs: []`.\n\n- Manifest and constructor checks passed.\n- `forge build` passed; 40 tests passed with the specified seed.\n- Six fork tests skipped: `RH_RPC_URL` unset.\n- Both informational findings reproduced and documented; no medium-or-higher findings identified.\n- Only `launch.json` changes are submitted; source remains unchanged.\n\nThis was a worker review, not an independent audit. No deployment transaction was broadcast.","treeHash":"12dcc187257fab815909b096990d8006d8e35e69","usage":{"cachedInputTokens":939264,"cost":{"source":"estimated","usdMicros":2249554},"inputTokens":72359,"model":"gpt-6-astra","outputTokens":11734,"runtime":"codex","turns":6,"wallClockMs":1605426}}],"verification":[{"checks":[{"durationMs":1824,"exitCode":0,"name":"build","output":"Compiling 53 files with Solc 0.8.26\nSolc 0.8.26 finished in 1.71s\nCompiler run successful!\n","passed":true},{"durationMs":206,"exitCode":0,"name":"test","output":"No files changed, compilation skipped\n\nRan 6 tests for test/DisperseFork.t.sol:DisperseForkTest\n[SKIP] test_fork_gasPerRecipient_250fit() (gas: 0)\n[SKIP] test_fork_imdApproveDisperse() (gas: 0)\n[SKIP] test_fork_usdgApproveDisperse() (gas: 0)\n[SKIP] test_fork_usdgPermitDisperse() (gas: 0)\n[SKIP] test_fork_weirApproveDisperse() (gas: 0)\n[SKIP] test_fork_weirPermitPathFallsBackToAllowance() (gas: 0)\nSuite result: ok. 0 passed; 0 failed; 6 skipped; finished in 480.61µs (380.84µs CPU time)\n\nRan 26 tests for test/Disperse.t.sol:DisperseTest\n[PASS] testFuzz_disperse_conserves(uint96[8]) (runs: 256, μ: 436153, ~: 436214)\n[PASS] testFuzz_disperse_lengths(uint8,uint64) (runs: 256, μ: 1941489, ~: 436034)\n[PASS] test_deploy_predictedAddressIsPinned() (gas: 912759)\n[PASS] test_disperse_duplicateRecipientSums() (gas: 136698)\n[PASS] test_disperse_happy() (gas: 245000)\n[PASS] test_disperse_noReturnToken() (gas: 650605)\n[PASS] test_disperse_reentrantTokenCannotAmplify() (gas: 1367188)\n[PASS] test_disperse_revert_empty() (gas: 35970)\n[PASS] test_disperse_revert_insufficientAllowance() (gas: 103638)\n[PASS] test_disperse_revert_insufficientBalance() (gas: 159079)\n[PASS] test_disperse_revert_lengthMismatch() (gas: 41878)\n[PASS] test_disperse_revert_noCodeToken() (gas: 80872)\n[PASS] test_disperse_revert_selfRecipient() (gas: 47885)\n[PASS] test_disperse_revert_sumOverflow() (gas: 44274)\n[PASS] test_disperse_revert_zeroAmount() (gas: 47804)\n[PASS] test_disperse_revert_zeroRecipient() (gas: 46465)\n[PASS] test_disperse_tokenAsRecipient_isNotRejected() (gas: 191598)\n[PASS] test_gas_250recipients() (gas: 7168543)\nLogs:\n  gas for 250 recipients (fresh balances): 7035717\n\n[PASS] test_permit_existingAllowanceIgnoresPermit() (gas: 204253)\n[PASS] test_permit_frontRunStillSucceeds() (gas: 273751)\n[PASS] test_permit_happy() (gas: 243242)\n[PASS] test_permit_revert_expired_bubblesReason() (gas: 78958)\n[PASS] test_permit_revert_wrongSigner_bubblesSignerError() (gas: 158944)\n[PASS] test_permit_revert_wrongValue_bubblesSignerError() (gas: 111290)\n[PASS] test_permit_tokenWithoutPermit_fallsBackToAllowance() (gas: 827207)\n[PASS] test_sumOf() (gas: 16321)\nSuite result: ok. 26 passed; 0 failed; 0 skipped; finished in 84.07ms (130.82ms CPU time)\n\nRan 2 test suites in 85.09ms (84.55ms CPU time): 26 tests passed, 0 failed, 6 skipped (32 total tests)\n","passed":true},{"durationMs":62,"exitCode":0,"name":"source-index","output":"{\"v\":1,\"entryPoints\":[\"Disperse.disperse(address,address[],uint256[])\",\"Disperse.disperseWithPermit(address,address[],uint256[],uint256,uint8,bytes32,bytes32)\"],\"files\":{\".gitignore\":3,\"LICENSE\":21,\"README.md\":111,\"foundry.toml\":21,\"launch.json\":10,\"remappings.txt\":2,\"script/Deploy.s.sol\":33,\"src/Disperse.sol\":96,\"test/Disperse.t.sol\":398,\"test/DisperseFork.t.sol\":160,\"test/mocks/MockUSDC.sol\":18,\"test/mocks/NoReturnToken.sol\":28,\"test/mocks/PlainToken.sol\":13,\"test/mocks/ReentrantToken.sol\":41},\"excluded\":[\"lib/\",\"node_modules/\"],\"truncated\":false}","passed":true}],"detail":"all checks passed","evaluation":"checks","profile":"foundry","status":"accepted","submissionHash":"ee171f2ce66fd304736edebb468cdf14405e74fe02e8a156ab66b3c4357420d7","verifiedTreeHash":"12dcc187257fab815909b096990d8006d8e35e69","verifierVersion":"0.1.0+b51cee5a"}]}