QuantAMM

QuantAMM
49,600 OP
View results
Submission Details
Severity: low
Invalid

Inconsistent Require Condition vs. Error Message for _quantAMMSwapFeeTake in setQuantAMMSwapFeeTake and setQuantAMMUpliftFeeTake functions

Summary

In the setQuantAMMSwapFeeTake function, the contract enforces:

require(
_quantAMMSwapFeeTake <= 1e18,
"Swap fee must be less than 100%"
);

However, the error message “Swap fee must be less than 100%” conflicts with the actual code:
• The code uses <= 1e18, which allows a 100% fee.
• The error message suggests strictly less than 100%.

This can cause confusion about whether 100% (_quantAMMSwapFeeTake == 1e18) is allowed or not.

Vulnerability Details

Impact

• Misleading Error Handling: Developers or integrators may think that 1e18 is disallowed when, in reality, the code allows it.
• Low Severity: This is a mismatch in message vs. code logic rather than a direct security threat.

Tools Used

Manual audit

Recommendations

  1. Clarify the Condition or the Error Message

    • If exactly 100% is permitted, the error message should read “Swap fee must be ≤ 100%.”

    • If the intention is to disallow 100%, then change the code to
      require( _quantAMMSwapFeeTake < 1e18, "Swap fee must be less than 100%" );

  2. Maintain Consistency in all similar checks (for example, “uplift fee must be less than 100%” in the setQuantAMMUpliftFeeTake function).

Updates

Lead Judging Commences

n0kto Lead Judge 10 months ago
Submission Judgement Published
Invalidated
Reason: Non-acceptable severity
Assigned finding tags:

Informational or Gas / Admin is trusted / Pool creation is trusted / User mistake / Suppositions

Please read the CodeHawks documentation to know which submissions are valid. If you disagree, provide a coded PoC and explain the real likelyhood and the detailed impact on the mainnet without any supposition (if, it could, etc) to prove your point.

Support

FAQs

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

Give us feedback!