Core Contracts

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

User able to claim previous rewards on FeeCollector

Summary

FeeCollector is used totalDistributed to store previous all distrubuted reward token amount. But in _calculatePendingRewards function , totalDistributed is used to calculate share amount which caused an issue.

Vulnerability Details

_calculatePendingRewards function is used totalDistributed to calculate share amount. But it should be used new reward amount to be distributed instead of historical total distributed amount.

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;
return share > userRewards[user] ? share - userRewards[user] : 0;
}

Due to this , later(lets say after few years later) user who lock token on veRAACToken has voting power so he is able to claim large amount of reward token which already distributed , since during this whole duration totalDistributed is increased .

Impact

Later user who lock funds on veRAACToken contract able to claim previous rewards.

Tools Used

Manual Review

Recommendations

Calculate the share value based on current reward amount to be distributed rather historial total one.

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.