fee to 5 bips
This commit is contained in:
@ -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);
|
||||
}
|
||||
|
||||
@ -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')
|
||||
})
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user