The function closePot distributes the remaining rewards of the users that did not claim, to the users that claimed their rewards. But the calculation is done wrong, resulting in either overdistributing and therefor the call reverts, or too little gets distributed and some funds stay in the pot.
The code distributes the remainingRewards - managerCut
based on the total number of players (i_players.length
). But it should calculate it based on the number of claimants.
The function either overdistributing and therefor the call reverts, or too little gets distributed and some funds stay in the pot.
manual review
Update the function to do the calculation like this:
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.