The lock
function in the veRAACToken
contract contains a flawed check to prevent exceeding the max total supply of veRAACToken
. The function checks whether totalSupply() + amount
exceeds MAX_TOTAL_SUPPLY
, but the amount of veRAACTokens minted depends on both the lock amount and the lock duration, meaning the actual minted amount can be higher than the deposit amount. This can result in exceeding the max total supply limit.
The incorrect total supply check assumes that the veRAACTokens minted are equal to the lock amount:
However, the minted amount is actually calculated based on the lock amount and lock duration, which can be greater than amount
. Because of this, the check is ineffective, and the total supply of veRAACToken can exceed MAX_TOTAL_SUPPLY
, violating supply constraints.
A user locks 100
tokens for 4 years
, receiving 400
veRAACTokens due to the extended duration multiplier.
The contract checks whether totalSupply() + 100
exceeds MAX_TOTAL_SUPPLY
, which it does not.
However, the actual minted veRAACTokens are 400
, which are then added to the total supply.
the total supply can exceed the MAX_TOTAL_SUPPLY
limit, breaking the protocol constraints.
Total Supply Exceeds Defined Limits: The protocol's intended supply cap for veRAACToken is bypassed.
Check Minted veRAACToken Amount Instead of Lock Amount
Modify the check to use the actual minted amount (newPower
) instead of the raw amount
.
Example Fix:
Precompute Minted Amount Before Checking Total Supply
Instead of checking totalSupply() + amount
, first compute the actual veRAACTokens to be minted and use that for validation.
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.