Core Contracts

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

Incorrect Excess Tokens Handling Leading to Uncontrolled Minting

Summary

The mintRewards function mints RAAC tokens unconditionally due to uninitialized and improperly managed excessTokens, allowing unlimited token minting if the stabilityPool is compromised.

Vulnerability Details

The excessTokens variable is declared but never initialized or updated outside of mintRewards. By default, it is 0. When excessTokens is 0 (always true in current code), toMint is calculated as amount - 0 = amount. The line excessTokens = excessTokens >= amount ? excessTokens - amount : 0 sets excessTokens to 0 because excessTokens is always 0. The contract mints toMint = amount and transfers amount to the user.

function mintRewards(address to, uint256 amount) external nonReentrant whenNotPaused {
if (msg.sender != address(stabilityPool)) revert OnlyStabilityPool();
// @audit excessTokens is always zero therefore toMint=amount
uint256 toMint = excessTokens >= amount ? 0 : amount - excessTokens;
// @audit excessTOkens is 0 too here. therefore the excessTokens isn't controlling the minting in any way
excessTokens = excessTokens >= amount ? excessTokens - amount : 0;
if (toMint > 0) {
raacToken.mint(address(this), toMint);
}
raacToken.safeTransfer(to, amount);
emit RAACMinted(amount);
}

Since excessTokens is never replenished, every call to mintRewards mints new tokens equal to amount. If the stabilityPool is compromised, attackers can mint infinite RAAC tokens.

Impact

  • Inflation Attack: Malicious actors can drain the protocol by minting unlimited RAAC tokens ( if stabilityPoolgets compromised )

  • Token Devaluation: Uncontrolled minting devalues RAAC tokens, harming all holders.

Tools Used

manual review

Recommendations

Make changes to how excessTokens is calculated to make it suit how the protocol intend to use it.

Updates

Lead Judging Commences

inallhonesty Lead Judge about 2 months ago
Submission Judgement Published
Invalidated
Reason: Incorrect statement

Support

FAQs

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