In the contract QuantammVarianceBasedRule.sol, the implementation of _calculateQuantAMMVariance is wrong because it does not properly handle the case where the lambda is a vector.
In the function _calculateQuantAMMVariance, when lambda is a scale, it will decrement locals.nMinusOne by one. Later, when locals.notDivisibleByTwo is tue, it will increase locals.nMinusOne by one. However, when lambda is a vector, it doesn’t decrement the locals.nMinusOne but still increase the locals.nMinusOne, which will cause the index locals.nMinusOne out of range:
Dos of function _calculateQuantAMMVariance.
VScode
Decrement the locals.nMinusOne when lambda is a vectore correctly.
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.