lock and increase functions in veRAACToken contract are defined as follows:
The problem arises because _updateBoostState internal function is called before _votingState.calculateAndUpdatePower in both functions.
updateBoostState function is defined as follows:
It will first calculate the voting power of the user at the current timestamp with _votingState.calculatePowerAtTimestamp.
The issue is that _votingState.calculateAndUpdatePower should be called first to create a new point for the user, which will reflect his current voting power (including current lock creation or increase).
Because _votingState.calculateAndUpdatePower is called after _updateBoostState, current lock or lock increase is not taken into account when computing the current boost for the user.
The impact of this issue is high as it leads to incorrect computation of boost for users and loss of potential rewards.
Manual review
Make sure to first call _votingState.calculateAndUpdatePower to update the voting power of the user and then call _updateBoostState to update the boost state accordingly.
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.