The RAACMinter contract hardcodes BLOCKS_PER_DAY to 7200 assuming a 12-second block time (Ethereum mainnet), which will result in incorrect emission rates when deployed on other EVM chains with different block times.
The RAACMinter contract calculates daily emission rates based on BLOCKS_PER_DAY constant set to 7200 blocks, assuming each block takes 12 seconds. However, different EVM chains have different block times and more importantly most of the L2s have few block times.
The emission rate calculations in functions like tick() and calculateNewEmissionRate() will be incorrect because they use this hardcoded value:
When calculating the amount to mint (emit) we use the number blocks of what ever the chain the code is on, which means blocksSinceLastUpdate will vary greatly depending on the chain. and the amountToMint value uses this number of blocks value WHILE the emissionRate has still remained constant with respect to the chains.
For example:
On BSC (3s), actual blocks per day = 28800, causing 4x higher emissions than intended
On Polygon (2s), actual blocks per day = 43200, causing 6x higher emissions than intended
On Avalanche (2s), actual blocks per day = 43200, causing 6x higher emissions than intended
On Arbitrum (~0.5s), actual blocks per day = 172800, causing 24x higher emissions than intended
From the scope in part of compatibilities it says;
All EVM Compatible
which implies that the code will not only be deployed on ethereum mainnet where block time is 12s but also other "EVM Compatible chains" which most of which are significantly fast and that value of BLOCKS_PER_DAY being 7200 won't apply to them.
Contract is deployed on BSC with BLOCKS_PER_DAY = 7200
Intended daily emission is 1000 RAAC tokens
Due to 3s block time, actual blocks per day is 28800
Per block emission becomes: 1000 * 1e18 / 7200 = ~138.89e18
Actual daily emission: 138.89e18 * 28800 = 4000 RAAC tokens
This is 4x higher than intended emission rate
Severe economic impact as emission rates will be significantly different from intended rates on non-Ethereum chains, potentially causing hyperinflation or severely reduced rewards depending on the chain's block time.
Manual code review
Allow the BLOCKS_PER_DAY value to be adjusted (through a constructor and a setter function)
or alternatively Use time-based calculations instead of block-based:
Known issue LightChaser M12
Known issue LightChaser M12
Known issue LightChaser M12
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.