https://github.com/Cyfrin/2024-08-MyCut/blob/main/src/Pot.sol#L57
The project description states that the remaining rewards should be distributed equally among those who claimed them in time. However, in the Pot::closePot
function, the formula for claimantCut
is (remainingRewards - managerCut) / i_players.length
. If not all players claim their rewards (i.e., claimants.length < i_players.length
), the claimants will receive a smaller cut, and tokens will remain in the Pot contract after the pot is closed.
If not all players claim their rewards, they will receive a smaller cut when the pot is closed.
To fix this, the denominator in the formula should be changed to claimants.length
:
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.