Core contracts
DicesCoin.sol
DicesCoin is the cloneable launch token and tracks qualifying holders. The findings concern implementation initialisation, Permit2 allowances and input bounds; shared findings cover holder arithmetic and the effect of burns.
Reviewed source: src/DicesCoin.sol at commit bcd45b2.
Findings
| ID | Severity | Finding |
|---|---|---|
| DICES-12 | Informational | Anyone can initialise the coin implementation |
| DICES-15 | Informational | Every holder gives Permit2 an infinite allowance |
| DICES-22 | Informational | Unbounded inputs |
[INFORMATIONAL] DICES-12 · Anyone can initialise the coin implementation
Affected modules: DicesCoin.sol.
Severity: Informational.
DicesCoin.initialize has a one-time flag and no caller check (src/DicesCoin.sol:123-138), and the constructor does not set the flag. Clones are unaffected: each has its own storage and is initialised in the transaction that creates it. A stranger can turn the published implementation address into a token with any name and a supply minted to themselves (testPoC7_anyoneCanInitialiseTheCoinImplementation). Recommendation: set _initialized = true in the constructor.
Recorded test source and output: poc-tests.md.
Source finding: findings.md, DICES-12.
[INFORMATIONAL] DICES-15 · Every holder gives Permit2 an infinite allowance
Affected modules: DicesCoin.sol.
Severity: Informational.
solady's ERC20 grants the canonical Permit2 contract an unlimited allowance by default (_givePermit2InfiniteAllowance, solady ERC20.sol:667-669) and DicesCoin does not override it. It cannot be revoked, and approve(PERMIT2, x) with x below the maximum reverts (testPoC15_permit2AllowanceIsInfiniteAndFixed). A signed Permit2 message is still needed to move coins. Recommendation: keep it if the gas saving for Universal Router users is wanted, and document it; otherwise override the function to return false.
Recorded test source and output: poc-tests.md.
Source finding: findings.md, DICES-15.
[INFORMATIONAL] DICES-22 · Unbounded inputs
Affected modules: DicesHook.sol, DicesCoin.sol, TrustedRouters.sol.
Severity: Informational.
Coin name and symbol are stored as given (src/DicesCoin.sol:133-134): front ends must escape them and may want a length limit. setCreateFee accepts any value (src/DicesHook.sol:783). setTrustedRouter accepts the zero address (src/core/TrustedRouters.sol:25). None has an on-chain consequence that was found.
Source finding: findings.md, DICES-22.
Shared findings
- DICES-02 · Medium: Game levels 9 and 10 can never unlock — The 300,000-coin holder threshold and one-billion-coin launch supply cannot support the upper holder floors.
- DICES-14 · Informational: Levels price the coin on a supply that burning changes — burn reduces totalSupply while level calculations continue to use launch supply.
- DICES-17 · Informational: Documentation and comments promise things the code does not do — The same-block holder-count guarantee and supply comments need more precise wording.
- DICES-20 · Informational: Blind spots in the test suite — Tests that reach level 10 use a stand-in coin rather than the real holder constraints.
- DICES-21 · Informational: Design limits the team already documents — Splitting balances across wallets can satisfy a holder floor without creating independent holders.