Normally, the owner registers rewards[] whose sum must equal totalRewards, and funds exactly totalRewards; each claim then reduces remainingRewards until it reaches zero.
No entry validation exists. When sum(rewards) > totalRewards, mid-way through claiming, remainingRewards -= reward underflows. In Solidity ^0.8.20 checked arithmetic this reverts with Panic(uint256(0x11)) — permanently: the mapping entry keeps luring the player (checkCut still shows their reward), and the leftover ledger value also becomes unclaimable.
Likelihood:
One configuration slip when assembling the winners list (a duplicate row, a wrong total) ships silently — creation, funding and early claims all succeed, so the error surfaces only when the budget is exhausted mid-contest.
Impact:
Verified: total 4 with rewards [3,3] — player1 claims 3 fine; player2's claim panics forever and their 3 tokens are permanently unclaimable, while the pot keeps the leftover 1 also permanently (p2 cannot claim it, close computes from a broken ledger).
The reverse misconfiguration (sum(rewards) 4 is accepted silently because createContest performs no consistency validation — and funds the pot with the (smaller) 4. Step: player1 claims 3 fine, driving remainingRewards to 1. When player2 attempts to claim, the state update remainingRewards -= 3 underflows; Solidity ^0.8.20 checked arithmetic aborts with Panic(0x11), asserted via stdError.arithmeticError. Consequences proven: player2's 3 WETH are permanently unclaimable (the mapping still lures them via checkCut), and the leftover 1 is stranded too. Creation, funding and early claims all succeed, so the misconfiguration ships silently and only detonates when the budget runs out. Run with: forge test --match-test test_POC7_SumMismatch_UnderflowPanic -vv (PASS; asserts the Panic and the stuck 1 WETH).
⚠ Combination note: this full validation set subsumes V9 (empty players -> sum=0 != totalRewards>0) — ship both together so the close-path division-by-zero is closed at the entrance rather than at the panic site. It does NOT catch V8's duplicate addresses (sum 5+4+1=10 == totalRewards passes).
The contest is live. Earn rewards by submitting a finding.
Submissions are being reviewed by our AI judge. Results will be available in a few minutes.
View all submissionsThe contest is complete and the rewards are being distributed.