Severity: High Location: Pot.sol, constructor
The Pot constructor accepts an array of rewards and a separate 'totalRewards' parameter but does not verify that the sum of all elements in rewards equals 'totalRewards'.
If the provided rewards sum to less than 'totalRewards', the contract will expect more funds than are actually claimable by players. When funding the exact 'totalRewards' (as done by 'ContestManager'), the excess funds ('totalRewards' - actual sum) will remain unclaimable forever:
Players can only claim their individual reward (sum totalRewards, then early claimants can drain, later revert on transfer (if funded exactly), or remainingRewards underflow (currently no check, but subtraction would wrap around in older solidity, but ^0.8 safe).
But main risk is sum < totalRewards, common mistake.
Permanent loss of the excess tokens sent to the contract.
Manager receives only a small portion of the unclaimed excess on close.
The bulk of excess is lost unless close logic is fixed (but it's not).
here is the runnable poc that shows how the above described issue can be exploited
In the constructor, compute the sum of rewards and require it equals totalRewards. Revert with a descriptive error if not.
solidity
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.