Due to the position of a function in the flow of execution, users' boost states will not be updated correctly.
Users lock RAAC tokens for veRAAC tokens which give them voting power and affect their boost state. But if we break down the lock function, we will see that the update to boost state is placed in an incorrect position.
Take notice that the _updateBoostState() call is made before the _votingState.calculateAndUpdatePower() call:
The _updateBoostState() function calculates the voting power from the user's voting state calculation at a given timestamp:
But in order to make that calculation, the user must have a checkpoint created in the _votingState:
In order to calculate the power at timestamp and update it in _updateBoostState, the user must have a checkpoint created in the _votingState, but in the original lock() function flow, that point is created after the update to boost state, inside _votingState.calculateAndUpdatePower():
Due to this incorrect placement of functions inside lock(), whenever users lock tokens the boost state will be updated incorrectly. Since the at the time of updating the boost state the user will have no checkpoint created, the boost state will be updated with amount 0 which is the default to return if a checkpoint does not exist yet. The same is the case when useres increase() their lock, where the update to boost state is also put in place before the checkpoint creation.
Since locks are meant to be long term and users lock tokens for up to years at a single time, the boost state will return 0 instead of the correct amount for years on end. Due to this, the boost state will return incorrect amounts when calculating rewards minting.
Manual Review
Make sure the _updateBoostState() call is placed after the _votingState.calculateAndUpdatePower() call so that the checkpoint is already created and the boost state is stored correctly.
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.