The FeeCollector contract's collectFee()
function uses the input amount parameter for internal accounting rather than the actual amount of tokens received after transfer fees. This causes the tracked fees to be higher than the actual token balance, making fee distribution impossible due to insufficient balance checks. This issue is also found in `veRAACToken::lock` function.
In FeeCollector.sol:
RAACToken implements a fee-on-transfer mechanism but when collecting fees, FeeCollector updates its accounting with the pre-fee amount. That makes the actual balance received less than the tracked amount, this causes `FeeCollector::distributeCollectedFees` to revert with insufficient balance error.
POC
To use foundry in the codebase, follow the hardhat guide here: Foundry-Hardhat hybrid integration by Nomic foundation
Fee distribution is completely broken as it becomes impossible once any fees are collected. No fees can be distributed to veRAACToken holders, treasury, or repair fund.
Manual review, foundry test suite
Track actual received amounts instead of input amounts
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.