No checks to verify the flag of enableHookAdjustedAmounts before setting the params.disableUnbalancedLiquidity to liquidityManagement.disableUnbalancedLiquidity which can lead to undefined behaviour in the deployed pool.
The enableHookAdjustedAmounts flag, when enabled, can modify the amounts involved in a liquidity operation. This is done by using custom logic in hooks to adjust the amounts during key operations like adding liquidity and removing liquidity. In QauntAMMWeightedPoolFactory.sol, the functions create() and createWithoutArgs() are used for deploying new pools. The issue here is that in setting the disableUnbalancedLiquidity the function is supposed to first check if disableUnbalancedLiquidity is set to true and if so, disableUnbalancedLiquidity musst be to set to true also, but this ws not done in the code.
see code below;
Can lead to irregularities in pool accounting, as if the disableUnbalancedLiquidity is set to false when it should be true, the pool will allow unbalanced liquidity to be added, whereas the hookadjustedamounts is set to true and it will adjust the amount based on fees while trying to balance the amounts of liquidity being added. This creates irregularities in accounting, which may lead to loss of funds if severe.
Manual Review
query the hook for the pool for the flag of enableHookAdjustedAmounts and add checks to ensure that it does not conflict with disableUnbalancedLiquidity
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.
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.
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.