After the 90-day claim period, closePot() distributes the remaining rewards to addresses in the claimants array. However, this array contains players who have already claimed their original rewards. Players who never claimed their allocations are excluded from the final distribution, even though their unclaimed rewards contribute to remainingRewards.
The issue occurs whenever a contest has remaining rewards and at least one player has already claimed. The function's distribution loop explicitly targets the claimants array.
The root cause is that closePot() uses the list of previous claimants to distribute remaining rewards, rather than identifying players with unclaimed allocations.
The claimants array is populated in claimCut() after a player claims their original reward.
Consequently, the final distribution rewards previous claimants instead of distributing the remaining funds according to the intended allocation rules.
Likelihood: The incorrect recipient selection is deterministic when closePot() executes with remaining rewards and a nonempty claimant list.
Impact: The final distribution can unfairly reward players who already claimed while excluding players with unclaimed allocations.
The test assumes the test contract owns the Pot, the token is a compatible ERC20 mock, and the test environment provides Foundry's vm cheatcode.
Define an explicit policy for unclaimed rewards. If those rewards should be redistributed among players who did not claim, iterate over the original player list and check each player's remaining allocation instead of iterating over claimants. Calculate payouts using the actual eligible recipients, and update the accounting before transferring tokens.
Ensure the manager's cut is accounted for consistently and remainingRewards is updated when funds are distributed. The exact redistribution policy should match the contest's documented rules.
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.