The Pot contract expects the deployer to provide a totalRewards parameter that matches the sum of individual rewards[] entries. The totalRewards value determines how many ERC20 tokens are transferred into the Pot during ContestManager.fundContest(), while rewards[] determines what each player can claim via claimCut(). These two values must be equal for the protocol to function correctly.
The Pot constructor stores both values without validating that sum(rewards[]) == totalRewards. Additionally, there is no duplicate address check in players[], which silently overwrites earlier reward entries. This allows contests to be deployed in broken states where claimants are either denied service (under-funded) or excess tokens are locked (over-funded).
Likelihood: High
The constructor is called on every contest creation. There is no on-chain or off-chain validation layer between the admin's input and the contract deployment.
A simple arithmetic mistake in the admin's reward allocation array creates an irrecoverable mismatch.
Impact: High
Under-funding: later claimants' claimCut() calls revert due to insufficient ERC20 balance, causing denial of service.
Over-funding: excess tokens beyond sum(rewards[]) are permanently locked with no sweep function.
Duplicate players: the mapping overwrites the first reward value, effectively stealing that allocation.
Severity: High
An admin creates a contest with totalRewards = 500 but provides rewards = [200, 200, 200] (sum = 600). Only 500 tokens are transferred during fundContest(). The first two players claim 200 each (400 used). The third player calls claimCut() but the Pot only has 100 tokens remaining — the ERC20 transfer reverts, permanently denying the third player their reward.
Adding constructor validation ensures the invariant sum(rewards[]) == totalRewards holds at deployment. The duplicate check prevents silent overwrites that break accounting.
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.