onAfterSwap() is a hook used to calculate the fees that users must pay to QuantAMM and the owner. The owner's fee is deposited into the contract. However, the contract lacks a function to withdraw the ERC20 tokens, resulting in the funds being permanently locked within the contract.
onAfterSwap() is implemented as follows.
As observed, if ownerFee > 0, the tokens are deposited into the contract. The issue lies in the fact that the contract lacks any function to withdraw these ERC20 tokens, causing the funds to remain permanently locked within the contract.
Loss of funds occurs as the ERC20 tokens will remain permanently locked in the contract.
Manual review.
Add a function to enable the withdrawal of collected fees (ERC20).
Likelihood: High, every swap. Impact: High, funds are stuck.
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.