The lock function in the veRAACToken.sol allows users to lock their RAAC tokens for a specified duration, granting them voting power. However, due to missing validation checks, users can bypass the maximum lock amount restriction by repeatedly calling the function.
The function lock(uint256 amount, uint256 duration) enforces a maximum lock amount (MAX_LOCK_AMOUNT). However, there is no validation to check if the caller has already locked tokens previously. This allows a user to repeatedly call the function and lock additional tokens, exceeding the intended limit.
The above check only applies to the current transaction and does not consider the cumulative locked amount by the user. Thus, a user can call lock multiple times with amounts below the MAX_LOCK_AMOUNT, effectively bypassing the restriction.
Bypassing Lock Limits: Users can exceed the intended maximum lock amount by repeatedly locking tokens, leading to potential economic imbalances and unfair advantages in voting power.
Manual Review
Enforce a Cumulative Lock Check: Introduce a validation step to check the total amount of tokens a user has already locked before allowing a new lock transaction.
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.