QuantAMM

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

computeBalance function, QuantAMMWeightedPool.sol

Summary

The computeBalance function contains an unchecked subtraction operation that may result in arithmetic underflow when multiplierTime is less than lastUpdateIntervalTime, leading to incorrect calculations and potential misbehavior.

Vulnerability Details

The function is not checking if multiplierTime is greater than or equal timeSinceLastUpdate.

uint256 timeSinceLastUpdate = uint256(
multiplierTime - poolSettings.quantAMMBaseInterpolationDetails.lastUpdateIntervalTime
);

Impact

Incorrect Calculations: Underflow results in wrong timeSinceLastUpdate, leading to inaccurate balance computations.

Disruption: The pool may calculate invalid balances.

Exploit Potential: Manipulated timestamps could cause unexpected pool behavior.

Tools Used

Manual review

Recommendations

Add a require statement to ensure multiplierTime >= lastUpdateIntervalTime before the unchecked block.

require(multiplierTime >= timeSinceLastUpdate, "Invalid time range");
uint256 timeSinceLastUpdate = uint256(
multiplierTime - poolSettings.quantAMMBaseInterpolationDetails.lastUpdateIntervalTime
);
Updates

Lead Judging Commences

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