The RAACMinter
contract’s tick()
function updates the emission rate
before minting tokens for elapsed blocks. As a result, the new emission rate is applied retroactively to all blocks since the last update. This flaw causes over-minting if the rate increases or under-minting if it decreases, leading to inaccurate token distribution.
The current implementation of the tick() function follows these steps:
Emission Rate Update:
The function checks if the emission update interval has passed and calls updateEmissionRate()
. This updates the emission rate to a new value.
Token Minting:
The function then calculates the number of blocks elapsed since the last update:
It uses the newly updated emissionRate
to compute the tokens to mint:
Consequently, tokens for all blocks since the last update are minted using the new rate.
Assumptions:
Previous emission rate: 1 token per block.
New emission rate (after update): 2 tokens per block.
Elapsed blocks since the last update: 10 blocks.
Expected Behavior:
Tokens minted for the 10 blocks should be:
Actual Behavior:
Since the new rate is applied retroactively, tokens minted are:
Result:
Over-minting occurs, as the new emission rate is incorrectly applied to blocks that should have been rewarded at the previous, lower rate. Conversely, if the new rate were lower than the previous one, under-minting would occur.
Retroactively applying the updated emission rate results in incorrect token distributions. Over-minting inflates the supply, while under-minting reduces rewards.
The flawed token emission process can destabilize the protocol’s tokenomics, affecting incentives, market dynamics, and stakeholder trust.
Manual Review
Modify the tick()
function to first mint tokens using the current emission rate for elapsed blocks and then update the emission rate afterward. This ensures that past blocks are rewarded based on the rate in effect during those blocks. For example:
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.