In the UpliftOnlyExample::onAfterSwap
function, the ownerFee
is calculated and sent to address(this)
instead of the owner's address. Additionally, there is no function or mechanism for the owner to withdraw these funds, effectively locking them in the contract.
The onAfterSwap
function sends the calculated ownerFee
to the contract's address (address(this)
), as shown below:
Since the contract does not include a mechanism for the owner to withdraw these fees, the funds become inaccessible. This oversight prevents the owner from claiming fees earned through swaps.
The owner loses access to the ownerFee
funds.
The following test demonstrates the issue, where the ownerFee
is locked in the contract:
To address this issue, implement one of the following solutions:
Directly Send Fees to Owner Address:
Add a Restricted Withdrawal Function:
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.