The veRAACToken
contract's voting power calculation for locked tokens (calculateAndUpdatePower
) can result in non-decaying voting power when the locked amount is too small. This occurs due to integer division truncation in the slope calculation, leading to a slope of zero. Consequently, the voting power remains constant over time, violating the intended linear decay mechanism.
In the veRAACToken::lock
, veRAACToken::increase
, and veRAACToken::extend
functions, when the locked amount is too small (specifically, less than MAX_LOCK_DURATION
), the slope calculation in calculateAndUpdatePower
will be 0. As a result, the voting power does not decay over time, which contradicts the intended behavior of the protocol.
Here is the code of VotingPowerLib::calculateAndUpdatePower
:
If amount < MAX_LOCK_DURATION
, the slope calculation will result in slope = 0, causing the voting power to remain constant.
Users can lock multiple small amounts to maintain full voting power until unlock, bypassing the intended decay. This allows unfair governance influence by accumulating non-decaying voting power, distorting voting outcomes.
and the output of the test is:
Manual Review
To mitigate this issue, enforce a minimum effective lock amount that ensures the slope calculation does not truncate to zero.
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.