The lock
function in the veRAACToken
contract does not check if the user already has an existing lock. It calls the LockManager
contract to create a new lock, which overrides the user's previous lock state with the new state.
The current lock
function in the veRAACToken
contract is:
The function does not check if the user already has an existing lock, leading to the user's previous lock state being overridden. Because of that there is no protocol breakdown but when the user withdraws or votes the voting power is determined by the user.lockAmount and totalPower is the TotalSupply which affects the voting and at withdrawls the user will burn all his tokens for the lastCreated LockState amount.
Links:
This bug can lead to the loss of the user's previous lock state, potentially causing issues with token accounting and user balances within the protocol.
Manual code review.
Update the lock
function to check if the user already has an existing lock before creating a new one. The corrected function should be:
This ensures that the user's previous lock state is not overridden, leading to accurate token accounting and user balances.
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.