In the DifferenceMomentumUpdateRule contract, there's a function called validParameters which is used to check whether parameters are valid or not which are necessary to calculate and update weights. The function is all good and doing its job perfectly. However, function contains an inefficient if check.
DifferenceMomentumUpdateRule::validParameters:
Did you see the bug above, chisel helped to know that 1e18 is smaller than type(int128).max, int256(1e18) < type(int128).max. So we should only check if shortLambda[i] is greater than int256(1e18) or not, comparing shortLambda[i] > int256(type(int128).max is totally worthless and is a complete waste of GAS.
Excessive wastage of GAS
Manual review
Please remove that inefficient if check and then we're good to go.
DifferenceMomentumUpdateRule::validParameters:
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.
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.