FoundrySolidityLayer 2
7.25 ETH
Submission Details
Impact: low
Likelihood: low

`claimSurvived()` Uses `InvalidAmount` Revert for Already-Claimed Check Misleading Error Message

Author Revealed upon completion

Summary

When a user who has already claimed calls claimSurvived() again, the function reverts with InvalidAmount. This is the wrong error the user did not pass an invalid amount, they already claimed. This misleads developers, integrators, and users debugging failed transactions.

Root Cause

function claimSurvived() external nonReentrant {
if (outcome != PoolStates.Outcome.SURVIVED) revert OutcomeNotSet();
// Wrong revert — has nothing to do with amount
if (hasClaimed[msg.sender]) revert InvalidAmount(); // misleading
uint256 userEligible = eligibleStake[msg.sender];
if (userEligible == 0) revert InvalidAmount(); // this one is correct
...
}

Code snippet-
https://github.com/CodeHawks-Contests/2026-07-bc-confidence-pools/blob/58e8ba4ce3f3277866e4926f3140e597f9554a1e/src/ConfidencePool.sol#L384

Impact

Misleading error message for already-claimed users.

Mitigation

Add a dedicated revert and use it correctly.

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.

Give us feedback!