# Token Integration Analysis Report: Dices launchpad

| | |
| --- | --- |
| Skill | Trail of Bits `building-secure-contracts` 1.1.1 / `token-integration-analyzer` (loaded with the Skill tool; `resources/ASSESSMENT_CATEGORIES.md` and `resources/REPORT_TEMPLATES.md` read in full) |
| Commit | `bcd45b2` (`main`, "Merge launch distribution with TWAP game levels") |
| Date | 2026-11-25 |
| Platform | Solidity 0.8.38, EVM `osaka`, Foundry (`foundry.toml:1-22`); target chain Base (`script/deployment/V001.s.sol:126-128`) |
| Scope, token implementation | `src/DicesCoin.sol` and the solady base it inherits, `lib/v4-hooks-public/lib/solady/src/tokens/ERC20.sol` (solady 0.1.26, `remappings.txt:52`) |
| Scope, token integration | `src/DicesHook.sol`, `src/libraries/CurrencySettler.sol`, `src/core/InternalSwapPool.sol`, `src/core/FeeEscrow.sol`, `src/calculators/LiveCalculator.sol`, `src/calculators/FeeCalculator.sol`, the upstream `lib/v4-hooks-public/lib/v4-core/test/utils/CurrencySettler.sol`, `v4-core/src/types/Currency.sol`, and the USDC constants in `script/deployment/V001.s.sol` |
| Token types | ERC20 only. No ERC721 is involved (section 9) |

## How this review was done

- **Phase 1, context.** Both contexts apply: the repository implements a token (`DicesCoin`) and integrates one external token (USDC) plus every launched `DicesCoin`. `FeeEscrow` additionally accepts any currency from any caller.
- **Phase 2, Slither.** Not run by this reviewer (the build cache is shared). The pre-generated output in `audits/2026-11-25-skills-review/slither/` was used: `check-erc20-DicesCoin.txt`, `printer-human-summary.txt`, `printer-contract-summary.txt`, `printer-function-summary.txt`, `slither-detectors.txt`. Slither failed to generate IR for three functions (`DicesHook._swapFee`, `DicesHook._addInitialTokenLiquidity`, `InternalSwapPool.closeInternalSwapPool`; first lines of each output file), so its results for those functions are incomplete and they were reviewed by hand. **`slither-prop` was not run** (no fuzzer installed); the corresponding checklist item is open.
- **Phase 3, code analysis.** Every file in scope was read in full. No `forge`, build or test command was run, so statements about runtime behaviour are derived from reading the code and are marked "by code reading" where the distinction matters.
- **Phase 4, on-chain analysis: not performed.** The review is of source at a commit, with no network access. The only deployment on record is Base Sepolia (`deployments/deployment-84532.json`, `deployments/deployment-84532.md`, `broadcast/V001.s.sol/84532/run-latest.json`), and that broadcast file records `commit: 32487ad` (2026-11-05), which predates the bankroll and TWAP-level changes; its address book has no Bankroll row, which the current script writes (`script/deployment/V001.s.sol:660`). No Base mainnet (8453) deployment file exists, and the mainnet destination constants are unset (`script/deployment/V001.s.sol:131-134`). Scarcity and distribution are therefore analysed from source (section 6).
- **USDC behaviour.** USDC's source is not in the repository. Its properties (6 decimals, upgradeable proxy, pausable, blocklist, returns `bool`, no transfer hooks, no transfer fee today) are taken as given in the review brief and were not re-verified on-chain or from source.

Status words used below: **Pass**, **Concern**, **Fail**, **Not applicable**, **Not determined**, **Not evidenced in the repository**.

---

## Executive summary

**Token type:** ERC20 implementation (fixed-supply clone with a holder counter) and a protocol integrating USDC, its own coins, and arbitrary currencies in one escrow.

**Overall risk level: MEDIUM.** No defect was found in how tokens are moved: transfers use checked wrappers, the escrow verifies received amounts, and the fee ledger is a pull-payment design that isolates blocked recipients. The material issues are in how the token's parameters interact with the protocol's rules, and in owner control over the only market for each coin.

| Severity | Count |
| --- | --- |
| Critical | 0 |
| High | 0 |
| Medium | 3 |
| Low | 7 |
| Informational | 7 |

**Top concerns**

1. **TI-01.** Game levels 9 and 10 need 3,800 and 5,800 qualifying holders, but a qualifying holder needs 300,000 coins and the supply is 1,000,000,000, so at most 3,333 can exist. Those two levels can never unlock. Level 8 needs 75% of the whole supply to sit in threshold-sized wallets.
2. **TI-02.** The trading fee rate and split of every already-launched pool come from an owner-replaceable calculator with no on-chain bound, and liquidity can never leave those pools.
3. **TI-03.** 10% of every coin goes to a single unrestricted address shared by all coins (acknowledged as open question 10 in `AGENT.md`).

**Recommendation:** resolve TI-01 and TI-02 and decide TI-03 before a mainnet launch; the Low items are cheap to close at the same time.

---

## 1. General considerations

| Item | Status | Evidence |
| --- | --- | --- |
| Security review of `DicesCoin` and the launchpad | Not evidenced in the repository | `audits/` contains only this in-progress internal review (untracked in `git status`). No audit report is referenced in `README.md` or `AGENT.md` |
| Security review of dependencies | Not evidenced in the repository | solady 0.1.26, OpenZeppelin 5.6.1 and v4-core `d153b04` are vendored through `lib/v4-hooks-public` (`foundry.lock`, `.gitmodules`); their audit status is not recorded here |
| Team contactable, security contact | Not evidenced in the repository | No `SECURITY.md`, no contact address in `README.md` |
| Security mailing list or monitoring for USDC changes | Not evidenced in the repository | No reference to monitoring Circle upgrade, pause or blocklist events |

**Action:** see "Questions for the team".

---

## 2. Contract composition (`DicesCoin`)

**Complexity (Slither `human-summary`, `function-summary`).** `DicesCoin` is 250 lines (`src/DicesCoin.sol`), inherits one contract (solady `ERC20`, 670 lines), and has 33 functions including inherited ones (`printer-human-summary.txt`). Slither marks it "Complex code: Yes" and "Assembly", both of which come from the inherited solady base. Highest cyclomatic complexity is 9 for the inherited `transferFrom` and 6 for `permit`; the highest in `DicesCoin`'s own code is 3 (`_afterTokenTransfer`). **Pass.**

**Arithmetic.** `DicesCoin` compiles with `^0.8.38` and has no `unchecked` block or assembly of its own (a search of `src/` for `unchecked` and `assembly` returns nothing). The inherited solady code is assembly with explicit guards: balance underflow (`ERC20.sol:227-230`, `286-289`, `539-542`), supply overflow (`ERC20.sol:501-506`). The holder counter cannot overflow `uint32`: at most 3,333 holders can exist (TI-01). **Pass.**

**Non-token functions.** Three behaviours beyond ERC20/EIP-2612: `initialize` (`src/DicesCoin.sol:123-138`), `burn` (`182-184`), `qualifiedHolders` (`168-175`); plus five getters (`HOLDER_THRESHOLD`, `hook`, `poolManager`, `internalSwapPool`, `bankroll`, lines `32-60`). The transfer hook `_afterTokenTransfer` (`195-224`) adds state writes to every balance change. **Pass** (few, and each has a stated purpose).

**Single entry point.** Each coin is a minimal proxy created with `LibClone.cloneDeterministic` (`src/DicesHook.sol:551`; `LibClone.sol:201-206`) and is the only address for that coin. The shared implementation is a separate contract with its own storage; it is itself an initialisable token (TI-07). **Pass, with TI-07.**

---

## 3. Owner privileges

**`DicesCoin` has no owner.** There is no `Ownable`, role or admin function in `src/DicesCoin.sol`.

| Privilege | Status | Evidence |
| --- | --- | --- |
| Upgradeability | Not upgradeable | Clones point at a fixed implementation (`src/DicesHook.sol:551`). The implementation has no `delegatecall` or `selfdestruct`. `setCoinImplementation` changes only future launches (`src/DicesHook.sol:806-812`) |
| Minting | None after creation | `_mint` is reachable only from `initialize`, which runs once per clone (`src/DicesCoin.sol:125-137`) and is called in the creating transaction (`src/DicesHook.sol:551-554`). Slither: "No Minting" |
| Pausing | None on the coin | The hook is `Pausable`, but only `createCoin` is `whenNotPaused` (`src/DicesHook.sol:533`); swaps and transfers cannot be paused |
| Blocklist | None | No per-address restriction in `DicesCoin` or solady `ERC20` |
| Burn | Holder only | `burn` burns `msg.sender`'s balance (`src/DicesCoin.sol:182-184`) |

**Privileges over the coin's market (hook owner).** The coin itself is ownerless, but its only launch venue is a pool whose liquidity can never be withdrawn (`src/DicesHook.sol:289-307`) and whose rules the hook owner controls:

- `setFeeCalculator` replaces the fee rate and split for all pools, with no bound (**TI-02**).
- `setCoinImplementation` accepts any address with code (`src/DicesHook.sol:806-812`), so future coins may have any behaviour (mintable, pausable). Existing coins are unaffected.
- `setLiveCalculator` (`src/DicesHook.sol:761-763`) replaces the level rule; unlocked levels are kept (`src/DicesHook.sol:437-447`).
- `setTrustedRouter` (`src/core/TrustedRouters.sol:25-28`) decides who may swap in a launch block (`src/DicesHook.sol:334-336`).
- `setFeeRecipient`, `setBuyAndBurnRecipient`, `setCreateFee`, `pause`/`unpause` (`src/DicesHook.sol:770-799`, `843-852`).
- `renounceOwnership` is inherited from OpenZeppelin `Ownable` (`printer-contract-summary.txt`) and would freeze all of the above.

The owner is a single address set at deployment; the 48-hour timelock and Safe in the brief are deferred (`AGENT.md`, "Client component list"). **Team transparency: not evidenced in the repository.**

---

## 4. ERC20 conformity (`DicesCoin`)

**`slither-check-erc` (`check-erc20-DicesCoin.txt`).** All nine functions are present with correct signatures, return types and `view` markers; `Transfer` and `Approval` are present with indexed parameters. Three boxes are unticked ("Must emit ... Transfer/Approval") and one check fails ("not protected for the ERC20 approval race condition").

- The unticked event boxes are a tool limitation: solady emits both events with `log3` in assembly, which Slither does not trace. Verified by hand: `Transfer` in `transfer` (`ERC20.sol:241-242`), `transferFrom` (`300-301`, `341-342`), `_mint` (`516-517`), `_burn` (`548-549`); `Approval` in `approve` (`205-206`) and `permit` (`465`). **Pass.**
- Approval race: see TI-15.

| Check | Status | Evidence |
| --- | --- | --- |
| `transfer` / `transferFrom` return `bool` | Pass | `ERC20.sol:245`, `346` |
| `name`, `symbol`, `decimals` present | Pass | `src/DicesCoin.sol:145-156`; `ERC20.sol:138-140` |
| `decimals` returns `uint8` below 255 | Pass | 18, not overridden (`ERC20.sol:138-140`) |
| Reverts on failure | Pass | `InsufficientBalance`, `InsufficientAllowance` (`ERC20.sol:227-230`, `273-276`) |
| Race condition mitigated | Concern (TI-15) | No `increaseAllowance`/`decreaseAllowance`; `permit` exists |
| `slither-check-erc` | Pass with the notes above | `check-erc20-DicesCoin.txt` |
| `slither-prop` | Not run | No fuzzer installed |

**Behaviours inherited from solady that `DicesCoin` does not override**

- **Permit2 infinite allowance** (`ERC20.sol:667-669` returns `true`): TI-05.
- **EIP-2612 on a clone.** `_constantNameHash()` returns zero (`ERC20.sol:355`), so `permit` and `DOMAIN_SEPARATOR` hash `name()` on every call (`ERC20.sol:408-410`, `473-475`). `name()` reads the clone's storage (`src/DicesCoin.sol:145-147`) and the domain uses `chainid()` and `address()` at call time (`ERC20.sol:432-433`), so each clone has a correct, fork-safe domain separator. Version is the default `"1"` (`ERC20.sol:113-114`, `358-360`). **Pass.** There is no ERC-1271 path (contract wallets cannot use `permit`) and no ERC-5267 `eip712Domain()`.
- **Zero address.** Transfers and approvals to `address(0)` do not revert (`ERC20.sol:10-13`). Coins sent to `address(0)` stay in `totalSupply()`; only `burn` reduces it. The coin handles this in its counter (`src/DicesCoin.sol:247-249`) and rejects a zero bankroll (`105-107`); test at `test/DicesCoin.t.sol:143-157`.
- **Infinite allowance** is not decremented (`ERC20.sol:271`, `313`).

**Coverage.** `test/DicesCoin.t.sol` covers initialisation, burn and the holder counter (14 tests including a fuzzed balance-versus-count check at line 205). No test exercises `permit`, `DOMAIN_SEPARATOR`, `nonces` or the Permit2 behaviour on a clone.

---

## 5. ERC20 extension risks (`DicesCoin`)

| Check | Status | Evidence |
| --- | --- | --- |
| No external calls in transfers (not ERC777) | Pass | Transfer paths are storage writes and a log (`ERC20.sol:217-246`, `257-347`); `_afterTokenTransfer` reads its own balances and immutables and writes one packed slot (`src/DicesCoin.sol:195-224`) |
| No transfer fee | Pass | Recipient is credited the full `amount` (`ERC20.sol:239`, `298`) |
| No interest or rebase | Pass | Balances change only in `transfer`, `transferFrom`, `_mint`, `_burn` |

The transfer hook adds gas to every transfer (documented in `AGENT.md` as about 1.2k, or 6.6k when a wallet crosses the threshold; not re-measured).

---

## 6. Token scarcity analysis (from source; no on-chain data)

**Supply and launch distribution.** `LAUNCH_SUPPLY = 1_000_000_000e18` is minted to the hook (`src/DicesHook.sol:71`, `554`). The split is fixed by constants (`src/DicesHook.sol:76-86`):

| Share | Amount | Destination | Evidence |
| --- | --- | --- | --- |
| 70% | 700,000,000 | Sale position in the Uniswap v4 PoolManager, launch price to the $200k tick | `src/DicesHook.sol:645`, `652` |
| 20% | 200,000,000 | Upper position in the PoolManager, $200k tick to the usable tick limit | `src/DicesHook.sol:646`, `653` |
| 10% | 100,000,000 | `DicesCoin.bankroll()`, one address shared by every coin of an implementation | `src/DicesHook.sol:558`; `src/DicesCoin.sol:60` |

Liquidity-rounding dust stays in the hook permanently (`src/DicesHook.sol:613-614`; `test/DicesHookInvariant.t.sol:74`, `89`).

| Check | Status | Notes |
| --- | --- | --- |
| Supply owned by more than a few users | Fail at launch, by design | Two holders at creation: the PoolManager (90%) and the bankroll (10%). Distribution depends entirely on buying |
| Total supply sufficient | Pass | 1e27 base units |
| Tokens in more than a few exchanges | Concern | One venue at launch. Third parties cannot add liquidity to it (`src/DicesHook.sol:289-296`). Nothing prevents a second, hookless pool elsewhere; trades there pay no hook fee and are not seen by the level rule |
| Flash loan / large fund risk understood | Pass for the holder count; open for future users of `balanceOf` | Any coin held by the PoolManager (up to 90% of supply) can be taken and returned inside one `unlock` at no cost (`v4-core/src/PoolManager.sol:291-297`, `104-114`). The coin's holder count ignores same-block joiners for this reason (`src/DicesCoin.sol:162-175`). Any later contract that weights by `balanceOf` in one transaction (rakeback, voting) will need its own defence |
| No flash minting | Pass | No mint path after `initialize` |

**Holder threshold versus supply.** A qualifying holder needs `HOLDER_THRESHOLD = 300_000e18` (`src/DicesCoin.sol:32`). This is the basis of **TI-01**.

**Bankroll concentration.** **TI-03.**

---

## 7. Weird ERC20 patterns

Each pattern is answered twice: (a) does `DicesCoin` exhibit it, and (b) would the integration code mishandle a token that does. For (b), "USDC" means USDC as described in the brief, and "any token" applies to `FeeEscrow` alone, the only contract that accepts arbitrary currencies (`src/core/FeeEscrow.sol:34`). The hook and the swap pool only ever touch USDC and `DicesCoin`: the hook enforces a USDC pair (`src/DicesHook.sol:271-273`, `564`) and `_creditFee` is reached only with USDC or native currency (`src/DicesHook.sol:479-481`, `542`; `src/core/InternalSwapPool.sol:260-277`).

| # | Pattern | (a) `DicesCoin` | (b) Integration |
| --- | --- | --- | --- |
| 7.1 | Reentrant calls (ERC777 hooks) | **Absent.** No external call in any transfer path (`ERC20.sol:217-246`, `257-347`; `src/DicesCoin.sol:195-224`) | **Handled.** USDC: no hooks. Any token: `deposit`, `claim`, `claimBatch` are `nonReentrant` (`src/core/FeeEscrow.sol:34`, `80`, `89`) and `_claim` clears the credit before paying (`110` before `113-117`). The hook and swap pool have no guard of their own; they rely on `onlyPoolManager`/`onlyHook` and on touching only hook-free tokens |
| 7.2 | Missing return values | **Absent.** Returns `true` (`ERC20.sol:208`, `245`, `346`) | **Handled.** `SafeERC20` in the escrow (`src/core/FeeEscrow.sol:61`, `116`) and the hook's settler (`src/libraries/CurrencySettler.sol:41`); `Currency.transfer` accepts empty return data (`v4-core/src/types/Currency.sol:64-74`); `forceApprove` (`src/DicesHook.sol:738`, `src/core/InternalSwapPool.sol:294`). Exception: the swap pool's settler is the upstream test utility, which calls `IERC20Minimal.transfer` unchecked; it only ever targets `DicesCoin` (TI-12) |
| 7.3 | Fee on transfer | **Absent.** | **Handled, fail-closed.** USDC: none today. If an upgrade added one, `deposit` would revert with `UnexpectedTokenAmount` (`src/core/FeeEscrow.sol:60-67`), so swaps whose fee is in USDC would revert rather than mis-account. Any token: same check; tested (`test/FeeEscrow.t.sol:98-107`). A fee charged on the way out reduces only that beneficiary's receipt |
| 7.4 | Balance changes outside transfers (rebase, airdrop) | **Absent.** No rebase or admin mint. Supply can fall through holder `burn` (TI-06) | **USDC: not applicable.** Any token: rebasing is declared unsupported (`src/core/FeeEscrow.sol:17`) and cannot be detected; a negative rebase leaves the last claimants of that currency unpaid, a positive one strands the surplus. Credits are per currency (`src/core/FeeEscrow.sol:25`), so other currencies are unaffected. The swap pool caches coin inventory (`src/core/InternalSwapPool.sol:95`, `134`, `254`), which is sound for `DicesCoin` (invariant at `test/DicesHookInvariant.t.sol:87-91`) |
| 7.5 | Upgradable token | **Absent.** Minimal proxy to a fixed implementation (`src/DicesHook.sol:551`) | **Present in USDC; not mitigated.** `usdc` is immutable (`src/DicesHook.sol:110`), there is no upgrade detection and swaps cannot be paused. The escrow's balance check makes a behaviour change fail closed. No monitoring is evidenced |
| 7.6 | Flash mintable | **Absent** as minting. Flash-borrowable from the PoolManager; the holder count defends against it (`src/DicesCoin.sol:168-175`) | **Not applicable.** No integration decision reads a USDC or arbitrary-token balance as a signal |
| 7.7 | Blocklist | **Absent.** | **Present in USDC; partly mitigated.** A blocked fee recipient only loses its own `claim` (pull payment). A blocked hook, swap pool or escrow reverts swaps and cannot be replaced (TI-09). Any token: a blocked beneficiary cannot claim and reverts any batch that includes it (`src/core/FeeEscrow.sol:89-94`) |
| 7.8 | Pausable | **Absent.** | **Present in USDC; acceptable.** While paused, every swap and USDC claim reverts and state is unchanged; nothing is lost. Any token: same |
| 7.9 | Approval race protection (USDT, KNC) | **Absent.** `approve` overwrites (`ERC20.sol:197-208`) | **Handled.** USDC has none. Both `_creditFee` functions use `forceApprove` for the exact amount, which the escrow then pulls in full (`src/DicesHook.sol:738-739`, `src/core/InternalSwapPool.sol:294-295`). The escrow never approves |
| 7.10 | Revert on approval to zero address | **Absent.** Allowed (`ERC20.sol:10-13`) | **Handled by deployment.** The only spender approved is `feeEscrow`. The hook constructor reads it without a zero check (`src/DicesHook.sol:215`); the deployment script checks the wiring (`script/deployment/V001.s.sol:522`) |
| 7.11 | Revert on zero-value approval | **Present for one spender.** `approve(PERMIT2, 0)` reverts with `Permit2AllowanceIsFixedAtInfinity` (`ERC20.sol:187-196`); TI-05 | **Handled.** Zero amounts never reach `forceApprove` (`src/DicesHook.sol:732-734`, `src/core/InternalSwapPool.sol:288-290`) |
| 7.12 | Revert on zero-value transfer | **Absent.** Zero transfers succeed; the counter returns early (`src/DicesCoin.sol:197-199`) | **Handled.** Fee skipped when zero (`src/DicesHook.sol:376`); zero credits skipped (`732-734`); escrow rejects zero deposits and skips zero claims (`src/core/FeeEscrow.sol:41-43`, `105-107`); swap pool guards `spent` and `proceeds` (`src/core/InternalSwapPool.sol:257`, `261`) |
| 7.13 | Multiple token addresses | **Absent.** One address per coin. The implementation is a separate initialisable token (TI-07) | **Not applicable.** The escrow ledger is keyed by address and has no sweep or rescue function that a second entry point could abuse |
| 7.14 | Low decimals | **Absent.** 18 | **Handled, with one unit mismatch.** USDC must report 6 decimals (`src/DicesHook.sol:201`; `script/deployment/V001.s.sol:345`). Level ticks are hard-coded for 6-decimal USDC and an 18-decimal coin (`src/calculators/LiveCalculator.sol:214-242`); the calculator itself does not check. Fees round down (`src/DicesHook.sol:462`): a USDC leg under 80 units pays nothing pre-Live. The split gives the remainder to the platform, so no dust is stranded (`src/calculators/FeeCalculator.sol:87-93`). `MINIMUM_INTERNAL_SWAP_POOL_SIZE` has a 6-decimal scale but is compared with an 18-decimal balance (TI-11). Escrow: decimals-agnostic |
| 7.15 | High decimals | **Absent.** | **Not applicable** for USDC. Escrow: decimals-agnostic; `balanceBefore + _amount` is checked arithmetic (`src/core/FeeEscrow.sol:65`) |
| 7.16 | `transferFrom` with `src == msg.sender` | Allowance is always required and spent unless it is the maximum or the caller is Permit2 (`ERC20.sol:264-279`) | **Handled.** No call site uses `transferFrom` from itself: the settler branches on `payer` (`src/libraries/CurrencySettler.sol:40-44`); the escrow pulls from `msg.sender` (`src/core/FeeEscrow.sol:61`) |
| 7.17 | Non-string metadata | **Absent.** `string` | **Not applicable.** The only external metadata read is USDC `decimals()` (`src/DicesHook.sol:201`) |
| 7.18 | Revert on transfer to zero address | **Absent.** Does not revert; coins sent there are locked and remain in `totalSupply()` (`test/DicesCoin.t.sol:152-156`) | **Handled.** USDC reverts on it; no path pays the zero address: the escrow rejects a zero beneficiary at deposit (`src/core/FeeEscrow.sol:36-38`), which is also the cause of TI-04. The bankroll cannot be zero (`src/DicesCoin.sol:105-107`) |
| 7.19 | No revert on failure (returns `false`) | **Absent.** Reverts with custom errors | **Handled.** `SafeERC20` and `Currency.transfer` check the returned value. The upstream settler ignores it, but the PoolManager credits by balance difference (`v4-core/src/PoolManager.sol:349-365`), so an unpaid settle fails at the end of the unlock (`104-114`) |
| 7.20 | Revert on large approvals (UNI, COMP) | **Absent.** `uint256` allowances. The inverse applies to Permit2: any approval other than the maximum reverts | **Not applicable.** Approvals are exact fee amounts |
| 7.21 | Code injection via token name | **Present as a risk.** Name and symbol are unvalidated creator input (TI-08) | **Not applicable on-chain.** No contract reads an external token's name. Frontends and indexers must escape coin names |
| 7.22 | Unusual `permit` | **Absent.** Standard EIP-2612 (`ERC20.sol:389-469`), with the Permit2 special case | **Not applicable.** No integration contract calls `permit` on any token, so there is no phantom-permit exposure |
| 7.23 | Transfer less than amount (cUSDCv3) | **Absent.** | **Handled.** USDC: no. Any token: the escrow's equality check reverts (`src/core/FeeEscrow.sol:65`) |
| 7.24 | ERC-20 representation of native currency | **Absent.** | **Not determined for Base** (no on-chain check). By construction the escrow cannot double-credit: an ERC20 deposit requires `msg.value == 0` and a matching balance increase, a native deposit requires `msg.value == _amount`, and the two are separate ledgers (`src/core/FeeEscrow.sol:46-71`) |

**Tests against weird tokens.** One fee-on-transfer double (`test/utils/Fixtures.sol:41-51`) and a plain mintable token with configurable decimals (`22-36`). No test double models a paused or blocklisting USDC, a missing return value or a rebasing token.

---

## 8. Token integration safety

### Transfer call sites

Every token movement in `src/` (search for `settle(`, `take(`, `safeTransfer`, `forceApprove`, `.transfer(`, `transferFrom(`):

| Site | Token | Mechanism | Assessment |
| --- | --- | --- | --- |
| `src/DicesHook.sol:473` | USDC or coin | `PoolManager.take` to the hook | Safe: `Currency.transfer` inside the PoolManager |
| `src/DicesHook.sol:475-476` | Coin | `Currency.transfer` to the swap pool, then ledger entry | Safe: exact for `DicesCoin` |
| `src/DicesHook.sol:558` | Coin | `Currency.transfer` of 10% to the bankroll | Safe; recipient cannot be zero |
| `src/DicesHook.sol:614` | Coin | `sync`, `Currency.transfer`, `settle` | Safe; payer is always the hook, so Slither's `arbitrary-send-erc20` on `src/libraries/CurrencySettler.sol:41` is a false positive at the only call site |
| `src/DicesHook.sol:736-739` | Native or USDC | `deposit{value}` or `forceApprove` then `deposit` | Safe; reverts on a zero recipient (TI-04) |
| `src/core/InternalSwapPool.sol:258` | Coin | Upstream test `CurrencySettler.settle` | Safe for `DicesCoin` only (TI-12) |
| `src/core/InternalSwapPool.sol:262` | USDC | `PoolManager.take` to the swap pool | Safe |
| `src/core/InternalSwapPool.sol:292-295` | Native or USDC | As the hook's `_creditFee` | Safe; native branch unreachable (TI-13) |
| `src/core/FeeEscrow.sol:60-67` | Any | Balance-checked `safeTransferFrom` | Safe |
| `src/core/FeeEscrow.sol:114-116` | Native or any | `safeTransferETH` or `safeTransfer` after clearing the credit | Safe |

### Defensive patterns

| Pattern | Status | Evidence |
| --- | --- | --- |
| Safe transfer wrappers | Pass, one exception | Table above; TI-12 |
| Balance verification on receipt | Pass | `src/core/FeeEscrow.sol:60-67`; the PoolManager settles by balance difference |
| Pull payments for recipients | Pass | Fees are credited, never pushed (`src/DicesHook.sol:479-481`); a failing recipient cannot block a swap |
| Reentrancy protection | Pass | Escrow guard and checks-effects-interactions; hook and swap pool gated by caller |
| Zero-value handling | Pass | Pattern 7.12 |
| Token allowlist | Pass for the hook (USDC pair enforced, `src/DicesHook.sol:271-273`, `564`); none for the escrow, by design | `src/core/FeeEscrow.sol:14-17` |
| Decimals assumptions checked | Pass in the hook and script; not in `LiveCalculator` | `src/DicesHook.sol:201`; `script/deployment/V001.s.sol:345`, `526` |
| Upgrade detection for USDC | Fail | None |
| Blocklist-aware design | Partial | TI-09 |
| Residual balances | Pass | The fee split sums exactly (`src/calculators/FeeCalculator.sol:93`); invariant `usd.balanceOf(hook) == 0` (`test/DicesHookInvariant.t.sol:90`) |

### `LiveCalculator` assumptions about the coin

- `qualifiedHolders()` is read from the pool's coin only after the average has earned a level (`src/calculators/LiveCalculator.sol:364-371`). If that call reverted, the whole `qualify` call, including the observation written by `_observe`, would revert and the hook's `try` would swallow it (`src/DicesHook.sol:436-448`). `DicesCoin.qualifiedHolders` cannot revert (`src/DicesCoin.sol:168-175`); a replacement coin implementation must keep that property.
- Supply is the constant `SUPPLY = 1e27` (`src/calculators/LiveCalculator.sol:94`), not `totalSupply()` (TI-06).

---

## 9. ERC721 conformity

**Not applicable.** A case-insensitive search of `src/` and `script/` for `erc721`, `onERC721Received`, `safeMint`, `ERC1155`, `ERC777` and `tokensReceived` returns no match. Liquidity positions are created directly with `PoolManager.modifyLiquidity` (`src/DicesHook.sol:715`; `src/core/InternalSwapPool.sol:207`, `239`), not through the NFT-based PositionManager. ERC-6909 claims are not used either: the swap pool passes `false` for the `burn` and `claims` flags (`src/core/InternalSwapPool.sol:258`, `262`).

## 10. ERC721 common risks

**Not applicable**, for the same reason.

---

## Findings

### TI-01 (Medium). Holder floors of levels 9 and 10 exceed the number of qualifying holders the supply allows

`src/DicesCoin.sol:32`, `src/DicesHook.sol:71`, `src/calculators/LiveCalculator.sol:251-253`, `368-375`

```solidity
uint public constant HOLDER_THRESHOLD = 300_000e18;                       // DicesCoin.sol:32
uint internal constant LAUNCH_SUPPLY = 1_000_000_000e18;                  // DicesHook.sol:71
return [uint(150), 225, 350, 500, 750, 1_100, 1_700, 2_500, 3_800, 5_800]; // LiveCalculator.sol:252
```

A qualifying holder must hold 300,000 coins, the supply is fixed at 1,000,000,000 and can only fall (`burn`), so no more than `1e9 / 300,000 = 3,333` qualifying holders can exist, even if every coin, including the bankroll's and the pool's, sat in exactly threshold-sized wallets. `_levelAt` lowers the level until `holders >= floors[level_ - 1]` (`LiveCalculator.sol:373-375`), so it can never return 9 or 10.

| Level | Floor | Coins that must sit in qualifying wallets | Share of supply |
| --- | --- | --- | --- |
| 6 | 1,100 | 330,000,000 | 33% |
| 7 | 1,700 | 510,000,000 | 51% |
| 8 | 2,500 | 750,000,000 | 75% |
| 9 | 3,800 | 1,140,000,000 | 114%: impossible |
| 10 | 5,800 | 1,740,000,000 | 174%: impossible |

Level 8 is also out of practical reach. Coins held by the PoolManager, hook, swap pool and bankroll are never counted (`src/DicesCoin.sol:247-249`). By the constant-liquidity formula, the upper position still holds roughly `200M x sqrt($200k / $25.6M)`, about 18M coins, at the level-8 price, leaving about 982M outside the pool, or about 882M if the bankroll keeps its 100M (estimate from the formula, not executed). Level 8 then needs 76% to 85% of all coins outside the pool to be in wallets of 300,000 or more, with nothing held above the threshold.

The gap is not caught by tests: the only tests that reach level 10 replace the coin with a stub whose holder count is set directly (`test/utils/Fixtures.sol:83-99`; `test/Calculators.t.sol:139-143`). Tests with the real coin stop at 500 holders (`test/DicesHookLive.t.sol:194`).

**Consequence:** games 9 and 10 can never unlock for any coin, and game 8 effectively cannot. No funds are at risk.

**Fix:** lower `HOLDER_THRESHOLD`, scale the threshold per level, or revise the floors with the client. A threshold that makes level 10 reachable with, say, half the supply in qualifying wallets is about 86,000 coins. Add a test that asserts `floors[i] * HOLDER_THRESHOLD` against the supply.

### TI-02 (Medium). Fee rate and split of every launched pool are set by a replaceable calculator with no on-chain bound

`src/DicesHook.sol:462`, `478`, `752-754`, `819-825`

```solidity
fee.amount = Math.mulDiv(amount, feeCalculator.getSwapFee(poolLive(key.toId())), FEE_DENOMINATOR);  // :462
```

```solidity
function setFeeCalculator(address _calculator) external onlyOwner { _setFeeCalculator(_calculator); }  // :752-754
```

The only validation is that the new calculator has code (`:820-822`). The rate it returns is applied unbounded to the unspecified leg of every swap in every existing pool, and its `getFeeDistribution` decides who receives it (`:478-481`). There is no per-pool snapshot of the rate (the "Configuration" section of `AGENT.md` describes one, but that section is marked stale and the code has none). Holders cannot avoid a change by withdrawing liquidity, because all liquidity belongs to the hook and is locked. The 48-hour timelock from the brief is deferred.

**Consequence:** the owner key can, in one transaction, raise the fee on all pools to any level (a rate at or above 100% makes exact-input sells return nothing or revert) and redirect the creator and buy-and-burn shares.

**Fix:** enforce a maximum rate in the hook (for example `require(rate <= MAX_FEE)` after the calculator call) and, if the split is meant to be a commitment to creators, bound that too; put the owner behind the planned timelock before launch.

### TI-03 (Medium, acknowledged). 10% of every coin goes to one unrestricted address shared by all coins

`src/DicesHook.sol:86`, `558`; `src/DicesCoin.sol:60`; `script/deployment/V001.s.sol:134`, `227`

```solidity
Currency.wrap(coin).transfer(DicesCoin(coin).bankroll(), BANKROLL_SUPPLY);  // DicesHook.sol:558
```

The bankroll is an immutable of the coin implementation, so one address receives 100,000,000 coins of every launch and nothing on-chain restricts what it does with them. These are the only coins nobody paid for; selling them removes USDC that buyers put in, and the pool can run out of USDC while buyers still hold coins (pinned by `test/DicesHookLaunchCurve.t.sol:75`). The bankroll's coins can also seed qualifying holders at no cost (333 wallets' worth). This is open question 10 in `AGENT.md`; it is listed here because the skill's scarcity checks flag it and the mainnet address is still unset.

**Fix:** decide the bankroll's form before mainnet: a contract that can only pay winnings, or a lock until Live. Record the decision and the address.

### TI-04 (Low). A coin created with a zero `creator` has its USDC-fee swaps revert

`src/DicesHook.sol:574`, `480`, `731-740`; `src/core/FeeEscrow.sol:36-38`; `src/core/InternalSwapPool.sol:274`

```solidity
poolCreators[poolId] = params.creator;                                          // DicesHook.sol:574, no check
_creditFee(poolCreators[poolId], Currency.unwrap(fee.currency), creator);       // DicesHook.sol:480
if (_beneficiary == address(0)) { revert InvalidBeneficiary(); }                // FeeEscrow.sol:36-38
```

`createCoin` does not validate `params.creator` (`src/DicesHook.sol:533-578`). The creator's share is 30% of each fee (`src/calculators/FeeCalculator.sol:23`, `87`), which is non-zero for any fee of 4 units or more, and `_creditFee` skips only zero amounts.

**Consequence (by code reading, not executed):** for such a coin, every swap whose fee is taken in USDC reverts (exact-input sells and exact-output buys), and so does every buy that converts queued coin fees with non-zero proceeds (`InternalSwapPool.sol:261-274`). Exact-output sells still work, because their fee is taken in the coin and sells do not convert. The launcher mostly harms itself, but a first buyer is left with a coin that can only be exited one way.

**Fix:** revert in `createCoin` when `params.creator == address(0)` (the `ZeroAddress` error already exists, `src/interfaces/IDicesHook.sol:147`), and add a test.

### TI-05 (Low). Permit2 holds a fixed, irrevocable infinite allowance over every holder's coins

`lib/v4-hooks-public/lib/solady/src/tokens/ERC20.sol:171-173`, `187-196`, `260-264`, `398-407`, `667-669`

```solidity
function _givePermit2InfiniteAllowance() internal view virtual returns (bool) { return true; }   // :667-669
if (spender == _PERMIT2) return type(uint256).max;                                               // :172
```

`DicesCoin` does not override the solady default. For every holder, `allowance(holder, PERMIT2)` is the maximum, Permit2 can call `transferFrom` without any stored allowance, and `approve(PERMIT2, x)` or `permit(..., PERMIT2, x, ...)` with any `x` other than the maximum reverts with `Permit2AllowanceIsFixedAtInfinity`. The team is aware of it (`script/process/GenerateActivity.s.sol:156`).

**Consequence:** a holder never grants or sees an on-chain approval to Permit2, cannot revoke it (revocation tools that call `approve(PERMIT2, 0)` revert), and one phished Permit2 signature can move all of that holder's coins of every Dices coin. Integrators that reset an allowance to zero before setting it will revert for this spender. The behaviour also assumes the canonical Permit2 contract exists at `0x000000000022D473030F116dDEE9F6B43aC78BA3` on the target chain (not verified on-chain here).

**Fix:** make it a recorded decision. Either override `_givePermit2InfiniteAllowance()` to return `false`, or keep it and document it for users, wallets and integrators. Add tests for `permit`, `DOMAIN_SEPARATOR` and the Permit2 path on a clone.

### TI-06 (Low). `burn` lowers `totalSupply()` but the level rule prices the coin on a constant supply

`src/DicesCoin.sol:182-184`; `src/calculators/LiveCalculator.sol:94`, `208`, `219-242`

```solidity
function burn(uint amount) external { _burn(msg.sender, amount); }   // DicesCoin.sol:182-184
uint internal constant SUPPLY = 1e27;                                 // LiveCalculator.sol:94
```

Each level target is the tick at which 1e27 base units are worth the target, and `averageMarketCap` multiplies the price by the same constant. Burns are part of the product (30% of fees go to a buy-and-burn recipient, `src/calculators/FeeCalculator.sol:28`; the brief describes token burns). After any burn, the figure the protocol calls market cap is price times the launch supply, which overstates price times `totalSupply()` by the burned share. Coins sent to `address(0)` are a second kind of burn that does not reduce `totalSupply()` at all (section 4).

**Consequence:** levels unlock at a lower real capitalisation as supply is burned, and `averageMarketCap` disagrees with a figure computed from `totalSupply()`. Burning also makes TI-01 stricter.

**Fix:** state in the interface and UI that level targets are measured against the launch supply, or read `totalSupply()` in the calculator if circulating capitalisation is what the client means.

### TI-07 (Low). The `DicesCoin` implementation can be initialised by anyone

`src/DicesCoin.sol:103-113`, `123-138`; `script/deployment/V001.s.sol:227`

```solidity
function initialize(string calldata name_, string calldata symbol_, uint supply, address to) external {
    if (_initialized) { revert AlreadyInitialized(); }
```

The constructor sets the immutables but not `_initialized`, and the deployment script deploys the implementation without initialising it. Anyone can call `initialize` on the implementation address and mint any supply under any name to themselves. The tests do exactly this (`test/DicesCoin.t.sol:40-46`). Clones are unaffected: they have their own storage and the implementation has no `delegatecall` or `selfdestruct`.

**Consequence:** the address published as "DicesCoin (impl)" in the deployment book (`script/deployment/V001.s.sol:649`) can be turned into a live token with an attacker-chosen name, which is a phishing aid.

**Fix:** set `_initialized = true` in the constructor.

### TI-08 (Low). Coin name and symbol are unvalidated creator input

`src/DicesHook.sol:554`; `src/DicesCoin.sol:133-134`; `ERC20.sol:408-410`

`createCoin` passes `params.name` and `params.symbol` straight to `initialize`, which stores them. Empty strings, arbitrary bytes, markup, names of any length and duplicates of well-known tokens ("USD Coin", "USDC") are all accepted, and `createCoin` is permissionless. The name is also hashed on every `permit` and `DOMAIN_SEPARATOR` call, so a very long name raises the cost of those calls for that coin's holders.

**Consequence:** injection and impersonation risk for the frontend, indexer and any third-party UI that renders coin names.

**Fix:** require non-empty strings and cap their lengths in `createCoin`; escape names off-chain; show the coin address beside the name.

### TI-09 (Low). Three launchpad addresses are single points of failure under USDC's blocklist, with no way to replace them

`src/DicesHook.sol:125`, `145`, `473`, `738-739`; `src/core/InternalSwapPool.sol:262`, `294-295`

Fee recipients are protected by the pull design. The contracts in the swap path are not: the hook receives USDC (`:473`), the swap pool receives USDC (`InternalSwapPool.sol:262`), and both transfer it into the escrow inside the swap (`:738-739`). `feeEscrow` and `internalSwapPool` have no setter (Slither `immutable-states` reports both as effectively immutable), and the coin implementation hard-codes the swap pool.

**Consequence (by code reading, not executed; assumes USDC rejects transfers to and from a blocked address):**

| Blocked address | Swaps that revert | Still available |
| --- | --- | --- |
| Hook | Exact-input sells, exact-output buys (fee taken in USDC) | Exact-input buys, exact-output sells |
| Swap pool | Buys that convert queued coin fees | All sells |
| Escrow | Exact-input sells, exact-output buys, converting buys; all existing USDC credits frozen | Exact-output sells |

Likelihood is low, since it requires action by Circle against a protocol contract, but there is no recovery path short of redeploying and abandoning existing pools.

**Fix:** record the risk. If it is not acceptable, wrap the credit in a `try` that falls back to holding the fee in the hook for later delivery, so a failing escrow transfer cannot revert a swap.

### TI-10 (Low). The swap pool splits converted fees with its own fixed calculator while the hook's can be replaced

`src/core/InternalSwapPool.sol:75`, `265`; `src/DicesHook.sol:115`, `478`, `752-754`

```solidity
IFeeCalculator public immutable feeCalculator;                                                              // InternalSwapPool.sol:75
(uint platform, uint creator, uint buyAndBurn) = feeCalculator.getFeeDistribution(proceeds, ...);           // InternalSwapPool.sol:265
```

**Consequence:** after `setFeeCalculator`, fees taken in USDC follow the new split and fees taken in the coin (then converted by the swap pool) follow the old one indefinitely, because the swap pool cannot be replaced.

**Fix:** have the swap pool read `dicesHook.feeCalculator()` at the time of the split.

### Informational

- **TI-11. `MINIMUM_INTERNAL_SWAP_POOL_SIZE = 1e6` is compared with an 18-decimal coin balance** (`src/core/InternalSwapPool.sol:90`, `155`; the inventory is in coin units, `src/DicesHook.sol:475-476`). 1e6 base units is 1e-12 coins, so the guard described as "fees ... that are worth interacting with" (`InternalSwapPool.sol:152-153`) never filters anything. The constant has the scale of one USDC. The effect is gas only: every buy that follows a coin-denominated fee adds and removes a position, settles, takes and makes up to three escrow deposits, whatever the inventory is worth. Whether a real minimum was intended is not determined.
- **TI-12. The swap pool imports a v4-core test utility in production** (`src/core/InternalSwapPool.sol:9`). Its `settle` calls `IERC20Minimal(...).transfer(address(manager), amount)` and ignores the result (`v4-core/test/utils/CurrencySettler.sol:29-31`). It is only used to pay `DicesCoin` to the PoolManager (`InternalSwapPool.sol:258`), which reverts on failure, and the PoolManager credits by balance difference, so there is no exposure today. The repository already has a checked version (`src/libraries/CurrencySettler.sol`); use it.
- **TI-13. Native-currency paths in the swap pool are unreachable and its `receive()` locks ETH** (`src/core/InternalSwapPool.sol:291-292`, `363-365`). The paired currency is always USDC and never `address(0)` (`src/DicesHook.sol:201`, `271-273`, `564`). ETH sent to the swap pool has no way out. Slither reports `_creditFee` as dead code there; that is a side effect of its IR failure on `closeInternalSwapPool`, where the function is called (`InternalSwapPool.sol:271-277`).
- **TI-14. `FeeEscrow` properties to keep in mind.** Anyone can credit any beneficiary in any currency and anyone can trigger a payout (`src/core/FeeEscrow.sol:34`, `80`), so indexers and keepers should filter by depositor and currency. A native credit to a beneficiary that cannot receive ETH is permanent: there is no redirect (`src/core/FeeEscrow.sol:16`, `114`); this applies to the creation fee credited to `feeRecipient` (`src/DicesHook.sol:542`). `claimBatch` is atomic, so one failing entry reverts the batch (`89-94`). Rebasing currencies are unsupported and undetectable (pattern 7.4). Credits follow the recipient set at the time of the fee; `setFeeRecipient` does not move earlier credits.
- **TI-15. ERC20 approval race not mitigated.** solady has no `increaseAllowance`/`decreaseAllowance` (Slither: "Approve Race Cond."). Standard behaviour; `permit` is available.
- **TI-16. Holder count properties (acknowledged in `AGENT.md`).** One party with 45,000,000 coins can supply all 150 Live holders; the count only requires the coins to be held across one block boundary (`src/DicesCoin.sol:168-175`). Any address outside the four excluded ones counts, including `FeeEscrow`, routers, other pools and dead addresses other than `address(0)` (`src/DicesCoin.sol:247-249`). `qualifiedHolders` relies on `block.number` advancing per block, which holds on Base.
- **TI-17. Documentation and deployment records are behind the code.** `README.md:10-13` says every fee is charged in USDC and accrues as ERC-6909 claims withdrawn with `claimFees()`; the code charges the fee in the unspecified currency, which is the coin for exact-input buys and exact-output sells (`src/DicesHook.sol:460`), and pays real tokens into `FeeEscrow`. The Base Sepolia address book was broadcast from commit `32487ad` and does not describe the reviewed code.

---

## Compliance checklist

`[x]` met, `[ ]` not met, `[?]` not evidenced or not determined, `[n/a]` not applicable.

**General considerations**
- `[?]` Security review completed (not evidenced in the repository)
- `[?]` Team contactable (not evidenced in the repository)
- `[?]` Security mailing list exists (not evidenced in the repository)

**Contract composition**
- `[x]` Avoids unnecessary complexity
- `[x]` Uses Solidity 0.8+
- `[x]` Few non-token functions
- `[x]` Single address entry point (see TI-07 for the implementation)

**Owner privileges**
- `[x]` Not upgradeable
- `[x]` Limited minting (none after creation)
- `[x]` Not pausable
- `[x]` No blacklist
- `[?]` Known team (not evidenced in the repository)
- `[ ]` Privileges over the coin's market are bounded (TI-02)

**ERC20 conformity**
- `[x]` Returns boolean from transfer functions
- `[x]` Metadata functions present
- `[x]` Decimals returns `uint8`
- `[ ]` Race condition mitigated (TI-15)
- `[x]` Passes `slither-check-erc` (event boxes verified by hand)
- `[?]` Passes `slither-prop` generated tests (not run)
- `[x]` No external calls in transfers
- `[x]` No transfer fees
- `[n/a]` Interest accounted for

**Token scarcity** (from source)
- `[ ]` Distributed ownership (two holders at launch; TI-03)
- `[x]` Sufficient total supply
- `[ ]` Multiple exchange listings (one venue at launch)
- `[x]` Flash loan risks understood (holder count)
- `[x]` No flash minting

**ERC721 conformity and risks**
- `[n/a]` All nine items (no ERC721 in the codebase)

**Integration safety**
- `[x]` Safe transfer wrappers (TI-12 noted)
- `[x]` Received amounts verified
- `[x]` Reentrancy protection
- `[x]` Zero-value handling
- `[x]` Fee-on-transfer rejected
- `[ ]` Upgrade detection for USDC
- `[ ]` Blocklist-aware design for protocol contracts (TI-09)
- `[ ]` Tests model pausable or blocklisting USDC

---

## On-chain analysis report

**Not performed.** No network access; no deployment of commit `bcd45b2` is evidenced; no mainnet deployment exists in `deployments/` or `broadcast/`. Token name, symbol, holder distribution, exchange distribution and live configuration are therefore not reported. The USDC, PoolManager and Universal Router constants for Base (`script/deployment/V001.s.sol:126-128`) and Base Sepolia (`140-142`) were not checked against the chain; the script itself checks code presence and 6 decimals before broadcasting (`341-347`).

---

## Prioritized recommendations

**Critical (fix before deployment):** none.

**High:** none.

**Medium**
1. TI-01: reconcile `HOLDER_THRESHOLD`, the supply and the ten holder floors; add a test tying them together.
2. TI-02: cap the fee rate in the hook and put the owner behind the timelock.
3. TI-03: decide and implement the bankroll's restrictions; set the mainnet address.

**Low**
4. TI-04: reject a zero creator in `createCoin`.
5. TI-05: decide on the Permit2 default; document or disable it; test `permit` on a clone.
6. TI-06: define market cap against launch supply or `totalSupply()` and say which.
7. TI-07: lock the implementation in its constructor.
8. TI-08: bound and validate name and symbol.
9. TI-09: accept or mitigate the USDC blocklist dependency.
10. TI-10: read the fee calculator from the hook in the swap pool.

**Best practice**
11. TI-11 to TI-13: fix the inventory threshold's units, replace the test-utility settler, remove the unreachable native paths.
12. Run `slither-prop` with Echidna or port its properties to Foundry invariants for `DicesCoin`.
13. Add test doubles for a paused and a blocklisting USDC, and a fork test against real USDC.
14. Monitor USDC upgrade, pause and blocklist events for the hook, swap pool and escrow.
15. Bring `README.md` and `AGENT.md` in line with the fee and escrow code (TI-17).

---

## Questions for the team

1. Has `DicesCoin` or the launchpad been audited, or is an audit planned? (Not evidenced in the repository.)
2. What is the security contact, and is there a disclosure policy? (Not evidenced in the repository.)
3. Who are the accountable team members and under which jurisdiction? (Not evidenced in the repository.)
4. Does anyone subscribe to Circle's USDC announcements, and is there a plan for a USDC upgrade, pause or blocklisting of a launchpad contract?
5. Are levels 9 and 10 meant to be reachable? If so, which of the threshold, the floors or the supply should change (TI-01)?
6. Is the Permit2 infinite allowance intended for end users (TI-05)?
7. Should market cap follow `totalSupply()` after burns (TI-06)?
8. Was a real minimum inventory intended for fee conversion, and in which unit (TI-11)?
9. Is `FeeEscrow` meant to accept arbitrary currencies from arbitrary callers, or only USDC and native currency from the hook and swap pool?
10. What is the mainnet bankroll, and what may it do with its coins (TI-03)?
11. Will the fee rate be capped on-chain, and when does the timelock arrive (TI-02)?

---

## Appendix: material read

- In scope, read in full: `src/DicesCoin.sol`, `src/DicesHook.sol`, `src/core/FeeEscrow.sol`, `src/core/InternalSwapPool.sol`, `src/core/TrustedRouters.sol`, `src/libraries/CurrencySettler.sol`, `src/calculators/LiveCalculator.sol`, `src/calculators/FeeCalculator.sol`, `src/interfaces/IDicesCoin.sol`, `src/interfaces/IFeeEscrow.sol`, `script/deployment/V001.s.sol`.
- Dependencies read: solady `tokens/ERC20.sol` (full), v4-core `test/utils/CurrencySettler.sol` (full), v4-core `src/types/Currency.sol` (full), v4-core `PoolManager.sol` (`sync`, `take`, `_settle`, `unlock`), OpenZeppelin `SafeERC20.forceApprove`, solady `SafeTransferLib.safeTransferETH`, solady `LibClone.cloneDeterministic` (signature).
- Partially read: `src/interfaces/IDicesHook.sol` (lines 1-200), `README.md`, `AGENT.md`, tests (`test/DicesCoin.t.sol`, `test/FeeEscrow.t.sol`, `test/DicesHookInvariant.t.sol`, `test/utils/Fixtures.sol`, and searches across `test/`).
- Slither output used: `check-erc20-DicesCoin.txt`, `printer-human-summary.txt`, `printer-contract-summary.txt`, `printer-function-summary.txt`, `slither-detectors.txt`.
- Not done: no build, test, Slither or fuzzer run; no network or on-chain query; USDC source not reviewed.

---

## Reconciliation with the consolidated findings

Added by the lead reviewer after this report was written. The report above was produced from the code alone,
without sight of the other reviews. Its findings were then checked and merged into [`findings.md`](findings.md)
under `DICES-nn` identifiers; severities there take precedence where they differ. "Run" means a
proof-of-concept test was executed (see [`poc-tests.md`](poc-tests.md)).

| This report | Consolidated | Status after verification |
| --- | --- | --- |
| TI-01 | DICES-02 | Confirmed; run (`testPoC9`) |
| TI-02 | DICES-03 | Confirmed; run (`testPoC4`) |
| TI-03 | DICES-21 | Acknowledged design limit |
| TI-04 | DICES-01 | Confirmed; the swap matrix was run for both orderings (`testPoC1`) and matches. Rated Medium in the consolidated list |
| TI-05 | DICES-15 | Confirmed |
| TI-06 | DICES-14 | Confirmed |
| TI-07 | DICES-12 | Confirmed; run (`testPoC7`) |
| TI-08 | DICES-22 | Confirmed |
| TI-09 | DICES-21 | Assumes USDC's published blocklist behaviour; not tested |
| TI-10 | DICES-08 | Confirmed; run (`testPoC5`) |
| TI-11 | DICES-10 | Confirmed |
| TI-12 | DICES-11 | Confirmed |
| TI-13 | DICES-13 | Confirmed |
| TI-14, TI-15, TI-16 | DICES-21 and notes in `tob-secure-workflow.md` | Informational |
| TI-17 | DICES-09, DICES-17 | Confirmed |

Findings in the consolidated list that this report does not contain: DICES-05 (fee conversion at a price any
caller can push down, rated Medium), DICES-06 (launch-block guard) and DICES-07 (malformed calculator return).
None concerns how tokens are moved.
