The k=2 bonus should distribute rewards according to each deposit's exact score, amount × (T - entryTime)², while allowing every eligible staker to recover principal.
The pool stores absolute timestamp moments and later expands the score into several checked uint256 products. No stake bound ensures those intermediate terms fit. For a sufficiently high-raw-supply standard ERC-20, the stored moments and true score fit while userPlus or the shared plus term overflows before subtraction. Every eligible claimSurvived() and paying claimExpired() then reverts.
For A = floor(type(uint256).max / (2 × s²)) and T = s + 1, A × s² fits and the true score is only A, but A × T² + A × s² exceeds uint256. A one-unit bonus is enough to enter the vulnerable calculation.
Likelihood:
Occurs when an allowlisted standard token has unusually high raw supply and aggregate stake reaches the unsafe moment range.
Requires a nonzero snapshotted bonus; one raw token unit is sufficient.
Impact:
Every eligible survivor or expiry claimant is unable to recover principal or bonus.
The sweep function continues reserving all outstanding liabilities, leaving no owner or moderator rescue route.
Setup: append the function below to test/unit/ConfidencePool.t.sol (same ConfidencePoolTest harness / BaseConfidencePoolTest helpers already used by the suite), then run:
At timestamp s, alice stakes type(uint256).max / (2 · s²) while the registry is UNDER_ATTACK, so deposit moments A · s² still fit in uint256.
Time advances one second (T = s + 1) and carol contributes a 1-wei bonus so _bonusShare will evaluate the expanded score.
The moderator flags SURVIVED; outcomeFlaggedAt becomes s + 1.
Alice's claimSurvived() reverts because A · T² + A · s² overflows before subtraction recovers the true score A.
sweepUnclaimedBonus() reverts with NothingToSweep because outstanding principal + bonus remain reserved, leaving the full balance stuck in the pool.
Use full-width arithmetic for moment construction or enforce a conservative aggregate-stake bound before crediting deposits.
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.
The contest is complete and the rewards are being distributed.