QuantAMM

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

The `createWithoutArgs` and `create` functions set the `liquidityManagement.disableUnbalancedLiquidity` without checking whether the flag `enableHookAdjustedAmounts` is true or not.

Summary

The function createWithoutArgs and createlack a check for flag enableHookAdjustedAmounts is true or not.

Vulnerability Details

As stated in the comment that disableUnbalancedLiquidity must be set to true if flag enableHookAdjustedAmounts = true.

// disableUnbalancedLiquidity must be set to true if a hook has the flag enableHookAdjustedAmounts = true.

The function do not check for the flag just directly set the value of liquidityManagement.disableUnbalancedLiquidity.

@> LiquidityManagement memory liquidityManagement = getDefaultLiquidityManagement();
liquidityManagement.enableDonation = params.enableDonation;
// disableUnbalancedLiquidity must be set to true if a hook has the flag enableHookAdjustedAmounts = true.
@> liquidityManagement.disableUnbalancedLiquidity = params.disableUnbalancedLiquidity;

Impact

Directly setting the liquidityManagement.disableUnbalancedLiquidity without checking the enableHookAdjustedAmounts flag can lead to incorrect behavior of the protocol or pool, as it bypasses necessary conditions for liquidity management and may cause unexpected results.

Tools Used

Manual Review

Recommendations

First check the flag enableHookAdjustedAmounts is true or not then set the value of liquidityManagement.disableUnbalancedLiquidityas needed.

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!