In QuantAMMWeightedPool.sol::calculateBlockNormalisedWeight(), when the multiplier is negative, the function uses mulUp instead of mulDown, causing potential weight calculation errors.
Proof of Concept:
** Deploy the contract with initial weights and negative multipliers:
** Create a test file to demonstrate the weight calculation error:
Impact
There is a critical vulnerability in the weight validation that can severely impact the protocol's functionality. The issue lies in the calculateBlockNormalisedWeight() function where the incorrect use of mulUp vs mulDown for negative multipliers leads to:
Incorrect weight calculations that compound over time
Potential pool imbalances
Deviation from intended pool behavior
Possible economic exploitation through arbitrage
This is particularly critical because:
Weight calculations are fundamental to the entire AMM mechanism
The error compounds with each weight update
It affects all trades involving negative multipliers
Could lead to significant economic losses
Tools Used:
VSCodium
Foundry
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.