The params uint _amount0, uint _amount1 are misleading because calculating the sqrt price from the amounts is the inverse, where you will do the price is derived from _amount1 / _amount0, as illustrated by Uniswap's encodePriceSqrt() test helper function.
Recommended Mitigation Steps
uint _amount0 and uint _amount1 should be renamed to uint _price0 and uint _price1.
Handle
hickuphh3
Vulnerability details
Impact
The params
uint _amount0, uint _amount1
are misleading because calculating the sqrt price from the amounts is the inverse, where you will do the price is derived from_amount1 / _amount0
, as illustrated by Uniswap'sencodePriceSqrt()
test helper function.Recommended Mitigation Steps
uint _amount0
anduint _amount1
should be renamed touint _price0
anduint _price1
.