From d2ddbd95e8500cfd3669ab81b64f48956521ea6b Mon Sep 17 00:00:00 2001 From: Noah Zinsmeister Date: Fri, 20 Dec 2019 15:26:04 -0500 Subject: [PATCH] note edge case --- contracts/UniswapV2.sol | 1 + 1 file changed, 1 insertion(+) diff --git a/contracts/UniswapV2.sol b/contracts/UniswapV2.sol index 956e81b..2b11cc0 100644 --- a/contracts/UniswapV2.sol +++ b/contracts/UniswapV2.sol @@ -84,6 +84,7 @@ contract UniswapV2 is IUniswapV2, ERC20("Uniswap V2", "UNI-V2", 18, 0) { function made() external lock returns (uint amount0, uint amount1) { uint liquidity = balanceOf[address(this)]; + // there's a funny case here where if a token deflates uniswap's balance, we give too many tokens... amount0 = liquidity.mul(reserve0) / totalSupply; amount1 = liquidity.mul(reserve1) / totalSupply; require(amount0 > 0 && amount1 > 0, "UniswapV2: INSUFFICIENT_LIQUIDITY_BURNED");