diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 0446b6330..87d03651e 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -4,7 +4,7 @@ on: push: branches: - master - pull_request: + pull_request_target: jobs: run-linters: @@ -27,6 +27,5 @@ jobs: uses: wearerequired/lint-action@v1 with: github_token: ${{ secrets.github_token }} - # Enable your linters heren prettier: true auto_fix: true diff --git a/.solhint.json b/.solhint.json new file mode 100644 index 000000000..11b3647f4 --- /dev/null +++ b/.solhint.json @@ -0,0 +1,6 @@ +{ + "plugins": ["prettier"], + "rules": { + "prettier/prettier": "error" + } +} diff --git a/contracts/UniswapV3Factory.sol b/contracts/UniswapV3Factory.sol index 39d123e17..034854552 100644 --- a/contracts/UniswapV3Factory.sol +++ b/contracts/UniswapV3Factory.sol @@ -15,7 +15,7 @@ contract UniswapV3Factory is IUniswapV3Factory { feeToSetter = _feeToSetter; } - function allPairsLength() external override view returns (uint) { + function allPairsLength() external view override returns (uint256) { return allPairs.length; } @@ -25,7 +25,7 @@ contract UniswapV3Factory is IUniswapV3Factory { require(token0 != address(0), 'UniswapV3: ZERO_ADDRESS'); require(getPair[token0][token1] == address(0), 'UniswapV3: PAIR_EXISTS'); // single check is sufficient // CREATE2 salt is 0 since token0 and token1 are included as constructor arguments - pair = address(new UniswapV3Pair{ salt: bytes32(0) }(address(this), token0, token1)); + pair = address(new UniswapV3Pair{salt: bytes32(0)}(address(this), token0, token1)); getPair[token0][token1] = pair; getPair[token1][token0] = pair; // populate mapping in the reverse direction allPairs.push(pair); diff --git a/contracts/UniswapV3Pair.sol b/contracts/UniswapV3Pair.sol index 26e08b282..7663c8c72 100644 --- a/contracts/UniswapV3Pair.sol +++ b/contracts/UniswapV3Pair.sol @@ -16,10 +16,10 @@ import './interfaces/IUniswapV3Factory.sol'; import './interfaces/IUniswapV3Callee.sol'; contract UniswapV3Pair is IUniswapV3Pair { - using SafeMath for uint; + using SafeMath for uint256; using SafeMath for uint112; - using SafeMath for int; - using SafeMath for int112; + using SafeMath for int256; + using SafeMath for int112; using FixedPoint for FixedPoint.uq112x112; @@ -31,16 +31,14 @@ contract UniswapV3Pair is IUniswapV3Pair { // options are 0.05%, 0.10%, 0.30%, 0.60%, 1.00%, 2.00% // ideally this would be a constant array, but constant arrays are not supported in solidity function FEE_OPTIONS() public pure returns (uint24[NUM_FEE_OPTIONS] memory) { - return [ - uint24(500), 1000, 3000, 6000, 10000, 20000 - ]; + return [uint24(500), 1000, 3000, 6000, 10000, 20000]; } uint112 public constant override LIQUIDITY_MIN = 1000; // TODO could this be 100, or does it need to be 102, or higher? // TODO this could potentially affect how many ticks we need to support - uint8 public constant override TOKEN_MIN = 101; + uint8 public constant override TOKEN_MIN = 101; address public immutable override factory; address public immutable override token0; @@ -49,7 +47,7 @@ contract UniswapV3Pair is IUniswapV3Pair { // ⬇ single storage slot ⬇ uint112 public override reserve0Virtual; uint112 public override reserve1Virtual; - uint32 public override blockTimestampLast; + uint32 public override blockTimestampLast; // ⬆ single storage slot ⬆ // the first price tick _at_ or _below_ the current (reserve1Virtual / reserve0Virtual) price @@ -65,20 +63,19 @@ contract UniswapV3Pair is IUniswapV3Pair { uint256 public override price0CumulativeLast; // cumulative (reserve1Virtual / reserve0Virtual) oracle price uint256 public override price1CumulativeLast; // cumulative (reserve0Virtual / reserve1Virtual) oracle price - + struct TickInfo { // fee growth on the _other_ side of this tick (relative to the current tick) // only has relative meaning, not absolute — the value depends on when the tick is initialized FixedPoint.uq112x112 growthOutside; // seconds spent on the _other_ side of this tick (relative to the current tick) // only has relative meaning, not absolute — the value depends on when the tick is initialized - uint32 secondsOutside; - + uint32 secondsOutside; // amount of token0 added when ticks are crossed from left to right // (i.e. as the (reserve1Virtual / reserve0Virtual) price goes up), for each fee vote - int112[NUM_FEE_OPTIONS] token0VirtualDeltas; + int112[NUM_FEE_OPTIONS] token0VirtualDeltas; } - mapping (int16 => TickInfo) public tickInfos; + mapping(int16 => TickInfo) public tickInfos; struct Position { // the amount of liquidity (sqrt(amount0 * amount1)). @@ -90,9 +87,9 @@ contract UniswapV3Pair is IUniswapV3Pair { // will be smaller than liquidity if any fees have been earned in range. uint112 liquidityAdjusted; } - mapping (bytes32 => Position) public positions; + mapping(bytes32 => Position) public positions; - uint public unlocked = 1; + uint256 public unlocked = 1; modifier lock() { require(unlocked == 1, 'UniswapV3: LOCKED'); unlocked = 0; @@ -100,29 +97,46 @@ contract UniswapV3Pair is IUniswapV3Pair { unlocked = 1; } - function _getPosition(address owner, int16 tickLower, int16 tickUpper, uint8 feeVote) - private - view - returns (Position storage position) - { + function _getPosition( + address owner, + int16 tickLower, + int16 tickUpper, + uint8 feeVote + ) private view returns (Position storage position) { assert(tickLower >= TickMath.MIN_TICK); assert(tickUpper <= TickMath.MAX_TICK); position = positions[keccak256(abi.encodePacked(owner, tickLower, tickUpper, feeVote))]; } // sum the virtual supply across all fee votes to get the total - function getVirtualSupply() public override view returns (uint112 virtualSupply) { - virtualSupply = virtualSupplies[0] + virtualSupplies[1] + virtualSupplies[2] + virtualSupplies[3] + virtualSupplies[4] + virtualSupplies[5]; + function getVirtualSupply() public view override returns (uint112 virtualSupply) { + virtualSupply = + virtualSupplies[0] + + virtualSupplies[1] + + virtualSupplies[2] + + virtualSupplies[3] + + virtualSupplies[4] + + virtualSupplies[5]; } // find the median fee vote, and return the fee in pips - function getFee() public override view returns (uint24 fee) { + function getFee() public view override returns (uint24 fee) { uint112 virtualSupplyCumulative; // load all virtual supplies into memory uint112[NUM_FEE_OPTIONS] memory virtualSupplies_ = [ - virtualSupplies[0], virtualSupplies[1], virtualSupplies[2], virtualSupplies[3], virtualSupplies[4], virtualSupplies[5] + virtualSupplies[0], + virtualSupplies[1], + virtualSupplies[2], + virtualSupplies[3], + virtualSupplies[4], + virtualSupplies[5] ]; - uint112 threshold = (virtualSupplies_[0] + virtualSupplies_[1] + virtualSupplies_[2] + virtualSupplies_[3] + virtualSupplies_[4] + virtualSupplies_[5]) / 2; + uint112 threshold = (virtualSupplies_[0] + + virtualSupplies_[1] + + virtualSupplies_[2] + + virtualSupplies_[3] + + virtualSupplies_[4] + + virtualSupplies_[5]) / 2; uint24[NUM_FEE_OPTIONS] memory feeOptions = FEE_OPTIONS(); for (uint8 feeVoteIndex = 0; feeVoteIndex < NUM_FEE_OPTIONS - 1; feeVoteIndex++) { virtualSupplyCumulative += virtualSupplies_[feeVoteIndex]; @@ -136,18 +150,18 @@ contract UniswapV3Pair is IUniswapV3Pair { // get fee growth (sqrt(reserve0Virtual * reserve1Virtual) / virtualSupply) function getG() public view returns (FixedPoint.uq112x112 memory g) { // safe, because uint(reserve0Virtual) * reserve1Virtual is guaranteed to fit in a uint224 - uint112 rootK = uint112(Babylonian.sqrt(uint(reserve0Virtual) * reserve1Virtual)); + uint112 rootK = uint112(Babylonian.sqrt(uint256(reserve0Virtual) * reserve1Virtual)); g = FixedPoint.fraction(rootK, getVirtualSupply()); } // gets the growth in g between two ticks // this only has relative meaning, not absolute // TODO: simpler or more precise way to compute this? - function _getGrowthBelow(int16 tick, TickInfo storage tickInfo, FixedPoint.uq112x112 memory g) - private - view - returns (FixedPoint.uq112x112 memory growthBelow) - { + function _getGrowthBelow( + int16 tick, + TickInfo storage tickInfo, + FixedPoint.uq112x112 memory g + ) private view returns (FixedPoint.uq112x112 memory growthBelow) { growthBelow = tickInfo.growthOutside; assert(growthBelow._x != 0); // tick is above the current tick, meaning growth outside represents growth above, not below, so adjust @@ -155,11 +169,12 @@ contract UniswapV3Pair is IUniswapV3Pair { growthBelow = FixedPointExtra.divuq(g, growthBelow); } } - function _getGrowthAbove(int16 tick, TickInfo storage tickInfo, FixedPoint.uq112x112 memory g) - private - view - returns (FixedPoint.uq112x112 memory growthAbove) - { + + function _getGrowthAbove( + int16 tick, + TickInfo storage tickInfo, + FixedPoint.uq112x112 memory g + ) private view returns (FixedPoint.uq112x112 memory growthAbove) { growthAbove = tickInfo.growthOutside; assert(growthAbove._x != 0); // tick is at or below the current tick, meaning growth outside represents growth below, not above, so adjust @@ -167,16 +182,13 @@ contract UniswapV3Pair is IUniswapV3Pair { growthAbove = FixedPointExtra.divuq(g, growthAbove); } } + function _getGrowthInside( int16 tickLower, int16 tickUpper, TickInfo storage tickInfoLower, TickInfo storage tickInfoUpper - ) - private - view - returns (FixedPoint.uq112x112 memory growthInside) - { + ) private view returns (FixedPoint.uq112x112 memory growthInside) { FixedPoint.uq112x112 memory g = getG(); FixedPoint.uq112x112 memory growthBelow = _getGrowthBelow(tickLower, tickInfoLower, g); FixedPoint.uq112x112 memory growthAbove = _getGrowthAbove(tickUpper, tickInfoUpper, g); @@ -195,7 +207,11 @@ contract UniswapV3Pair is IUniswapV3Pair { amount1 = FixedPointExtra.muli(price, amount0).itoInt112(); } - constructor(address _factory, address _token0, address _token1) public { + constructor( + address _factory, + address _token0, + address _token1 + ) public { factory = _factory; token0 = _token0; token1 = _token1; @@ -209,7 +225,7 @@ contract UniswapV3Pair is IUniswapV3Pair { // returns the block timestamp % 2**32. // the timestamp is truncated to 32 bits because the pair only ever uses it for relative timestamp computations. // overridden for tests. - function _blockTimestamp() internal virtual view returns (uint32) { + function _blockTimestamp() internal view virtual returns (uint32) { return uint32(block.timestamp); // truncation is desired } @@ -225,22 +241,25 @@ contract UniswapV3Pair is IUniswapV3Pair { } // the reason this can't _just_ burn but needs to mint is because otherwise it would incentivize bad starting prices - function initialize(uint112 amount0, uint112 amount1, int16 tick, uint8 feeVote) - external lock returns (uint112 liquidity) - { - require(getVirtualSupply() == 0, 'UniswapV3: ALREADY_INITIALIZED'); // sufficient check - require(amount0 >= TOKEN_MIN, 'UniswapV3: AMOUNT_0_TOO_SMALL'); - require(amount1 >= TOKEN_MIN, 'UniswapV3: AMOUNT_1_TOO_SMALL'); + function initialize( + uint112 amount0, + uint112 amount1, + int16 tick, + uint8 feeVote + ) external lock returns (uint112 liquidity) { + require(getVirtualSupply() == 0, 'UniswapV3: ALREADY_INITIALIZED'); // sufficient check + require(amount0 >= TOKEN_MIN, 'UniswapV3: AMOUNT_0_TOO_SMALL'); + require(amount1 >= TOKEN_MIN, 'UniswapV3: AMOUNT_1_TOO_SMALL'); require(tick >= TickMath.MIN_TICK, 'UniswapV3: TICK_TOO_SMALL'); - require(tick < TickMath.MAX_TICK, 'UniswapV3: TICK_TOO_LARGE'); + require(tick < TickMath.MAX_TICK, 'UniswapV3: TICK_TOO_LARGE'); // ensure the tick witness is correct FixedPoint.uq112x112 memory price = FixedPoint.fraction(amount1, amount0); - require(TickMath.getRatioAtTick(tick )._x <= price._x, 'UniswapV3: STARTING_TICK_TOO_LARGE'); - require(TickMath.getRatioAtTick(tick + 1)._x > price._x, 'UniswapV3: STARTING_TICK_TOO_SMALL'); + require(TickMath.getRatioAtTick(tick)._x <= price._x, 'UniswapV3: STARTING_TICK_TOO_LARGE'); + require(TickMath.getRatioAtTick(tick + 1)._x > price._x, 'UniswapV3: STARTING_TICK_TOO_SMALL'); // ensure that at a minimum amount of liquidity will be generated - liquidity = uint112(Babylonian.sqrt(uint(amount0) * amount1)); + liquidity = uint112(Babylonian.sqrt(uint256(amount0) * amount1)); require(liquidity >= LIQUIDITY_MIN, 'UniswapV3: LIQUIDITY_TOO_SMALL'); // take the tokens @@ -261,16 +280,22 @@ contract UniswapV3Pair is IUniswapV3Pair { // set the permanent LIQUIDITY_MIN position Position storage position = _getPosition(address(0), TickMath.MIN_TICK, TickMath.MAX_TICK, feeVote); - position.liquidity = LIQUIDITY_MIN; + position.liquidity = LIQUIDITY_MIN; position.liquidityAdjusted = LIQUIDITY_MIN; emit PositionSet(address(0), TickMath.MIN_TICK, TickMath.MAX_TICK, feeVote, int112(LIQUIDITY_MIN)); // set the user's position if necessary if (liquidity > LIQUIDITY_MIN) { position = _getPosition(msg.sender, TickMath.MIN_TICK, TickMath.MAX_TICK, feeVote); - position.liquidity = liquidity - LIQUIDITY_MIN; + position.liquidity = liquidity - LIQUIDITY_MIN; position.liquidityAdjusted = liquidity - LIQUIDITY_MIN; - emit PositionSet(msg.sender, TickMath.MIN_TICK, TickMath.MAX_TICK, feeVote, int112(liquidity) - int112(LIQUIDITY_MIN)); + emit PositionSet( + msg.sender, + TickMath.MIN_TICK, + TickMath.MAX_TICK, + feeVote, + int112(liquidity) - int112(LIQUIDITY_MIN) + ); } emit Initialized(amount0, amount1, tick, feeVote); @@ -289,16 +314,19 @@ contract UniswapV3Pair is IUniswapV3Pair { } } - function getLiquidityFee(int16 tickLower, int16 tickUpper, uint8 feeVote) public view returns (int112 amount0, int112 amount1) { + function getLiquidityFee( + int16 tickLower, + int16 tickUpper, + uint8 feeVote + ) public view returns (int112 amount0, int112 amount1) { TickInfo storage tickInfoLower = tickInfos[tickLower]; TickInfo storage tickInfoUpper = tickInfos[tickUpper]; FixedPoint.uq112x112 memory growthInside = _getGrowthInside(tickLower, tickUpper, tickInfoLower, tickInfoUpper); Position storage position = _getPosition(msg.sender, tickLower, tickUpper, feeVote); - uint liquidityFee = - FixedPoint.decode144(growthInside.mul(position.liquidityAdjusted)) > position.liquidity ? - FixedPoint.decode144(growthInside.mul(position.liquidityAdjusted)) - position.liquidity : - 0; + uint256 liquidityFee = FixedPoint.decode144(growthInside.mul(position.liquidityAdjusted)) > position.liquidity + ? FixedPoint.decode144(growthInside.mul(position.liquidityAdjusted)) - position.liquidity + : 0; FixedPoint.uq112x112 memory price = FixedPoint.fraction(reserve1Virtual, reserve0Virtual); (amount0, amount1) = getValueAtPrice(price, liquidityFee.toInt112()); @@ -313,7 +341,7 @@ contract UniswapV3Pair is IUniswapV3Pair { (amount0, amount1) = getValueAtPrice(price, liquidityDelta); // checkpoint rootK - uint112 rootKLast = uint112(Babylonian.sqrt(uint(reserve0Virtual) * reserve1Virtual)); + uint112 rootKLast = uint112(Babylonian.sqrt(uint256(reserve0Virtual) * reserve1Virtual)); // update reserves (the price doesn't change, so no need to update the oracle/current tick) // TODO: the price _can_ change because of rounding error @@ -326,9 +354,10 @@ contract UniswapV3Pair is IUniswapV3Pair { // update virtual supply // TODO i believe this consistently results in a smaller g uint112 virtualSupply = getVirtualSupply(); - uint112 rootK = uint112(Babylonian.sqrt(uint(reserve0Virtual) * reserve1Virtual)); - virtualSupplies[feeVote] = - virtualSupplies[feeVote].addi((int(rootK) - rootKLast) * virtualSupply / rootKLast).toUint112(); + uint112 rootK = uint112(Babylonian.sqrt(uint256(reserve0Virtual) * reserve1Virtual)); + virtualSupplies[feeVote] = virtualSupplies[feeVote] + .addi(((int256(rootK) - rootKLast) * virtualSupply) / rootKLast) + .toUint112(); FixedPoint.uq112x112 memory priceNext = FixedPoint.fraction(reserve1Virtual, reserve0Virtual); if (amount0 > 0) { @@ -341,122 +370,140 @@ contract UniswapV3Pair is IUniswapV3Pair { // add or remove a specified amount of liquidity from a specified range, and/or change feeVote for that range // also sync a position and return accumulated fees from it to user as tokens // liquidityDelta is sqrt(reserve0Virtual * reserve1Virtual), so does not incorporate fees - function setPosition(int16 tickLower, int16 tickUpper, uint8 feeVote, int112 liquidityDelta) - external lock returns (int112 amount0, int112 amount1) - { - require(getVirtualSupply() > 0, 'UniswapV3: NOT_INITIALIZED'); // sufficient check + function setPosition( + int16 tickLower, + int16 tickUpper, + uint8 feeVote, + int112 liquidityDelta + ) external lock returns (int112 amount0, int112 amount1) { + require(getVirtualSupply() > 0, 'UniswapV3: NOT_INITIALIZED'); // sufficient check require(tickLower >= TickMath.MIN_TICK, 'UniswapV3: LOWER_TICK'); require(tickUpper <= TickMath.MAX_TICK, 'UniswapV3: UPPER_TICK'); - require(tickLower < tickUpper, 'UniswapV3: TICKS'); + require(tickLower < tickUpper, 'UniswapV3: TICKS'); _update(); TickInfo storage tickInfoLower = _initializeTick(tickLower); // initialize tick idempotently TickInfo storage tickInfoUpper = _initializeTick(tickUpper); // initialize tick idempotently { - Position storage position = _getPosition(msg.sender, tickLower, tickUpper, feeVote); - FixedPoint.uq112x112 memory growthInside = _getGrowthInside(tickLower, tickUpper, tickInfoLower, tickInfoUpper); + Position storage position = _getPosition(msg.sender, tickLower, tickUpper, feeVote); + FixedPoint.uq112x112 memory growthInside = _getGrowthInside( + tickLower, + tickUpper, + tickInfoLower, + tickInfoUpper + ); - // check if this condition has accrued any untracked fees - // to account for rounding errors, we have to short-circuit the calculation if the untracked fees are too low - // TODO is this calculation correct/precise? - // TODO technically this can overflow - // TODO optimize this to save gas - uint liquidityFee = - FixedPoint.decode144(growthInside.mul(position.liquidityAdjusted)) > position.liquidity ? - FixedPoint.decode144(growthInside.mul(position.liquidityAdjusted)) - position.liquidity : - 0; - if (liquidityFee > 0) { - address feeTo = IUniswapV3Factory(factory).feeTo(); - // take the protocol fee if it's on (feeTo isn't address(0)) and the sender isn't feeTo - if (feeTo != address(0) && msg.sender != feeTo) { - uint liquidityProtocol = liquidityFee / 6; - if (liquidityProtocol > 0) { - // 1/6 of the user's liquidityFee gets allocated as liquidity between - // MIN/MAX for `feeTo`. - liquidityFee -= liquidityProtocol; - - // TODO ensure all of the below is correct - // note: this accumulates protocol fees under the user's current fee vote - Position storage positionProtocol = - _getPosition(feeTo, TickMath.MIN_TICK, TickMath.MAX_TICK, feeVote); - FixedPoint.uq112x112 memory g = getG(); // shortcut for _getGrowthInside - - // accrue any newly earned fee liquidity from the existing protocol position - liquidityProtocol = liquidityProtocol.add( - FixedPoint.decode144(g.mul(positionProtocol.liquidityAdjusted)) > positionProtocol.liquidity ? - FixedPoint.decode144(g.mul(positionProtocol.liquidityAdjusted)) - positionProtocol.liquidity : - 0 - ); - // update the reserves to account for the this new liquidity - updateReservesAndVirtualSupply(liquidityProtocol.toInt112(), feeVote); - - // update the position - // TODO all the same caveats as above apply - positionProtocol.liquidity = positionProtocol.liquidity.add(liquidityProtocol).toUint112(); - positionProtocol.liquidityAdjusted = - uint(FixedPoint.encode(positionProtocol.liquidity)._x / g._x).toUint112(); + // check if this condition has accrued any untracked fees + // to account for rounding errors, we have to short-circuit the calculation if the untracked fees are too low + // TODO is this calculation correct/precise? + // TODO technically this can overflow + // TODO optimize this to save gas + uint256 liquidityFee = FixedPoint.decode144(growthInside.mul(position.liquidityAdjusted)) > + position.liquidity + ? FixedPoint.decode144(growthInside.mul(position.liquidityAdjusted)) - position.liquidity + : 0; + if (liquidityFee > 0) { + address feeTo = IUniswapV3Factory(factory).feeTo(); + // take the protocol fee if it's on (feeTo isn't address(0)) and the sender isn't feeTo + if (feeTo != address(0) && msg.sender != feeTo) { + uint256 liquidityProtocol = liquidityFee / 6; + if (liquidityProtocol > 0) { + // 1/6 of the user's liquidityFee gets allocated as liquidity between + // MIN/MAX for `feeTo`. + liquidityFee -= liquidityProtocol; + + // TODO ensure all of the below is correct + // note: this accumulates protocol fees under the user's current fee vote + Position storage positionProtocol = _getPosition( + feeTo, + TickMath.MIN_TICK, + TickMath.MAX_TICK, + feeVote + ); + FixedPoint.uq112x112 memory g = getG(); // shortcut for _getGrowthInside + + // accrue any newly earned fee liquidity from the existing protocol position + liquidityProtocol = liquidityProtocol.add( + FixedPoint.decode144(g.mul(positionProtocol.liquidityAdjusted)) > positionProtocol.liquidity + ? FixedPoint.decode144(g.mul(positionProtocol.liquidityAdjusted)) - + positionProtocol.liquidity + : 0 + ); + // update the reserves to account for the this new liquidity + updateReservesAndVirtualSupply(liquidityProtocol.toInt112(), feeVote); + + // update the position + // TODO all the same caveats as above apply + positionProtocol.liquidity = positionProtocol.liquidity.add(liquidityProtocol).toUint112(); + positionProtocol.liquidityAdjusted = uint256( + FixedPoint.encode(positionProtocol.liquidity)._x / g._x + ) + .toUint112(); + } } - } - // credit the caller for the value of the fee liquidity - (amount0, amount1) = updateReservesAndVirtualSupply(-(liquidityFee.toInt112()), feeVote); - } + // credit the caller for the value of the fee liquidity + (amount0, amount1) = updateReservesAndVirtualSupply(-(liquidityFee.toInt112()), feeVote); + } - // update position - position.liquidity = position.liquidity.addi(liquidityDelta).toUint112(); - position.liquidityAdjusted = uint(FixedPoint.encode(position.liquidity)._x / growthInside._x).toUint112(); + // update position + position.liquidity = position.liquidity.addi(liquidityDelta).toUint112(); + position.liquidityAdjusted = uint256(FixedPoint.encode(position.liquidity)._x / growthInside._x) + .toUint112(); } // calculate how much the specified liquidity delta is worth at the lower and upper ticks // amount0Lower :> amount0Upper // amount1Upper :> amount1Lower - (int112 amount0Lower, int112 amount1Lower) = - getValueAtPrice(TickMath.getRatioAtTick(tickLower), liquidityDelta); - (int112 amount0Upper, int112 amount1Upper) = - getValueAtPrice(TickMath.getRatioAtTick(tickUpper), liquidityDelta); + (int112 amount0Lower, int112 amount1Lower) = getValueAtPrice( + TickMath.getRatioAtTick(tickLower), + liquidityDelta + ); + (int112 amount0Upper, int112 amount1Upper) = getValueAtPrice( + TickMath.getRatioAtTick(tickUpper), + liquidityDelta + ); // regardless of current price, when lower tick is crossed from left to right, amount0Lower should be added if (tickLower > TickMath.MIN_TICK) { - tickInfoLower.token0VirtualDeltas[feeVote] = - tickInfoLower.token0VirtualDeltas[feeVote].iadd(amount0Lower).itoInt112(); + tickInfoLower.token0VirtualDeltas[feeVote] = tickInfoLower.token0VirtualDeltas[feeVote] + .iadd(amount0Lower) + .itoInt112(); } // regardless of current price, when upper tick is crossed from left to right amount0Upper should be removed if (tickUpper < TickMath.MAX_TICK) { - tickInfoUpper.token0VirtualDeltas[feeVote] = - tickInfoUpper.token0VirtualDeltas[feeVote].isub(amount0Upper).itoInt112(); + tickInfoUpper.token0VirtualDeltas[feeVote] = tickInfoUpper.token0VirtualDeltas[feeVote] + .isub(amount0Upper) + .itoInt112(); } // the current price is below the passed range, so the liquidity can only become in range by crossing from left // to right, at which point we'll need _more_ token0 (it's becoming more valuable) so the user must provide it if (tickCurrent < tickLower) { amount0 = amount0.iadd(amount0Lower.isub(amount0Upper)).itoInt112(); - } - // the current price is inside the passed range - else if (tickCurrent < tickUpper) { - { + } else if (tickCurrent < tickUpper) { + // the current price is inside the passed range (int112 amount0Current, int112 amount1Current) = updateReservesAndVirtualSupply(liquidityDelta, feeVote); // charge the user whatever is required to cover their position amount0 = amount0.iadd(amount0Current.isub(amount0Upper)).itoInt112(); amount1 = amount1.iadd(amount1Current.isub(amount1Lower)).itoInt112(); - } - } - // the current price is above the passed range, so the liquidity can only become in range by crossing from right - // to left, at which point we'll need _more_ token1 (it's becoming more valuable) so the user must provide it - else { + } else { + // the current price is above the passed range, so the liquidity can only become in range by crossing from right + // to left, at which point we'll need _more_ token1 (it's becoming more valuable) so the user must provide it amount1 = amount1.iadd(amount1Upper.isub(amount1Lower)).itoInt112(); } if (amount0 > 0) { - TransferHelper.safeTransferFrom(token0, msg.sender, address(this), uint(amount0)); + TransferHelper.safeTransferFrom(token0, msg.sender, address(this), uint256(amount0)); } else if (amount0 < 0) { - TransferHelper.safeTransfer(token0, msg.sender, uint(-amount0)); + TransferHelper.safeTransfer(token0, msg.sender, uint256(-amount0)); } if (amount1 > 0) { - TransferHelper.safeTransferFrom(token1, msg.sender, address(this), uint(amount1)); + TransferHelper.safeTransferFrom(token1, msg.sender, address(this), uint256(amount1)); } else if (amount1 < 0) { - TransferHelper.safeTransfer(token1, msg.sender, uint(-amount1)); + TransferHelper.safeTransfer(token1, msg.sender, uint256(-amount1)); } } @@ -494,10 +541,7 @@ contract UniswapV3Pair is IUniswapV3Pair { assert(tick >= TickMath.MIN_TICK); assert(tick <= TickMath.MAX_TICK); // ensure that there is enough liquidity to guarantee we can get a price within the next tick - require( - reserve0Virtual >= TOKEN_MIN && reserve1Virtual >= TOKEN_MIN, - 'UniswapV3: INSUFFICIENT_LIQUIDITY' - ); + require(reserve0Virtual >= TOKEN_MIN && reserve1Virtual >= TOKEN_MIN, 'UniswapV3: INSUFFICIENT_LIQUIDITY'); // get the inclusive lower bound price for the current tick StepComputations memory step; @@ -507,43 +551,51 @@ contract UniswapV3Pair is IUniswapV3Pair { uint24 currentFee = getFee(); if (fee < currentFee) fee = currentFee; - (uint112 reserveInVirtual, uint112 reserveOutVirtual) = params.zeroForOne ? (reserve0Virtual, reserve1Virtual) : (reserve1Virtual, reserve0Virtual); + (uint112 reserveInVirtual, uint112 reserveOutVirtual) = params.zeroForOne + ? (reserve0Virtual, reserve1Virtual) + : (reserve1Virtual, reserve0Virtual); // compute the amount of token0 required s.t. the price is ~the lower bound for the current tick // TODO adjust this amount (or amountOutStep) so that we're guaranteed the ratio is as close (or equal) // to the lower bound _without_ exceeding it as possible uint112 amountInRequiredForShift = PriceMath.getInputToRatio( - reserveInVirtual, reserveOutVirtual, fee, params.zeroForOne ? step.nextPrice.reciprocal() : step.nextPrice + reserveInVirtual, + reserveOutVirtual, + fee, + params.zeroForOne ? step.nextPrice.reciprocal() : step.nextPrice ); // only trade as much as we need to if (amountInRequiredForShift > 0) { - uint144 reserveInTarget = uint144(step.nextPrice._x > type(uint144).max ? 1 << 112 >> 80 : 1 << 112); - uint144 reserveOutTarget = uint144(step.nextPrice._x > type(uint144).max ? step.nextPrice._x >> 80 : step.nextPrice._x); - uint112 reserveInVirtualNext = (uint(reserveInVirtual) + amountInRequiredForShift).toUint112(); - uint112 amountOutMaximum = - reserveOutVirtual.sub(reserveOutTarget * reserveInVirtualNext / reserveInTarget).toUint112(); - - step.amountIn = amountInRemaining > amountInRequiredForShift ? - amountInRequiredForShift : - amountInRemaining; + uint144 reserveInTarget = uint144(step.nextPrice._x > type(uint144).max ? (1 << 112) >> 80 : 1 << 112); + uint144 reserveOutTarget = uint144( + step.nextPrice._x > type(uint144).max ? step.nextPrice._x >> 80 : step.nextPrice._x + ); + uint112 reserveInVirtualNext = (uint256(reserveInVirtual) + amountInRequiredForShift).toUint112(); + uint112 amountOutMaximum = reserveOutVirtual + .sub((reserveOutTarget * reserveInVirtualNext) / reserveInTarget) + .toUint112(); + + step.amountIn = amountInRemaining > amountInRequiredForShift + ? amountInRequiredForShift + : amountInRemaining; // adjust the step amount by the current fee uint112 amountInAdjusted = uint112( - uint(step.amountIn) * (PriceMath.LP_FEE_BASE - fee) / PriceMath.LP_FEE_BASE + (uint256(step.amountIn) * (PriceMath.LP_FEE_BASE - fee)) / PriceMath.LP_FEE_BASE ); // calculate the output amount - step.amountOut = ( - uint(reserveOutVirtual) * amountInAdjusted / (uint(reserveInVirtual) + amountInAdjusted) - ).toUint112(); + step.amountOut = ((uint256(reserveOutVirtual) * amountInAdjusted) / + (uint256(reserveInVirtual) + amountInAdjusted)) + .toUint112(); step.amountOut = step.amountOut > amountOutMaximum ? amountOutMaximum : step.amountOut; if (params.zeroForOne) { - reserve0Virtual = (uint(reserve0Virtual) + step.amountIn).toUint112(); + reserve0Virtual = (uint256(reserve0Virtual) + step.amountIn).toUint112(); reserve1Virtual = reserve1Virtual.sub(step.amountOut).toUint112(); } else { - reserve1Virtual = (uint(reserve1Virtual) + step.amountIn).toUint112(); + reserve1Virtual = (uint256(reserve1Virtual) + step.amountIn).toUint112(); reserve0Virtual = reserve0Virtual.sub(step.amountOut).toUint112(); } amountInRemaining = amountInRemaining.sub(step.amountIn).toUint112(); - amountOut = (uint(amountOut) + step.amountOut).toUint112(); + amountOut = (uint256(amountOut) + step.amountOut).toUint112(); } // if a positive input amount still remains, we have to shift down to the next tick @@ -570,7 +622,9 @@ contract UniswapV3Pair is IUniswapV3Pair { // note: this may be overkill/unnecessary uint112 virtualSupply = getVirtualSupply(); for (uint8 i = 0; i < NUM_FEE_OPTIONS; i++) { - int112 virtualSupplyDelta = (tickInfo.token0VirtualDeltas[i].imul(virtualSupply) / reserveInVirtual).itoInt112(); + int112 virtualSupplyDelta = (tickInfo.token0VirtualDeltas[i].imul(virtualSupply) / + reserveInVirtual) + .itoInt112(); // TODO are these SSTOREs optimized/packed? virtualSupplies[i] = virtualSupplies[i].subi(virtualSupplyDelta).toUint112(); } @@ -598,32 +652,46 @@ contract UniswapV3Pair is IUniswapV3Pair { tickCurrent = tick; TransferHelper.safeTransfer(params.zeroForOne ? token1 : token0, params.to, amountOut); // optimistically transfer tokens if (params.data.length > 0) IUniswapV3Callee(params.to).uniswapV3Call(msg.sender, 0, amountOut, params.data); - TransferHelper.safeTransferFrom(params.zeroForOne ? token0 : token1, msg.sender, address(this), params.amountIn); // this is different than v2 + TransferHelper.safeTransferFrom( + params.zeroForOne ? token0 : token1, + msg.sender, + address(this), + params.amountIn + ); // this is different than v2 } // move from right to left (token 1 is becoming more valuable) - function swap0For1(uint112 amount0In, address to, bytes calldata data) external returns (uint112 amount1Out) { - SwapParams memory params = SwapParams({ zeroForOne: true, amountIn: amount0In, to: to, data: data }); + function swap0For1( + uint112 amount0In, + address to, + bytes calldata data + ) external returns (uint112 amount1Out) { + SwapParams memory params = SwapParams({zeroForOne: true, amountIn: amount0In, to: to, data: data}); return _swap(params); } // move from left to right (token 0 is becoming more valuable) - function swap1For0(uint112 amount1In, address to, bytes calldata data) external returns (uint112 amount0Out) { - SwapParams memory params = SwapParams({ zeroForOne: false, amountIn: amount1In, to: to, data: data }); + function swap1For0( + uint112 amount1In, + address to, + bytes calldata data + ) external returns (uint112 amount0Out) { + SwapParams memory params = SwapParams({zeroForOne: false, amountIn: amount1In, to: to, data: data}); return _swap(params); } // Helper for reading the cumulative price as of the current block - function getCumulativePrices() public override view returns ( - uint256 price0Cumulative, - uint256 price1Cumulative - ) { + function getCumulativePrices() public view override returns (uint256 price0Cumulative, uint256 price1Cumulative) { uint32 blockTimestamp = _blockTimestamp(); if (blockTimestampLast != blockTimestamp) { uint32 timeElapsed = blockTimestamp - blockTimestampLast; - price0Cumulative = price0CumulativeLast + FixedPoint.fraction(reserve1Virtual, reserve0Virtual).mul(timeElapsed)._x; - price1Cumulative = price1CumulativeLast + FixedPoint.fraction(reserve0Virtual, reserve1Virtual).mul(timeElapsed)._x; + price0Cumulative = + price0CumulativeLast + + FixedPoint.fraction(reserve1Virtual, reserve0Virtual).mul(timeElapsed)._x; + price1Cumulative = + price1CumulativeLast + + FixedPoint.fraction(reserve0Virtual, reserve1Virtual).mul(timeElapsed)._x; } else { price0Cumulative = price0CumulativeLast; price1Cumulative = price1CumulativeLast; diff --git a/contracts/interfaces/IUniswapV3Callee.sol b/contracts/interfaces/IUniswapV3Callee.sol index 46276ebda..119427bb0 100644 --- a/contracts/interfaces/IUniswapV3Callee.sol +++ b/contracts/interfaces/IUniswapV3Callee.sol @@ -2,5 +2,10 @@ pragma solidity >=0.5.0; interface IUniswapV3Callee { - function uniswapV3Call(address sender, uint amount0, uint amount1, bytes calldata data) external; + function uniswapV3Call( + address sender, + uint256 amount0, + uint256 amount1, + bytes calldata data + ) external; } diff --git a/contracts/interfaces/IUniswapV3Factory.sol b/contracts/interfaces/IUniswapV3Factory.sol index cd7582b3f..cdea75563 100644 --- a/contracts/interfaces/IUniswapV3Factory.sol +++ b/contracts/interfaces/IUniswapV3Factory.sol @@ -2,17 +2,21 @@ pragma solidity >=0.5.0; interface IUniswapV3Factory { - event PairCreated(address indexed token0, address indexed token1, address pair, uint); + event PairCreated(address indexed token0, address indexed token1, address pair, uint256); function feeTo() external view returns (address); + function feeToSetter() external view returns (address); function getPair(address tokenA, address tokenB) external view returns (address pair); - function allPairs(uint) external view returns (address pair); - function allPairsLength() external view returns (uint); + + function allPairs(uint256) external view returns (address pair); + + function allPairsLength() external view returns (uint256); function createPair(address tokenA, address tokenB) external returns (address pair); function setFeeTo(address) external; + function setFeeToSetter(address) external; } diff --git a/contracts/interfaces/IUniswapV3Pair.sol b/contracts/interfaces/IUniswapV3Pair.sol index da887a0a6..744a682cb 100644 --- a/contracts/interfaces/IUniswapV3Pair.sol +++ b/contracts/interfaces/IUniswapV3Pair.sol @@ -2,31 +2,43 @@ pragma solidity >=0.5.0; interface IUniswapV3Pair { - event Initialized(uint amount0, uint amount1, int16 tick, uint8 feeVote); + event Initialized(uint256 amount0, uint256 amount1, int16 tick, uint8 feeVote); // todo: liquidityDelta or liquidity? event PositionSet(address owner, int16 tickLower, int16 tickUpper, uint8 feeVote, int112 liquidityDelta); // constants function NUM_FEE_OPTIONS() external pure returns (uint8); + function LIQUIDITY_MIN() external pure returns (uint112); + function TOKEN_MIN() external pure returns (uint8); // immutables function factory() external view returns (address); + function token0() external view returns (address); + function token1() external view returns (address); // variables/state function reserve0Virtual() external view returns (uint112); + function reserve1Virtual() external view returns (uint112); + function blockTimestampLast() external view returns (uint32); + function tickCurrent() external view returns (int16); - function virtualSupplies(uint) external view returns (uint112); + + function virtualSupplies(uint256) external view returns (uint112); + function price0CumulativeLast() external view returns (uint256); + function price1CumulativeLast() external view returns (uint256); // derived state function getFee() external view returns (uint24 fee); + function getVirtualSupply() external view returns (uint112 virtualSupply); + function getCumulativePrices() external view returns (uint256 price0Cumulative, uint256 price1Cumulative); } diff --git a/contracts/libraries/FixedPointExtra.sol b/contracts/libraries/FixedPointExtra.sol index 54fa0fe80..e32463f4c 100644 --- a/contracts/libraries/FixedPointExtra.sol +++ b/contracts/libraries/FixedPointExtra.sol @@ -9,15 +9,14 @@ import './SafeMath.sol'; library FixedPointExtra { // multiply a UQ112x112 by an int and decode, returning an int // reverts on overflow - function muli(FixedPoint.uq112x112 memory self, int other) internal pure returns (int) { - uint144 z = FixedPoint.decode144(FixedPoint.mul(self, uint(other < 0 ? -other : other))); - return other < 0 ? -int(z) : z; + function muli(FixedPoint.uq112x112 memory self, int256 other) internal pure returns (int256) { + uint144 z = FixedPoint.decode144(FixedPoint.mul(self, uint256(other < 0 ? -other : other))); + return other < 0 ? -int256(z) : z; } // lower 112 bits, representing decimal portion of the number, i.e. 14 bytes uint224 public constant LOWER_MASK = 0xffff_ffff_ffff_ffff_ffff_ffff_ffff; - // multiply a UQ112x112 by a UQ112x112, returning a UQ112x112 function muluq(FixedPoint.uq112x112 memory self, FixedPoint.uq112x112 memory other) internal pure @@ -26,33 +25,26 @@ library FixedPointExtra { if (self._x == 0 || other._x == 0) { return FixedPoint.uq112x112(0); } - uint112 upper_self = uint112(self._x >> 112); // * 2^0 - uint112 lower_self = uint112(self._x & LOWER_MASK); // * 2^-112 - uint112 upper_other = uint112(other._x >> 112); // * 2^0 - uint112 lower_other = uint112(other._x & LOWER_MASK); // * 2^-112 + uint112 upper_self = uint112(self._x >> 112); + uint112 lower_self = uint112(self._x & LOWER_MASK); + uint112 upper_other = uint112(other._x >> 112); + uint112 lower_other = uint112(other._x & LOWER_MASK); - // partial products - uint224 uppers = uint224(upper_self) * upper_other; // * 2^0 - uint224 lowers = uint224(lower_self) * lower_other; // * 2^-224 - uint224 uppers_lowero = uint224(upper_self) * lower_other; // * 2^-112 - uint224 uppero_lowers = uint224(upper_other) * lower_self; // * 2^-112 + uint224 uppers = uint224(upper_self) * upper_other; + uint224 lowers = uint224(lower_self) * lower_other; + uint224 uppers_lowero = uint224(upper_self) * lower_other; + uint224 uppero_lowers = uint224(upper_other) * lower_self; - // so the bit shift does not overflow - require(uppers <= uint112(-1), "FixedPointExtra: MULTIPLICATION_OVERFLOW"); + require(uppers <= uint112(-1), 'FixedPointExtra: MULTIPLICATION_OVERFLOW'); - // this cannot exceed 256 bits, all values are 224 bits - uint sum = uint(uppers << 112) + uppers_lowero + uppero_lowers + (lowers >> 112); + uint256 sum = uint256(uppers << 112) + uppers_lowero + uppero_lowers + (lowers >> 112); - // between 224 bits and 256 bits - require(sum <= uint224(-1), "FixedPointExtra: MULTIPLICATION_OVERFLOW"); + require(sum <= uint224(-1), 'FixedPointExtra: MULTIPLICATION_OVERFLOW'); - // the multiplication results in a number too small to be represented in Q112.112 - require(sum > 0, "FixedPointExtra: MULTIPLICATION_UNDERFLOW"); + require(sum > 0, 'FixedPointExtra: MULTIPLICATION_UNDERFLOW'); return FixedPoint.uq112x112(uint224(sum)); } - // divide a UQ112x112 by a UQ112x112, returning a UQ112x112 - // TODO improve the precision of this? would be great to avoid hard-coding function divuq(FixedPoint.uq112x112 memory self, FixedPoint.uq112x112 memory other) internal pure diff --git a/contracts/libraries/PriceMath.sol b/contracts/libraries/PriceMath.sol index ea16458c7..509b51330 100644 --- a/contracts/libraries/PriceMath.sol +++ b/contracts/libraries/PriceMath.sol @@ -13,20 +13,15 @@ library PriceMath { uint112 reserveOut, uint24 lpFee, FixedPoint.uq112x112 memory inOutRatio - ) - internal - pure - returns (uint112 amountIn) - { + ) internal pure returns (uint112 amountIn) { FixedPoint.uq112x112 memory reserveRatio = FixedPoint.fraction(reserveIn, reserveOut); if (reserveRatio._x >= inOutRatio._x) return 0; // short-circuit if the ratios are equal - uint inputToRatio = getInputToRatioUQ128x128(reserveIn, reserveOut, lpFee, inOutRatio._x); + uint256 inputToRatio = getInputToRatioUQ128x128(reserveIn, reserveOut, lpFee, inOutRatio._x); require(inputToRatio >> 112 <= type(uint112).max, 'PriceMath: TODO'); return uint112(inputToRatio >> 112); } - /** * Calculate (y(g - 2) + sqrt (g^2 * y^2 + 4xyr(1 - g))) / 2(1 - g) * 2^112, where * y = reserveIn, @@ -35,54 +30,59 @@ library PriceMath { * r = inOutRatio * 2^-112. * Throw on overflow. */ - function getInputToRatioUQ128x128 ( - uint112 reserveIn, uint112 reserveOut, - uint24 lpFee, uint224 inOutRatio) - internal pure returns (uint256 amountIn) { + function getInputToRatioUQ128x128( + uint112 reserveIn, + uint112 reserveOut, + uint24 lpFee, + uint224 inOutRatio + ) internal pure returns (uint256 amountIn) { // g2y2 = g^2 * y^2 * 1e6 (max value: ~2^236) - uint256 g2y2 = (uint256 (lpFee) * uint256 (lpFee) * uint256 (reserveIn) * uint256 (reserveIn) + 999999) / 1e6; + uint256 g2y2 = (uint256(lpFee) * uint256(lpFee) * uint256(reserveIn) * uint256(reserveIn) + 999999) / 1e6; // xyr4g1 = 4 * x * y * (1 - g) * 1e6 (max value: ~2^246) - uint256 xy41g = 4 * uint256 (reserveIn) * uint256 (reserveOut) * (1e6 - uint256 (lpFee)); + uint256 xy41g = 4 * uint256(reserveIn) * uint256(reserveOut) * (1e6 - uint256(lpFee)); // xyr41g = 4 * x * y * r * (1 - g) * 1e6 (max value: ~2^246) - uint256 xyr41g = mulshift (xy41g, uint256 (inOutRatio), 112); - require (xyr41g < 2**254); + uint256 xyr41g = mulshift(xy41g, uint256(inOutRatio), 112); + require(xyr41g < 2**254); // sr = sqrt (g^2 * y^2 + 4 * x * y * r * (1 - g)) * 2^128 - uint256 sr = (sqrt (g2y2 + xyr41g) + 999) / 1000; + uint256 sr = (sqrt(g2y2 + xyr41g) + 999) / 1000; // y2g = y(2 - g) * 2^128 - uint256 y2g = uint256 (reserveIn) * (2e6 - uint256 (lpFee)) * 0x10c6f7a0b5ed8d36b4c7f3493858; + uint256 y2g = uint256(reserveIn) * (2e6 - uint256(lpFee)) * 0x10c6f7a0b5ed8d36b4c7f3493858; // Make sure numerator is non-negative - require (sr >= y2g); + require(sr >= y2g); // num = (sqrt (g^2 * y^2 + 4 * x * y * r * (1 - g)) - y(2 - g)) * 2^128 uint256 num = sr - y2g; // den = 2 * (1 - g) * 1e6 - uint256 den = 2 * (1e6 - uint256 (lpFee)); + uint256 den = 2 * (1e6 - uint256(lpFee)); - return ((num + den - 1) / den * 1e6 + 0xffff) >> 16; + return (((num + den - 1) / den) * 1e6 + 0xffff) >> 16; } /** * Calculate x * y >> s rounding up. Throw on overflow. */ - function mulshift (uint256 x, uint256 y, uint8 s) - internal pure returns (uint256 result) { + function mulshift( + uint256 x, + uint256 y, + uint8 s + ) internal pure returns (uint256 result) { uint256 l = x * y; - uint256 m = mulmod (x, y, uint256 (-1)); + uint256 m = mulmod(x, y, uint256(-1)); uint256 h = m - l; if (m < l) h -= 1; uint256 ss = 256 - s; - require (h >> s == 0); + require(h >> s == 0); result = (h << ss) | (l >> s); if (l << ss > 0) { - require (result < uint256 (-1)); + require(result < uint256(-1)); result += 1; } } @@ -90,32 +90,52 @@ library PriceMath { /** * Calculate sqrt (x) * 2^128 rounding up. Throw on overflow. */ - function sqrt (uint256 x) - internal pure returns (uint256 result) { + function sqrt(uint256 x) internal pure returns (uint256 result) { if (x == 0) return 0; else { uint256 s = 128; - if (x < 2**128) { x <<= 128; s -= 64; } - if (x < 2**192) { x <<= 64; s -= 32; } - if (x < 2**224) { x <<= 32; s -= 16; } - if (x < 2**240) { x <<= 16; s -= 8; } - if (x < 2**248) { x <<= 8; s -= 4; } - if (x < 2**252) { x <<= 4; s -= 2; } - if (x < 2**254) { x <<= 2; s -= 1; } + if (x < 2**128) { + x <<= 128; + s -= 64; + } + if (x < 2**192) { + x <<= 64; + s -= 32; + } + if (x < 2**224) { + x <<= 32; + s -= 16; + } + if (x < 2**240) { + x <<= 16; + s -= 8; + } + if (x < 2**248) { + x <<= 8; + s -= 4; + } + if (x < 2**252) { + x <<= 4; + s -= 2; + } + if (x < 2**254) { + x <<= 2; + s -= 1; + } result = 2**127; - result = x / result + result >> 1; - result = x / result + result >> 1; - result = x / result + result >> 1; - result = x / result + result >> 1; - result = x / result + result >> 1; - result = x / result + result >> 1; - result = x / result + result >> 1; // 7 iterations should be enough + result = (x / result + result) >> 1; + result = (x / result + result) >> 1; + result = (x / result + result) >> 1; + result = (x / result + result) >> 1; + result = (x / result + result) >> 1; + result = (x / result + result) >> 1; + result = (x / result + result) >> 1; // 7 iterations should be enough if (result * result < x) result = x / result + 1; - require (result <= uint256 (-1) >> s); + require(result <= uint256(-1) >> s); result <<= s; } } diff --git a/contracts/libraries/SafeMath.sol b/contracts/libraries/SafeMath.sol index 03013bdd4..542b7ed8c 100644 --- a/contracts/libraries/SafeMath.sol +++ b/contracts/libraries/SafeMath.sol @@ -6,34 +6,35 @@ pragma solidity >=0.5.0; // OpenZeppelin (https://github.com/OpenZeppelin/openzeppelin-contracts) library SafeMath { - function add(uint x, uint y) internal pure returns (uint z) { - require((z = x + y) >= x, "ds-math-add-overflow"); + function add(uint256 x, uint256 y) internal pure returns (uint256 z) { + require((z = x + y) >= x, 'ds-math-add-overflow'); } - function sub(uint x, uint y) internal pure returns (uint z) { - require((z = x - y) <= x, "ds-math-sub-underflow"); + function sub(uint256 x, uint256 y) internal pure returns (uint256 z) { + require((z = x - y) <= x, 'ds-math-sub-underflow'); } - function mul(uint x, uint y) internal pure returns (uint z) { - require(y == 0 || (z = x * y) / y == x, "ds-math-mul-overflow"); + function mul(uint256 x, uint256 y) internal pure returns (uint256 z) { + require(y == 0 || (z = x * y) / y == x, 'ds-math-mul-overflow'); } - function iadd(int a, int b) internal pure returns (int) { - int c = a + b; - require((b >= 0 && c >= a) || (b < 0 && c < a), "SignedSafeMath: addition overflow"); + function iadd(int256 a, int256 b) internal pure returns (int256) { + int256 c = a + b; + require((b >= 0 && c >= a) || (b < 0 && c < a), 'SignedSafeMath: addition overflow'); return c; } - function isub(int a, int b) internal pure returns (int) { - int c = a - b; - require((b >= 0 && c <= a) || (b < 0 && c > a), "SignedSafeMath: subtraction overflow"); + function isub(int256 a, int256 b) internal pure returns (int256) { + int256 c = a - b; + require((b >= 0 && c <= a) || (b < 0 && c > a), 'SignedSafeMath: subtraction overflow'); return c; } - int constant private _INT256_MIN = -2**255; - function imul(int a, int b) internal pure returns (int) { + int256 private constant _INT256_MIN = -2**255; + + function imul(int256 a, int256 b) internal pure returns (int256) { // Gas optimization: this is cheaper than requiring 'a' not being zero, but the // benefit is lost if 'b' is also tested. // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522 @@ -41,34 +42,34 @@ library SafeMath { return 0; } - require(!(a == -1 && b == _INT256_MIN), "SignedSafeMath: multiplication overflow"); + require(!(a == -1 && b == _INT256_MIN), 'SignedSafeMath: multiplication overflow'); - int c = a * b; - require(c / a == b, "SignedSafeMath: multiplication overflow"); + int256 c = a * b; + require(c / a == b, 'SignedSafeMath: multiplication overflow'); return c; } // TODO check that this is gas efficient as compared to requiring `y <= type(uint112).max` - function toUint112(uint y) internal pure returns (uint112 z) { - require((z = uint112(y)) == y, "downcast-overflow"); + function toUint112(uint256 y) internal pure returns (uint112 z) { + require((z = uint112(y)) == y, 'downcast-overflow'); } // TODO check that this is gas efficient as compared to requiring `y <= type(int112).max` - function toInt112(uint y) internal pure returns (int112 z) { - require((z = int112(y)) >= 0 && uint(z) == y, "downcast-overflow"); + function toInt112(uint256 y) internal pure returns (int112 z) { + require((z = int112(y)) >= 0 && uint256(z) == y, 'downcast-overflow'); } // TODO check that this is gas efficient as compared to requiring `y <= type(int128).max` - function itoInt112(int y) internal pure returns (int112 z) { - require((z = int112(y)) == y, "downcast-overflow"); + function itoInt112(int256 y) internal pure returns (int112 z) { + require((z = int112(y)) == y, 'downcast-overflow'); } - function addi(uint x, int y) internal pure returns (uint z) { - z = y < 0 ? sub(x, uint(-y)) : add(x, uint(y)); + function addi(uint256 x, int256 y) internal pure returns (uint256 z) { + z = y < 0 ? sub(x, uint256(-y)) : add(x, uint256(y)); } - function subi(uint x, int y) internal pure returns (uint z) { - z = y < 0 ? add(x, uint(-y)) : sub(x, uint(y)); + function subi(uint256 x, int256 y) internal pure returns (uint256 z) { + z = y < 0 ? add(x, uint256(-y)) : sub(x, uint256(y)); } } diff --git a/contracts/libraries/TickMath.sol b/contracts/libraries/TickMath.sol index 23d19557e..b653b7945 100644 --- a/contracts/libraries/TickMath.sol +++ b/contracts/libraries/TickMath.sol @@ -27,25 +27,24 @@ library TickMath { /** * Calculate 1.01^tick << 128 (i.e. Q128x128). Throw in case |tick| > 7802. */ - function getRatioAtTickUQ128x128(int256 tick) - internal pure returns (uint256 ratio) { + function getRatioAtTickUQ128x128(int256 tick) internal pure returns (uint256 ratio) { uint256 absTick = uint256(tick >= 0 ? tick : -tick); require(absTick <= 7802); ratio = absTick & 0x1 != 0 ? 0xfd7720f353a4c0a237c32b16cfd7720f : 0x100000000000000000000000000000000; - if (absTick & 0x2 != 0) ratio = ratio * 0xfaf4ae9099c9241ccf4a1b745e424d72 >> 128; - if (absTick & 0x4 != 0) ratio = ratio * 0xf602cecfa70ae4afe789b849b8ba756d >> 128; - if (absTick & 0x8 != 0) ratio = ratio * 0xec69657ef75a64f2bc647042cf997b9b >> 128; - if (absTick & 0x10 != 0) ratio = ratio * 0xda527e868273006c1a1a2faf830951f8 >> 128; - if (absTick & 0x20 != 0) ratio = ratio * 0xba309a1262e01d7a68fd2cf1bd98bbe8 >> 128; - if (absTick & 0x40 != 0) ratio = ratio * 0x876aa91cdb4cdf289fa30a8cd1d4bc37 >> 128; - if (absTick & 0x80 != 0) ratio = ratio * 0x47a1aacceae7cbd1d95338b2354be7f2 >> 128; - if (absTick & 0x100 != 0) ratio = ratio * 0x140b12d5f200d69fd82ba1b225ef0175 >> 128; - if (absTick & 0x200 != 0) ratio = ratio * 0x191bb6c0d95b67023dc9b2e7f36d979 >> 128; - if (absTick & 0x400 != 0) ratio = ratio * 0x2766cb1b99879bae2a835f8b53197 >> 128; - if (absTick & 0x800 != 0) ratio = ratio * 0x6107b28e3ea71f5ef5255e1a7 >> 128; - if (absTick & 0x1000 != 0) ratio = ratio * 0x24c6d58b0bcc3113a5 >> 128; + if (absTick & 0x2 != 0) ratio = (ratio * 0xfaf4ae9099c9241ccf4a1b745e424d72) >> 128; + if (absTick & 0x4 != 0) ratio = (ratio * 0xf602cecfa70ae4afe789b849b8ba756d) >> 128; + if (absTick & 0x8 != 0) ratio = (ratio * 0xec69657ef75a64f2bc647042cf997b9b) >> 128; + if (absTick & 0x10 != 0) ratio = (ratio * 0xda527e868273006c1a1a2faf830951f8) >> 128; + if (absTick & 0x20 != 0) ratio = (ratio * 0xba309a1262e01d7a68fd2cf1bd98bbe8) >> 128; + if (absTick & 0x40 != 0) ratio = (ratio * 0x876aa91cdb4cdf289fa30a8cd1d4bc37) >> 128; + if (absTick & 0x80 != 0) ratio = (ratio * 0x47a1aacceae7cbd1d95338b2354be7f2) >> 128; + if (absTick & 0x100 != 0) ratio = (ratio * 0x140b12d5f200d69fd82ba1b225ef0175) >> 128; + if (absTick & 0x200 != 0) ratio = (ratio * 0x191bb6c0d95b67023dc9b2e7f36d979) >> 128; + if (absTick & 0x400 != 0) ratio = (ratio * 0x2766cb1b99879bae2a835f8b53197) >> 128; + if (absTick & 0x800 != 0) ratio = (ratio * 0x6107b28e3ea71f5ef5255e1a7) >> 128; + if (absTick & 0x1000 != 0) ratio = (ratio * 0x24c6d58b0bcc3113a5) >> 128; - if (tick > 0) ratio = uint256 (-1) / ratio; + if (tick > 0) ratio = uint256(-1) / ratio; } } diff --git a/contracts/test/FixedPointExtraTest.sol b/contracts/test/FixedPointExtraTest.sol index d48f591de..31920bca8 100644 --- a/contracts/test/FixedPointExtraTest.sol +++ b/contracts/test/FixedPointExtraTest.sol @@ -8,30 +8,40 @@ import '../libraries/FixedPointExtra.sol'; contract FixedPointExtraTest { function muluq(FixedPoint.uq112x112 memory self, FixedPoint.uq112x112 memory other) - public - pure - returns (FixedPoint.uq112x112 memory) { + public + pure + returns (FixedPoint.uq112x112 memory) + { return FixedPointExtra.muluq(self, other); } - function muluqGasUsed(FixedPoint.uq112x112 memory self, FixedPoint.uq112x112 memory other) view public returns (uint) { - uint gasBefore = gasleft(); + function muluqGasUsed(FixedPoint.uq112x112 memory self, FixedPoint.uq112x112 memory other) + public + view + returns (uint256) + { + uint256 gasBefore = gasleft(); FixedPointExtra.muluq(self, other); - uint gasAfter = gasleft(); + uint256 gasAfter = gasleft(); return (gasBefore - gasAfter); } function divuq(FixedPoint.uq112x112 memory self, FixedPoint.uq112x112 memory other) - public - pure - returns (FixedPoint.uq112x112 memory) { + public + pure + returns (FixedPoint.uq112x112 memory) + { return FixedPointExtra.divuq(self, other); } - function divuqGasUsed(FixedPoint.uq112x112 memory self, FixedPoint.uq112x112 memory other) view public returns (uint) { - uint gasBefore = gasleft(); + function divuqGasUsed(FixedPoint.uq112x112 memory self, FixedPoint.uq112x112 memory other) + public + view + returns (uint256) + { + uint256 gasBefore = gasleft(); FixedPointExtra.divuq(self, other); - uint gasAfter = gasleft(); + uint256 gasAfter = gasleft(); return (gasBefore - gasAfter); } } diff --git a/contracts/test/MockTimeUniswapV3Pair.sol b/contracts/test/MockTimeUniswapV3Pair.sol index a67ef7923..2fdb00afa 100644 --- a/contracts/test/MockTimeUniswapV3Pair.sol +++ b/contracts/test/MockTimeUniswapV3Pair.sol @@ -8,14 +8,17 @@ import '../UniswapV3Pair.sol'; contract MockTimeUniswapV3Pair is UniswapV3Pair { uint32 public time; - constructor(address factory, address tokenA, address tokenB) public UniswapV3Pair(factory, tokenA, tokenB) {} + constructor( + address factory, + address tokenA, + address tokenB + ) public UniswapV3Pair(factory, tokenA, tokenB) {} function setTime(uint32 _time) external { time = _time; } - function _blockTimestamp() internal override view returns (uint32) { + function _blockTimestamp() internal view override returns (uint32) { return time; } } - diff --git a/contracts/test/PriceMathTest.sol b/contracts/test/PriceMathTest.sol index b7fa68601..726c369cf 100644 --- a/contracts/test/PriceMathTest.sol +++ b/contracts/test/PriceMathTest.sol @@ -8,15 +8,21 @@ import '../libraries/PriceMath.sol'; contract PriceMathTest { function getInputToRatio( - uint112 reserveIn, uint112 reserveOut, uint16 lpFee, FixedPoint.uq112x112 memory inOutRatio + uint112 reserveIn, + uint112 reserveOut, + uint16 lpFee, + FixedPoint.uq112x112 memory inOutRatio ) public pure returns (uint112 amountIn) { return PriceMath.getInputToRatio(reserveIn, reserveOut, lpFee, inOutRatio); } function getGasCostOfGetInputToRatio( - uint112 reserveIn, uint112 reserveOut, uint16 lpFee, FixedPoint.uq112x112 memory inOutRatio - ) public view returns (uint) { - uint gasBefore = gasleft(); + uint112 reserveIn, + uint112 reserveOut, + uint16 lpFee, + FixedPoint.uq112x112 memory inOutRatio + ) public view returns (uint256) { + uint256 gasBefore = gasleft(); PriceMath.getInputToRatio(reserveIn, reserveOut, lpFee, inOutRatio); return gasBefore - gasleft(); } diff --git a/contracts/test/TestERC20.sol b/contracts/test/TestERC20.sol index b2c0e5b03..a8b990184 100644 --- a/contracts/test/TestERC20.sol +++ b/contracts/test/TestERC20.sol @@ -4,11 +4,11 @@ pragma solidity =0.6.11; import '@openzeppelin/contracts/token/ERC20/ERC20.sol'; contract TestERC20 is ERC20 { - constructor (uint amountToMint) ERC20('TestERC20', 'TEST') public { + constructor(uint256 amountToMint) public ERC20('TestERC20', 'TEST') { mint(msg.sender, amountToMint); } - function mint(address to, uint amount) public { + function mint(address to, uint256 amount) public { _mint(to, amount); } } diff --git a/contracts/test/TickMathTest.sol b/contracts/test/TickMathTest.sol index 60915118c..d30649030 100644 --- a/contracts/test/TickMathTest.sol +++ b/contracts/test/TickMathTest.sol @@ -10,10 +10,10 @@ contract TickMathTest { return TickMath.getRatioAtTick(tick); } - function getGasUsed(int16 tick) view public returns (uint) { - uint gasBefore = gasleft(); + function getGasUsed(int16 tick) public view returns (uint256) { + uint256 gasBefore = gasleft(); TickMath.getRatioAtTick(tick); - uint gasAfter = gasleft(); + uint256 gasAfter = gasleft(); return (gasBefore - gasAfter); } } diff --git a/contracts/test/UniswapV3PairTest.sol b/contracts/test/UniswapV3PairTest.sol index 7fea16583..236bc052c 100644 --- a/contracts/test/UniswapV3PairTest.sol +++ b/contracts/test/UniswapV3PairTest.sol @@ -1,7 +1,7 @@ // SPDX-License-Identifier: GPL-3.0-or-later pragma solidity =0.6.11; -import "../interfaces/IUniswapV3Pair.sol"; +import '../interfaces/IUniswapV3Pair.sol'; contract UniswapV3PairTest { IUniswapV3Pair pair; @@ -10,14 +10,14 @@ contract UniswapV3PairTest { pair = IUniswapV3Pair(pair_); } - function getGasCostOfGetFee() public view returns (uint) { - uint gasBefore = gasleft(); + function getGasCostOfGetFee() public view returns (uint256) { + uint256 gasBefore = gasleft(); pair.getFee(); return gasBefore - gasleft(); } - function getGasCostOfGetVirtualSupply() public view returns (uint) { - uint gasBefore = gasleft(); + function getGasCostOfGetVirtualSupply() public view returns (uint256) { + uint256 gasBefore = gasleft(); pair.getVirtualSupply(); return gasBefore - gasleft(); } diff --git a/package.json b/package.json index 586e1a0ae..0d4ec7293 100644 --- a/package.json +++ b/package.json @@ -20,8 +20,7 @@ "node": ">=10" }, "dependencies": { - "@uniswap/lib": "1.1.2", - "decimal.js": "^10.2.0" + "@uniswap/lib": "1.1.2" }, "devDependencies": { "@nomiclabs/buidler": "^1.4.3", @@ -31,11 +30,15 @@ "@types/chai": "^4.2.6", "@types/mocha": "^5.2.7", "chai": "^4.2.0", + "decimal.js": "^10.2.0", "ethereum-waffle": "^3.0.2", "ethers": "^5.0.8", "mocha": "^6.2.2", "mocha-chai-jest-snapshot": "^1.1.0", "prettier": "^2.0.5", + "prettier-plugin-solidity": "^1.0.0-alpha.59", + "solhint": "^3.2.1", + "solhint-plugin-prettier": "^0.0.5", "ts-node": "^8.5.4", "typescript": "^3.7.3" }, @@ -43,6 +46,7 @@ "compile": "buidler compile", "pretest": "yarn compile", "test": "buidler test", + "lint": "solhint contracts/**/*.sol", "prepublishOnly": "yarn test" } } diff --git a/test/FixedPointExtra.spec.ts b/test/FixedPointExtra.spec.ts index c6815537b..5063a85be 100644 --- a/test/FixedPointExtra.spec.ts +++ b/test/FixedPointExtra.spec.ts @@ -1,8 +1,8 @@ -import { MockProvider, deployContract } from 'ethereum-waffle' -import { Contract, BigNumber } from 'ethers' +import {MockProvider, deployContract} from 'ethereum-waffle' +import {Contract, BigNumber} from 'ethers' import FixedPointExtraTest from '../build/FixedPointExtraTest.json' -import { expect } from './shared/expect' +import {expect} from './shared/expect' import snapshotGasCost from './shared/snapshotGasCost' const overrides = { diff --git a/test/PriceMath.spec.ts b/test/PriceMath.spec.ts index 849b52bc0..564ffb844 100644 --- a/test/PriceMath.spec.ts +++ b/test/PriceMath.spec.ts @@ -1,10 +1,10 @@ -import { Contract, BigNumber } from 'ethers' -import { MockProvider, deployContract } from 'ethereum-waffle' +import {Contract, BigNumber} from 'ethers' +import {MockProvider, deployContract} from 'ethereum-waffle' import PriceMathTest from '../build/PriceMathTest.json' -import { expect } from './shared/expect' +import {expect} from './shared/expect' import snapshotGasCost from './shared/snapshotGasCost' -import { expandTo18Decimals } from './shared/utilities' +import {expandTo18Decimals} from './shared/utilities' describe('PriceMath', () => { const provider = new MockProvider({ diff --git a/test/TickMath.spec.ts b/test/TickMath.spec.ts index 4c06bc3eb..36cd6fc16 100644 --- a/test/TickMath.spec.ts +++ b/test/TickMath.spec.ts @@ -1,8 +1,8 @@ -import { MockProvider, deployContract } from 'ethereum-waffle' -import { Contract, BigNumber, BigNumberish } from 'ethers' -import { expect } from './shared/expect' +import {MockProvider, deployContract} from 'ethereum-waffle' +import {Contract, BigNumber, BigNumberish} from 'ethers' +import {expect} from './shared/expect' import snapshotGasCost from './shared/snapshotGasCost' -import { bnify2 } from './shared/utilities' +import {bnify2} from './shared/utilities' import TickMathTest from '../build/TickMathTest.json' diff --git a/test/UniswapV3Factory.spec.ts b/test/UniswapV3Factory.spec.ts index 395b3d5c3..357943543 100644 --- a/test/UniswapV3Factory.spec.ts +++ b/test/UniswapV3Factory.spec.ts @@ -1,10 +1,10 @@ -import { expect } from './shared/expect' -import { Contract, BigNumber, constants } from 'ethers' -import { waffle } from '@nomiclabs/buidler' +import {expect} from './shared/expect' +import {Contract, BigNumber, constants} from 'ethers' +import {waffle} from '@nomiclabs/buidler' import snapshotGasCost from './shared/snapshotGasCost' -import { getCreate2Address } from './shared/utilities' -import { factoryFixture } from './shared/fixtures' +import {getCreate2Address} from './shared/utilities' +import {factoryFixture} from './shared/fixtures' import UniswapV3Pair from '../build/UniswapV3Pair.json' diff --git a/test/UniswapV3Pair.spec.ts b/test/UniswapV3Pair.spec.ts index 4b2078895..c86310151 100644 --- a/test/UniswapV3Pair.spec.ts +++ b/test/UniswapV3Pair.spec.ts @@ -1,10 +1,10 @@ -import { Contract, constants, BigNumber } from 'ethers' -import { waffle } from '@nomiclabs/buidler' -import { expect } from './shared/expect' -import { deployContract } from 'ethereum-waffle' +import {Contract, constants, BigNumber} from 'ethers' +import {waffle} from '@nomiclabs/buidler' +import {expect} from './shared/expect' +import {deployContract} from 'ethereum-waffle' import MockTimeUniswapV3Pair from '../build/MockTimeUniswapV3Pair.json' -import { TEST_PAIR_START_TIME, pairFixture } from './shared/fixtures' +import {TEST_PAIR_START_TIME, pairFixture} from './shared/fixtures' import snapshotGasCost from './shared/snapshotGasCost' import { @@ -29,7 +29,7 @@ describe('UniswapV3Pair', () => { let pairTest: Contract beforeEach('load fixture', async () => { - ;({ token0, token1, factory, pair, pairTest } = await waffle.loadFixture(pairFixture)) + ;({token0, token1, factory, pair, pairTest} = await waffle.loadFixture(pairFixture)) }) // this invariant should always hold true. @@ -751,7 +751,7 @@ describe('UniswapV3Pair', () => { } it('off', async () => { - const { token0BalanceBefore, token0BalanceAfter, token1BalanceBefore, token1BalanceAfter } = await claimFee() + const {token0BalanceBefore, token0BalanceAfter, token1BalanceBefore, token1BalanceAfter} = await claimFee() token0FeesWithoutFeeTo = token0BalanceAfter.sub(token0BalanceBefore) token1FeesWithoutFeeTo = token1BalanceAfter.sub(token1BalanceBefore) @@ -760,7 +760,7 @@ describe('UniswapV3Pair', () => { it('on', async () => { await factory.setFeeTo(other.address) - const { token0BalanceBefore, token0BalanceAfter, token1BalanceBefore, token1BalanceAfter } = await claimFee() + const {token0BalanceBefore, token0BalanceAfter, token1BalanceBefore, token1BalanceAfter} = await claimFee() const token0FeesWithFeeTo = token0BalanceAfter.sub(token0BalanceBefore) const token1FeesWithFeeTo = token1BalanceAfter.sub(token1BalanceBefore) diff --git a/test/shared/expect.ts b/test/shared/expect.ts index 0e114020a..d5c22aa6b 100644 --- a/test/shared/expect.ts +++ b/test/shared/expect.ts @@ -1,8 +1,8 @@ -import chai, { expect } from 'chai' -import { solidity } from 'ethereum-waffle' -import { jestSnapshotPlugin } from 'mocha-chai-jest-snapshot' +import chai, {expect} from 'chai' +import {solidity} from 'ethereum-waffle' +import {jestSnapshotPlugin} from 'mocha-chai-jest-snapshot' chai.use(solidity) chai.use(jestSnapshotPlugin()) -export { expect } +export {expect} diff --git a/test/shared/fixtures.ts b/test/shared/fixtures.ts index f4276ca38..e7b89b2d3 100644 --- a/test/shared/fixtures.ts +++ b/test/shared/fixtures.ts @@ -1,8 +1,8 @@ -import { Contract, Signer, providers } from 'ethers' -import { waffle } from '@nomiclabs/buidler' -const { loadFixture, deployContract } = waffle +import {Contract, Signer, providers} from 'ethers' +import {waffle} from '@nomiclabs/buidler' +const {loadFixture, deployContract} = waffle -import { expandTo18Decimals } from './utilities' +import {expandTo18Decimals} from './utilities' import TestERC20 from '../../build/TestERC20.json' import UniswapV3Factory from '../../build/UniswapV3Factory.json' @@ -15,7 +15,7 @@ interface FactoryFixture { export async function factoryFixture([wallet]: Signer[]): Promise { const factory = await deployContract(wallet, UniswapV3Factory, [await wallet.getAddress()]) - return { factory } + return {factory} } interface TokensFixture { @@ -30,7 +30,7 @@ export async function tokensFixture([wallet]: Signer[]): Promise const [token0, token1] = tokenA.address.toLowerCase() < tokenB.address.toLowerCase() ? [tokenA, tokenB] : [tokenB, tokenA] - return { token0, token1 } + return {token0, token1} } type TokensAndFactoryFixture = FactoryFixture & TokensFixture @@ -44,12 +44,12 @@ interface PairFixture extends TokensAndFactoryFixture { export const TEST_PAIR_START_TIME = 1601906400 export async function pairFixture([wallet]: Signer[]): Promise { - const { factory } = await loadFixture(factoryFixture) - const { token0, token1 } = await loadFixture(tokensFixture) + const {factory} = await loadFixture(factoryFixture) + const {token0, token1} = await loadFixture(tokensFixture) const pair = await deployContract(wallet, MockTimeUniswapV3Pair, [factory.address, token0.address, token1.address]) await pair.setTime(TEST_PAIR_START_TIME) const pairTest = await deployContract(wallet, UniswapV3PairTest, [pair.address]) - return { token0, token1, pair, pairTest, factory } + return {token0, token1, pair, pairTest, factory} } diff --git a/test/shared/snapshotGasCost.ts b/test/shared/snapshotGasCost.ts index 19f5b6d61..9cc5bfd04 100644 --- a/test/shared/snapshotGasCost.ts +++ b/test/shared/snapshotGasCost.ts @@ -1,6 +1,6 @@ -import { TransactionReceipt, TransactionResponse } from '@ethersproject/abstract-provider' -import { expect } from './expect' -import { Contract, BigNumber } from 'ethers' +import {TransactionReceipt, TransactionResponse} from '@ethersproject/abstract-provider' +import {expect} from './expect' +import {Contract, BigNumber} from 'ethers' export default async function snapshotGasCost( x: diff --git a/test/shared/utilities.ts b/test/shared/utilities.ts index e546c5fae..642460987 100644 --- a/test/shared/utilities.ts +++ b/test/shared/utilities.ts @@ -1,6 +1,6 @@ -import { BigNumber, BigNumberish, utils, constants } from 'ethers' -import { Decimal } from 'decimal.js' -import { assert } from 'chai' +import {BigNumber, BigNumberish, utils, constants} from 'ethers' +import {Decimal} from 'decimal.js' +import {assert} from 'chai' export const MIN_TICK = -7802 export const MAX_TICK = 7802 @@ -15,7 +15,7 @@ export enum FeeVote { FeeVote4 = 4, FeeVote5 = 5, } -export const FEES: { [vote in FeeVote]: number } = { +export const FEES: {[vote in FeeVote]: number} = { [FeeVote.FeeVote0]: 500, [FeeVote.FeeVote1]: 1000, [FeeVote.FeeVote2]: 3000, diff --git a/yarn.lock b/yarn.lock index 3ed4cb200..b77577849 100644 --- a/yarn.lock +++ b/yarn.lock @@ -686,6 +686,11 @@ resolved "https://registry.yarnpkg.com/@solidity-parser/parser/-/parser-0.5.2.tgz#4d74670ead39e4f4fdab605a393ba8ea2390a2c4" integrity sha512-uRyvnvVYmgNmTBpWDbBsH/0kPESQhQpEc4KsvMRLVzFJ1o1s0uIv0Y6Y9IB5vI1Dwz2CbS4X/y4Wyw/75cTFnQ== +"@solidity-parser/parser@^0.8.1": + version "0.8.1" + resolved "https://registry.yarnpkg.com/@solidity-parser/parser/-/parser-0.8.1.tgz#1b606578af86b9ad10755409804a6ba83f9ce8a4" + integrity sha512-DF7H6T8I4lo2IZOE2NZwt3631T8j1gjpQLjmvY2xBNK50c4ltslR4XPKwT6RkeSd4+xCAK0GHC/k7sbRDBE4Yw== + "@szmarczak/http-timer@^1.1.2": version "1.1.2" resolved "https://registry.yarnpkg.com/@szmarczak/http-timer/-/http-timer-1.1.2.tgz#b1665e2c461a2cd92f4c1bbf50d5454de0d4b421" @@ -931,6 +936,16 @@ accepts@~1.3.7: mime-types "~2.1.24" negotiator "0.6.2" +acorn-jsx@^5.0.0: + version "5.3.1" + resolved "https://registry.yarnpkg.com/acorn-jsx/-/acorn-jsx-5.3.1.tgz#fc8661e11b7ac1539c47dbfea2e72b3af34d267b" + integrity sha512-K0Ptm/47OKfQRpNQ2J/oIN/3QYiK6FwW+eJbILhsdxh2WTLdl+30o8aGdTbm5JbffpFFAg/g+zi1E+jvJha5ng== + +acorn@^6.0.7: + version "6.4.2" + resolved "https://registry.yarnpkg.com/acorn/-/acorn-6.4.2.tgz#35866fd710528e92de10cf06016498e47e39e1e6" + integrity sha512-XtGIhXwF8YM8bJhGxG5kXgjkEuNGLTkoYqVE+KMR+aspr4KGYmKYg7yUe3KghyQ9yheNwLnjmzh/7+gfDBmHCQ== + aes-js@3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/aes-js/-/aes-js-3.0.0.tgz#e21df10ad6c2053295bcbb8dab40b09dbea87e4d" @@ -948,6 +963,16 @@ agent-base@6: dependencies: debug "4" +ajv@^6.10.2, ajv@^6.6.1, ajv@^6.9.1: + version "6.12.6" + resolved "https://registry.yarnpkg.com/ajv/-/ajv-6.12.6.tgz#baf5a62e802b07d977034586f8c3baf5adf26df4" + integrity sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g== + dependencies: + fast-deep-equal "^3.1.1" + fast-json-stable-stringify "^2.0.0" + json-schema-traverse "^0.4.1" + uri-js "^4.2.2" + ajv@^6.5.5: version "6.12.0" resolved "https://registry.yarnpkg.com/ajv/-/ajv-6.12.0.tgz#06d60b96d87b8454a5adaba86e7854da629db4b7" @@ -975,6 +1000,11 @@ ansi-colors@^4.1.1: resolved "https://registry.yarnpkg.com/ansi-colors/-/ansi-colors-4.1.1.tgz#cbb9ae256bf750af1eab344f229aa27fe94ba348" integrity sha512-JoX0apGbHaUJBNl6yF+p6JAFYZ666/hhCGKN5t9QFjbJQKUU/g8MNbFDbvfrgKXvI1QpZplPOnwIo99lX/AAmA== +ansi-escapes@^3.2.0: + version "3.2.0" + resolved "https://registry.yarnpkg.com/ansi-escapes/-/ansi-escapes-3.2.0.tgz#8780b98ff9dbf5638152d1f1fe5c1d7b4442976b" + integrity sha512-cBhpre4ma+U0T1oM5fXg7Dy1Jw7zzwv7lt/GoCpr+hDQJoYnKVPLL4dCvSEFMmQurOQvSrwT7SL/DAlhBI97RQ== + ansi-escapes@^4.3.0: version "4.3.1" resolved "https://registry.yarnpkg.com/ansi-escapes/-/ansi-escapes-4.3.1.tgz#a5c47cc43181f1f38ffd7076837700d395522a61" @@ -1033,6 +1063,11 @@ ansi-wrap@0.1.0, ansi-wrap@^0.1.0: resolved "https://registry.yarnpkg.com/ansi-wrap/-/ansi-wrap-0.1.0.tgz#a82250ddb0015e9a27ca82e82ea603bbfa45efaf" integrity sha1-qCJQ3bABXponyoLoLqYDu/pF768= +antlr4@4.7.1: + version "4.7.1" + resolved "https://registry.yarnpkg.com/antlr4/-/antlr4-4.7.1.tgz#69984014f096e9e775f53dd9744bf994d8959773" + integrity sha512-haHyTW7Y9joE5MVs37P2lNYfU2RWBLfcRDD8OWldcdZm5TiCE91B5Xl1oWSwiDUSd4rlExpt2pu1fksYQjRBYQ== + any-promise@1.3.0: version "1.3.0" resolved "https://registry.yarnpkg.com/any-promise/-/any-promise-1.3.0.tgz#abc6afeedcea52e809cdc0376aed3ce39635d17f" @@ -1189,6 +1224,16 @@ assign-symbols@^1.0.0: resolved "https://registry.yarnpkg.com/assign-symbols/-/assign-symbols-1.0.0.tgz#59667f41fadd4f20ccbc2bb96b8d4f7f78ec0367" integrity sha1-WWZ/QfrdTyDMvCu5a41Pf3jsA2c= +ast-parents@0.0.1: + version "0.0.1" + resolved "https://registry.yarnpkg.com/ast-parents/-/ast-parents-0.0.1.tgz#508fd0f05d0c48775d9eccda2e174423261e8dd3" + integrity sha1-UI/Q8F0MSHddnszaLhdEIyYejdM= + +astral-regex@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/astral-regex/-/astral-regex-1.0.0.tgz#6c8c3fb827dd43ee3918f27b82782ab7658a6fd9" + integrity sha512-+Ryf6g3BKoRc7jfp7ad8tM4TtMiaWvbF/1/sQcZPkkS7ag3D5nMBCe2UfOTONtAkaG0tO0ij3C5Lwmf1EiyjHg== + async-done@^1.2.0, async-done@^1.2.2: version "1.3.2" resolved "https://registry.yarnpkg.com/async-done/-/async-done-1.3.2.tgz#5e15aa729962a4b07414f528a88cdf18e0b290a2" @@ -2181,6 +2226,30 @@ cachedown@1.0.0: abstract-leveldown "^2.4.1" lru-cache "^3.2.0" +caller-callsite@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/caller-callsite/-/caller-callsite-2.0.0.tgz#847e0fce0a223750a9a027c54b33731ad3154134" + integrity sha1-hH4PzgoiN1CpoCfFSzNzGtMVQTQ= + dependencies: + callsites "^2.0.0" + +caller-path@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/caller-path/-/caller-path-2.0.0.tgz#468f83044e369ab2010fac5f06ceee15bb2cb1f4" + integrity sha1-Ro+DBE42mrIBD6xfBs7uFbsssfQ= + dependencies: + caller-callsite "^2.0.0" + +callsites@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/callsites/-/callsites-2.0.0.tgz#06eb84f00eea413da86affefacbffb36093b3c50" + integrity sha1-BuuE8A7qQT2oav/vrL/7Ngk7PFA= + +callsites@^3.0.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/callsites/-/callsites-3.1.0.tgz#b3630abd8943432f54b3f0519238e33cd7df2f73" + integrity sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ== + camelcase@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-3.0.0.tgz#32fc4b9fcdaf845fcdf7e73bb97cac2261f0ab0a" @@ -2241,7 +2310,7 @@ chalk@^1.1.3: strip-ansi "^3.0.0" supports-color "^2.0.0" -chalk@^2.0.0, chalk@^2.0.1, chalk@^2.4.2: +chalk@^2.0.0, chalk@^2.0.1, chalk@^2.1.0, chalk@^2.4.2: version "2.4.2" resolved "https://registry.yarnpkg.com/chalk/-/chalk-2.4.2.tgz#cd42541677a54333cf541a49108c1432b44c9424" integrity sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ== @@ -2258,6 +2327,11 @@ chalk@^4.0.0, chalk@^4.1.0: ansi-styles "^4.1.0" supports-color "^7.1.0" +chardet@^0.7.0: + version "0.7.0" + resolved "https://registry.yarnpkg.com/chardet/-/chardet-0.7.0.tgz#90094849f0937f2eedc2425d0d28a9e5f0cbad9e" + integrity sha512-mT8iDcrh03qDGRRmoA2hmBJnxpllMR+0/0qlzjqZES6NdiWDcZkCNAk4rPFZ9Q85r27unkiNNg8ZOiwZXBHwcA== + check-error@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/check-error/-/check-error-1.0.2.tgz#574d312edd88bb5dd8912e9286dd6c0aed4aac82" @@ -2347,6 +2421,18 @@ class-utils@^0.3.5: isobject "^3.0.0" static-extend "^0.1.1" +cli-cursor@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/cli-cursor/-/cli-cursor-2.1.0.tgz#b35dac376479facc3e94747d41d0d0f5238ffcb5" + integrity sha1-s12sN2R5+sw+lHR9QdDQ9SOP/LU= + dependencies: + restore-cursor "^2.0.0" + +cli-width@^2.0.0: + version "2.2.1" + resolved "https://registry.yarnpkg.com/cli-width/-/cli-width-2.2.1.tgz#b0433d0b4e9c847ef18868a4ef16fd5fc8271c48" + integrity sha512-GRMWDxpOB6Dgk2E5Uo+3eEBvtOOlimMmpbFiKuLFnQzYDavtLFY3K5ona41jgN/WdRZtG7utuVSVTL4HbZHGkw== + cliui@^3.2.0: version "3.2.0" resolved "https://registry.yarnpkg.com/cliui/-/cliui-3.2.0.tgz#120601537a916d29940f934da3b48d585a39213d" @@ -2481,6 +2567,11 @@ command-exists@^1.2.8: resolved "https://registry.yarnpkg.com/command-exists/-/command-exists-1.2.8.tgz#715acefdd1223b9c9b37110a149c6392c2852291" integrity sha512-PM54PkseWbiiD/mMsbvW351/u+dafwTJ0ye2qB60G1aGQP9j3xK2gmMDc+R34L3nDtx4qMCitXT75mkbkGJDLw== +commander@2.18.0: + version "2.18.0" + resolved "https://registry.yarnpkg.com/commander/-/commander-2.18.0.tgz#2bf063ddee7c7891176981a2cc798e5754bc6970" + integrity sha512-6CYPa+JP2ftfRU2qkDK+UTVeQYosOg/2GbcjIcKPHfinyOLPVGXu/ovN86RP49Re5ndJK1N0kuiidFFuepc4ZQ== + commander@3.0.2: version "3.0.2" resolved "https://registry.yarnpkg.com/commander/-/commander-3.0.2.tgz#6837c3fb677ad9933d1cfba42dd14d5117d6b39e" @@ -2596,6 +2687,16 @@ cors@^2.8.1: object-assign "^4" vary "^1" +cosmiconfig@^5.0.7: + version "5.2.1" + resolved "https://registry.yarnpkg.com/cosmiconfig/-/cosmiconfig-5.2.1.tgz#040f726809c591e77a17c0a3626ca45b4f168b1a" + integrity sha512-H65gsXo1SKjf8zmrJ67eJk8aIRKV5ff2D4uKZIBZShbhGSpEmsQOPW/SKMKYhSTrqR7ufy6RP69rPogdaPh/kA== + dependencies: + import-fresh "^2.0.0" + is-directory "^0.3.1" + js-yaml "^3.13.1" + parse-json "^4.0.0" + create-ecdh@^4.0.0: version "4.0.3" resolved "https://registry.yarnpkg.com/create-ecdh/-/create-ecdh-4.0.3.tgz#c9111b6f33045c4697f144787f9254cdc77c45ff" @@ -2635,7 +2736,7 @@ cross-fetch@^2.1.0, cross-fetch@^2.1.1: node-fetch "2.1.2" whatwg-fetch "2.0.4" -cross-spawn@^6.0.0: +cross-spawn@^6.0.0, cross-spawn@^6.0.5: version "6.0.5" resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-6.0.5.tgz#4a5ec7c64dfae22c3a14124dbacdee846d80cbc4" integrity sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ== @@ -2699,6 +2800,13 @@ debug@4, debug@^4.1.1: dependencies: ms "^2.1.1" +debug@^4.0.1: + version "4.2.0" + resolved "https://registry.yarnpkg.com/debug/-/debug-4.2.0.tgz#7f150f93920e94c58f5574c2fd01a3110effe7f1" + integrity sha512-IX2ncY78vDTjZMFUdmsvIRFY2Cf4FnD0wRs+nQwJU8Lu99/tPFdb0VybiiMTPe3I6rQmwsqQqRBvxU+bZ/I8sg== + dependencies: + ms "2.1.2" + decamelize@^1.1.1, decamelize@^1.2.0: version "1.2.0" resolved "https://registry.yarnpkg.com/decamelize/-/decamelize-1.2.0.tgz#f6534d15148269b20352e7bee26f501f9a191290" @@ -2793,6 +2901,11 @@ deep-equal@~1.1.1: object-keys "^1.1.1" regexp.prototype.flags "^1.2.0" +deep-is@~0.1.3: + version "0.1.3" + resolved "https://registry.yarnpkg.com/deep-is/-/deep-is-0.1.3.tgz#b369d6fb5dbc13eecf524f91b070feedc357cf34" + integrity sha1-s2nW+128E+7PUk+RsHD+7cNXzzQ= + deepmerge@^2.1.0: version "2.2.1" resolved "https://registry.yarnpkg.com/deepmerge/-/deepmerge-2.2.1.tgz#5d3ff22a01c00f645405a2fbc17d0778a1801170" @@ -2923,6 +3036,18 @@ diffie-hellman@^5.0.0: miller-rabin "^4.0.0" randombytes "^2.0.0" +dir-to-object@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/dir-to-object/-/dir-to-object-2.0.0.tgz#29723e9bd1c3e58e4f307bd04ff634c0370c8f8a" + integrity sha512-sXs0JKIhymON7T1UZuO2Ud6VTNAx/VTBXIl4+3mjb2RgfOpt+hectX0x04YqPOPdkeOAKoJuKqwqnXXURNPNEA== + +doctrine@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/doctrine/-/doctrine-3.0.0.tgz#addebead72a6574db783639dc87a121773973961" + integrity sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w== + dependencies: + esutils "^2.0.2" + dom-walk@^0.1.0: version "0.1.2" resolved "https://registry.yarnpkg.com/dom-walk/-/dom-walk-0.1.2.tgz#0c548bef048f4d1f2a97249002236060daa3fd84" @@ -3049,6 +3174,11 @@ emoji-regex@^8.0.0: resolved "https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-8.0.0.tgz#e818fd69ce5ccfcb404594f842963bf53164cc37" integrity sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A== +emoji-regex@^9.0.0: + version "9.1.1" + resolved "https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-9.1.1.tgz#1d5ffce26d8191e6c3f3a9d27987b1c5bba7d20a" + integrity sha512-AaWyDiNO9rbtMIcGl7tdxMcNu8SOLaDLxmQEFT5JhgKufOJzPPkYmgN2QwqTgw4doWMZZQttC6sUWVQjb+1VdA== + encodeurl@~1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/encodeurl/-/encodeurl-1.0.2.tgz#ad3ff4c86ec2d029322f5a02c3a9a606c95b3f59" @@ -3177,11 +3307,118 @@ escape-string-regexp@^2.0.0: resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-2.0.0.tgz#a30304e99daa32e23b2fd20f51babd07cffca344" integrity sha512-UpzcLCXolUWcNu5HtVMHYdXJjArjsF9C0aNnquZYY4uW/Vu0miy5YoWvbV345HauVvcAUnpRuhMMcqTcGOY2+w== +escape-string-regexp@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz#14ba83a5d373e3d311e5afca29cf5bfad965bf34" + integrity sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA== + +eslint-scope@^4.0.3: + version "4.0.3" + resolved "https://registry.yarnpkg.com/eslint-scope/-/eslint-scope-4.0.3.tgz#ca03833310f6889a3264781aa82e63eb9cfe7848" + integrity sha512-p7VutNr1O/QrxysMo3E45FjYDTeXBy0iTltPFNSqKAIfjDSXC+4dj+qfyuD8bfAXrW/y6lW3O76VaYNPKfpKrg== + dependencies: + esrecurse "^4.1.0" + estraverse "^4.1.1" + +eslint-utils@^1.3.1: + version "1.4.3" + resolved "https://registry.yarnpkg.com/eslint-utils/-/eslint-utils-1.4.3.tgz#74fec7c54d0776b6f67e0251040b5806564e981f" + integrity sha512-fbBN5W2xdY45KulGXmLHZ3c3FHfVYmKg0IrAKGOkT/464PQsx2UeIzfz1RmEci+KLm1bBaAzZAh8+/E+XAeZ8Q== + dependencies: + eslint-visitor-keys "^1.1.0" + +eslint-visitor-keys@^1.0.0, eslint-visitor-keys@^1.1.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-1.3.0.tgz#30ebd1ef7c2fdff01c3a4f151044af25fab0523e" + integrity sha512-6J72N8UNa462wa/KFODt/PJ3IU60SDpC3QXC1Hjc1BXXpfL2C9R5+AU7jhe0F6GREqVMh4Juu+NY7xn+6dipUQ== + +eslint@^5.6.0: + version "5.16.0" + resolved "https://registry.yarnpkg.com/eslint/-/eslint-5.16.0.tgz#a1e3ac1aae4a3fbd8296fcf8f7ab7314cbb6abea" + integrity sha512-S3Rz11i7c8AA5JPv7xAH+dOyq/Cu/VXHiHXBPOU1k/JAM5dXqQPt3qcrhpHSorXmrpu2g0gkIBVXAqCpzfoZIg== + dependencies: + "@babel/code-frame" "^7.0.0" + ajv "^6.9.1" + chalk "^2.1.0" + cross-spawn "^6.0.5" + debug "^4.0.1" + doctrine "^3.0.0" + eslint-scope "^4.0.3" + eslint-utils "^1.3.1" + eslint-visitor-keys "^1.0.0" + espree "^5.0.1" + esquery "^1.0.1" + esutils "^2.0.2" + file-entry-cache "^5.0.1" + functional-red-black-tree "^1.0.1" + glob "^7.1.2" + globals "^11.7.0" + ignore "^4.0.6" + import-fresh "^3.0.0" + imurmurhash "^0.1.4" + inquirer "^6.2.2" + js-yaml "^3.13.0" + json-stable-stringify-without-jsonify "^1.0.1" + levn "^0.3.0" + lodash "^4.17.11" + minimatch "^3.0.4" + mkdirp "^0.5.1" + natural-compare "^1.4.0" + optionator "^0.8.2" + path-is-inside "^1.0.2" + progress "^2.0.0" + regexpp "^2.0.1" + semver "^5.5.1" + strip-ansi "^4.0.0" + strip-json-comments "^2.0.1" + table "^5.2.3" + text-table "^0.2.0" + +espree@^5.0.1: + version "5.0.1" + resolved "https://registry.yarnpkg.com/espree/-/espree-5.0.1.tgz#5d6526fa4fc7f0788a5cf75b15f30323e2f81f7a" + integrity sha512-qWAZcWh4XE/RwzLJejfcofscgMc9CamR6Tn1+XRXNzrvUSSbiAjGOI/fggztjIi7y9VLPqnICMIPiGyr8JaZ0A== + dependencies: + acorn "^6.0.7" + acorn-jsx "^5.0.0" + eslint-visitor-keys "^1.0.0" + +esprima-extract-comments@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/esprima-extract-comments/-/esprima-extract-comments-1.1.0.tgz#0dacab567a5900240de6d344cf18c33617becbc9" + integrity sha512-sBQUnvJwpeE9QnPrxh7dpI/dp67erYG4WXEAreAMoelPRpMR7NWb4YtwRPn9b+H1uLQKl/qS8WYmyaljTpjIsw== + dependencies: + esprima "^4.0.0" + esprima@^4.0.0: version "4.0.1" resolved "https://registry.yarnpkg.com/esprima/-/esprima-4.0.1.tgz#13b04cdb3e6c5d19df91ab6987a8695619b0aa71" integrity sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A== +esquery@^1.0.1: + version "1.3.1" + resolved "https://registry.yarnpkg.com/esquery/-/esquery-1.3.1.tgz#b78b5828aa8e214e29fb74c4d5b752e1c033da57" + integrity sha512-olpvt9QG0vniUBZspVRN6lwB7hOZoTRtT+jzR+tS4ffYx2mzbw+z0XCOk44aaLYKApNX5nMm+E+P6o25ip/DHQ== + dependencies: + estraverse "^5.1.0" + +esrecurse@^4.1.0: + version "4.3.0" + resolved "https://registry.yarnpkg.com/esrecurse/-/esrecurse-4.3.0.tgz#7ad7964d679abb28bee72cec63758b1c5d2c9921" + integrity sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag== + dependencies: + estraverse "^5.2.0" + +estraverse@^4.1.1: + version "4.3.0" + resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-4.3.0.tgz#398ad3f3c5a24948be7725e83d11a7de28cdbd1d" + integrity sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw== + +estraverse@^5.1.0, estraverse@^5.2.0: + version "5.2.0" + resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-5.2.0.tgz#307df42547e6cc7324d3cf03c155d5cdb8c53880" + integrity sha512-BxbNGGNm0RyRYvUdHpIwv9IWzeM9XClbOxwoATuFdOE7ZE6wHL+HQ5T8hoPM+zHvmKzzsEqhgy0GrQ5X13afiQ== + esutils@^2.0.2: version "2.0.3" resolved "https://registry.yarnpkg.com/esutils/-/esutils-2.0.3.tgz#74d2eb4de0b8da1293711910d50775b9b710ef64" @@ -3869,6 +4106,15 @@ extend@^3.0.0, extend@~3.0.2: resolved "https://registry.yarnpkg.com/extend/-/extend-3.0.2.tgz#f8b1136b4071fbd8eb140aff858b1019ec2915fa" integrity sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g== +external-editor@^3.0.3: + version "3.1.0" + resolved "https://registry.yarnpkg.com/external-editor/-/external-editor-3.1.0.tgz#cb03f740befae03ea4d283caed2741a83f335495" + integrity sha512-hMQ4CX1p1izmuLYyZqLMO/qGNw10wSv9QDCPfzXfyFrOaCSSoRfqE1Kf1s5an66J5JZC62NewG+mK49jOCtQew== + dependencies: + chardet "^0.7.0" + iconv-lite "^0.4.24" + tmp "^0.0.33" + extglob@^2.0.4: version "2.0.4" resolved "https://registry.yarnpkg.com/extglob/-/extglob-2.0.4.tgz#ad00fe4dc612a9232e8718711dc5cb5ab0285543" @@ -3883,6 +4129,14 @@ extglob@^2.0.4: snapdragon "^0.8.1" to-regex "^3.0.1" +extract-comments@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/extract-comments/-/extract-comments-1.1.0.tgz#b90bca033a056bd69b8ba1c6b6b120fc2ee95c18" + integrity sha512-dzbZV2AdSSVW/4E7Ti5hZdHWbA+Z80RJsJhr5uiL10oyjl/gy7/o+HI1HwK4/WSZhlq4SNKU3oUzXlM13Qx02Q== + dependencies: + esprima-extract-comments "^1.1.0" + parse-code-context "^1.0.0" + extsprintf@1.3.0: version "1.3.0" resolved "https://registry.yarnpkg.com/extsprintf/-/extsprintf-1.3.0.tgz#96918440e3041a7a414f8c52e3c574eb3c3e1e05" @@ -3915,11 +4169,21 @@ fast-deep-equal@^3.1.1: resolved "https://registry.yarnpkg.com/fast-deep-equal/-/fast-deep-equal-3.1.1.tgz#545145077c501491e33b15ec408c294376e94ae4" integrity sha512-8UEa58QDLauDNfpbrX55Q9jrGHThw2ZMdOky5Gl1CDtVeJDPVrG4Jxx1N8jw2gkWaff5UUuX1KJd+9zGe2B+ZA== +fast-diff@^1.1.2: + version "1.2.0" + resolved "https://registry.yarnpkg.com/fast-diff/-/fast-diff-1.2.0.tgz#73ee11982d86caaf7959828d519cfe927fac5f03" + integrity sha512-xJuoT5+L99XlZ8twedaRf6Ax2TgQVxvgZOYoPKqZufmJib0tL2tegPBOZb1pVNgIhlqDlA0eO0c3wBvQcmzx4w== + fast-json-stable-stringify@^2.0.0: version "2.1.0" resolved "https://registry.yarnpkg.com/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz#874bf69c6f404c2b5d99c481341399fd55892633" integrity sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw== +fast-levenshtein@~2.0.6: + version "2.0.6" + resolved "https://registry.yarnpkg.com/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz#3d8a5c66883a16a30ca8643e851f19baa7797917" + integrity sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc= + fb-watchman@^2.0.0: version "2.0.1" resolved "https://registry.yarnpkg.com/fb-watchman/-/fb-watchman-2.0.1.tgz#fc84fb39d2709cf3ff6d743706157bb5708a8a85" @@ -3941,6 +4205,20 @@ fetch-ponyfill@^4.0.0: dependencies: node-fetch "~1.7.1" +figures@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/figures/-/figures-2.0.0.tgz#3ab1a2d2a62c8bfb431a0c94cb797a2fce27c962" + integrity sha1-OrGi0qYsi/tDGgyUy3l6L84nyWI= + dependencies: + escape-string-regexp "^1.0.5" + +file-entry-cache@^5.0.1: + version "5.0.1" + resolved "https://registry.yarnpkg.com/file-entry-cache/-/file-entry-cache-5.0.1.tgz#ca0f6efa6dd3d561333fb14515065c2fafdf439c" + integrity sha512-bCg29ictuBaKUwwArK4ouCaqDgLZcysCFLmM/Yn/FDoqndh/9vNuQfXRDvTuXKLxfD/JtZQGKFT8MGcJBK644g== + dependencies: + flat-cache "^2.0.1" + file-type@^3.8.0: version "3.9.0" resolved "https://registry.yarnpkg.com/file-type/-/file-type-3.9.0.tgz#257a078384d1db8087bc449d107d52a52672b9e9" @@ -4086,6 +4364,15 @@ flagged-respawn@^1.0.0: resolved "https://registry.yarnpkg.com/flagged-respawn/-/flagged-respawn-1.0.1.tgz#e7de6f1279ddd9ca9aac8a5971d618606b3aab41" integrity sha512-lNaHNVymajmk0OJMBn8fVUAU1BtDeKIqKoVhk4xAALB57aALg6b4W0MfJ/cUE0g9YBXy5XhSlPIpYIJ7HaY/3Q== +flat-cache@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/flat-cache/-/flat-cache-2.0.1.tgz#5d296d6f04bda44a4630a301413bdbc2ec085ec0" + integrity sha512-LoQe6yDuUMDzQAEH8sgmh4Md6oZnc/7PjtwjNFSzveXqSHt6ka9fPBuso7IGf9Rz4uqnSnWiFH2B/zj24a5ReA== + dependencies: + flatted "^2.0.0" + rimraf "2.6.3" + write "1.0.3" + flat@^4.1.0: version "4.1.0" resolved "https://registry.yarnpkg.com/flat/-/flat-4.1.0.tgz#090bec8b05e39cba309747f1d588f04dbaf98db2" @@ -4093,6 +4380,11 @@ flat@^4.1.0: dependencies: is-buffer "~2.0.3" +flatted@^2.0.0: + version "2.0.2" + resolved "https://registry.yarnpkg.com/flatted/-/flatted-2.0.2.tgz#4575b21e2bcee7434aa9be662f4b7b5f9c2b5138" + integrity sha512-r5wGx7YeOwNWNlCA0wQ86zKyDLMQr+/RB8xy74M4hTphfmjlijTSSXGuH8rnvKZnfT9i+75zmd8jcKdMR4O6jA== + flow-stoplight@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/flow-stoplight/-/flow-stoplight-1.0.0.tgz#4a292c5bcff8b39fa6cc0cb1a853d86f27eeff7b" @@ -4410,7 +4702,7 @@ glob@7.1.3: once "^1.3.0" path-is-absolute "^1.0.0" -glob@^7.1.1, glob@^7.1.3, glob@~7.1.6: +glob@^7.1.1, glob@^7.1.2, glob@^7.1.3, glob@~7.1.6: version "7.1.6" resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.6.tgz#141f33b81a7c2492e125594307480c46679278a6" integrity sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA== @@ -4457,6 +4749,11 @@ global@~4.3.0: min-document "^2.19.0" process "~0.5.1" +globals@^11.7.0: + version "11.12.0" + resolved "https://registry.yarnpkg.com/globals/-/globals-11.12.0.tgz#ab8795338868a0babd8525758018c2a7eb95c42e" + integrity sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA== + globals@^9.18.0: version "9.18.0" resolved "https://registry.yarnpkg.com/globals/-/globals-9.18.0.tgz#aa3896b3e69b487f17e31ed2143d69a8e30c2d8a" @@ -4801,7 +5098,7 @@ https-proxy-agent@^5.0.0: agent-base "6" debug "4" -iconv-lite@0.4.24, iconv-lite@~0.4.13: +iconv-lite@0.4.24, iconv-lite@^0.4.24, iconv-lite@~0.4.13: version "0.4.24" resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.4.24.tgz#2022b4b25fbddc21d2f524974a474aafe733908b" integrity sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA== @@ -4820,11 +5117,37 @@ ieee754@^1.1.4: resolved "https://registry.yarnpkg.com/ieee754/-/ieee754-1.1.13.tgz#ec168558e95aa181fd87d37f55c32bbcb6708b84" integrity sha512-4vf7I2LYV/HaWerSo3XmlMkp5eZ83i+/CDluXi/IGTs/O1sejBNhTtnxzmRZfvOUqj7lZjqHkeTvpgSFDlWZTg== +ignore@^4.0.6: + version "4.0.6" + resolved "https://registry.yarnpkg.com/ignore/-/ignore-4.0.6.tgz#750e3db5862087b4737ebac8207ffd1ef27b25fc" + integrity sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg== + immediate@^3.2.3, immediate@~3.2.3: version "3.2.3" resolved "https://registry.yarnpkg.com/immediate/-/immediate-3.2.3.tgz#d140fa8f614659bd6541233097ddaac25cdd991c" integrity sha1-0UD6j2FGWb1lQSMwl92qwlzdmRw= +import-fresh@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/import-fresh/-/import-fresh-2.0.0.tgz#d81355c15612d386c61f9ddd3922d4304822a546" + integrity sha1-2BNVwVYS04bGH53dOSLUMEgipUY= + dependencies: + caller-path "^2.0.0" + resolve-from "^3.0.0" + +import-fresh@^3.0.0: + version "3.2.1" + resolved "https://registry.yarnpkg.com/import-fresh/-/import-fresh-3.2.1.tgz#633ff618506e793af5ac91bf48b72677e15cbe66" + integrity sha512-6e1q1cnWP2RXD9/keSkxHScg508CdXqXWgWBaETNhyuBFz+kUZlKboh+ISK+bU++DmbHimVBrOz/zzPe0sZ3sQ== + dependencies: + parent-module "^1.0.0" + resolve-from "^4.0.0" + +imurmurhash@^0.1.4: + version "0.1.4" + resolved "https://registry.yarnpkg.com/imurmurhash/-/imurmurhash-0.1.4.tgz#9218b9b2b928a238b13dc4fb6b6d576f231453ea" + integrity sha1-khi5srkoojixPcT7a21XbyMUU+o= + inflight@^1.0.4: version "1.0.6" resolved "https://registry.yarnpkg.com/inflight/-/inflight-1.0.6.tgz#49bd6331d7d02d0c09bc910a1075ba8165b56df9" @@ -4848,6 +5171,25 @@ ini@^1.3.4: resolved "https://registry.yarnpkg.com/ini/-/ini-1.3.5.tgz#eee25f56db1c9ec6085e0c22778083f596abf927" integrity sha512-RZY5huIKCMRWDUqZlEi72f/lmXKMvuszcMBduliQ3nnWbx9X/ZBQO7DijMEYS9EhHBb2qacRUMtC7svLwe0lcw== +inquirer@^6.2.2: + version "6.5.2" + resolved "https://registry.yarnpkg.com/inquirer/-/inquirer-6.5.2.tgz#ad50942375d036d327ff528c08bd5fab089928ca" + integrity sha512-cntlB5ghuB0iuO65Ovoi8ogLHiWGs/5yNrtUcKjFhSSiVeAIVpD7koaSU9RM8mpXw5YDi9RdYXGQMaOURB7ycQ== + dependencies: + ansi-escapes "^3.2.0" + chalk "^2.4.2" + cli-cursor "^2.1.0" + cli-width "^2.0.0" + external-editor "^3.0.3" + figures "^2.0.0" + lodash "^4.17.12" + mute-stream "0.0.7" + run-async "^2.2.0" + rxjs "^6.4.0" + string-width "^2.1.0" + strip-ansi "^5.1.0" + through "^2.3.6" + interpret@^1.1.0: version "1.2.0" resolved "https://registry.yarnpkg.com/interpret/-/interpret-1.2.0.tgz#d5061a6224be58e8083985f5014d844359576296" @@ -4990,6 +5332,11 @@ is-descriptor@^1.0.0, is-descriptor@^1.0.2: is-data-descriptor "^1.0.0" kind-of "^6.0.2" +is-directory@^0.3.1: + version "0.3.1" + resolved "https://registry.yarnpkg.com/is-directory/-/is-directory-0.3.1.tgz#61339b6f2475fc772fd9c9d83f5c8575dc154ae1" + integrity sha1-YTObbyR1/Hcv2cnYP1yFddwVSuE= + is-extendable@^0.1.0, is-extendable@^0.1.1: version "0.1.1" resolved "https://registry.yarnpkg.com/is-extendable/-/is-extendable-0.1.1.tgz#62b110e289a471418e3ec36a617d472e301dfc89" @@ -5388,6 +5735,14 @@ js-yaml@3.13.1: argparse "^1.0.7" esprima "^4.0.0" +js-yaml@^3.12.0, js-yaml@^3.13.0, js-yaml@^3.13.1: + version "3.14.0" + resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.14.0.tgz#a7a34170f26a21bb162424d8adacb4113a69e482" + integrity sha512-/4IbIeHcD9VMHFqDR/gQ7EdZdLimOvW2DdcxFjdyyZ9NsbS+ccrXqVWDtab/lRl5AlUqmpBx8EhPaWR+OtY17A== + dependencies: + argparse "^1.0.7" + esprima "^4.0.0" + jsbn@~0.1.0: version "0.1.1" resolved "https://registry.yarnpkg.com/jsbn/-/jsbn-0.1.1.tgz#a5e654c2e5a2deb5f201d96cefbca80c0ef2f513" @@ -5408,6 +5763,11 @@ json-buffer@3.0.0: resolved "https://registry.yarnpkg.com/json-buffer/-/json-buffer-3.0.0.tgz#5b1f397afc75d677bde8bcfc0e47e1f9a3d9a898" integrity sha1-Wx85evx11ne96Lz8Dkfh+aPZqJg= +json-parse-better-errors@^1.0.1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/json-parse-better-errors/-/json-parse-better-errors-1.0.2.tgz#bb867cfb3450e69107c131d1c514bab3dc8bcaa9" + integrity sha512-mrqyZKfX5EhL7hvqcV6WG1yYjnjeuYDzDhhcAAUrq8Po85NBQBJP+ZDUT75qZQ98IkUoBqdkExkukOU7Ts2wrw== + json-parse-even-better-errors@^2.3.0: version "2.3.1" resolved "https://registry.yarnpkg.com/json-parse-even-better-errors/-/json-parse-even-better-errors-2.3.1.tgz#7c47805a94319928e05777405dc12e1f7a4ee02d" @@ -5751,6 +6111,14 @@ levelup@^1.2.1: semver "~5.4.1" xtend "~4.0.0" +levn@^0.3.0, levn@~0.3.0: + version "0.3.0" + resolved "https://registry.yarnpkg.com/levn/-/levn-0.3.0.tgz#3b09924edf9f083c0490fdd4c0bc4421e04764ee" + integrity sha1-OwmSTt+fCDwEkP3UwLxEIeBHZO4= + dependencies: + prelude-ls "~1.1.2" + type-check "~0.3.2" + liftoff@^3.1.0: version "3.1.0" resolved "https://registry.yarnpkg.com/liftoff/-/liftoff-3.1.0.tgz#c9ba6081f908670607ee79062d700df062c52ed3" @@ -5819,7 +6187,7 @@ lodash@^4.17.11, lodash@^4.17.14, lodash@^4.17.15, lodash@^4.17.4: resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.15.tgz#b447f6670a0455bbfeedd11392eff330ea097548" integrity sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A== -lodash@^4.17.19: +lodash@^4.17.12, lodash@^4.17.19: version "4.17.20" resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.20.tgz#b44a9b6297bcb698f1c51a3545a2b3b368d59c52" integrity sha512-PlhdFcillOINfeV7Ni6oF1TAEayyZBoZ8bcshTHqOYJYlrqzRK5hagpagky5o4HfCzzd1TRkXPMFq6cKk9rGmA== @@ -6089,6 +6457,11 @@ mime@1.6.0: resolved "https://registry.yarnpkg.com/mime/-/mime-1.6.0.tgz#32cd9e5c64553bd58d19a568af452acff04981b1" integrity sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg== +mimic-fn@^1.0.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/mimic-fn/-/mimic-fn-1.2.0.tgz#820c86a39334640e99516928bd03fca88057d022" + integrity sha512-jf84uxzwiuiIVKiOLpfYk7N46TSy8ubTonmneY9vrpHNAnp0QBt2BxWV9dO3/j+BoVAb+a5G6YDPW3M5HOdMWQ== + mimic-response@^1.0.0, mimic-response@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/mimic-response/-/mimic-response-1.0.1.tgz#4923538878eef42063cb8a3e3b0798781487ab1b" @@ -6264,7 +6637,7 @@ ms@2.1.1: resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.1.tgz#30a5864eb3ebb0a66f2ebe6d727af06a09d86e0a" integrity sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg== -ms@^2.1.1: +ms@2.1.2, ms@^2.1.1: version "2.1.2" resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.2.tgz#d09d1f357b443f493382a8eb3ccd183872ae6009" integrity sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w== @@ -6274,6 +6647,11 @@ mute-stdout@^1.0.0: resolved "https://registry.yarnpkg.com/mute-stdout/-/mute-stdout-1.0.1.tgz#acb0300eb4de23a7ddeec014e3e96044b3472331" integrity sha512-kDcwXR4PS7caBpuRYYBUz9iVixUk3anO3f5OYFiIPwK/20vCzKCHyKoulbiDY1S53zD2bxUpxN/IJ+TnXjfvxg== +mute-stream@0.0.7: + version "0.0.7" + resolved "https://registry.yarnpkg.com/mute-stream/-/mute-stream-0.0.7.tgz#3075ce93bc21b8fab43e1bc4da7e8115ed1e7bab" + integrity sha1-MHXOk7whuPq0PhvE2n6BFe0ee6s= + nan@2.13.2: version "2.13.2" resolved "https://registry.yarnpkg.com/nan/-/nan-2.13.2.tgz#f51dc7ae66ba7d5d55e1e6d4d8092e802c9aefe7" @@ -6567,6 +6945,25 @@ once@^1.3.0, once@^1.3.1, once@^1.3.2, once@^1.4.0: dependencies: wrappy "1" +onetime@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/onetime/-/onetime-2.0.1.tgz#067428230fd67443b2794b22bba528b6867962d4" + integrity sha1-BnQoIw/WdEOyeUsiu6UotoZ5YtQ= + dependencies: + mimic-fn "^1.0.0" + +optionator@^0.8.2: + version "0.8.3" + resolved "https://registry.yarnpkg.com/optionator/-/optionator-0.8.3.tgz#84fa1d036fe9d3c7e21d99884b601167ec8fb495" + integrity sha512-+IW9pACdk3XWmmTXG8m3upGUJst5XRGzxMRjXzAuJ1XnIFNvfhjjIuYkDvysnPQ7qzqVzLt78BCruntqRhWQbA== + dependencies: + deep-is "~0.1.3" + fast-levenshtein "~2.0.6" + levn "~0.3.0" + prelude-ls "~1.1.2" + type-check "~0.3.2" + word-wrap "~1.2.3" + ordered-read-streams@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/ordered-read-streams/-/ordered-read-streams-1.0.1.tgz#77c0cb37c41525d64166d990ffad7ec6a0e1363e" @@ -6689,6 +7086,13 @@ p-try@^2.0.0: resolved "https://registry.yarnpkg.com/p-try/-/p-try-2.2.0.tgz#cb2868540e313d61de58fafbe35ce9004d5540e6" integrity sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ== +parent-module@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/parent-module/-/parent-module-1.0.1.tgz#691d2709e78c79fae3a156622452d00762caaaa2" + integrity sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g== + dependencies: + callsites "^3.0.0" + parse-asn1@^5.0.0: version "5.1.5" resolved "https://registry.yarnpkg.com/parse-asn1/-/parse-asn1-5.1.5.tgz#003271343da58dc94cace494faef3d2147ecea0e" @@ -6701,6 +7105,11 @@ parse-asn1@^5.0.0: pbkdf2 "^3.0.3" safe-buffer "^5.1.1" +parse-code-context@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/parse-code-context/-/parse-code-context-1.0.0.tgz#718c295c593d0d19a37f898473268cc75e98de1e" + integrity sha512-OZQaqKaQnR21iqhlnPfVisFjBWjhnMl5J9MgbP8xC+EwoVqbXrq78lp+9Zb3ahmLzrIX5Us/qbvBnaS3hkH6OA== + parse-filepath@^1.0.1: version "1.0.2" resolved "https://registry.yarnpkg.com/parse-filepath/-/parse-filepath-1.0.2.tgz#a632127f53aaf3d15876f5872f3ffac763d6c891" @@ -6722,6 +7131,14 @@ parse-json@^2.2.0: dependencies: error-ex "^1.2.0" +parse-json@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/parse-json/-/parse-json-4.0.0.tgz#be35f5425be1f7f6c747184f98a788cb99477ee0" + integrity sha1-vjX1Qlvh9/bHRxhPmKeIy5lHfuA= + dependencies: + error-ex "^1.3.1" + json-parse-better-errors "^1.0.1" + parse-json@^5.0.0: version "5.1.0" resolved "https://registry.yarnpkg.com/parse-json/-/parse-json-5.1.0.tgz#f96088cdf24a8faa9aea9a009f2d9d942c999646" @@ -6899,6 +7316,11 @@ precond@0.2: resolved "https://registry.yarnpkg.com/precond/-/precond-0.2.3.tgz#aa9591bcaa24923f1e0f4849d240f47efc1075ac" integrity sha1-qpWRvKokkj8eD0hJ0kD0fvwQdaw= +prelude-ls@~1.1.2: + version "1.1.2" + resolved "https://registry.yarnpkg.com/prelude-ls/-/prelude-ls-1.1.2.tgz#21932a549f5e52ffd9a827f570e04be62a97da54" + integrity sha1-IZMqVJ9eUv/ZqCf1cOBL5iqX2lQ= + prepend-http@^1.0.1: version "1.0.4" resolved "https://registry.yarnpkg.com/prepend-http/-/prepend-http-1.0.4.tgz#d4f4562b0ce3696e41ac52d0e002e57a635dc6dc" @@ -6909,6 +7331,32 @@ prepend-http@^2.0.0: resolved "https://registry.yarnpkg.com/prepend-http/-/prepend-http-2.0.0.tgz#e92434bfa5ea8c19f41cdfd401d741a3c819d897" integrity sha1-6SQ0v6XqjBn0HN/UAddBo8gZ2Jc= +prettier-linter-helpers@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/prettier-linter-helpers/-/prettier-linter-helpers-1.0.0.tgz#d23d41fe1375646de2d0104d3454a3008802cf7b" + integrity sha512-GbK2cP9nraSSUF9N2XwUwqfzlAFlMNYYl+ShE/V+H8a9uNl/oUqB1w2EL54Jh0OlyRSd8RfWYJ3coVS4TROP2w== + dependencies: + fast-diff "^1.1.2" + +prettier-plugin-solidity@^1.0.0-alpha.59: + version "1.0.0-alpha.59" + resolved "https://registry.yarnpkg.com/prettier-plugin-solidity/-/prettier-plugin-solidity-1.0.0-alpha.59.tgz#b0cf82fb068537d152d0bc417588d08e952a56c6" + integrity sha512-6cE0SWaiYCBoJY4clCfsbWlEEOU4K42Ny6Tg4Jwprgts/q+AVfYnPQ5coRs7zIjYzc4RVspifYPeh+oAg8RpLw== + dependencies: + "@solidity-parser/parser" "^0.8.1" + dir-to-object "^2.0.0" + emoji-regex "^9.0.0" + escape-string-regexp "^4.0.0" + extract-comments "^1.1.0" + prettier "^2.0.5" + semver "^7.3.2" + string-width "^4.2.0" + +prettier@^1.14.3: + version "1.19.1" + resolved "https://registry.yarnpkg.com/prettier/-/prettier-1.19.1.tgz#f7d7f5ff8a9cd872a7be4ca142095956a60797cb" + integrity sha512-s7PoyDv/II1ObgQunCbB9PdLmUcBZcnWOcxDh7O0N/UwDEsHyqkW+Qh28jW+mVuCdx7gLB0BotYI1Y6uI9iyew== + prettier@^2.0.5: version "2.0.5" resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.0.5.tgz#d6d56282455243f2f92cc1716692c08aa31522d4" @@ -6944,6 +7392,11 @@ process@~0.5.1: resolved "https://registry.yarnpkg.com/process/-/process-0.5.2.tgz#1638d8a8e34c2f440a91db95ab9aeb677fc185cf" integrity sha1-FjjYqONML0QKkduVq5rrZ3/Bhc8= +progress@^2.0.0: + version "2.0.3" + resolved "https://registry.yarnpkg.com/progress/-/progress-2.0.3.tgz#7e8cf8d8f5b8f239c1bc68beb4eb78567d572ef8" + integrity sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA== + promise-to-callback@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/promise-to-callback/-/promise-to-callback-1.0.0.tgz#5d2a749010bfb67d963598fcd3960746a68feef7" @@ -7297,6 +7750,11 @@ regexp.prototype.flags@^1.2.0: define-properties "^1.1.3" es-abstract "^1.17.0-next.1" +regexpp@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/regexpp/-/regexpp-2.0.1.tgz#8d19d31cf632482b589049f8281f93dbcba4d07f" + integrity sha512-lv0M6+TkDVniA3aD1Eg0DVpfU/booSu7Eev3TDO/mZKHBfVjgCGTV4t4buppESEYDtkArYFOxTJWv6S5C+iaNw== + regexpu-core@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/regexpu-core/-/regexpu-core-2.0.0.tgz#49d038837b8dcf8bfa5b9a42139938e6ea2ae240" @@ -7430,6 +7888,16 @@ resolve-dir@^1.0.0, resolve-dir@^1.0.1: expand-tilde "^2.0.0" global-modules "^1.0.0" +resolve-from@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/resolve-from/-/resolve-from-3.0.0.tgz#b22c7af7d9d6881bc8b6e653335eebcb0a188748" + integrity sha1-six699nWiBvItuZTM17rywoYh0g= + +resolve-from@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/resolve-from/-/resolve-from-4.0.0.tgz#4abcd852ad32dd7baabfe9b40e00a36db5f392e6" + integrity sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g== + resolve-options@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/resolve-options/-/resolve-options-1.1.0.tgz#32bb9e39c06d67338dc9378c0d6d6074566ad131" @@ -7463,6 +7931,14 @@ responselike@1.0.2, responselike@^1.0.2: dependencies: lowercase-keys "^1.0.0" +restore-cursor@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/restore-cursor/-/restore-cursor-2.0.0.tgz#9f7ee287f82fd326d4fd162923d62129eee0dfaf" + integrity sha1-n37ih/gv0ybU/RYpI9YhKe7g368= + dependencies: + onetime "^2.0.0" + signal-exit "^3.0.2" + resumer@~0.0.0: version "0.0.0" resolved "https://registry.yarnpkg.com/resumer/-/resumer-0.0.0.tgz#f1e8f461e4064ba39e82af3cdc2a8c893d076759" @@ -7475,6 +7951,13 @@ ret@~0.1.10: resolved "https://registry.yarnpkg.com/ret/-/ret-0.1.15.tgz#b8a4825d5bdb1fc3f6f53c2bc33f81388681c7bc" integrity sha512-TTlYpa+OL+vMMNG24xSlQGEJ3B/RzEfUlLct7b5G/ytav+wPrplCpVMFuwzXbkecJrb6IYo1iFb0S9v37754mg== +rimraf@2.6.3: + version "2.6.3" + resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-2.6.3.tgz#b2d104fe0d8fb27cf9e0a1cda8262dd3833c6cab" + integrity sha512-mwqeW5XsA2qAejG46gYdENaxXjx9onRNCfn7L0duuP4hCuTIi/QO7PDK07KJfp1d+izWPrzEJDcSqBa0OZQriA== + dependencies: + glob "^7.1.3" + rimraf@^2.2.8, rimraf@^2.6.3: version "2.7.1" resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-2.7.1.tgz#35797f13a7fdadc566142c29d4f07ccad483e3ec" @@ -7502,11 +7985,23 @@ rsvp@^4.8.4: resolved "https://registry.yarnpkg.com/rsvp/-/rsvp-4.8.5.tgz#c8f155311d167f68f21e168df71ec5b083113734" integrity sha512-nfMOlASu9OnRJo1mbEk2cz0D56a1MBNrJ7orjRZQG10XDyuvwksKbuXNp6qa+kbn839HwjwhBzhFmdsaEAfauA== +run-async@^2.2.0: + version "2.4.1" + resolved "https://registry.yarnpkg.com/run-async/-/run-async-2.4.1.tgz#8440eccf99ea3e70bd409d49aab88e10c189a455" + integrity sha512-tvVnVv01b8c1RrA6Ep7JkStj85Guv/YrMcwqYQnwjsAS2cTmmPGBBjAjpCW7RrSodNSoE2/qg9O4bceNvUuDgQ== + rustbn.js@~0.2.0: version "0.2.0" resolved "https://registry.yarnpkg.com/rustbn.js/-/rustbn.js-0.2.0.tgz#8082cb886e707155fd1cb6f23bd591ab8d55d0ca" integrity sha512-4VlvkRUuCJvr2J6Y0ImW7NvTCriMi7ErOAqWk1y69vAdoNIzCF3yPmgeNzx+RQTLEDFq5sHfscn1MwHxP9hNfA== +rxjs@^6.4.0: + version "6.6.3" + resolved "https://registry.yarnpkg.com/rxjs/-/rxjs-6.6.3.tgz#8ca84635c4daa900c0d3967a6ee7ac60271ee552" + integrity sha512-trsQc+xYYXZ3urjOiJOuCOa5N3jAZ3eiSpQB5hIT8zGlL2QfnHLJ2r7GMkBGuIausdJN1OneaI6gQlsqNHHmZQ== + dependencies: + tslib "^1.9.0" + safe-buffer@5.1.2, safe-buffer@~5.1.0, safe-buffer@~5.1.1: version "5.1.2" resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.1.2.tgz#991ec69d296e0313747d59bdfd2b745c35f8828d" @@ -7641,7 +8136,7 @@ semver-greatest-satisfied-range@^1.1.0: dependencies: sver-compat "^1.5.0" -"semver@2 || 3 || 4 || 5", semver@^5.3.0, semver@^5.5.0, semver@^5.7.0: +"semver@2 || 3 || 4 || 5", semver@^5.3.0, semver@^5.5.0, semver@^5.5.1, semver@^5.7.0: version "5.7.1" resolved "https://registry.yarnpkg.com/semver/-/semver-5.7.1.tgz#a954f931aeba508d307bbf069eff0c01c96116f7" integrity sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ== @@ -7763,7 +8258,7 @@ shebang-regex@^1.0.0: resolved "https://registry.yarnpkg.com/shebang-regex/-/shebang-regex-1.0.0.tgz#da42f49740c0b42db2ca9728571cb190c98efea3" integrity sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM= -signal-exit@^3.0.0: +signal-exit@^3.0.0, signal-exit@^3.0.2: version "3.0.3" resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-3.0.3.tgz#a1410c2edd8f077b08b4e253c8eacfcaf057461c" integrity sha512-VUJ49FC8U1OxwZLxIbTTrDvLnf/6TDgxZcK8wxR8zs13xpx7xbG60ndBlhNrFi2EMuFRoeDoJO7wthSLq42EjA== @@ -7792,6 +8287,15 @@ slash@^3.0.0: resolved "https://registry.yarnpkg.com/slash/-/slash-3.0.0.tgz#6539be870c165adbd5240220dbe361f1bc4d4634" integrity sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q== +slice-ansi@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/slice-ansi/-/slice-ansi-2.1.0.tgz#cacd7693461a637a5788d92a7dd4fba068e81636" + integrity sha512-Qu+VC3EwYLldKa1fCxuuvULvSJOKEgk9pi8dZeCVK7TqBfUNTH4sFkk4joj8afVSfAYgJoSOetjx9QWOJ5mYoQ== + dependencies: + ansi-styles "^3.2.0" + astral-regex "^1.0.0" + is-fullwidth-code-point "^2.0.0" + snapdragon-node@^2.0.1: version "2.1.1" resolved "https://registry.yarnpkg.com/snapdragon-node/-/snapdragon-node-2.1.1.tgz#6c175f86ff14bdb0724563e8f3c1b021a286853b" @@ -7861,6 +8365,35 @@ solc@^0.6.3: semver "^5.5.0" tmp "0.0.33" +solhint-plugin-prettier@^0.0.5: + version "0.0.5" + resolved "https://registry.yarnpkg.com/solhint-plugin-prettier/-/solhint-plugin-prettier-0.0.5.tgz#e3b22800ba435cd640a9eca805a7f8bc3e3e6a6b" + integrity sha512-7jmWcnVshIrO2FFinIvDQmhQpfpS2rRRn3RejiYgnjIE68xO2bvrYvjqVNfrio4xH9ghOqn83tKuTzLjEbmGIA== + dependencies: + prettier-linter-helpers "^1.0.0" + +solhint@^3.2.1: + version "3.2.1" + resolved "https://registry.yarnpkg.com/solhint/-/solhint-3.2.1.tgz#62f250930fe2fdaf8787e50ad35c038eedb52bbf" + integrity sha512-Pq6jZxHp1TJ3K7dGxuY5c+ByMmUwJ/vs8FTZmeryf0SKB+zjPDWfYGpchPqW+PSbVzRCpS2O/+57O64mG4x/JA== + dependencies: + "@solidity-parser/parser" "^0.8.1" + ajv "^6.6.1" + antlr4 "4.7.1" + ast-parents "0.0.1" + chalk "^2.4.2" + commander "2.18.0" + cosmiconfig "^5.0.7" + eslint "^5.6.0" + fast-diff "^1.1.2" + glob "^7.1.3" + ignore "^4.0.6" + js-yaml "^3.12.0" + lodash "^4.17.11" + semver "^6.3.0" + optionalDependencies: + prettier "^1.14.3" + sort-keys-length@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/sort-keys-length/-/sort-keys-length-1.0.1.tgz#9cb6f4f4e9e48155a6aa0671edd336ff1479a188" @@ -8046,7 +8579,7 @@ string-width@^1.0.1, string-width@^1.0.2: is-fullwidth-code-point "^1.0.0" strip-ansi "^3.0.0" -"string-width@^1.0.2 || 2": +"string-width@^1.0.2 || 2", string-width@^2.1.0: version "2.1.1" resolved "https://registry.yarnpkg.com/string-width/-/string-width-2.1.1.tgz#ab93f27a8dc13d28cac815c462143a6d9012ae9e" integrity sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw== @@ -8188,7 +8721,7 @@ strip-hex-prefix@1.0.0: dependencies: is-hex-prefixed "1.0.0" -strip-json-comments@2.0.1: +strip-json-comments@2.0.1, strip-json-comments@^2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-2.0.1.tgz#3c531942e908c2697c0ec344858c286c7ca0a60a" integrity sha1-PFMZQukIwml8DsNEhYwobHygpgo= @@ -8252,6 +8785,16 @@ swarm-js@0.1.39: tar "^4.0.2" xhr-request-promise "^0.1.2" +table@^5.2.3: + version "5.4.6" + resolved "https://registry.yarnpkg.com/table/-/table-5.4.6.tgz#1292d19500ce3f86053b05f0e8e7e4a3bb21079e" + integrity sha512-wmEc8m4fjnob4gt5riFRtTu/6+4rSe12TpAELNSqHMfF3IqnA+CH37USM6/YR3qRZv7e56kAEAtd6nKZaxe0Ug== + dependencies: + ajv "^6.10.2" + lodash "^4.17.14" + slice-ansi "^2.1.0" + string-width "^3.0.0" + tape@^4.6.3: version "4.13.2" resolved "https://registry.yarnpkg.com/tape/-/tape-4.13.2.tgz#eb419b9d9bc004025b1a81a5b63093e07f425629" @@ -8304,6 +8847,11 @@ testrpc@0.0.1: resolved "https://registry.yarnpkg.com/testrpc/-/testrpc-0.0.1.tgz#83e2195b1f5873aec7be1af8cbe6dcf39edb7aed" integrity sha512-afH1hO+SQ/VPlmaLUFj2636QMeDvPCeQMc/9RBMW0IfjNe9gFD9Ra3ShqYkB7py0do1ZcCna/9acHyzTJ+GcNA== +text-table@^0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/text-table/-/text-table-0.2.0.tgz#7f5ee823ae805207c00af2df4a84ec3fcfa570b4" + integrity sha1-f17oI66AUgfACvLfSoTsP8+lcLQ= + through2-filter@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/through2-filter/-/through2-filter-3.0.0.tgz#700e786df2367c2c88cd8aa5be4cf9c1e7831254" @@ -8320,7 +8868,7 @@ through2@^2.0.0, through2@^2.0.3, through2@~2.0.0: readable-stream "~2.3.6" xtend "~4.0.1" -through@^2.3.8, through@~2.3.4, through@~2.3.8: +through@^2.3.6, through@^2.3.8, through@~2.3.4, through@~2.3.8: version "2.3.8" resolved "https://registry.yarnpkg.com/through/-/through-2.3.8.tgz#0dd4c9ffaabc357960b1b724115d7e0e86a2e1f5" integrity sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU= @@ -8335,7 +8883,7 @@ timed-out@^4.0.0, timed-out@^4.0.1: resolved "https://registry.yarnpkg.com/timed-out/-/timed-out-4.0.1.tgz#f32eacac5a175bea25d7fab565ab3ed8741ef56f" integrity sha1-8y6srFoXW+ol1/q1Zas+2HQe9W8= -tmp@0.0.33: +tmp@0.0.33, tmp@^0.0.33: version "0.0.33" resolved "https://registry.yarnpkg.com/tmp/-/tmp-0.0.33.tgz#6d34335889768d21b2bcda0aa277ced3b1bfadf9" integrity sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw== @@ -8462,6 +9010,11 @@ ts-node@^8.5.4: source-map-support "^0.5.6" yn "3.1.1" +tslib@^1.9.0: + version "1.14.1" + resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.14.1.tgz#cf2d38bdc34a134bcaf1091c41f6619e2f672d00" + integrity sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg== + tslib@^1.9.3: version "1.13.0" resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.13.0.tgz#c881e13cc7015894ed914862d276436fa9a47043" @@ -8494,6 +9047,13 @@ tweetnacl@^1.0.0: resolved "https://registry.yarnpkg.com/tweetnacl/-/tweetnacl-1.0.3.tgz#ac0af71680458d8a6378d0d0d050ab1407d35596" integrity sha512-6rt+RN7aOi1nGMyC4Xa5DdYiukl2UWCbcJft7YhxReBGQD7OAM8Pbxw6YMo4r2diNEA8FEmu32YOn9rhaiE5yw== +type-check@~0.3.2: + version "0.3.2" + resolved "https://registry.yarnpkg.com/type-check/-/type-check-0.3.2.tgz#5884cab512cf1d355e3fb784f30804b2b520db72" + integrity sha1-WITKtRLPHTVeP7eE8wgEsrUg23I= + dependencies: + prelude-ls "~1.1.2" + type-detect@^4.0.0, type-detect@^4.0.5: version "4.0.8" resolved "https://registry.yarnpkg.com/type-detect/-/type-detect-4.0.8.tgz#7646fb5f18871cfbb7749e69bd39a6388eb7450c" @@ -9157,6 +9717,11 @@ window-size@^0.2.0: resolved "https://registry.yarnpkg.com/window-size/-/window-size-0.2.0.tgz#b4315bb4214a3d7058ebeee892e13fa24d98b075" integrity sha1-tDFbtCFKPXBY6+7okuE/ok2YsHU= +word-wrap@~1.2.3: + version "1.2.3" + resolved "https://registry.yarnpkg.com/word-wrap/-/word-wrap-1.2.3.tgz#610636f6b1f703891bd34771ccb17fb93b47079c" + integrity sha512-Hz/mrNwitNRh/HUAtM/VT/5VH+ygD6DV7mYKZAtHOrbs8U7lvPS6xf7EJKMF0uW1KJCl0H701g3ZGus+muE5vQ== + wrap-ansi@^2.0.0: version "2.1.0" resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-2.1.0.tgz#d8fc3d284dd05794fe84973caecdd1cf824fdd85" @@ -9188,6 +9753,13 @@ wrappy@1: resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f" integrity sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8= +write@1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/write/-/write-1.0.3.tgz#0800e14523b923a387e415123c865616aae0f5c3" + integrity sha512-/lg70HAjtkUgWPVZhZcm+T4hkL8Zbtp1nFNOn3lRrxnlv50SRBv7cR7RqR+GMsd3hUXy9hWBo4CHTbFTcOYwig== + dependencies: + mkdirp "^0.5.1" + ws@7.2.3: version "7.2.3" resolved "https://registry.yarnpkg.com/ws/-/ws-7.2.3.tgz#a5411e1fb04d5ed0efee76d26d5c46d830c39b46"