From 5c042758e8d4d369d2c0466c0e51924380a4e1b6 Mon Sep 17 00:00:00 2001 From: Noah Zinsmeister Date: Thu, 6 Feb 2020 15:38:58 -0500 Subject: [PATCH] fee to 5 bips --- contracts/UniswapV2Exchange.sol | 2 +- test/UniswapV2Exchange.spec.ts | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/contracts/UniswapV2Exchange.sol b/contracts/UniswapV2Exchange.sol index 5dbfd77..3efa62c 100644 --- a/contracts/UniswapV2Exchange.sol +++ b/contracts/UniswapV2Exchange.sol @@ -88,7 +88,7 @@ contract UniswapV2Exchange is IUniswapV2Exchange, UniswapV2ERC20 { uint rootKLast = Math.sqrt(_kLast); if (rootK > rootKLast) { uint numerator = totalSupply.mul(rootK.sub(rootKLast)); - uint denominator = rootK.mul(4).add(rootKLast); + uint denominator = rootK.mul(5).add(rootKLast); uint liquidity = numerator / denominator; if (liquidity > 0) _mint(feeTo, liquidity); } diff --git a/test/UniswapV2Exchange.spec.ts b/test/UniswapV2Exchange.spec.ts index 65e15fb..e8f7c69 100644 --- a/test/UniswapV2Exchange.spec.ts +++ b/test/UniswapV2Exchange.spec.ts @@ -255,10 +255,10 @@ describe('UniswapV2Exchange', () => { const expectedLiquidity = expandTo18Decimals(1000) await exchange.transfer(exchange.address, expectedLiquidity) await exchange.burn(wallet.address, overrides) - expect(await exchange.totalSupply()).to.eq('299700614071741') - expect(await exchange.balanceOf(other.address)).to.eq('299700614071741') + expect(await exchange.totalSupply()).to.eq('249750499251388') + expect(await exchange.balanceOf(other.address)).to.eq('249750499251388') - expect(await token0.balanceOf(exchange.address)).to.eq('299402020436935') - expect(await token1.balanceOf(exchange.address)).to.eq('300000224775562') + expect(await token0.balanceOf(exchange.address)).to.eq('249501683697446') + expect(await token1.balanceOf(exchange.address)).to.eq('250000187312968') }) })