The onAfterRemoveLiquidity lacks the required access control, and can be used by any malicious attacker to reduce all liquidity providers balance to zero while stealing part of the fees as profit
The UpliftOnlyExample is both the hook and router contract used to manage funds, however there is a critical issue here which enables the theft of all liquidity added.
The function as shown below does not check to ensure the function call is coming from the Vault contract before modifying state, burning the user's nft, or deducting fees.
The function can be used to reduce the user's balance which is stored in the poolsFeeData mapping, When the whole liquidity in 1 FeeData Struct is being removed, the NFT is burned from the liquidity Providers wallet.
Conditions for these is if the quantAMMSwapFeeTake is ever zero, however the impact for this is too large even for an edge scenario
All users who added liquidity using this UpLift contract will loose all funds.
The bulk of the liquidity is permanently locked away since they now have no owner, and the vault will always call onAfterRemoveLiquidity() when withdrawing.
The part of the fees accrued that do not go to the QuantAMMAdmin are sent to the attacker instead of being deposited back to LPs.
Manual Review
Adding the onlyVault is necessary in this function. Add it as a modifier to the function.
Likelihood: High, anyone, anytime. Impact: High, Loss of funds
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.