QuantAMM

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

Allows setting 100% fees on swap and on uplift, when error messages states it doesn't

Summary

Conflicting validation error message and the condition when setting the fee percentage for swap fees and uplift fees.

Vulnerability Details

function setQuantAMMSwapFeeTake(uint256 _quantAMMSwapFeeTake) external override {
require(msg.sender == quantammAdmin, "ONLYADMIN");
require(_quantAMMSwapFeeTake <= 1e18, "Swap fee must be less than 100%"); // <- "<=" allows up to and including 100%
uint256 oldSwapFee = quantAMMSwapFeeTake;
quantAMMSwapFeeTake = _quantAMMSwapFeeTake;
emit SwapFeeTakeSet(oldSwapFee, _quantAMMSwapFeeTake);
}
function setQuantAMMUpliftFeeTake(uint256 _quantAMMUpliftFeeTake) external{
require(msg.sender == quantammAdmin, "ONLYADMIN");
require(_quantAMMUpliftFeeTake <= 1e18, "Uplift fee must be less than 100%"); // <- "<=" allows up to and including 100%
uint256 oldSwapFee = quantAMMSwapFeeTake;
quantAMMSwapFeeTake = _quantAMMUpliftFeeTake;
emit UpliftFeeTakeSet(oldSwapFee, _quantAMMUpliftFeeTake);
}

Even though the error in both places indicates "fee must be LESS than 100%", the check allows up to and INCLUDING exact 1e18 value, which represents the 100%.

Impact

Fee can be set to 100% when the error states it does not.

Due to even setting to 1e18 doesn't really break anything and there are "if" checking for those exactly values. Likely is a mistake the error message - Low or Informational.

Tools Used

Manual review

Recommendations

replace "<=" with "<"

or

change the messages from ...fee must be less than 100% to ... fee must be less or equal to 100%

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!