QuantAMM

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

`UpdateWeightRunner::setQuantAMMUpliftFeeTake` imposes no low limits on quantAMMSwapFeeTake

Summary

There is currently limit no low limits on what quantAMMSwapFeeTake can be set to. Even though this is an admin function, accidentally setting quantAMMSwapFeeTake to zero, for instance, would have negative impacts.

function setQuantAMMUpliftFeeTake(uint256 _quantAMMUpliftFeeTake) external{
require(msg.sender == quantammAdmin, "ONLYADMIN");
require(_quantAMMUpliftFeeTake <= 1e18, "Uplift fee must be less than 100%");
uint256 oldSwapFee = quantAMMSwapFeeTake;
quantAMMSwapFeeTake = _quantAMMUpliftFeeTake;
emit UpliftFeeTakeSet(oldSwapFee, _quantAMMUpliftFeeTake);
}

Impact

Calculations dependant on this variable can break if it is set incorrectly.

Vulnerability Details

Example in UpliftOnlyExample.sol

if (quantAMMFeeTake > 0) {
@> uint256 adminFee = hookFee / (1e18 / quantAMMFeeTake);
.
.
.
}

Recommendations

Consider adding restrictions for _quantAMMUpliftFeeTake not being 0

Updates

Lead Judging Commences

n0kto Lead Judge 7 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.