The Pot
contract contains a bug in the closePot()
function where the remaining rewards are divided by the total number of players (i_players.length
) instead of the number of claimants (claimants.length
). This leads to an incorrect calculation of the additional reward distribution after the 90-day claim period and violates the intended protocol behavior.
According to the protocol description:
MyCut is a contest rewards distribution protocol which allows the set up and management of multiple rewards distributions, allowing authorized claimants 90 days to claim before the manager takes a cut of the remaining pool and the remainder is distributed equally to those who claimed in time!
However, in the closePot()
function, the following line calculates the individual cut for each claimant:
This calculation uses i_players.length
, which represents all players, instead of claimants.length
, which should represent "those who claimed in time". This discrepancy means the current implementation does not fulfill the protocol's stated behavior of distributing the remainder "equally to those who claimed in time".
The impact of this vulnerability includes:
Incorrect reward distribution: Claimants receive less additional reward than intended if not all players claimed within 90 days.
Potential fund lock: If i_players.length
> claimants.length
, some funds may remain locked in the contract.
Violation of protocol rules: The distribution does not follow the stated rule of equal distribution among timely claimants.
Broken user expectations: Users expecting the behavior described in the protocol description will find the actual distribution doesn't match what was promised.
Manual code review.
AI for report text and formatting.
To address this vulnerability and align with the intended protocol behavior as described in the documentation, implement the following change:
By implementing this recommendation, you ensure that the remaining rewards are distributed equally among those who claimed in time, aligning with the intended protocol behavior as described in the protocol documentation.
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.