You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The input amount must less than the amount that a LP have in a position, it's apparently here's no logic error in the code because LiquidityMath.addLiquidity(a,b) will make sure a>b when a-b due to solidity's OverFlow checking, but if adding a specific checking such as if (inputAmount < position.liquidity) and a clear revert like notEnoughLiquidity is more clear and meaningful instead of reverting by solidity's OverFlow checking.This is my personal opinion, which may not necessarily be correct
The text was updated successfully, but these errors were encountered:
The input amount must less than the amount that a LP have in a position, it's apparently here's no logic error in the code because
LiquidityMath.addLiquidity(a,b)
will make surea>b
whena-b
due to solidity's OverFlow checking, but if adding a specific checking such asif (inputAmount < position.liquidity)
and a clear revert likenotEnoughLiquidity
is more clear and meaningful instead of reverting by solidity's OverFlow checking.This is my personal opinion, which may not necessarily be correctThe text was updated successfully, but these errors were encountered: