The veRAACToken.lock() function fails to account for RAAC token's tax mechanism when calculating lock amounts. Since RAAC implements both swap and burn taxes, the actual amount received by the veRAACToken contract will be less than the input amount, leading to incorrect accounting in lock positions and potentially affecting users' ability to withdraw their full recorded amounts.
The issue stems from the veRAACToken contract recording pre-tax amounts rather than actual received tokens when creating locks:
The RAAC token applies tax on transfers:
This creates a discrepancy in the withdrawal function:
The key issue is that while users can withdraw their recorded amounts as long as the contract has sufficient total balance, this gradual depletion of the contract's balance could affect users withdrawing later, as the contract's actual token balance is less than the sum of all recorded locks.
Alice has 10,000 RAAC tokens
Alice calls veRAACToken.lock(10,000, 365 days)
Due to 1.5% tax:
Contract receives 9,850 RAAC
System records lock of 10,000 RAAC
When withdrawing:
Alice can withdraw 10,000 RAAC if she's early
This depletes more from the contract than was actually locked
Affects the availability of funds for other users' withdrawals
Incorrect voting power calculation leading to inflated governance weight
System promises withdrawals of pre-tax amounts while holding post-tax amounts
Early withdrawers may receive more tokens than actually locked
Later withdrawers might receive less than their recorded amount
Inaccurate protocol accounting
Manual code review
Calculate and use actual received amount (use balance differences):
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.