Link to Affected Code:
Description:
The lock function performs an incorrect supply cap check by comparing RAAC tokens against veRAAC supply limit. This logic is only correct if both tokens maintain a 1:1 ratio. But according to this callculation, its only a 1:1 ratio if a user is locking their RAAC tokens for 4 years. Look at here:
So the cap check can revert with TotalSupplyLimitExceeded for valid locks up because of this comparism:
This check is fundamentally wrong because:
totalSupply() returns veRAAC tokens
amount is in RAAC tokens
The actual veRAAC minted is (amount * duration) / MAX_LOCK_DURATION
Comparing different token units leads to incorrect restrictions
Impact:
Prevents valid lock operations that would mint less veRAAC than MAX_TOTAL_SUPPLY
Creates unnecessary DoS for users trying to lock RAAC tokens
Proof of Concept:
Let's look a this scenerio where totalSupply is a 91m and a user wants to lock 10m RAAC tokens for a year.
Recommended Mitigation:
- Calculate actual veRAAC amount before supply cap check:
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.