The QuantAMMGradientBasedRule::_calculateQuantAMMGradient function will revert due to accessing an out-of-bounds index in the intermediateGradientStates[_poolParameters.pool] array.
In the QuantAMMGradientBasedRule::_calculateQuantAMMGradient function, when _poolParameters.lambda.length != 1, the function mistakenly uses the loop variable i as the index for accessing the intermediateGradientStates[_poolParameters.pool] array instead of locals.storageArrayIndex.
QuantAMMGradientBasedRule::_calculateQuantAMMGradient function:
For instance, if _poolParameters.numberOfAssets == 6, the length of the intermediateGradientStates[_poolParameters.pool] array will be 3. However, the loop variable i increments from 0 to 4 (inclusive) with a step of 2. When i == 4, the function attempts to access intermediateGradientStates[_poolParameters.pool][4], causing an out-of-bounds error.
The QuantAMMGradientBasedRule::_calculateQuantAMMGradient function reverts in case where _poolParameters.lambda.length != 1.
Update the QuantAMMGradientBasedRule::_calculateQuantAMMGradient function:
Likelihood: Medium/High, assets>4, lambdas > 1. Impact: Medium/High, DoS update but pool works fine. Pool with 5 assets will use incorrect weights.
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.