The _updateBoostState
function updates the boost state but does not ensure that the boost values are within the valid range (MIN_BOOST
to MAX_BOOST
). This inconsistency can lead to incorrect boost calculations, which are critical for determining rewards and voting power.
The boost state is updated without enforcing constraints on the boost values. Specifically:
The _boostState.maxBoost
and _boostState.minBoost
are set during initialization but are not validated during state updates.
The calculateTimeWeightedBoost
function does not explicitly clamp the boost values to the valid range.
A user locks RAAC tokens and receives veRAAC tokens representing their voting power.
The boost calculation is performed to determine the user's reward multiplier.
Due to inconsistent state updates, the boost value exceeds the valid range (MIN_BOOST
to MAX_BOOST
), leading to incorrect rewards.
Deploy the veRAACToken
contract with the RAAC token address.
Set MIN_BOOST = 10000
(1x) and MAX_BOOST = 25000
(2.5x).
User A locks 1000 RAAC tokens for 4 years (MAX_LOCK_DURATION
).
The voting power is calculated, and veRAAC tokens are minted.
Call _updateBoostState
with a large newAmount
or artificially inflate the totalVotingPower
and totalWeight
values.
Call calculateBoost
for User A.
Observe that the boost value exceeds MAX_BOOST
(25000).
The boost value should be clamped to the valid range (MIN_BOOST
to MAX_BOOST
), ensuring fair and consistent rewards.
The boost value exceeds MAX_BOOST
, leading to incorrect rewards and unfair advantages.
The boostBasisPoints
value exceeds 25000
, violating the MAX_BOOST
constraint.
Incorrect Boost Calculations: If boost values exceed the valid range, users may receive incorrect rewards or voting power, leading to unfair advantages or disadvantages.
Undermined System Integrity: Incorrect boosts could undermine the trust and fairness of the governance and reward distribution mechanisms.
Manual Code Review
Emit an event when the boost state is updated to improve transparency.
Modify the calculateTimeWeightedBoost
function to clamp the boost value to the valid range.
Add checks in _updateBoostState
to ensure boost values are within the valid range.
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.