Core Contracts

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

MAX_TOTAL_SUPPLY could be bypassed thru 'increase' and 'extend' functions

Summary

Missing MAX_TOTAL_SUPPLY checks before minting veRAACTokens allows users to bypass this cap using the increase and extend functions

Vulnerability Details

contract : veRAACToken

increase and extend functions in the veRAACToken contract
are used to increase an users voting power by minting more veRAACTokens.

The issue stems from the lack of checks inside the increase and extend functions
to ensure totalSupply() of veRAACToken doesnot exceed MAX_TOTAL_SUPPLY

This allows users of the protocol to bypass the MAX_TOTAL_SUPPLY limit.

Impact

MAX_TOTAL_SUPPLY cap could be breached.

Recommendations

Enforce the check on MAX_TOTAL_SUPPLY after voting power calculation and before minting new veRAACToken tokens in the increase and extend functions

// increase function
// Update checkpoints
uint256 newPower = uint256(uint128(newBias));
// --- > check here
if (totalSupply() + newPower > MAX_TOTAL_SUPPLY) revert TotalSupplyLimitExceeded();
_checkpointState.writeCheckpoint(msg.sender, newPower);
// Transfer additional tokens and mint veTokens
raacToken.safeTransferFrom(msg.sender, address(this), amount);
_mint(msg.sender, newPower - balanceOf(msg.sender));

A similar check should be made for extend function

Updates

Lead Judging Commences

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

veRAACToken::increase doesn't check the token supply, making it possible to mint over the MAX

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.