Hooks.wtf

Calculators

FeeCalculator.sol

FeeCalculator defines the launch price, pre-Live and post-Live rates, and the 40% platform / 30% creator / 30% buy-and-burn distribution. DICES-09 remains undetermined because the intended commercial model requires client confirmation.

Reviewed source: src/calculators/FeeCalculator.sol at commit bcd45b2.

Findings

IDSeverityFinding
DICES-09UndeterminedThe fee model in the code is not the one in the brief as restated in AGENT.md

[UNDETERMINED] DICES-09 · The fee model in the code is not the one in the brief as restated in AGENT.md

Affected modules: DicesHook.sol, FeeCalculator.sol.

Severity: Undetermined. Type: specification.

Affected code: src/calculators/FeeCalculator.sol:23-38, :85-94; src/DicesHook.sol:458-483; AGENT.md:43-49; README.md:10-13.

Description

AGENT.md section 2 and README.mdCode
Buy fee before Live1.25% base + 0.50% to the coin's reserve1.25%
Buy fee after Live1.00% base + 0.50% to the reserve1.00%
After the reserve targetbase + 0.25% to the race poolNo reserve, target or race pool exists
Who receives the base feePlatform and creator40% platform, 30% creator, 30% buy and burn
Fee currencyUSDC, alwaysThe swap's unspecified currency: the coin on exact-input buys and exact-output sells
"Every buy funds the coin's casino reserve"Required outputNot produced
Sealed game registered at launchRequired output (gameCommitment)Not in CoinParams

AGENT.md carries a note dated 5 November that its Fees, Ledgers, Contracts and Configuration subsections "predate the internal-swap-pool rework and no longer match the code". That note covers section 3. The rows above are from section 2, the restated client brief, and from the README, neither of which is flagged.

Impact

This cannot be rated from the repository. If the client has agreed to replace the reserve surcharge with a buy-and-burn share, the code is right and the documents are stale (see DICES-17). If not, a required output of the brief is missing: nothing funds the per-coin casino bankroll that later phases depend on.

Recommendation

Get the fee model confirmed in writing, then update AGENT.md section 2, its open questions 1 to 3 and the README to match whichever answer stands.

The spec-compliance review extracted 209 statements from AGENT.md, README.md and NatSpec. 127 match the code in full, 41 contradict it and 23 describe things that are not in the code. Most of the last two groups are this one fee-and-ledger design counted sentence by sentence. It rates the missing reserve HIGH as a compliance gap (DIV-01) and the three-way split and missing game commitment MEDIUM (DIV-02, DIV-05).

Reported by the code-maturity (F4), guidelines (F-02), Uniswap (V4SF-11) and spec-compliance (DIV-01, 02, 05, 08, 09) reviews.

Source finding: findings.md, DICES-09.

Shared findings

Previous
TrustedRouters.sol