Core Contracts

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

`veRAACToken::increase` completely ignores all sanity checks done on `veRAACToken::lock`, allowing users to easily bypass checks

Summary

To maintain certain control and sanitize inputs, the veRAACToken::lock implements a series of checks to ensure the protocol's health. However, the veRAACToken::increase function completely ignores the same checks allowing users to easily bypass the sanity checks.

function increaseLock(
LockState storage state,
address user,
uint256 additionalAmount
) internal {
Lock storage lock = state.locks[user];
if (!lock.exists) revert LockNotFound();
if (lock.end <= block.timestamp) revert LockExpired();
// Maximum lock amount
if (lock.amount + additionalAmount > state.maxLockAmount) revert AmountExceedsLimit();
// Maximum total locked amount
// if (state.totalLocked + additionalAmount > state.maxTotalLocked) revert AmountExceedsLimit();
lock.amount += additionalAmount;
state.totalLocked += additionalAmount;
emit LockIncreased(user, additionalAmount);
}

Vulnerability Details

Users can start a lock position by entering a minimum value accepted by MAX_TOTAL_SUPPLY and then call veRAACToken::increaseto increment their positions without any constraints.

Impact

Protocol MAX_TOTAL_SUPPLYwill be blown up leading to wrong calculations done on top of totalSupply amounts. For example:

  1. BoostController::_calculateBoost

  2. BoostController::calculateBoost

Tools Used

Code review

Recommendations

Ensure the MAX_TOTAL_SUPPLYis enforced on the veRAACTokens::increasefunction.

function increase(uint256 amount) external nonReentrant whenNotPaused {
+ if (totalSupply() + amount > MAX_TOTAL_SUPPLY) revert TotalSupplyLimitExceeded();
// Increase lock using LockManager
_lockState.increaseLock(msg.sender, amount);
_updateBoostState(msg.sender, locks[msg.sender].amount);
...snip...
}
Updates

Lead Judging Commences

inallhonesty Lead Judge 7 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

Support

FAQs

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

Give us feedback!