The _updateBoostState
function in the veRAACToken
contract retrieves the total token supply and voting power before they are updated. Since _updateBoostState
is called before _mint(msg.sender, newPower)
, it uses an outdated value for totalSupply()
. Additionally, _boostState.votingPower
is calculated using _votingState.calculatePowerAtTimestamp(user, block.timestamp)
, but _votingState
is only updated later in the lock
function, leading to incorrect calculations for boost weight and voting power distribution.
The function _updateBoostState
updates the _boostState
values using totalSupply()
and _votingState
before they are properly updated:
At this point:
totalSupply()
does not yet reflect the new voting power minted in the lock
function because _mint(msg.sender, newPower);
is executed after _updateBoostState
.
_votingState.calculatePowerAtTimestamp(user, block.timestamp)
retrieves outdated voting power since _votingState.calculateAndUpdatePower
has not yet been called.
This results in miscalculations in _boostState
, leading to incorrect weight distributions.
The use of outdated totalSupply()
and _votingState
values causes incorrect calculations for boost weight and voting power distribution. This can lead to governance discrepancies, where some token holders might receive inaccurate voting power allocations. Over time, this could impact governance decisions by misrepresenting token holders' influence.
Manual review of the contract’s logic.
Move the _updateBoostState
call after _mint(msg.sender, newPower);
and ensure _votingState
is updated before it is used in _updateBoostState
. This will ensure that both totalSupply()
and _votingState
reflect the correct values before being used in boost calculations.
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.