Description: The calculation of Pot::claimantCut
is incorrect. According to the protocol, after a pot is closed, the manager takes a percentage cut from the remaining pool, and the remainder should be distributed equally among those who claimed their rewards in time. The current implementation erroneously divides the remaining amount by the total number of players rather than the number of claimants, severely affecting the core functionality.
Impact: Claimants receive less reward than they are entitled to.
Proof of Concept:
Suppose there are 109
players in a pot, with a total reward of 109
tokens, equating to 1
token per player.
If 9 players claim their reward before the pot is closed, the pot will have 100
tokens remaining.
Upon closure, the manager takes a 10%
cut, leaving 90
tokens.
According to the protocol, 90
tokens should be distributed equally among the 9
claimants. However, due to the current implementation, the division (remainingRewards - managerCut) / i_players.length
uses the total number of players (109) as the denominator. This results in a claimantCut of 0
because 90 / 109 is less than 1 and thus truncated to 0.
Consequently, claimants who were supposed to receive 10
additional tokens each will not receive any additional tokens.
Proof of Code:
Code:
Place the folowing into TestMyCut.t.sol
Run the test by using:
Recommended Mitigation: Update the calculation of claimantCut
in Pot::closePot
to use the correct denominator.
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.