Core Contracts

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

Inability to configure immediate updates and minting of raacTokens

Summary

The tick() function in the RAACMinter contract allows for the emission rate to be updated and RAAC tokens to be minted whenever the emissionUpdateInterval is set to 0. However, the setEmissionUpdateInterval() function does not permit this value to be set, leading to a contradiction in the intended functionality of the contract.

Vulnerability Details

1.Functionality of tick():

The tick() function checks the emissionUpdateInterval:

// @audit-info The logic is meant to handle immediate updates and minting
>> if (emissionUpdateInterval == 0 || block.timestamp >= lastEmissionUpdateTimestamp + emissionUpdateInterval) {
updateEmissionRate();
}
uint256 currentBlock = block.number;
uint256 blocksSinceLastUpdate = currentBlock - lastUpdateBlock;
if (blocksSinceLastUpdate > 0) {
uint256 amountToMint = emissionRate * blocksSinceLastUpdate;
if (amountToMint > 0) {
excessTokens += amountToMint;
lastUpdateBlock = currentBlock;
// @audit-info Tokens minted here to stabilityPool
>> raacToken.mint(address(stabilityPool), amountToMint);
emit RAACMinted(amountToMint);
}
}

This allows for immediate updates and minting if emissionUpdateInterval is 0.

2.Restriction in setEmissionUpdateInterval():

The setEmissionUpdateInterval() function prevents setting the interval to 0:

>> if (_emissionUpdateInterval == 0 || _emissionUpdateInterval > MAX_EMISSION_UPDATE_INTERVAL) revert InvalidEmissionUpdateInterval();
---SNIP---
emissionUpdateInterval = _emissionUpdateInterval;

As seen, the function reverts when a zero value is to be set. This restriction means that the contract cannot be configured to allow for immediate updates and minting.

Impact

The inability to set emissionUpdateInterval to 0 prevents the contract from functioning as intended, where the emission rate could be updated and tokens minted at any time.

Tools Used

Manual Review

Recommendations

Modify the setEmissionUpdateInterval() function to allow setting the interval to 0, enabling the intended functionality of the tick() function.

- if (_emissionUpdateInterval == 0 || _emissionUpdateInterval > MAX_EMISSION_UPDATE_INTERVAL) revert InvalidEmissionUpdateInterval();
+ if (_emissionUpdateInterval > MAX_EMISSION_UPDATE_INTERVAL) revert InvalidEmissionUpdateInterval();
---SNIP---
emissionUpdateInterval = _emissionUpdateInterval;
Updates

Lead Judging Commences

inallhonesty Lead Judge 4 months ago
Submission Judgement Published
Invalidated
Reason: Non-acceptable severity
inallhonesty Lead Judge 4 months ago
Submission Judgement Published
Invalidated
Reason: Non-acceptable severity

Support

FAQs

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