The claimRewards function in the FeeCollector contract allows users to claim rewards based on their voting power. However, there are multiple issues that can lead to users being unable to claim their rightful rewards or claiming more than their fair share. Specifically:
If a user claims rewards after only one distribution, they may lose access to future rewards due to incorrect tracking of claimed amounts.
The contract does not correctly account for voting power changes over multiple distributions.
Users who had voting power during distribution may be unable to withdraw their rewards if new users with voting power claim first.
The issue arises from the way userRewards[user] is updated in claimRewards:
This assignment effectively prevents users from claiming any additional rewards in future distributions. Once a user claims, their rewards are set to totalDistributed, which could be higher than their entitled share if multiple distributions occur. Consequently, if new users with voting power claim rewards, previous users may find themselves locked out from withdrawing their rightful rewards.
Additionally, _calculatePendingRewards does not account for changes in voting power correctly. If the total voting power fluctuates over time, users may not receive their proportional share.
Also users can claim rewards for all distribtuion from begging.
Consider the following scenario:
A user has voting power and rewards are distributed.
The user claims their rewards. Their userRewards[user] is set to totalDistributed.
New distribution is added.
The user, who initially had voting power during the first distribution, can no longer claim further rewards due to the incorrect update of userRewards[user].
The vulnerabilities described above have significant consequences for the fairness and functionality of the reward distribution mechanism:
Loss of Rewards for Legitimate Users: Users who claim rewards early may lose access to future distributions, even if they maintain their voting power. This undermines the intended incentive structure of the protocol.
Unfair Distribution of Rewards: Users who claim rewards later may receive more than their fair share, especially if the total voting power changes over time. This could lead to centralization of rewards among a small group of users.
Lockout of Early Users: Early participants in the protocol may be permanently locked out of claiming rewards if new users claim rewards first, reducing trust in the system and discouraging participation.
Manual review
Implement a mechanism which will correctly rewards only to eligible for every epoch.
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.