Function tick is used to calculate the emission rate if interval passed adn raacToken will get minted based on the block passed since last-update this may lead to double minting.
Function tick() we can see below code snippet
Interval time is determined by blockTimestamp and delta block number is used to mint the raacToken. What if in the current block.number re-org happens.
Take a scenario
Calls tick() at at block 100, minting tokens.
tick() updates lastUpdateBlock = 100.
10 blocks pass, emission rate = 100 RAAC per block.
**Minted **10 * 100 = 1000 RAAC.
Blockchain re-orgs back to block 98, invalidating block 100.
Contract still believes lastUpdateBlock = 100, while the chain is at 98.
Waits until the chain reaches 100 again and calls tick().
tick() recalculates from lastUpdateBlock = 100, even though it was already executed.
Another 1000 RAAC is minted, even though the total blocks haven't increased.
POC
Miniting will be taken two times
Manual View
Use BlockTimestamp instead of block.number.
Use check points that current block number is to be higer than the stored block number
require(block.number > lastUpdateBlock, "Possible re-org detected");
Code Snippet
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.