# post burn state fee calculation model can be gamed by burning small amounts

Cap's burn fee is computed on post-burn ratio for the whole amount, so splitting a burn into smaller calls pays a lower blended fee.

- Payout: Audit contest
- Severity: medium
- Program: Cap
- Found by: kangaroo
- Disclosed: 2025-07-07
- Write-up quality: 6/10
- Original: https://github.com/sherlock-audit/2025-07-cap-judging/issues/449
- Library page: https://bugbountylibrary.com/r/sherlock%3A2025-07-cap%3AM-7
- Tags: area:web3 domain:web3 impact:funds-loss kind:contest platform:sherlock sev:medium tech:solidity technique:source-review vuln:business-logic vuln:fee-bypass

**Target:** MinterLogic.sol burn fee calculation
**Root cause:** _amountOutBeforeFee computes the post-burn ratio and _applyFeeSlopes applies a single slope rate to the entire burn amount, instead of integrating the fee across the ratio range actually traversed.
**Steps:**
1. Configure fees: optimalRatio=0.5e27, burnKinkRatio=0.2e27, slope0=0.2e27, slope1=0.8e27.
2. Single burn of 1000e18 reaching ratio 0.05e27: `excessRatio=0.15e27`, `rate=0.2+0.8*0.15/0.2=0.8` → fee 800e18.
3. Split into two 500e18 burns: first call rate 0.52 → fee 260e18; second call rate 0.8 → fee 400e18; total fee 660e18.
4. Repeat splitting near fee cliffs to minimize blended fee.
**How found:** Reading _amountOutBeforeFee and _applyFeeSlopes, noticed the fee rate is derived from the final post-burn ratio and applied uniformly to the whole amount, ignoring the path across slope segments.
**Exploitation:** Attacker calls burn() repeatedly with smaller amounts so each call's post-burn ratio lands in a cheaper slope segment, paying less total fee than a single large burn.
**Insight:** When a fee is a function of a state variable that the operation itself changes, check whether the fee is applied to the post-state value for the whole amount; splitting the operation can traverse cheaper segments.

