lock which creates a new lock position by transferring raacToken and minting veTokens, includes a check
if (totalSupply() + amount > MAX_TOTAL_SUPPLY) revert TotalSupplyLimitExceeded()
to ensure the total supply of veTokens doesn’t exceed a cap. However, this check incorrectly adds amount (the number of raacToken being locked) to totalSupply() (the current supply of veeRAAC tokens) instead of adding the minted voting power (newPower), which is what actually increases totalSupply(). Since raacToken and veeRAAC are distinct units—where newPower (veTokens) is derived from amount and duration via a voting power calculation—this introduces an inconsistency in currency, rendering the check ineffective or misleading.
Unit Mismatch:
totalSupply() represents the total number of veeRAAC tokens (veTokens), which are minted based on voting power (newPower).
amount is the number of raacToken locked, a different asset/unit.
newPower (calculated by _votingState.calculateAndUpdatePower) depends on amount and duration, not a 1:1 mapping with raacToken.
Ineffective Cap Enforcement:
totalSupply() + amount doesn’t accurately predict the post-mint totalSupply(), which increases by newPower. If newPower > amount (e.g., long duration), the cap could be exceeded without reverting; if newPower < amount, valid locks might be rejected unnecessarily.
Impact: Fails to enforce MAX_TOTAL_SUPPLY as a veToken cap, allowing over-issuance or blocking legitimate locks.
Could lead to over-Issuance of veTokens
manual review
Use newPower in Check:
Replace totalSupply() + amount with totalSupply() + newPower after calculating voting power:
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.