Reya-Labs/voltz-core

Remove !(((amount0 <= 0 && amount1 >= 0) || (amount0 >= 0 && amount1 <= 0)) || (amount0 == 0 && amount1 == 0)) in FixedAndVariableMath.

Closed this issue · 2 comments

!(((amount0 <= 0 && amount1 >= 0) ||
(amount0 >= 0 && amount1 <= 0)) ||
(amount0 == 0 && amount1 == 0))

Instead we should just return 0 if (amount0 == 0 && amount1 == 0)) and else let the code run.

Comment from ABDK: "don't see any good reason to forbid both position amounts to have the same sign, other than this would make the code a bit more complicated, If both are zero, it is fine. But if both a marginally positive, then the current implementation will revert for no good reason."