Core Contracts

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

Incorrect `block.number` Usage on Arbitrum May Cause Reward Miscalculations

Summary

The use of block.number in the RAACMinter contract introduces a critical issue when deployed on the Arbitrum chain, as block.number on Arbitrum reflects the Ethereum L1 block number instead of the expected L2 block number. This can cause severe inconsistencies in reward emissions and time-based logic.

Vulnerability Details

In the RAACMinter contract, block.number is used to determine reward emission schedules and other time-sensitive calculations. The contract assumes that block.number increments at a predictable rate based on the BLOCKS_PER_DAY constant. However, when deployed on Arbitrum:

  • block.number corresponds to Ethereum's L1 block number, which progresses significantly slower than the L2 block rate.

  • This results in reward calculations and emission schedules being severely delayed.

function tick() external nonReentrant whenNotPaused {
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;
raacToken.mint(address(stabilityPool), amountToMint);
emit RAACMinted(amountToMint);
}
}
}

https://github.com/Cyfrin/2025-02-raac/blob/89ccb062e2b175374d40d824263a4c0b601bcb7f/contracts/core/minters/RAACMinter/RAACMinter.sol#L259C3-L275C6

Impact

Delayed or broken reward distribution: Users may receive rewards much later than expected.

Tools Used

Manual Review

Recommendations

Use block.timestamp instead of block.number for time-sensitive calculations.

Updates

Lead Judging Commences

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

Give us feedback!