closePot() can be called repeatedly, repaying the manager and claimants multiple times since remainingRewards is never decrementedNormally, closePot() should be a one-time action that distributes whatever rewards were left unclaimed after 90 days — a manager cut and a split among claimants — and finalize the pot so no further payouts can occur.
The function never decrements remainingRewards (or sets any "closed" flag) after paying out, so its if (remainingRewards > 0) guard remains true after a successful close. Calling closePot() again re-executes the entire payout logic, sending the manager and every claimant another round of tokens, limited only by whatever balance the pot happens to still hold.
Likelihood:
The owner (or ContestManager, which holds onlyOwner access) can call closePot() any number of times after the 90-day window opens, since nothing in the contract prevents a second call.
claimantCut is calculated by dividing by i_players.length while only iterating over claimants (a strict subset of players who actually claimed), so remainingRewards is virtually always left above zero after the first close — keeping the vulnerable branch open for repeat calls.
Impact:
Every repeat call re-pays the manager cut and the full claimant list again, extracting tokens beyond what totalRewards was ever meant to distribute.
The only limit on how much can be drained is the pot's actual token balance — repeated calls will keep paying out until a transfer reverts from insufficient balance, at which point the entire pot is gone.
Trace confirms the second call's manager transfer (50 tokens) executes successfully before the loop reverts on player1's transfer with ERC20InsufficientBalance(175, 225) — proving the payout logic re-runs with no guard, and is only ever halted by accidentally running out of tokens rather than by design.
Track whether the pot has already been closed, and zero out remainingRewards after distribution so the branch can't be re-entered.
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.