From 12b269d6863c3b05e186cfb314d4f6af4f02b7dc Mon Sep 17 00:00:00 2001 From: Noah Zinsmeister Date: Mon, 9 Dec 2019 16:24:59 -0500 Subject: [PATCH] small tweaks --- README.md | 2 +- contracts/UniswapV2.sol | 2 +- contracts/interfaces/IUniswapV2.sol | 1 + test/UniswapV2.spec.ts | 4 ++-- 4 files changed, 5 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index b4baf5e..dbb1ffa 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ # Uniswap v2 Smart Contracts -[![CircleCI](https://circleci.com/gh/Uniswap/uniswap-v2.svg?style=svg)](https://circleci.com/gh/Uniswap/uniswap-v2) +[![CircleCI](https://circleci.com/gh/Uniswap/uniswap-v2-core.svg?style=svg)](https://circleci.com/gh/Uniswap/uniswap-v2-core) ## Local Development diff --git a/contracts/UniswapV2.sol b/contracts/UniswapV2.sol index fe86662..4e51913 100644 --- a/contracts/UniswapV2.sol +++ b/contracts/UniswapV2.sol @@ -161,7 +161,7 @@ contract UniswapV2 is IUniswapV2, ERC20("Uniswap V2", "UNI-V2", 18, 0), SafeTran emit Swap(msg.sender, recipient, amount0, amount1, reserve0, reserve1, token1); } - // almost certainly never needs to be called, it's for weird tokens + // almost never _needs_ to be called, it's for weird tokens and can also be helpful for oracles function sync() external lock { update(IERC20(token0).balanceOf(address(this)), IERC20(token1).balanceOf(address(this))); } diff --git a/contracts/interfaces/IUniswapV2.sol b/contracts/interfaces/IUniswapV2.sol index af171df..7110247 100644 --- a/contracts/interfaces/IUniswapV2.sol +++ b/contracts/interfaces/IUniswapV2.sol @@ -47,4 +47,5 @@ interface IUniswapV2 { function burnLiquidity(address recipient) external returns (uint amount0, uint amount1); function swap0(address recipient) external returns (uint amount1); function swap1(address recipient) external returns (uint amount0); + function sync() external; } diff --git a/test/UniswapV2.spec.ts b/test/UniswapV2.spec.ts index 09e4a29..48dbed8 100644 --- a/test/UniswapV2.spec.ts +++ b/test/UniswapV2.spec.ts @@ -19,9 +19,9 @@ describe('UniswapV2', () => { let token1: Contract let exchange: Contract beforeEach(async () => { - const { token0: _token0, token1: _token1, exchange: _exchange } = (await loadFixture( + const { token0: _token0, token1: _token1, exchange: _exchange }: ExchangeFixture = await loadFixture( exchangeFixture as any - )) as ExchangeFixture + ) token0 = _token0 token1 = _token1 exchange = _exchange