The veRAACToken
contract's locking mechanism incorrectly handles new lock creation when a user already has an existing lock. Instead of rejecting the transaction or merging the locks, it silently overwrites the existing lock, leading to lost funds, incorrect total locked amounts, and permanently unminted voting power.
The veRAACToken
contract implements a vote-escrowed token system where users can lock their RAAC tokens to receive veRaac
. The longer the lock duration, the more voting power they receive. This is done through the lock
function:
The issue occurs in the LockManager library's createLock
function:
When a user calls lock
while having an existing lock, the function simply overwrites the old lock,the previous lock's amount and duration are completely discarded and no check is performed to see if a lock already exists
For example:
User locks 100 RAAC for 1 year
totalLocked
= 100
Voting power minted based on 100 RAAC
User calls createLock again with 50 RAAC for 6 months
Previous 100 RAAC are lost
totalLocked
= 150
Original voting power remains
New voting power is minted for 50 RAAC
Users lose their previously locked tokens
Protocol's totalLocked
accounting becomes inflated
Excess voting power remains in circulation forever
System-wide voting power calculations become inaccurate
Manual Review
Code Analysis
Add existence check and revert if user already has a lock:
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.