QuantAMM

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

Incorrect Fee Calculation in `UpliftOnlyExample.sol`

Title

Incorrect Fee Calculation in UpliftOnlyExample.sol

Summary

The onAfterRemoveLiquidity hook in UpliftOnlyExample.sol is responsible for calculating fees, including the uplift fee and admin charges. However, the getQuantAMMUpliftFeeTake() function in this updateWeightRunner.sol incorrectly returns the value of quantAMMSwapFeeTake instead of quantAMMUpliftFeeTake. This results in incorrect fee calculations.

Vulnerability Details

  • In the onAfterRemoveLiquidity hook, fees such as upliftFee are calculated using getQuantAMMUpliftFeeTake().

  • In the updateWeightRunner, getQuantAMMUpliftFeeTake() wrongly fetches the value of quantAMMSwapFeeTake instead of quantAMMUpliftFeeTake.

  • This bug leads to incorrect fee deductions for liquidity removal operations, impacting both users and the protocol.

Impact

  1. Incorrect Fee Calculation

Tools Used

  • Manual Review

Recommendations

  1. Fix Function Logic:

    • Update the setQuantAMMUpliftFeeTake() and getQuantAMMUpliftFeeTake() functions to correctly set and retrieve the value of quantAMMUpliftFeeTake.

Updates

Lead Judging Commences

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

finding_quantAMMSwapFeeTake==quantAMMUplfitFeeTake

Likelyhood: High, calling setters or getters Impact: Low/Medium, both getters return `quantAMMSwapFeeTake` and `setQuantAMMUpliftFeeTake` modify `quantAMMUplfitFeeTake`. Real impact: those 2 values will be always the same.

Support

FAQs

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

Give us feedback!