The issue allows users to lock more tokens than intended when creating the lock, leading to imbalances in the veRAAC ecosystem.
Issue: MAX_TOTAL_LOCKED_AMOUNT
Not Enforced
The veRAACToken
contract defines a maximum total locked amount (MAX_TOTAL_LOCKED_AMOUNT
), intended to limit the total amount of RAAC that can be locked in the system. However, the contract does not enforce this limit. While individual lock amounts (MAX_LOCK_AMOUNT
) and lock durations (MAX_LOCK_DURATION
) are checked, there is no check to prevent the sum of all locked amounts from exceeding MAX_TOTAL_LOCKED_AMOUNT
.
Location: veRAACToken.sol:lock
MAX_TOTAL_LOCKED_AMOUNT
is set to 1,000,000,000e18
The curent lockedAmount = 990,000,000e18
Alice locks 10,000,000e18 RAAC.
Bob locks 10,000,000e18 RAAC.
Ema locks 10,000,000e18 RAAC.
The contract allows Bob's and Ema's lock, even though the total locked amount (1,020,000,000e18) now significantly exceeds MAX_TOTAL_LOCKED_AMOUNT
.
Severity: High
Potential Consequences:
Unfair Rewards: The boost calculation mechanism in veRAACToken
relies on the total locked amount. Inflating the total locked amount.
Potential for Manipulation: The boost mechanism is tied to governance, the inflated boost could allow manipulation of governance proposals and voting power.
Manual Code Review
Enforce MAX_TOTAL_LOCKED_AMOUNT
: Add check in the lock
function to ensure that the total locked amount does not exceed MAX_TOTAL_LOCKED_AMOUNT
. The provided code snippet below demonstrates the necessary changes:
(Recommended code is not tested)
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.