Core Contracts

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

Missing Time-Weighted Distribution Logic In Fee Distribution

Summary

The FeeCollector veRAAC rewards is intended to distribute over a period using a time-weighted average mechanism. However, the current implementation does not enforce this logic. Instead, it distributes rewards immediately based on the current voting power, bypassing the intended time-weighted distribution. This deviation from the design could lead to unfair or inefficient reward distribution.

Vulnerability Details

The _processDistributions function calls TimeWeightedAverage.createPeriod but does not implement the time-weighted distribution logic. Specifically:

  • Rewards are added to totalDistributed immediately, without considering the time-weighted average.

  • The createPeriod function initializes a period but does not enforce gradual distribution over time.

  • Instead, it uses a simple, immediate distribution based on current voting power.

function _processDistributions(uint256 totalFees, uint256[4] memory shares) internal {
uint256 contractBalance = raacToken.balanceOf(address(this));
if (contractBalance < totalFees) revert InsufficientBalance();
if (shares[0] > 0) {
uint256 totalVeRAACSupply = veRAACToken.getTotalVotingPower();
if (totalVeRAACSupply > 0) {
TimeWeightedAverage.createPeriod(
distributionPeriod,
block.timestamp + 1,
7 days,
shares[0],
totalVeRAACSupply
);
totalDistributed += shares[0];
} else {
shares[3] += shares[0]; // Add to treasury if no veRAAC holders
}
}
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;
}

Impact

Inefficient use of rewards, as the time-weighted mechanism is designed to incentivize long-term participation.

Tools Used

Manual

Recommendations

Implement the time-weighted distribution logic to ensure rewards are distributed gradually over the specified period.

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.