QuantAMM

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

AntiMomentumUpdateRule allow invalid weights in scalar kappa mode

Summary

Inconsistent validation in AntiMomentumUpdateRule where negative weight check is only present in vector kappa mode but missing in scalar kappa mode.

Impact

Low. The code is inconsistent, alloing negative invalid weights.

Recommendation

Add require(res >= 0, "Invalid weight") in scalar kappa path to maintain consistent validation patterns:

if (locals.kappa.length == 1) {
locals.normalizationFactor /= int256(_prevWeights.length);
for (locals.i = 0; locals.i < _prevWeights.length; ) {
int256 res = int256(_prevWeights[locals.i]) +
int256(locals.kappa[0]).mul(locals.normalizationFactor - locals.newWeights[locals.i]);
require(res >= 0, "Invalid weight"); // Add this line
newWeightsConverted[locals.i] = res;
unchecked { ++locals.i; }
}
}
Updates

Lead Judging Commences

n0kto Lead Judge 5 months ago
Submission Judgement Published
Invalidated
Reason: Incorrect statement
Assigned finding tags:

invalid_weights_can_be_negative_or_extreme_values

_clampWeights will check that these weights are positive and in the boundaries before writing them in storage.

Appeal created

0xtheblackpanther Submitter
5 months ago
n0kto Lead Judge
5 months ago
n0kto Lead Judge 4 months ago
Submission Judgement Published
Invalidated
Reason: Incorrect statement
Assigned finding tags:

invalid_weights_can_be_negative_or_extreme_values

_clampWeights will check that these weights are positive and in the boundaries before writing them in storage.

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.