The _updateBoostState() function is missing at the end of extend() and withdraw() in veRAACToken.sol. Since these functions significantly affect totalSupply() and user voting power, failing to update the boost state leads to outdated calculations. This issue distorts governance calculations dependent on the latest update of _boostState.
Users extending their lock is poised to increase their decaying voting power after invoking _votingState.calculateAndUpdatePower() because duration has increased due to extended unlockTime:
It may increase or decrease totalSupply() as is evidenced from the logic below:
They will be needed to separately update _boostState.votingPower and _boostState.totalVotingPower, but is missing in the function logic to invoke _updateBoostState():
The same issue is also found in the logic of withdraw() where the user's voting has supposedly decayed to zero and totalSupply() is now reduced by the currentPower burned.
All calculations protocol wide dependent on _boostState will be affected. As a paralleled example, BaseGauge._applyBoost() internally invoked by getUserWeight() which is being triggered by earned() is crucially needed when updating reward state for an account. As is evidenced in the code logic entailed, totalVotingPower: boostState.totalVotingPower and votingPower: boostState.votingPower are part of the params serving as the third input parameter for BoostCalculator.calculateBoost():
Manual
Consider making the following fix:
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.