The QuantAMMVarianceBasedRule::_calculateQuantAMMVariance function will revert in case _poolParameters.lambda.length != 1 and locals.notDivisibleByTwo == true due to an array index out-of-bounds access.
In the QuantAMMVarianceBasedRule::_calculateQuantAMMVariance function, there is a lack of logic to decrease locals.nMinusOne by 1 when _poolParameters.lambda.length != 1 and locals.notDivisibleByTwo == true. This causes the function to attempt accessing array elements at an index that is out of bounds.
QuantAMMVarianceBasedRule::_calculateQuantAMMVariance function:
Key issues:
After ++locals.nMinusOne, locals.nMinusOne becomes equal to locals.n.
Arrays like locals.finalState and locals.intermediateVarianceState have a length of locals.n.
Accessing elements such as locals.intermediateVarianceState[locals.nMinusOne] and locals.finalState[locals.nMinusOne] results in an index-out-of-bounds error.
The QuantAMMVarianceBasedRule::_calculateQuantAMMVariance function reverts in cases where _poolParameters.lambda.length != 1 and locals.notDivisibleByTwo == true.
Update the QuantAMMVarianceBasedRule::_calculateQuantAMMVariance function:
Likelihood: Medium/High, odd asset number + lambda is a vector. Impact: Medium/High, DoS the update.
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.