Core Contracts

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

Incorrect total supply check in `lock` in the `veRAACToken` contract

Summary

The veRAACToken contract miscalculates the total supply check by incorrectly comparing the total veRAACToken supply with the amount of RAACTokens locked, instead of the actual voting power (veRAACTokens) minted based on duration.

Vulnerability Details

In the lock function, the issue arises because the totalSuppply is the supply of veRAACTokens and amount represents the RAACTokens being locked. The actual veRAACTokens minted (newPower) is calculated based on both amount and duration:

uint256 initialPower = (amount * duration) / MAX_LOCK_DURATION;

The amount of RAACTokens a user locks is always going to be bigger than the amount of veRAACTokens they receive, unless the user locks their RAACTokens for 1460 days, which is the MAX_LOCK_DURATION.

Impact

This flaw results in an inaccurate enforcement of the total supply cap, potentially preventing valid token locks or allowing supply inconsistencies, which could disrupt the protocol’s economic model.

Recommendations

Ensure the total supply check is performed after calculating newPower, so that the comparison is made against the actual voting power being minted rather than the raw lock amount.

Updates

Lead Judging Commences

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

Incorrect `MAX_TOTAL_SUPPLY` check in the `veRAACToken::lock/extend` function of `veRAACToken` could harm locking functionality

Support

FAQs

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