A user can change the amount of fee they pay by modifying the value of lpTokenDepositValue in the afterUpdate function. Altering the lpTokenDepositValue will consequently change the fee.
The bug occurs when the owner of the NFT transfers it to another account, but effectively to themselves.
When the ower transfer the NFT, the value of lpTokenDepositValueis changed to current value.
By checking the value of lpTokenDepositValue , the owner can transfer the NFT to themself when the price is highest, or any price benifiting the owner causing them to pay the minimum fee or a significantly reduced fee.
calculation of fee in the `onAfterRemoveLiquidity` :-
The owner of an NFT can manipulate the fee they pay significantly. If the owner sends the NFT to themselves at a very high LP token value, and the value drops slightly, they will only be charged the minimum fee.
Manual review
In my opinion:
Avoid updating the value of lpTokenDepositValue.
Alternatively, calculate the fee using the old value of lpTokenDepositValue to prevent manipulation.
Likelihood: High, any transfer will trigger the bug. Impact: High, will update lpTokenDepositValue to the new current value without taking fees on profit.
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.