Core Contracts

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

New veRAAC holders can claim historical rewards, leading to unfair distribution

Summary

The FeeCollector::claimRewards() function allows new veRAAC holders to claim rewards that should belong to historical holders, due to using current voting power instead of time-weighted power for calculations.

Vulnerability Details

The FeeCollector::claimRewards function calculates rewards based on a user's current voting power relative to total voting power, without considering when they acquired their veRAAC tokens. This means new holders can immediately claim a portion of accumulated rewards that should belong to users who held veRAAC during the actual fee collection period.

The root cause is in the _calculatePendingRewards() function:

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;
}

The calculation uses current voting power ratios rather than historical voting power during the fee collection period. This creates an unfair distribution where new holders can claim rewards they didn't earn.

Proof of Concept

** Note this example doesn't take into account the decaying voting power over time, so the issue is shown more clear.**

  1. Alice holds 100 veRAAC tokens for 30 days while fees accumulate

  2. Protocol collects 1000 RAAC tokens in fees during this period

  3. Bob locks 100 veRAAC tokens after the fee collection

  4. Bob can immediately claim ~500 RAAC tokens (50% of rewards) despite not holding during collection

  5. Alice only receives 500 RAAC instead of the full 1000 she should get for being the sole holder during collection

Impact

  • Unfair distribution of protocol fees

  • Early veRAAC holders receive less rewards than they should

  • Potential for gaming the system by timing veRAAC mints with reward distributions

Recommendations

  1. Implement time-weighted reward tracking.

  2. Implement a checkpoint system that tracks historical balances and calculates rewards based on average balance during the distribution period.

Updates

Lead Judging Commences

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

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

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