The veRAACToken.lock
function contains a critical state management flaw where boost calculations use outdated voting power data during lock creation. This occurs because boost state updates are performed before completing voting power calculations and token minting operations. The incorrect sequencing leads to systematically underreported voting power values being used in reward distributions and governance weight calculations, creating cumulative inaccuracies in core protocol mechanisms over time.
The vulnerability arises from incorrect state update sequencing in the veRAACToken lock mechanism. The veRAACToken.lock
function (veRAACToken.sol#L227) updates boost state parameters before completing critical voting power calculations and token minting operations:
Premature Boost State Update _updateBoostState()
is called before:
Voting power calculation via _votingState.calculateAndUpdatePower()
veToken minting operation _mint()
Stale Data Dependency
The boost calculation in _updateBoostState()
depends on:
_votingState.points[user]
updated by _votingState.calculateAndUpdatePower()
totalSupply()
value changed by _mint()
This results in boost calculations being based on pre-operation state values, systematically underreporting the user's actual voting power during the lock creation transaction.
This sequencing error creates systemic inaccuracies in three critical protocol mechanisms:
Reward Miscalculations
Boost-dependent reward distributions (in gauges and pools) will use stale voting power data, leading to:
Under-allocation of rewards for new locks
Disproportionate rewards for existing positions
Cumulative errors in long-term reward accounting
Protocol Parameter Inaccuracies
Key system metrics relying on boost calculations will be compromised:
Total voting power tracking
Gauge weight distributions
These effects compound over time, creating growing discrepancies between actual and recorded protocol states, ultimately undermining core protocol functionality and user trust in the RAAC governance system.
Manual Review
Move _updateBoostState()
call after voting power calculation and token minting in veRAACToken.lock
:
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.