Core Contracts

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

Incorrect Pending Reward Update in Fee Collector ClaimRewards Function

Summary

In the FeeCollector contract, the pending reward for a user is calculated based on their voting power share of the total distributed rewards. However, upon claiming rewards, the contract incorrectly sets the user’s reward record to the full totalDistributed amount instead of subtracting the claimed pending reward. This miscalculation may result in inaccurate accounting for subsequent reward claims.

Vulnerability Details

The issue arises in the claimRewards function. The pending reward is computed as a share of totalDistributed based on the user’s voting power relative to the total voting power. Ideally, after a successful claim, the pending reward should be deducted from the user’s outstanding reward balance. However, the current implementation resets the user’s reward state with the following line:

userRewards[user] = totalDistributed;

Impact

Minor Accounting Discrepancy: While this error does not compromise the security of the contract, it may lead to inaccurate reward calculations over multiple claims.

Tools Used

Recommendations

Adjust Reward Update Logic: Modify the claimRewards function so that after transferring the pending reward, the contract correctly updates userRewards[user] by subtracting the claimed amount. For example:

userRewards[user] = totalDistributed - pendingReward;
Updates

Lead Judging Commences

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

FeeCollector::claimRewards sets `userRewards[user]` to `totalDistributed` seriously grieving users from rewards

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.

Give us feedback!