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
| ID | Severity | Finding |
|---|---|---|
| DICES-09 | Undetermined | The 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.md | Code | |
|---|---|---|
| Buy fee before Live | 1.25% base + 0.50% to the coin's reserve | 1.25% |
| Buy fee after Live | 1.00% base + 0.50% to the reserve | 1.00% |
| After the reserve target | base + 0.25% to the race pool | No reserve, target or race pool exists |
| Who receives the base fee | Platform and creator | 40% platform, 30% creator, 30% buy and burn |
| Fee currency | USDC, always | The swap's unspecified currency: the coin on exact-input buys and exact-output sells |
| "Every buy funds the coin's casino reserve" | Required output | Not produced |
| Sealed game registered at launch | Required 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
- DICES-03 · Medium: The owner can change the fee, the split and the level of existing pools without bound or delay — The hook accepts replacement fee rates and distributions without a protocol cap or conservation check.
- DICES-08 · Low: The swap pool keeps the fee split it was deployed with — Direct USDC fees use the replacement calculator while converted fees keep the original split.
- DICES-17 · Informational: Documentation and comments promise things the code does not do — The documented fee and ledger design needs to match the implemented calculator and escrow.