QuantAMM

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

Uplift Fee Overwrites quantAMMSwapFeeTake Instead of Using a Separate Variable

Summary

In the setQuantAMMUpliftFeeTake function:

quantAMMSwapFeeTake = _quantAMMUpliftFeeTake;

the code incorrectly stores the uplift fee in quantAMMSwapFeeTake rather than using a dedicated variable (e.g., quantAMMUpliftFeeTake). This mixes two separate fees (swap fee vs. uplift fee) into a single state variable, causing confusion or unintended overrides.

Vulnerability Details

Impact

  • Fee Confusion: Because both the swap fee and the uplift fee are stored in quantAMMSwapFeeTake, the actual values for each may become unclear.

  • Functional Errors: Any logic relying on a distinct “uplift” fee might incorrectly read the “swap” fee, or vice versa.

Tools Used

Manual audit

Recommendations

  1. Use a Separate State Variable. Introduce a dedicated variable, for example:

uint256 public quantAMMUpliftFeeTake; // separate from quantAMMSwapFeeTake

and assign _quantAMMUpliftFeeTake to that variable in the setQuantAMMUpliftFeeTake() function:

quantAMMUpliftFeeTake = _quantAMMUpliftFeeTake;
  1. Adjust Getter.
    Update the getQuantAMMUpliftFeeTake() function to return this new quantAMMUpliftFeeTake variable.

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!