# Adversary can permanently brick auctions due to precision error in Auction#_computeTotalRewards

Precision loss in Auction._computeTotalRewards causes totalRewards to mismatch sum of individual reward amounts, bricking auction settlement permanently.

- Payout: Contest reward
- Severity: high
- Program: Nounsbuilder
- Credited: 0x52
- Disclosed: 2023-09-14
- Write-up quality: 7/10
- Original: https://github.com/sherlock-audit/2023-09-nounsbuilder-judging/issues/251
- Library page: https://bugbountylibrary.com/r/sherlock%3A2023-09-nounsbuilder%3AH-2
- Tags: domain:web3 impact:dos kind:contest platform:sherlock sev:high technique:source-review vuln:accounting-error vuln:dos

**Target:** Auction contract settlement logic
**Root cause:** totalRewards is computed from the sum of BPS percentages, while individual amounts are computed separately, leading to unequal rounding and a mismatch that violates ProtocolRewards.depositBatch's exact msg.value check.
**Steps:**
1. Set referral reward BPS and builder reward BPS such that their sum times a crafted bid amount causes totalRewards to round up while individual amounts round down.
2. Place a bid with final digits that trigger the rounding mismatch (e.g., bid ending in 19 with 5%+5% rewards).
3. Auction settles: _computeTotalRewards calculates totalRewards = (bid * totalBPS) / 10000 and amounts[i] = (bid * bps_i) / 10000.
4. depositBatch is called with msg.value = totalRewards, but sum(amounts) != totalRewards, causing revert INVALID_DEPOSIT.
5. Auction cannot be settled, permanently bricking it.
**How found:** Manual review of the reward calculation logic identified that totalRewards is derived from summed percentages while individual amounts are computed separately, leading to potential rounding discrepancies.
**Exploitation:** An adversary places a bid with a specific final amount that causes the rounding mismatch. When the auction ends, settlement reverts due to the depositBatch check, locking the auction permanently.
**Insight:** When computing totals and individual components with integer division, always derive the total from the sum of components to avoid rounding mismatches that can break exact-match checks.
