QuantAMM

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

Initial intermediate values can be set even if given an invalid set of moving averages

Summary

The function DifferenceMomentumUpdateRule::_setInitialIntermediateValues will always set initial intermediate values even if the provided set of moving averages is invalid.This is because _initialValues.length == _numberOfAssets will always be the case whenever the IF statement is read.

Vulnerability Details

function _setInitialIntermediateValues(
address _poolAddress,
int256[] memory _initialValues,
uint _numberOfAssets
) internal override {
@> require(_initialValues.length == _numberOfAssets, "Invalid initial values");
uint movingAverageLength = shortMovingAverages[_poolAddress].length;
@> if (movingAverageLength == 0 || _initialValues.length == _numberOfAssets) {
shortMovingAverages[_poolAddress] = _quantAMMPack128Array(_initialValues);
} else {
revert("Invalid set moving avg");
}
}

Recommendations

Remove _initialValues.length == _numberOfAssets as one of the IF statement's conditionals.

Updates

Lead Judging Commences

n0kto Lead Judge 7 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.