QuantAMM

QuantAMM
49,600 OP
View results
Submission Details
Severity: high
Valid

Malicious User Can Bypass Uplift Fee in `UpliftOnlyExample.sol`

Summary

The UpliftOnlyExample.sol contract applies an uplift fee only when a user profits from liquidity. However, malicious users can bypass this fee by transferring their lpNFT to their own address, resetting the price to the current BPT price. By doing so, they avoid paying the uplift fee, even after gaining a profit.

Vulnerability Details

The afterUpdate() function is triggered when an lpNFT is transferred. This function resets the base price of the associated lpNFT to the current BPT price. A malicious user can:

  1. Transfer their lpNFT to another wallet, causing the afterUpdate() function to set the profit baseline to the current price.

  2. Remove liquidity from the new wallet without incurring any uplift fee, as the calculated profit becomes zero.

Impact

  1. Loss of revenue for the protocol

  2. Less fee for the malicious user

Tools Used

Manual Review

Recommendations

Apply the uplift fee during lpNFT transfers

Updates

Lead Judging Commences

n0kto Lead Judge 10 months ago
Submission Judgement Published
Validated
Assigned finding tags:

finding_afterUpdate_bypass_fee_collection_updating_the_deposited_value

Likelihood: High, any transfer will trigger the bug. Impact: High, will update lpTokenDepositValue to the new current value without taking fees on profit.

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.

Give us feedback!