Core Contracts

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

Unclaimable Rewards When Total Voting Power Reaches Zero in `FeeCollector` contract

Summary

The FeeCollector contract contains a critical flaw where rewards allocated to veRAAC token holders become permanently unclaimable if the total voting power (totalVeRAACSupply) ever drops to zero. This occurs because reward calculations depend on a non-zero totalVeRAACSupply, and the contract lacks safeguards to handle this edge case. As a result, all RAAC tokens in the totalDistributed pool are effectively lost, rendering the protocol’s reward mechanism unreliable.

Vulnerability Details

FeeCollector Contract_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; // ❌ Rewards locked if totalVotingPower = 0
uint256 share = (totalDistributed * userVotingPower) / totalVotingPower;
return share > userRewards[user] ? share - userRewards[user] : 0;
}

Root Cause

  • Dynamic totalVeRAACSupply Dependency: The totalDistributed variable accumulates rewards allocated to veRAAC holders, but reward claims require a non-zero totalVotingPower to calculate user shares.

  • No Recovery Mechanism: If totalVeRAACSupply drops to zero (e.g., all veRAAC tokens are unstaked or burned), the totalDistributed pool becomes inaccessible, as the calculation (totalDistributed * userVotingPower) / totalVotingPower reverts to zero.

Scenario Example

  1. Initial Distribution:

    • totalVeRAACSupply = 1000

    • totalDistributed = 5000 RAAC (allocated to veRAAC holders).

  2. Users Unstake All veRAAC Tokens:

    • totalVeRAACSupply = 0.

  3. Reward Claims Attempted:

    • _calculatePendingRewards returns 0 for all users due to division by zero.

    • Result: 5000 RAAC tokens are permanently locked in the contract.

Impact

All RAAC tokens in totalDistributed become unclaimable if totalVeRAACSupply reaches zero.

Tools Used

Manual Review +

Recommendations

Store snapshots of totalVeRAACSupply during each distribution to enable accurate reward calculations

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`

Appeal created

0x23r0 Submitter
6 months ago
0x23r0 Submitter
6 months ago
inallhonesty Lead Judge
6 months ago
inallhonesty Lead Judge 6 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!