Skip to content

Commit

Permalink
fixed invalid amount check
Browse files Browse the repository at this point in the history
  • Loading branch information
sarangparikh22 committed Mar 11, 2022
1 parent ca1fc84 commit 6a6ffec
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion contracts/pool/constant-product/ConstantProductPool.sol
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ contract ConstantProductPool is IPool, ERC20, ReentrancyGuard {
(uint256 _totalSupply, uint256 k) = _mintFee(_reserve0, _reserve1);

if (_totalSupply == 0) {
if (amount0 <= 0 && amount1 <= 0) revert InvalidAmounts();
if (amount0 == 0 || amount1 == 0) revert InvalidAmounts();
liquidity = computed - MINIMUM_LIQUIDITY;
_mint(address(0), MINIMUM_LIQUIDITY);
} else {
Expand Down

0 comments on commit 6a6ffec

Please sign in to comment.