# Dust blocks liquidation and clearing

Exact-zero or empty-collateral guards that dust can satisfy or defeat, and rounding that never reaches zero

_Area: DeFi accounting and math bugs. Seen in 5 disclosed reports; latest 2025-08-13. Updated 2026-10-23._

## How it works
State transitions in DeFi (moving bad debt to a backstop, closing an auction, clearing a position, allowing a deposit) are often gated on an exact condition: collateral balance is empty, balance is zero, or a computed repay reaches the full amount. Rounding and dust break these assumptions. A tiny deposit can make "collateral is empty" false while being too small to liquidate; a down-rounded repay leaves a remainder that never clears; a 1 wei balance keeps an auction open. The guard and the arithmetic disagree about what "done" means, so the state machine can never advance.

## Where it shows up
- Guards like `bad_debt()` that panic or revert when collateral is nonzero, with no minimum deposit.
- Auction math where `collateral_base`/`collateral_raw` round to 0, so `new_auction()` reverts.
- Liquidation repay computed with `mulDivDown`, leaving residual collateral below rounding granularity.
- Auction close gated on `balanceOf(this) == 0`, defeatable by a 1 wei transfer.
- Deposit caps that are a percentage of current balance, where other flows can shrink balance below a minimum.
- Cooldown/deadline gates keyed on a generic "last modified" timestamp any counterparty can reset.

## How to review
For each state transition, identify the exact invariant that must hold to advance (empty, zero, fully repaid) and ask whether rounding or an outside transfer can make it unreachable or falsely satisfied. Check that "done" conditions use tolerances or explicit minimums rather than exact equality, and that dust below the liquidation granularity is swept or ignored. Verify cooldown timers use a dedicated request timestamp, not a shared mutable one.

## Variants seen
- Dust collateral blocks bad-debt transfer to backstop and cannot be auctioned [E1](https://bugbountylibrary.com/r/c4%3A2025-02-blend-v2-audit-certora-formal-verification%3AM-17.md).
- Draining a vault to dust pushes MAX below MIN, soft-DoSing deposits [E2](https://bugbountylibrary.com/r/sherlock%3A2024-12-numa-audit%3AM-14.md).
- Down-rounded liquidation repay leaves dust, so `clearBadDebt` never triggers [E3](https://bugbountylibrary.com/r/sherlock%3A2024-07-exactly-stacking-contracts%3AM-10.md).
- Dust partial fill resets a cooldown, blocking force-close [E4](https://bugbountylibrary.com/r/sherlock%3A2023-06-symmetrical%3AM-11.md).
- 1 wei left in an auction keeps the discount timer running [E5](https://bugbountylibrary.com/r/sherlock%3A2023-04-hubble-exchange%3AM-8.md).

## Impact and severity
Medium in all evidence: stranded bad debt and insolvency risk [E1](https://bugbountylibrary.com/r/c4%3A2025-02-blend-v2-audit-certora-formal-verification%3AM-17.md)[E3](https://bugbountylibrary.com/r/sherlock%3A2024-07-exactly-stacking-contracts%3AM-10.md), blocked deposits [E2](https://bugbountylibrary.com/r/sherlock%3A2024-12-numa-audit%3AM-14.md), denied profit-taking [E4](https://bugbountylibrary.com/r/sherlock%3A2023-06-symmetrical%3AM-11.md), and cheap collateral acquisition [E5](https://bugbountylibrary.com/r/sherlock%3A2023-04-hubble-exchange%3AM-8.md). Severity rises where the stuck state is permanent and touches solvency.

## Evidence
- E1: https://bugbountylibrary.com/r/c4%3A2025-02-blend-v2-audit-certora-formal-verification%3AM-17.md
- E2: https://bugbountylibrary.com/r/sherlock%3A2024-12-numa-audit%3AM-14.md
- E3: https://bugbountylibrary.com/r/sherlock%3A2024-07-exactly-stacking-contracts%3AM-10.md
- E4: https://bugbountylibrary.com/r/sherlock%3A2023-06-symmetrical%3AM-11.md
- E5: https://bugbountylibrary.com/r/sherlock%3A2023-04-hubble-exchange%3AM-8.md
