The function getCurrentPower()
does not apply any decay if timeDelta == 0
. This means that if a user calls the function immediately after their last voting power update, the function bypasses decay calculations and returns the full stored voting power (bias
).
While this might not be an immediate exploit, it can create unexpected behavior where voting power calculations are inconsistent depending on the exact timestamp of function calls.
The function first calculates timeDelta
:
If timestamp == point.timestamp
, then timeDelta = 0
.
The decay logic only runs when timeDelta > 0
Since timeDelta == 0
, this condition does not execute, and adjustedBias
remains equal to point.bias
.
Users Can Temporarily Maintain Full Voting Power
If a user locks tokens and immediately calls getCurrentPower()
, they receive full voting power (bias
) with no decay applied.
This means voting power calculations could be inconsistent across function calls.
PoC
Users who query getCurrentPower()
immediately after an update see full voting power, while others see reduced power.
Users can artificially boost their voting power for snapshots by updating and querying instantly.
External contracts using getCurrentPower()
may receive inaccurate voting power data.
Manual Review, Hardhat
Modify the voting power decay calculation to explicitly account for timeDelta == 0
, preventing unintended behavior.
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.