Core Contracts

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

In chains with lower block times than Ethereum, more tokens will be minted by RAACMinter than intended

Summary

The contract assumes 12-second block time. While this is true for Ethereum, on chains with much lower block times, it will result in more tokens being minted than intended.

Vulnerability Details

Any EVM-compatible chain will be used. From the contest page:

All EVM Compatible, Curve ecosystem ready (cross curve via EYWA).
NFT should be standard compatible (Opensea,...), and later will be using Instruxi Mesh.
Openzepellin inherited.
Chainlink Functions
CurveVault when available (mainnet).
USDC or other ERC20 usable in Zeno, but also within the pools.
Auto-compounders (e.g: Llama Airforce)

In RAACMinter contract:

uint256 public constant BLOCKS_PER_DAY = 7200; // Assuming 12-second block time
uint256 public constant INITIAL_RATE = 1000 * 1e18; // 1000 RAAC per day
uint256 public minEmissionRate = 100 * 1e18 / BLOCKS_PER_DAY; // 100 RAAC per day minimum
uint256 public maxEmissionRate = 2000 * 1e18 / BLOCKS_PER_DAY; // 2000 RAAC per day maximum

In the constructor:

emissionRate = INITIAL_RATE / BLOCKS_PER_DAY; //@audit - sus calculation?

About 1000 tokens are supposed to be minted as per the constructor. But, they are assuming a block time of 12 seconds on different chains. In chains with much lower block times, the amount minted will be much higher:

uint256 currentBlock = block.number;
uint256 blocksSinceLastUpdate = currentBlock - lastUpdateBlock;
if (blocksSinceLastUpdate > 0) {
uint256 amountToMint = emissionRate * blocksSinceLastUpdate;
if (amountToMint > 0) {
excessTokens += amountToMint;
lastUpdateBlock = currentBlock;
raacToken.mint(address(stabilityPool), amountToMint);
emit RAACMinted(amountToMint);
}
}

So in chains like Polygon POS, Fantom, BSC etc, this will be a problem

Impact

In chains with lower block times than Ethereum, more tokens will be minted than intended.

Tools Used

Manual review

Recommendations

Make these variables immutable and set them in the constructor according to the chain in which the contract will be deployed.

Updates

Lead Judging Commences

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

RAACMinter hardcoded BLOCKS_PER_DAY breaks cross-chain compatibility with variable token emission rates

Known issue LightChaser M12

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

RAACMinter hardcoded BLOCKS_PER_DAY breaks cross-chain compatibility with variable token emission rates

Known issue LightChaser M12

Appeal created

inallhonesty Lead Judge 3 months ago
Submission Judgement Published
Invalidated
Reason: Design choice
Assigned finding tags:

RAACMinter hardcoded BLOCKS_PER_DAY breaks cross-chain compatibility with variable token emission rates

Known issue LightChaser M12

Support

FAQs

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