Core Contracts

Regnum Aurum Acquisition Corp
HardhatReal World AssetsNFT
77,280 USDC
View results
Submission Details
Severity: high
Valid

Users that join after fee distributions are immediately elegible for rewards

Summary

Whenever users lock in RAACTokens, they receive veRAACTokens, which makes them eligible for RAACToken rewards. These rewards are based on fees collected in the FeeCollector, which are distributed over periods. However, with the current reward calculations, users who have joined after a fee distribution, are immediately eligible for rewards.

Vulnerability Details

If we look at how rewards are calculated, we will see that with every fee distribution totalDistributed increases, meaning that every new user who locks, will immediately have the ability to claim rewards:

function _calculatePendingRewards(address user) internal view returns (uint256) {
uint256 userVotingPower = veRAACToken.getVotingPower(user);
if (userVotingPower == 0) return 0;
uint256 totalVotingPower = veRAACToken.getTotalVotingPower();
if (totalVotingPower == 0) return 0;
@> uint256 share = (totalDistributed * userVotingPower) / totalVotingPower; // @audit - totalDistributed is increased globally meaning that people who join at later stages will be able to get rewards immediately
return share > userRewards[user] ? share - userRewards[user] : 0;
}

Impact

Early RAACToken lockers lose incentive and end up losing rightful rewards.

Tools Used

Manual review.

Recommendations

Create internal mappings in FeeCollector to track when users have locked and set their "earned" rewards to 0, and then update them when new fees are distributed.

Updates

Lead Judging Commences

inallhonesty Lead Judge 4 months ago
Submission Judgement Published
Validated
Assigned finding tags:

Time-Weighted Average Logic is Not Applied to Reward Distribution in `FeeCollector`

inallhonesty Lead Judge 4 months ago
Submission Judgement Published
Validated
Assigned finding tags:

Time-Weighted Average Logic is Not Applied to Reward Distribution in `FeeCollector`

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.