The lock
function in the veRAACToken
contract does not check whether a user already has an existing lock. Instead of updating the existing lock by increasing the locked amount and extending the duration, it completely overrides the previous lock. This results in the loss of previously locked funds, leading to significant user losses.
When a user calls lock(amount, duration)
, the function does not verify whether the user already has a lock. Instead, it blindly creates a new lock, erasing the previous lock data. Consequently, previously locked funds are lost, and users receive new veRAACTokens based only on the latest lock, disregarding prior locks.
A user locks 100
tokens for 1 year
.
Later, the user locks an additional 50
tokens for 2 years
.
The lock
function overrides the previous lock and only considers the 50
tokens locked for 2 years
, effectively erasing the initial 100
tokens locked for 1 year
.
The user loses the voting power and veRAACTokens associated with the first lock, leading to loss of funds and governance influence.
Loss of Funds: Users who lock tokens more than once will lose their previously locked tokens.
Incorrect Voting Power Calculation: Users who should have accrued more voting power will only receive voting power from the latest lock.
Check for Existing Locks and Update Instead of Overriding:
Modify the lock
function to check if a user already has a lock and increase the locked amount instead of overriding it.
Example Fix:
Introduce an increaseLockAmount
Function:
Allow users to increase their lock amount separately without overriding the lock duration.
Warn Users in the UI:
If fixing via contract changes is delayed, provide warnings in the UI to inform users that multiple locks will override previous ones.
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.