# Incorrect amount of Collateral moves for Auction

Witch._calcAuction rounds partial auction up to full vault when proportional debt falls below min debt, auctioning all collateral instead of a capped portion.

- Payout: Contest reward
- Severity: high
- Program: Yield
- Credited: csanuragjain
- Disclosed: 2022-10-03
- Write-up quality: 6/10
- Original: https://github.com/code-423n4/2022-07-yield-findings/issues/123
- Library page: https://bugbountylibrary.com/r/c4%3A2022-07-yield%3AH-02
- Tags: domain:web3 impact:funds-loss kind:contest platform:code4rena sev:high tech:solidity technique:source-review vuln:accounting-error vuln:business-logic

**Target:** Witch.sol auction calculation (_calcAuction)
**Root cause:** When line.proportion * art falls below debt.min, code sets art = balances.art and consequently ink = balances.ink, auctioning the entire vault instead of only raising the amount to the dust threshold.
**Steps:**
1. Set line.proportion to 10% (valid per Witch.sol L108).
2. Start auction on a vault whose art=10, ink=9, debt.min*10**dec=2.
3. In _calcAuction: art = 10*10% = 1; since 1<2, art = balances.art = 10.
4. ink = (art==balances.art) ? balances.ink : ... => ink = 9.
5. Observe full debt and full collateral (100%) placed for auction instead of 10%.
**How found:** Code reading of _calcAuction's branch logic: noticed the art<min-debt branch resets art to full balances.art, which cascades into ink=balances.ink, contradicting the intended proportional auction.
**Exploitation:** A vault owner with a small line.proportion and debt near the dust threshold has their entire collateral put up for auction when only a fraction should be, causing loss of full collateral.
**Insight:** When a 'raise to minimum' branch reassigns the primary amount, check whether dependent amounts (collateral) are recomputed from the new value or from the original proportion — a ternary keyed on equality to full balance silently escalates to 100%.
