Core Contracts

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

Users could end up losing rewards

Summary

Whenever the FeeCollector distributes fees, users who own veRAACTokens are subject to rewards. However, with the current reward distribution mechanism, if a user does not claim immediately after a distribution and new users lock in veRAACTokens they will end up losing rewards.

Vulnerability Details

Reward distribution depends directly on the total veRAACToken supply, meaning that whenever a user tries to claim rewards, they can get front-run by someone locking a high amount of RAACTokens, which will increase the total supply and reduce their potential rewards they should get.

function _calculatePendingRewards(address user) internal view returns (uint256) {
uint256 userVotingPower = veRAACToken.getVotingPower(user);
if (userVotingPower == 0) return 0;
@> uint256 totalVotingPower = veRAACToken.getTotalVotingPower(); // @audit - this could be front-run
if (totalVotingPower == 0) return 0;
uint256 share = (totalDistributed * userVotingPower) / totalVotingPower;
return share > userRewards[user] ? share - userRewards[user] : 0;
}

Impact

Users lose rewards.

Tools Used

Manual review

Recommendations

Whenever fees are distributed, snapshot the total voting power and apply reward claims based on this state.

Updates

Lead Judging Commences

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

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

inallhonesty Lead Judge 7 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.

Give us feedback!