# Dust donation triggers fee or rebalance drain

Empty groups or vaults where a tiny donation skews ratio checks or first-deposit share math

_Area: DeFi accounting and math bugs. Seen in 3 disclosed reports; latest 2026-04-20. Updated 2026-10-29._

## How it works

A check or share calculation compares ratios of fixed-point values, or initializes a share price, without accounting for the smallest representable unit or for pre-existing balances. When the denominator (group collateral, totalSupply) is zero or at minimum precision, a tiny donation makes the ratio meaningless: a rounded-to-zero target makes any nonzero actual look 100% off-target, or a first depositor mints shares 1:1 against a vault that already holds assets. The invariant that should hold — that a dust amount cannot change whether an action is permitted or how much a share is worth — is broken.

## Where it shows up

- Ratio/deviation checks (`pctFromTarget`, off-target tests) where the target is computed by multiplying a balance by a fraction and can round to 0.
- Fixed-point types at minimum precision (e.g. 1e-6) used as a denominator or multiplier.
- Vaults with `totalSupply()==0` but nonzero asset balance; first-deposit / `initWithdraw` paths.
- First-mint branches in UniswapV2 forks: how `MINIMUM_LIQUIDITY` is handled (locked vs burned vs minted to caller).
- Rebalance, keeper, or fee logic that can be re-triggered repeatedly on a no-op.

## How to review

- For every ratio check, ask: what happens when the denominator is 0 or the minimum unit? Does the target round to 0? If so, is the action still permitted?
- Confirm a dust donation cannot flip a permission or trigger a fee/rebalance loop; require an absolute-value floor alongside proportional deviation.
- For vaults: verify share price when `totalSupply()==0` accounts for pre-existing assets, and that first-deposit cannot redeem against the whole balance.
- For V2 forks: diff the first-mint branch against upstream; `MINIMUM_LIQUIDITY` must be permanently locked, not burned.
- Invariant: a transfer of the smallest unit must not change any permission, share price, or fee outcome.

## Variants seen

- Ratio check rounds target to 0 at minimum precision, enabling infinite rebalance cycles and keeper-fee drain [E1](https://bugbountylibrary.com/r/sherlock%3A2024-08-perennial-v2-update-3%3AH-7.md).
- Vault with assets but zero totalSupply: first depositor mints 1:1 then redeems pre-existing balance [E2](https://bugbountylibrary.com/r/dhl%3A20260420-thetanutsvaultsharerounding.md).
- V2 clone burns instead of locking `MINIMUM_LIQUIDITY`, reopening first-depositor manipulation and DoS [E3](https://bugbountylibrary.com/r/cantina%3Asuper_sushi_samurai_march2025%3A3.2.3.md).

## Impact and severity

Drain of victim account balances via repeated keeper fees [E1](https://bugbountylibrary.com/r/sherlock%3A2024-08-perennial-v2-update-3%3AH-7.md), theft of pre-existing vault assets [E2](https://bugbountylibrary.com/r/dhl%3A20260420-thetanutsvaultsharerounding.md), and DoS of LPs and swaps [E3](https://bugbountylibrary.com/r/cantina%3Asuper_sushi_samurai_march2025%3A3.2.3.md). Severity is high where funds are directly lost; worse when the trigger is a negligible donation and the loop is repeatable.

## Evidence
- E1: https://bugbountylibrary.com/r/sherlock%3A2024-08-perennial-v2-update-3%3AH-7.md
- E2: https://bugbountylibrary.com/r/dhl%3A20260420-thetanutsvaultsharerounding.md
- E3: https://bugbountylibrary.com/r/cantina%3Asuper_sushi_samurai_march2025%3A3.2.3.md
