diff --git a/.github/workflows/lint.yaml b/.github/workflows/lint.yaml index d995665..07bcbb8 100644 --- a/.github/workflows/lint.yaml +++ b/.github/workflows/lint.yaml @@ -3,16 +3,15 @@ name: Lint on: push: branches: - - master - - develop + - master + - develop pull_request: jobs: + solidity: + runs-on: ubuntu-latest - solidity: - runs-on: ubuntu-latest - - steps: + steps: - name: Check out github repository uses: actions/checkout@v2 with: @@ -21,7 +20,7 @@ jobs: - name: Setup node.js uses: actions/setup-node@v1 with: - node-version: '12.x' + node-version: "12.x" - name: Set yarn cache directory path id: yarn-cache-dir-path @@ -44,10 +43,10 @@ jobs: - name: Run linter on *.sol and *.json run: yarn lint:check - commits: - runs-on: ubuntu-latest + commits: + runs-on: ubuntu-latest - steps: + steps: - name: Check out github repository uses: actions/checkout@v2 with: @@ -56,10 +55,10 @@ jobs: - name: Run commitlint uses: wagoid/commitlint-github-action@v2 - brownie: - runs-on: ubuntu-latest + brownie: + runs-on: ubuntu-latest - steps: + steps: - name: Check out github repository uses: actions/checkout@v2 with: @@ -73,7 +72,7 @@ jobs: - name: Set pip cache directory path id: pip-cache-dir-path run: | - echo "::set-output name=dir::$(pip cache dir)" + echo "::set-output name=dir::$(pip cache dir)" - name: Restore pip cache uses: actions/cache@v2 @@ -91,5 +90,4 @@ jobs: - name: Run black run: black --check --include "(tests|scripts)" . - # TODO: Add Slither Static Analyzer diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index e9ef6f8..c6f4036 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -3,8 +3,8 @@ name: Test on: push: branches: - - master - - develop + - master + - develop pull_request: jobs: @@ -12,57 +12,57 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v1 - - name: Cache compiler installations - uses: actions/cache@v2 - with: - path: | - ~/.solcx - ~/.vvm - key: ${{ runner.os }}-compiler-cache + - name: Cache compiler installations + uses: actions/cache@v2 + with: + path: | + ~/.solcx + ~/.vvm + key: ${{ runner.os }}-compiler-cache - - name: Setup node.js - uses: actions/setup-node@v1 - with: - node-version: '12.x' + - name: Setup node.js + uses: actions/setup-node@v1 + with: + node-version: "12.x" - - name: Install ganache - run: npm install -g ganache-cli@6.12.1 + - name: Install ganache + run: npm install -g ganache-cli@6.12.1 - - name: Set up python 3.8 - uses: actions/setup-python@v2 - with: - python-version: 3.8 + - name: Set up python 3.8 + uses: actions/setup-python@v2 + with: + python-version: 3.8 - - name: Set pip cache directory path - id: pip-cache-dir-path - run: | - echo "::set-output name=dir::$(pip cache dir)" + - name: Set pip cache directory path + id: pip-cache-dir-path + run: | + echo "::set-output name=dir::$(pip cache dir)" - - name: Restore pip cache - uses: actions/cache@v2 - id: pip-cache - with: - path: | - ${{ steps.pip-cache-dir-path.outputs.dir }} - key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements-dev.txt') }} - restore-keys: | - ${{ runner.os }}-pip-${{ hashFiles('**/requirements-dev.txt') }} - ${{ runner.os }}-pip- + - name: Restore pip cache + uses: actions/cache@v2 + id: pip-cache + with: + path: | + ${{ steps.pip-cache-dir-path.outputs.dir }} + key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements-dev.txt') }} + restore-keys: | + ${{ runner.os }}-pip-${{ hashFiles('**/requirements-dev.txt') }} + ${{ runner.os }}-pip- - - name: Install python dependencies - run: pip install -r requirements-dev.txt + - name: Install python dependencies + run: pip install -r requirements-dev.txt - - name: Compile Code - run: brownie compile --size + - name: Compile Code + run: brownie compile --size - - name: Run Tests - env: - ETHERSCAN_TOKEN: MW5CQA6QK5YMJXP2WP3RA36HM5A7RA1IHA - WEB3_INFURA_PROJECT_ID: b7821200399e4be2b4e5dbdf06fbe85b - run: | - brownie test tests/test_migration.py --network ftm-main-fork - brownie test tests/test_operation.py --network ftm-main-fork - brownie test tests/test_loss.py --network ftm-main-fork - brownie test tests/test_joint_migration2.py --network ftm-main-fork + - name: Run Tests + env: + ETHERSCAN_TOKEN: MW5CQA6QK5YMJXP2WP3RA36HM5A7RA1IHA + WEB3_INFURA_PROJECT_ID: b7821200399e4be2b4e5dbdf06fbe85b + run: | + brownie test tests/test_migration.py --network ftm-main-fork + brownie test tests/test_operation.py --network ftm-main-fork + brownie test tests/test_loss.py --network ftm-main-fork + brownie test tests/test_joint_migration2.py --network ftm-main-fork diff --git a/.gitignore b/.gitignore index 0a6ddfe..ed8d80e 100644 --- a/.gitignore +++ b/.gitignore @@ -12,3 +12,10 @@ node_modules/ # Hardhat cache + +scripts/live_tc.py +scripts/find_pid.py +bin/ +lib/ +flattened* +pyvenv* \ No newline at end of file diff --git a/README.md b/README.md index 775d13f..bb9c670 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,6 @@ Read more at https://hackmd.io/rbPUCp47Sl2dSht6VTaiLg?both - ## What you'll find here - Basic Solidity Smart Contract for creating your own Yearn Strategy ([`contracts/Strategy.sol`](contracts/Strategy.sol)) @@ -96,14 +95,14 @@ Transaction sent: 0xa70b90eb9a9899e8f6e709c53a436976315b4279c4b6797d0a293e169f94 [`contracts/Strategy.sol`](contracts/Strategy.sol) is where you implement your own logic for your strategy. In particular: -* Create a descriptive name for your strategy via `Strategy.name()`. -* Invest your want tokens via `Strategy.adjustPosition()`. -* Take profits and report losses via `Strategy.prepareReturn()`. -* Unwind enough of your position to payback withdrawals via `Strategy.liquidatePosition()`. -* Unwind all of your positions via `Strategy.exitPosition()`. -* Fill in a way to estimate the total `want` tokens managed by the strategy via `Strategy.estimatedTotalAssets()`. -* Migrate all the positions managed by your strategy via `Strategy.prepareMigration()`. -* Make a list of all position tokens that should be protected against movements via `Strategy.protectedTokens()`. +- Create a descriptive name for your strategy via `Strategy.name()`. +- Invest your want tokens via `Strategy.adjustPosition()`. +- Take profits and report losses via `Strategy.prepareReturn()`. +- Unwind enough of your position to payback withdrawals via `Strategy.liquidatePosition()`. +- Unwind all of your positions via `Strategy.exitPosition()`. +- Fill in a way to estimate the total `want` tokens managed by the strategy via `Strategy.estimatedTotalAssets()`. +- Migrate all the positions managed by your strategy via `Strategy.prepareMigration()`. +- Make a list of all position tokens that should be protected against movements via `Strategy.protectedTokens()`. ## Testing diff --git a/brownie-config.yml b/brownie-config.yml index 3498b73..f2e1766 100644 --- a/brownie-config.yml +++ b/brownie-config.yml @@ -8,16 +8,18 @@ autofetch_sources: True # require OpenZepplin Contracts dependencies: - - iearn-finance/yearn-vaults@0.4.3 - - OpenZeppelin/openzeppelin-contracts@3.1.0 + - storming0x/yearn-vaults@0.4.3-sol8 + - OpenZeppelin/openzeppelin-contracts@4.4.1 + - 16slim/v3-core@1.0.2-solc-0.8-simulate # path remapping to support imports from GitHub/NPM compiler: solc: - version: 0.6.12 + version: 0.8.12 remappings: - - "@yearnvaults=iearn-finance/yearn-vaults@0.4.3" - - "@openzeppelin=OpenZeppelin/openzeppelin-contracts@3.1.0" + - "@yearnvaults=storming0x/yearn-vaults@0.4.3-sol8" + - "@openzeppelin=OpenZeppelin/openzeppelin-contracts@4.4.1" + - "@uniswap=16slim/v3-core@1.0.2-solc-0.8-simulate" reports: exclude_contracts: diff --git a/commitlint.config.js b/commitlint.config.js index e2b5db2..5073c20 100644 --- a/commitlint.config.js +++ b/commitlint.config.js @@ -1 +1 @@ -module.exports = {extends: ["@commitlint/config-conventional"]}; +module.exports = { extends: ["@commitlint/config-conventional"] }; diff --git a/contracts/AggregatorMock.sol b/contracts/AggregatorMock.sol index dd6ca34..8579237 100644 --- a/contracts/AggregatorMock.sol +++ b/contracts/AggregatorMock.sol @@ -1,4 +1,4 @@ -pragma solidity 0.6.12; +pragma solidity 0.8.12; contract AggregatorMock { int256 public price; diff --git a/contracts/DEXes/SolidexJoint.sol b/contracts/DEXes/SolidexJoint.sol deleted file mode 100644 index 26b3ecb..0000000 --- a/contracts/DEXes/SolidexJoint.sol +++ /dev/null @@ -1,473 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0 -pragma solidity 0.6.12; -pragma experimental ABIEncoderV2; - -import "../ySwapper.sol"; -import "../Hedges/NoHedgeJoint.sol"; -import "../../interfaces/ISolidex.sol"; -import "../../interfaces/ISolidRouter.sol"; - -interface ISolidlyPair is IUniswapV2Pair { - function getAmountOut(uint256 amountIn, address tokenIn) - external - view - returns (uint256); -} - -contract SolidexJoint is NoHedgeJoint { - ISolidex public solidex; - bool public stable; - bool public dontWithdraw; - - bool public isOriginal = true; - - address public constant SEX = 0xD31Fcd1f7Ba190dBc75354046F6024A9b86014d7; - address public constant SOLID_SEX = - 0x888EF71766ca594DED1F0FA3AE64eD2941740A20; - - constructor( - address _providerA, - address _providerB, - address _router, - address _weth, - address _reward, - address _solidex, - bool _stable - ) public NoHedgeJoint(_providerA, _providerB, _router, _weth, _reward) { - _initalizeSolidexJoint(_solidex, _stable); - } - - function initialize( - address _providerA, - address _providerB, - address _router, - address _weth, - address _reward, - address _solidex, - bool _stable - ) external { - _initialize(_providerA, _providerB, _router, _weth, _reward); - _initalizeSolidexJoint(_solidex, _stable); - } - - function _initalizeSolidexJoint(address _solidex, bool _stable) internal { - solidex = ISolidex(_solidex); - stable = _stable; - pair = IUniswapV2Pair(getPair()); - IERC20(address(pair)).approve(_solidex, type(uint256).max); - IERC20(address(pair)).approve(address(router), type(uint256).max); - } - - event Cloned(address indexed clone); - - function cloneSolidexJoint( - address _providerA, - address _providerB, - address _router, - address _weth, - address _reward, - address _solidex, - bool _stable - ) external returns (address newJoint) { - require(isOriginal, "!original"); - bytes20 addressBytes = bytes20(address(this)); - - assembly { - // EIP-1167 bytecode - let clone_code := mload(0x40) - mstore( - clone_code, - 0x3d602d80600a3d3981f3363d3d373d3d3d363d73000000000000000000000000 - ) - mstore(add(clone_code, 0x14), addressBytes) - mstore( - add(clone_code, 0x28), - 0x5af43d82803e903d91602b57fd5bf30000000000000000000000000000000000 - ) - newJoint := create(0, clone_code, 0x37) - } - - SolidexJoint(newJoint).initialize( - _providerA, - _providerB, - _router, - _weth, - _reward, - _solidex, - _stable - ); - - emit Cloned(newJoint); - } - - function name() external view override returns (string memory) { - string memory ab = - string( - abi.encodePacked( - IERC20Extended(address(tokenA)).symbol(), - "-", - IERC20Extended(address(tokenB)).symbol() - ) - ); - - return string(abi.encodePacked("NoHedgeSolidexJoint(", ab, ")")); - } - - function balanceOfStake() public view override returns (uint256) { - return solidex.userBalances(address(this), address(pair)); - } - - function pendingReward() public view override returns (uint256) { - address[] memory pairs = new address[](1); - pairs[0] = address(pair); - ISolidex.Amounts[] memory pendings = - solidex.pendingRewards(address(this), pairs); - - uint256 pendingSEX = pendings[0].sex; - uint256 pendingSOLID = pendings[0].solid; - - ISolidRouter.route[] memory path = getTokenOutPathSolid(SEX, SOLID_SEX); - pendingSOLID = pendingSOLID.add( - ISolidRouter(router).getAmountsOut(pendingSEX, path)[1] - ); - - return pendingSOLID; - } - - function getReward() internal override { - address[] memory pairs = new address[](1); - pairs[0] = address(pair); - solidex.getReward(pairs); - } - - function setDontWithdraw(bool _dontWithdraw) external onlyVaultManagers { - dontWithdraw = _dontWithdraw; - } - - function depositLP() internal override { - if (balanceOfPair() > 0) { - solidex.deposit(address(pair), balanceOfPair()); - } - } - - function withdrawLP() internal override { - uint256 stakeBalance = balanceOfStake(); - if (stakeBalance > 0 && !dontWithdraw) { - getReward(); - solidex.withdraw(address(pair), stakeBalance); - } - } - - function claimRewardManually() external onlyVaultManagers { - getReward(); - } - - function withdrawLPManually(uint256 amount) external onlyVaultManagers { - solidex.withdraw(address(pair), amount); - } - - // OVERRIDE to incorporate stableswap or volatileswap - function createLP() - internal - override - returns ( - uint256, - uint256, - uint256 - ) - { - // **WARNING**: This call is sandwichable, care should be taken - // to always execute with a private relay - return - ISolidRouter(router).addLiquidity( - tokenA, - tokenB, - stable, - balanceOfA() - .mul(RATIO_PRECISION.sub(getHedgeBudget(tokenA))) - .div(RATIO_PRECISION), - balanceOfB() - .mul(RATIO_PRECISION.sub(getHedgeBudget(tokenB))) - .div(RATIO_PRECISION), - 0, - 0, - address(this), - now - ); - } - - function _closePosition() internal override returns (uint256, uint256) { - // Unstake LP from staking contract - withdrawLP(); - - // Close the hedge - closeHedge(); - - if (balanceOfPair() == 0) { - return (0, 0); - } - - // **WARNING**: This call is sandwichable, care should be taken - // to always execute with a private relay - ISolidRouter(router).removeLiquidity( - tokenA, - tokenB, - stable, - balanceOfPair(), - 0, - 0, - address(this), - now - ); - - return (balanceOfA(), balanceOfB()); - } - - function removeLiquidityManually( - uint256 amount, - uint256 expectedBalanceA, - uint256 expectedBalanceB - ) external override onlyVaultManagers { - ISolidRouter(router).removeLiquidity( - tokenA, - tokenB, - stable, - amount, - 0, - 0, - address(this), - now - ); - require(expectedBalanceA <= balanceOfA(), "!sandwidched"); - require(expectedBalanceB <= balanceOfB(), "!sandwidched"); - } - - function sellCapital( - address _tokenFrom, - address _tokenTo, - uint256 _amountIn - ) internal override returns (uint256 _amountOut) { - uint256[] memory amounts = - ISolidRouter(router).swapExactTokensForTokens( - _amountIn, - 0, - getTokenOutPathSolid(_tokenFrom, _tokenTo), - address(this), - now - ); - _amountOut = amounts[amounts.length - 1]; - } - - function getTokenOutPathSolid(address _token_in, address _token_out) - internal - view - returns (ISolidRouter.route[] memory _routes) - { - address[] memory _path; - bool is_weth = - _token_in == address(WETH) || _token_out == address(WETH); - bool is_internal = - (_token_in == tokenA && _token_out == tokenB) || - (_token_in == tokenB && _token_out == tokenA); - _path = new address[](is_weth || is_internal ? 2 : 3); - _path[0] = _token_in; - if (is_weth || is_internal) { - _path[1] = _token_out; - } else { - _path[1] = address(WETH); - _path[2] = _token_out; - } - - uint256 pathLength = _path.length > 1 ? _path.length - 1 : 1; - _routes = new ISolidRouter.route[](pathLength); - for (uint256 i = 0; i < pathLength; i++) { - bool isStable = is_internal ? stable : false; - _routes[i] = ISolidRouter.route(_path[i], _path[i + 1], isStable); - } - } - - function swapReward(uint256 _rewardBal) - internal - override - returns (address, uint256) - { - // WARNING: NOT SELLING REWARDS! !!! - if (reward == tokenA || reward == tokenB || _rewardBal == 0) { - return (reward, 0); - } - - if (tokenA == WETH || tokenB == WETH) { - return (WETH, 0); - } - - // Assume that position has already been liquidated - (uint256 ratioA, uint256 ratioB) = - getRatios(balanceOfA(), balanceOfB(), investedA, investedB); - if (ratioA >= ratioB) { - return (tokenB, 0); - } - return (tokenA, 0); - } - - function getPair() internal view override returns (address) { - address factory = ISolidRouter(router).factory(); - return ISolidFactory(factory).getPair(tokenA, tokenB, stable); - } - - function estimatedTotalAssetsAfterBalance() - public - view - override - returns (uint256 _aBalance, uint256 _bBalance) - { - uint256 rewardsPending = pendingReward().add(balanceOfReward()); - - (_aBalance, _bBalance) = balanceOfTokensInLP(); - - _aBalance = _aBalance.add(balanceOfA()); - _bBalance = _bBalance.add(balanceOfB()); - - (uint256 callProfit, uint256 putProfit) = getHedgeProfit(); - _aBalance = _aBalance.add(callProfit); - _bBalance = _bBalance.add(putProfit); - - if (reward == tokenA) { - _aBalance = _aBalance.add(rewardsPending); - } else if (reward == tokenB) { - _bBalance = _bBalance.add(rewardsPending); - } else if (rewardsPending != 0) { - address swapTo = findSwapTo(reward); - uint256[] memory outAmounts = - ISolidRouter(router).getAmountsOut( - rewardsPending, - getTokenOutPathSolid(reward, swapTo) - ); - if (swapTo == tokenA) { - _aBalance = _aBalance.add(outAmounts[outAmounts.length - 1]); - } else if (swapTo == tokenB) { - _bBalance = _bBalance.add(outAmounts[outAmounts.length - 1]); - } - } - - (address sellToken, uint256 sellAmount) = - calculateSellToBalance(_aBalance, _bBalance, investedA, investedB); - - (uint256 reserveA, uint256 reserveB) = getReserves(); - - if (sellToken == tokenA) { - uint256 buyAmount = - ISolidlyPair(address(pair)).getAmountOut(sellAmount, sellToken); - _aBalance = _aBalance.sub(sellAmount); - _bBalance = _bBalance.add(buyAmount); - } else if (sellToken == tokenB) { - uint256 buyAmount = - ISolidlyPair(address(pair)).getAmountOut(sellAmount, sellToken); - _bBalance = _bBalance.sub(sellAmount); - _aBalance = _aBalance.add(buyAmount); - } - } - - function calculateSellToBalance( - uint256 currentA, - uint256 currentB, - uint256 startingA, - uint256 startingB - ) internal view override returns (address _sellToken, uint256 _sellAmount) { - if (startingA == 0 || startingB == 0) return (address(0), 0); - - (uint256 ratioA, uint256 ratioB) = - getRatios(currentA, currentB, startingA, startingB); - - if (ratioA == ratioB) return (address(0), 0); - - (uint256 reserveA, uint256 reserveB) = getReserves(); - - if (ratioA > ratioB) { - _sellToken = tokenA; - _sellAmount = _calculateSellToBalance( - _sellToken, - currentA, - currentB, - startingA, - startingB, - 10**uint256(IERC20Extended(tokenA).decimals()) - ); - } else { - _sellToken = tokenB; - _sellAmount = _calculateSellToBalance( - _sellToken, - currentB, - currentA, - startingB, - startingA, - 10**uint256(IERC20Extended(tokenB).decimals()) - ); - } - } - - function _calculateSellToBalance( - address sellToken, - uint256 current0, - uint256 current1, - uint256 starting0, - uint256 starting1, - uint256 precision - ) internal view returns (uint256 _sellAmount) { - uint256 numerator = - current0.sub(starting0.mul(current1).div(starting1)).mul(precision); - uint256 exchangeRate = - ISolidlyPair(address(pair)).getAmountOut(precision, sellToken); - - // First time to approximate - _sellAmount = numerator.div( - precision + starting0.mul(exchangeRate).div(starting1) - ); - // Shortcut to avoid Uniswap amountIn == 0 revert - if (_sellAmount == 0) { - return 0; - } - - // Second time to account for price impact - exchangeRate = ISolidlyPair(address(pair)) - .getAmountOut(_sellAmount, sellToken) - .mul(precision) - .div(_sellAmount); - _sellAmount = numerator.div( - precision + starting0.mul(exchangeRate).div(starting1) - ); - } - - function getYSwapTokens() - internal - view - override - returns (address[] memory, address[] memory) - { - address[] memory tokens = new address[](2); - address[] memory toTokens = new address[](2); - - tokens[0] = SEX; - toTokens[0] = address(tokenA); // swap to tokenA - - tokens[1] = SOLID_SEX; - toTokens[1] = address(tokenA); // swap to tokenA - - return (tokens, toTokens); - } - - function removeTradeFactoryPermissions() - external - override - onlyVaultManagers - { - _removeTradeFactory(); - } - - function updateTradeFactoryPermissions(address _newTradeFactory) - external - override - onlyGovernance - { - _updateTradeFactory(_newTradeFactory); - } -} diff --git a/contracts/DEXes/SpiritJoint.sol b/contracts/DEXes/SpiritJoint.sol deleted file mode 100644 index f963ea6..0000000 --- a/contracts/DEXes/SpiritJoint.sol +++ /dev/null @@ -1,160 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0 -pragma solidity 0.6.12; -pragma experimental ABIEncoderV2; - -import "../Hedges/HedgilJoint.sol"; - -interface ISpiritMasterchef is IMasterchef { - function pendingSpirit(uint256 _pid, address _user) - external - view - returns (uint256); -} - -contract SpiritJoint is HedgilJoint { - uint256 public pid; - - IMasterchef public masterchef; - bool public dontWithdraw; - - bool public isOriginal = true; - - constructor( - address _providerA, - address _providerB, - address _router, - address _weth, - address _reward, - address _hedgilPool, - address _masterchef, - uint256 _pid - ) - public - HedgilJoint( - _providerA, - _providerB, - _router, - _weth, - _reward, - _hedgilPool - ) - { - _initalizeSpiritJoint(_masterchef, _pid); - } - - function initialize( - address _providerA, - address _providerB, - address _router, - address _weth, - address _reward, - address _hedgilPool, - address _masterchef, - uint256 _pid - ) external { - _initialize(_providerA, _providerB, _router, _weth, _reward); - _initializeHedgilJoint(_hedgilPool); - _initalizeSpiritJoint(_masterchef, _pid); - } - - function _initalizeSpiritJoint(address _masterchef, uint256 _pid) internal { - masterchef = IMasterchef(_masterchef); - pid = _pid; - - IERC20(address(pair)).approve(_masterchef, type(uint256).max); - } - - event Cloned(address indexed clone); - - function cloneSpiritJoint( - address _providerA, - address _providerB, - address _router, - address _weth, - address _reward, - address _hedgilPool, - address _masterchef, - uint256 _pid - ) external returns (address newJoint) { - require(isOriginal, "!original"); - bytes20 addressBytes = bytes20(address(this)); - - assembly { - // EIP-1167 bytecode - let clone_code := mload(0x40) - mstore( - clone_code, - 0x3d602d80600a3d3981f3363d3d373d3d3d363d73000000000000000000000000 - ) - mstore(add(clone_code, 0x14), addressBytes) - mstore( - add(clone_code, 0x28), - 0x5af43d82803e903d91602b57fd5bf30000000000000000000000000000000000 - ) - newJoint := create(0, clone_code, 0x37) - } - - SpiritJoint(newJoint).initialize( - _providerA, - _providerB, - _router, - _weth, - _reward, - _hedgilPool, - _masterchef, - _pid - ); - - emit Cloned(newJoint); - } - - function name() external view override returns (string memory) { - string memory ab = - string( - abi.encodePacked( - IERC20Extended(address(tokenA)).symbol(), - "-", - IERC20Extended(address(tokenB)).symbol() - ) - ); - - return string(abi.encodePacked("HedgilSpiritJoint(", ab, ")")); - } - - function balanceOfStake() public view override returns (uint256) { - return masterchef.userInfo(pid, address(this)).amount; - } - - function pendingReward() public view override returns (uint256) { - return - ISpiritMasterchef(address(masterchef)).pendingSpirit( - pid, - address(this) - ); - } - - function getReward() internal override { - masterchef.deposit(pid, 0); - } - - function setDontWithdraw(bool _dontWithdraw) external onlyVaultManagers { - dontWithdraw = _dontWithdraw; - } - - function depositLP() internal override { - if (balanceOfPair() > 0) { - masterchef.deposit(pid, balanceOfPair()); - } - } - - function withdrawLP() internal override { - uint256 stakeBalance = balanceOfStake(); - if (stakeBalance > 0 && !dontWithdraw) { - masterchef.withdraw(pid, stakeBalance); - } - } - - function withdrawLPManually(uint256 amount) external onlyVaultManagers { - masterchef.withdraw(pid, amount); - } -} diff --git a/contracts/DEXes/SpookyJoint.sol b/contracts/DEXes/SpookyJoint.sol deleted file mode 100644 index d9917bb..0000000 --- a/contracts/DEXes/SpookyJoint.sol +++ /dev/null @@ -1,164 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0 -pragma solidity 0.6.12; -pragma experimental ABIEncoderV2; - -import "../Hedges/HedgilV2Joint.sol"; - -interface ISpookyMasterchef is IMasterchef { - function pendingBOO(uint256 _pid, address _user) - external - view - returns (uint256); -} - -contract SpookyJoint is HedgilV2Joint { - uint256 public pid; - - IMasterchef public masterchef; - bool public dontWithdraw; - - bool public isOriginal = true; - - constructor( - address _providerA, - address _providerB, - address _router, - address _weth, - address _reward, - address _hedgilPool, - address _masterchef, - uint256 _pid - ) - public - HedgilV2Joint( - _providerA, - _providerB, - _router, - _weth, - _reward, - _hedgilPool - ) - { - _initalizeSpookyJoint(_masterchef, _pid); - } - - function initialize( - address _providerA, - address _providerB, - address _router, - address _weth, - address _reward, - address _hedgilPool, - address _masterchef, - uint256 _pid - ) external { - _initialize(_providerA, _providerB, _router, _weth, _reward); - _initializeHedgilJoint(_hedgilPool); - _initalizeSpookyJoint(_masterchef, _pid); - } - - function _initalizeSpookyJoint(address _masterchef, uint256 _pid) internal { - masterchef = IMasterchef(_masterchef); - pid = _pid; - - IERC20(address(pair)).approve(_masterchef, type(uint256).max); - } - - event Cloned(address indexed clone); - - function cloneSpookyJoint( - address _providerA, - address _providerB, - address _router, - address _weth, - address _reward, - address _hedgilPool, - address _masterchef, - uint256 _pid - ) external returns (address newJoint) { - require(isOriginal, "!original"); - bytes20 addressBytes = bytes20(address(this)); - - assembly { - // EIP-1167 bytecode - let clone_code := mload(0x40) - mstore( - clone_code, - 0x3d602d80600a3d3981f3363d3d373d3d3d363d73000000000000000000000000 - ) - mstore(add(clone_code, 0x14), addressBytes) - mstore( - add(clone_code, 0x28), - 0x5af43d82803e903d91602b57fd5bf30000000000000000000000000000000000 - ) - newJoint := create(0, clone_code, 0x37) - } - - SpookyJoint(newJoint).initialize( - _providerA, - _providerB, - _router, - _weth, - _reward, - _hedgilPool, - _masterchef, - _pid - ); - - emit Cloned(newJoint); - } - - function name() external view override returns (string memory) { - string memory ab = - string( - abi.encodePacked( - IERC20Extended(address(tokenA)).symbol(), - "-", - IERC20Extended(address(tokenB)).symbol() - ) - ); - - return string(abi.encodePacked("HedgilSpookyJoint(", ab, ")")); - } - - function balanceOfStake() public view override returns (uint256) { - return masterchef.userInfo(pid, address(this)).amount; - } - - function pendingReward() public view override returns (uint256) { - return - ISpookyMasterchef(address(masterchef)).pendingBOO( - pid, - address(this) - ); - } - - function getReward() internal override { - masterchef.deposit(pid, 0); - } - - function setDontWithdraw(bool _dontWithdraw) external onlyVaultManagers { - dontWithdraw = _dontWithdraw; - } - - function depositLP() internal override { - if (balanceOfPair() > 0) { - masterchef.deposit(pid, balanceOfPair()); - } - } - - function withdrawLP() internal override { - uint256 stakeBalance = balanceOfStake(); - if (stakeBalance > 0 && !dontWithdraw) { - masterchef.withdraw(pid, stakeBalance); - } - } - - function withdrawLPManually(uint256 amount) external onlyVaultManagers { - masterchef.withdraw(pid, amount); - } - - function claimRewardManually() external onlyVaultManagers { - getReward(); - } -} diff --git a/contracts/DEXes/SushiJoint.sol b/contracts/DEXes/SushiJoint.sol deleted file mode 100644 index ef58011..0000000 --- a/contracts/DEXes/SushiJoint.sol +++ /dev/null @@ -1,165 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0 -pragma solidity 0.6.12; -pragma experimental ABIEncoderV2; - -import "../Hedges/HegicJoint.sol"; - -interface ISushiMasterchef is IMasterchef { - function pendingSushi(uint256 _pid, address _user) - external - view - returns (uint256); -} - -contract SushiJoint is HegicJoint { - uint256 public pid; - - IMasterchef public masterchef; - bool public dontWithdraw; - - bool public isOriginal = true; - - constructor( - address _providerA, - address _providerB, - address _router, - address _weth, - address _reward, - address _hegicCallOptionsPool, - address _hegicPutOptionsPool, - address _masterchef, - uint256 _pid - ) - public - HegicJoint( - _providerA, - _providerB, - _router, - _weth, - _reward, - _hegicCallOptionsPool, - _hegicPutOptionsPool - ) - { - _initalizeSushiJoint(_masterchef, _pid); - } - - function initialize( - address _providerA, - address _providerB, - address _router, - address _weth, - address _reward, - address _hegicCallOptionsPool, - address _hegicPutOptionsPool, - address _masterchef, - uint256 _pid - ) external { - _initialize(_providerA, _providerB, _router, _weth, _reward); - _initializeHegicJoint(_hegicCallOptionsPool, _hegicPutOptionsPool); - _initalizeSushiJoint(_masterchef, _pid); - } - - function _initalizeSushiJoint(address _masterchef, uint256 _pid) internal { - masterchef = IMasterchef(_masterchef); - pid = _pid; - - IERC20(address(pair)).approve(_masterchef, type(uint256).max); - } - - event Cloned(address indexed clone); - - function cloneSushiJoint( - address _providerA, - address _providerB, - address _router, - address _weth, - address _reward, - address _hegicCallOptionsPool, - address _hegicPutOptionsPool, - address _masterchef, - uint256 _pid - ) external returns (address newJoint) { - require(isOriginal, "!original"); - bytes20 addressBytes = bytes20(address(this)); - - assembly { - // EIP-1167 bytecode - let clone_code := mload(0x40) - mstore( - clone_code, - 0x3d602d80600a3d3981f3363d3d373d3d3d363d73000000000000000000000000 - ) - mstore(add(clone_code, 0x14), addressBytes) - mstore( - add(clone_code, 0x28), - 0x5af43d82803e903d91602b57fd5bf30000000000000000000000000000000000 - ) - newJoint := create(0, clone_code, 0x37) - } - - SushiJoint(newJoint).initialize( - _providerA, - _providerB, - _router, - _weth, - _reward, - _hegicCallOptionsPool, - _hegicPutOptionsPool, - _masterchef, - _pid - ); - - emit Cloned(newJoint); - } - - function name() external view override returns (string memory) { - string memory ab = - string( - abi.encodePacked( - IERC20Extended(address(tokenA)).symbol(), - "-", - IERC20Extended(address(tokenB)).symbol() - ) - ); - - return string(abi.encodePacked("HegicSushiJoint(", ab, ")")); - } - - function balanceOfStake() public view override returns (uint256) { - return masterchef.userInfo(pid, address(this)).amount; - } - - function pendingReward() public view override returns (uint256) { - return - ISushiMasterchef(address(masterchef)).pendingSushi( - pid, - address(this) - ); - } - - function getReward() internal override { - masterchef.deposit(pid, 0); - } - - function setDontWithdraw(bool _dontWithdraw) external onlyVaultManagers { - dontWithdraw = _dontWithdraw; - } - - function depositLP() internal override { - if (balanceOfPair() > 0) { - masterchef.deposit(pid, balanceOfPair()); - } - } - - function withdrawLP() internal override { - uint256 stakeBalance = balanceOfStake(); - if (stakeBalance > 0 && !dontWithdraw) { - masterchef.withdraw(pid, stakeBalance); - } - } - - function withdrawLPManually(uint256 amount) external onlyVaultManagers { - masterchef.withdraw(pid, amount); - } -} diff --git a/contracts/DEXes/UniV3StablesJoint.sol b/contracts/DEXes/UniV3StablesJoint.sol new file mode 100644 index 0000000..bf8500d --- /dev/null +++ b/contracts/DEXes/UniV3StablesJoint.sol @@ -0,0 +1,801 @@ +// SPDX-License-Identifier: AGPL-3.0 +pragma solidity 0.8.12; +pragma experimental ABIEncoderV2; + +// Import necessary libraries and interfaces: +// NoHedgeJoint to inherit from +import "../Hedges/NoHedgeJoint.sol"; +// Uni V3 pool functionality +import {IUniswapV3Pool} from "@uniswap/contracts/interfaces/IUniswapV3Pool.sol"; +// CRV pool functionalities for swaps and quotes +import {ICRVPool} from "../../interfaces/CRV/ICRVPool.sol"; +// Helper functions from Uni v3 +import {UniswapHelperViews} from "../libraries/UniswapHelperViews.sol"; +// Liquidity calculations +import {LiquidityAmounts} from "../libraries/LiquidityAmounts.sol"; +// Pool tick calculations +import {TickMath} from "../libraries/TickMath.sol"; +// Safe casting and math +import {SafeCast} from "../libraries/SafeCast.sol"; +import {FullMath} from "../libraries/FullMath.sol"; +import {FixedPoint128} from "../libraries/FixedPoint128.sol"; + +interface IBaseFee { + function isCurrentBaseFeeAcceptable() external view returns (bool); +} + +contract UniV3StablesJoint is NoHedgeJoint { + using SafeERC20 for IERC20; + using SafeCast for uint256; + using SafeCast for int256; + + // Used for cloning, will automatically be set to false for other clones + bool public isOriginal = true; + // lower tick of the current LP position + int24 public minTick; + // upper tick of the current LP position + int24 public maxTick; + // # of ticks to go up&down from current price to open LP position + uint24 public ticksFromCurrent; + // fee tier of the pool + uint24 public feeTier; + // boolean variable deciding wether to swap in the uni v3 pool or using CRV + // this can make sense if the pool is unbalanced and price is far from CRV or if the + // liquidity remaining in the pool is not enough for the rebalancing swap the strategy needs + // to perform as the swap function from the uniV3 pool uses a while loop that would get stuck + // until we reach gas limit + bool public useCRVPool; + // CRV pool to use in case of useCRVPool = true + address public crvPool; + + /// @dev The minimum value that can be returned from #getSqrtRatioAtTick. Equivalent to getSqrtRatioAtTick(MIN_TICK) + uint160 internal constant MIN_SQRT_RATIO = 4295128739; + /// @dev The maximum value that can be returned from #getSqrtRatioAtTick. Equivalent to getSqrtRatioAtTick(MAX_TICK) + uint160 internal constant MAX_SQRT_RATIO = + 1461446703485210103287273052203988822378723970342; + + /* + * @notice + * Constructor, only called during original deploy + * @param _providerA, provider strategy of tokenA + * @param _providerB, provider strategy of tokenB + * @param _referenceToken, token to use as reference, for pricing oracles and paying hedging costs (if any) + * @param _pool, Uni V3 pool to LP + * @param _ticksFromCurrent, # of ticks up & down to provide liquidity into + */ + constructor( + address _providerA, + address _providerB, + address _referenceToken, + address _pool, + uint24 _ticksFromCurrent + ) NoHedgeJoint(_providerA, _providerB, _referenceToken, _pool) { + _initializeUniV3StablesJoint(_ticksFromCurrent); + } + + /* + * @notice + * Constructor equivalent for clones, initializing the joint and the specifics of UniV3StablesJoint + * @param _providerA, provider strategy of tokenA + * @param _providerB, provider strategy of tokenB + * @param _referenceToken, token to use as reference, for pricing oracles and paying hedging costs (if any) + * @param _pool, Uni V3 pool to LP + * @param _ticksFromCurrent, # of ticks up & down to provide liquidity into + */ + function initialize( + address _providerA, + address _providerB, + address _referenceToken, + address _pool, + uint24 _ticksFromCurrent + ) external { + _initialize(_providerA, _providerB, _referenceToken, _pool); + _initializeUniV3StablesJoint(_ticksFromCurrent); + } + + /* + * @notice + * Initialize UniV3StablesJoint specifics + * @param _ticksFromCurrent, # of ticks up & down to provide liquidity into + */ + function _initializeUniV3StablesJoint(uint24 _ticksFromCurrent) internal { + ticksFromCurrent = _ticksFromCurrent; + // The reward tokens are the tokens provided to the pool + rewardTokens = new address[](2); + rewardTokens[0] = tokenA; + rewardTokens[1] = tokenB; + // by default use uni pool to swap as it has lower fees + useCRVPool = false; + // Initialize CRV pool to 3pool + crvPool = address(0xbEbc44782C7dB0a1A60Cb6fe97d0b483032FF1C7); + // Set up the fee tier + feeTier = IUniswapV3Pool(pool).fee(); + } + + event Cloned(address indexed clone); + + /* + * @notice + * Cloning function to migrate/ deploy to other pools + * @param _providerA, provider strategy of tokenA + * @param _providerB, provider strategy of tokenB + * @param _referenceToken, token to use as reference, for pricing oracles and paying hedging costs (if any) + * @param _pool, Uni V3 pool to LP + * @param _ticksFromCurrent, # of ticks up & down to provide liquidity into + * @return newJoint, address of newly deployed joint + */ + function cloneUniV3StablesJoint( + address _providerA, + address _providerB, + address _referenceToken, + address _pool, + uint24 _ticksFromCurrent + ) external returns (address newJoint) { + require(isOriginal, "!original"); + bytes20 addressBytes = bytes20(address(this)); + + assembly { + // EIP-1167 bytecode + let clone_code := mload(0x40) + mstore( + clone_code, + 0x3d602d80600a3d3981f3363d3d373d3d3d363d73000000000000000000000000 + ) + mstore(add(clone_code, 0x14), addressBytes) + mstore( + add(clone_code, 0x28), + 0x5af43d82803e903d91602b57fd5bf30000000000000000000000000000000000 + ) + newJoint := create(0, clone_code, 0x37) + } + + UniV3StablesJoint(newJoint).initialize( + _providerA, + _providerB, + _referenceToken, + _pool, + _ticksFromCurrent + ); + + emit Cloned(newJoint); + } + + /* + * @notice + * Function returning the name of the joint in the format "NoHedgeUniV3StablesJoint(USDC-DAI)" + * @return name of the strategy + */ + function name() external view override returns (string memory) { + string memory ab = string( + abi.encodePacked( + IERC20Extended(address(tokenA)).symbol(), + "-", + IERC20Extended(address(tokenB)).symbol() + ) + ); + + return string(abi.encodePacked("NoHedgeUniV3StablesJoint(", ab, ")")); + } + + /* + * @notice + * Function returning the liquidity amount of the LP position + * @return liquidity from positionInfo + */ + function balanceOfPool() public view override returns (uint256 liquidity) { + (liquidity,,,,) = _positionInfo(); + } + + /* + * @notice + * Function available for vault managers to set the boolean value deciding wether + * to use the uni v3 pool for swaps or a CRV pool + * @param newUseCRVPool, new boolean value to use + */ + function setUseCRVPool(bool _useCRVPool) external onlyVaultManagers { + useCRVPool = _useCRVPool; + } + + /* + * @notice + * Function available for vault managers to set the Uni v3 pool to invest into + * @param pool, new pool value to use + */ + function setUniPool(address _pool, uint24 _feeTier) external onlyVaultManagers { + require(investedA == 0 && investedB == 0 && UniswapHelperViews.checkExistingPool(tokenA, tokenB, _feeTier, _pool)); + pool = _pool; + feeTier = _feeTier; + } + + /* + * @notice + * Function available for vault managers to set the number of ticks on each side of + * current tick to provide liquidity to + * @param newTicksFromCurrent, new value to use + */ + function setTicksFromCurrent(uint24 _ticksFromCurrent) external onlyVaultManagers { + ticksFromCurrent = _ticksFromCurrent; + } + + /* + * @notice + * Function available for vault managers to set min & max values of the position. If, + * for any reason the ticks are not the value they should be, we always have the option + * to re-set them back to the necessary value using the force parameter + * @param _minTick, lower limit of position + * @param _minTick, lower limit of position + * @param forceChange, force parameter to ensure this function is not called randomly + */ + function setTicksManually(int24 _minTick, int24 _maxTick, bool forceChange) external onlyVaultManagers { + if ((investedA > 0 || investedB > 0) && !forceChange) { + revert(); + } + minTick = _minTick; + maxTick = _maxTick; + } + + /* + * @notice + * Function returning the current balance of each token in the LP position taking + * the new level of reserves into account + * @return _balanceA, balance of tokenA in the LP position + * @return _balanceB, balance of tokenB in the LP position + */ + function balanceOfTokensInLP() + public + view + override + returns (uint256 _balanceA, uint256 _balanceB) + { + // Get the current pool status + (uint160 sqrtPriceX96,,,,,,) = IUniswapV3Pool(pool).slot0(); + // Get the current position status + (uint128 liquidity,,,,) = _positionInfo(); + + // Use Uniswap libraries to calculate the token0 and token1 balances for the + // provided ticks and liquidity amount + (uint256 amount0, uint256 amount1) = LiquidityAmounts + .getAmountsForLiquidity( + sqrtPriceX96, + TickMath.getSqrtRatioAtTick(minTick), + TickMath.getSqrtRatioAtTick(maxTick), + liquidity + ); + // uniswap orders token0 and token1 based on alphabetical order + return tokenA < tokenB ? (amount0, amount1) : (amount1, amount0); + } + + /* + * @notice + * Function returning the amount of rewards earned until now - unclaimed + * @return uint256 array of tokenA and tokenB earned as rewards + */ + function pendingRewards() public view override returns (uint256[] memory) { + // Initialize the array to same length as reward tokens + uint256[] memory _amountPending = new uint256[](rewardTokens.length); + + // Get LP position info + (uint128 liquidity, + uint256 feeGrowthInside0LastX128, + uint256 feeGrowthInside1LastX128, + uint128 tokensOwed0, + uint128 tokensOwed1) = _positionInfo(); + + // Initialize to the current status of owed tokens + (_amountPending[0], _amountPending[1]) = tokenA < tokenB + ? (tokensOwed0, tokensOwed1) + : (tokensOwed1, tokensOwed0); + + // Gas savings + IUniswapV3Pool _pool = IUniswapV3Pool(pool); + int24 _minTick = minTick; + int24 _maxTick = maxTick; + + // Use Uniswap views library to calculate the fees earned in tokenA and tokenB based + // on current status of the pool and provided position + (,int24 tick,,,,,) = _pool.slot0(); + (tokensOwed0, tokensOwed1) = UniswapHelperViews.getFeesEarned( + UniswapHelperViews.feesEarnedParams( + pool, + liquidity, + tick, + _minTick, + _maxTick, + _pool.feeGrowthGlobal0X128(), + _pool.feeGrowthGlobal1X128(), + feeGrowthInside0LastX128, + feeGrowthInside1LastX128 + ) + ); + + // Reorder to make sure amounts are added correctly + if (tokenA < tokenB) { + _amountPending[0] += tokensOwed0; + _amountPending[1] += tokensOwed1; + } else { + _amountPending[1] += tokensOwed0; + _amountPending[0] += tokensOwed1; + } + + return _amountPending; + } + + /* + * @notice + * Function called by the uniswap pool when minting the LP position (providing liquidity), + * instead of approving and sending the tokens, uniV3 calls the callback imoplementation + * on the caller contract + * @param amount0Owed, amount of token0 to send + * @param amount1Owed, amount of token1 to send + * @param data, additional calldata + */ + function uniswapV3MintCallback( + uint256 amount0Owed, + uint256 amount1Owed, + bytes calldata data + ) external { + IUniswapV3Pool _pool = IUniswapV3Pool(pool); + // Only the pool can use this function + require(msg.sender == address(_pool)); // dev: callback only called by pool + // Send the required funds to the pool + IERC20(_pool.token0()).safeTransfer(address(_pool), amount0Owed); + IERC20(_pool.token1()).safeTransfer(address(_pool), amount1Owed); + } + + /* + * @notice + * Function called by the uniswap pool when swapping, + * instead of approving and sending the tokens, uniV3 calls the callback imoplementation + * on the caller contract + * @param amount0Delta, amount of token0 to send (if any) + * @param amount1Delta, amount of token1 to send (if any) + * @param data, additional calldata + */ + function uniswapV3SwapCallback( + int256 amount0Delta, + int256 amount1Delta, + bytes calldata data + ) external { + IUniswapV3Pool _pool = IUniswapV3Pool(pool); + // Only the pool can use this function + require(msg.sender == address(_pool)); // dev: callback only called by pool + + + uint256 amountIn; + address tokenIn; + + // Send the required funds to the pool + if (amount0Delta > 0) { + amountIn = uint256(amount0Delta); + tokenIn = _pool.token0(); + } else { + amountIn = uint256(amount1Delta); + tokenIn = _pool.token1(); + } + + IERC20(tokenIn).safeTransfer(address(_pool), amountIn); + } + + /* + * @notice + * Function used internally to collect the accrued fees by burn 0 of the LP position + * and collecting the owed tokens (only fees as no LP has been burnt) + * @return balance of tokens in the LP (invested amounts) + */ + function getReward() internal override { + _burnAndCollect(0, minTick, maxTick); + } + + /* + * @notice + * Function used internally to open the LP position in the uni v3 pool: + * - calculates the ticks to provide liquidity into + * - calculates the liquidity amount to provide based on the ticks + * and amounts to invest + * - calls the mint function in the uni v3 pool + * @return balance of tokens in the LP (invested amounts) + */ + function createLP() internal override returns (uint256, uint256) { + IUniswapV3Pool _pool = IUniswapV3Pool(pool); + // Get the current state of the pool + (uint160 sqrtPriceX96, int24 tick,,,,,) = _pool.slot0(); + // Space between ticks for this pool + int24 _tickSpacing = _pool.tickSpacing(); + // Current tick must be referenced as a multiple of tickSpacing + int24 _currentTick = (tick / _tickSpacing) * _tickSpacing; + // Gas savings for # of ticks to LP + int24 _ticksFromCurrent = int24(ticksFromCurrent); + // Minimum tick to enter + int24 _minTick = _currentTick - (_tickSpacing * _ticksFromCurrent); + // Maximum tick to enter + int24 _maxTick = _currentTick + (_tickSpacing * (_ticksFromCurrent + 1)); + + // Set the state variables + minTick = _minTick; + maxTick = _maxTick; + + uint256 amount0; + uint256 amount1; + + // MAke sure tokens are in order + if (tokenA < tokenB) { + amount0 = balanceOfA(); + amount1 = balanceOfB(); + } else { + amount0 = balanceOfB(); + amount1 = balanceOfA(); + } + + // Calculate the amount of liquidity the joint can provided based on current situation + // and amount of tokens available + uint128 liquidityAmount = LiquidityAmounts.getLiquidityForAmounts( + sqrtPriceX96, + TickMath.getSqrtRatioAtTick(_minTick), + TickMath.getSqrtRatioAtTick(_maxTick), + amount0, + amount1 + ); + + // Mint the LP position - we are not yet in the LP, needs to go through the mint + // callback first + _pool.mint(address(this), _minTick, _maxTick, liquidityAmount, ""); + + // After executing the mint callback, calculate the invested amounts + return balanceOfTokensInLP(); + } + + /* + * @notice + * Function used internally to close the LP position in the uni v3 pool: + * - burns the LP liquidity specified amount + * - collects all pending rewards + * - re-sets the active position min and max tick to 0 + * @param amount, amount of liquidity to burn + */ + function burnLP(uint256 _amount) internal override { + _burnAndCollect(_amount, minTick, maxTick); + // If entire position is closed, re-set the min and max ticks + (uint128 liquidity,,,,) = _positionInfo(); + if (liquidity == 0){ + minTick = 0; + maxTick = 0; + } + } + + /* + * @notice + * Function available to vault managers to burn the LP manually, if for any reason + * the ticks have been set to 0 (or any different value from the original LP), we make + * sure we can always get out of the position + * This function can be used to only collect fees by passing a 0 amount to burn + * @param _amount, amount of liquidity to burn + * @param _minTick, lower limit of position + * @param _maxTick, upper limit of position + */ + function burnLPManually( + uint256 _amount, + int24 _minTick, + int24 _maxTick, + uint256 _minOutTokenA, + uint256 _minOutTokenB + ) external onlyVaultManagers { + _burnAndCollect(_amount, _minTick, _maxTick); + require(IERC20(tokenA).balanceOf(address(this)) >= _minOutTokenA && + IERC20(tokenB).balanceOf(address(this)) >= _minOutTokenB); + } + + /* + * @notice + * Function available internally to burn the LP amount specified, for position + * defined by minTick and maxTick specified and collect the owed tokens + * @param _amount, amount of liquidity to burn + * @param _minTick, lower limit of position + * @param _maxTick, upper limit of position + */ + function _burnAndCollect( + uint256 _amount, + int24 _minTick, + int24 _maxTick + ) internal { + IUniswapV3Pool _pool = IUniswapV3Pool(pool); + _pool.burn(_minTick, _maxTick, uint128(_amount)); + _pool.collect( + address(this), + _minTick, + _maxTick, + type(uint128).max, + type(uint128).max + ); + } + + /* + * @notice + * Function used internally to swap tokens during rebalancing. Depending on the useCRVPool + * state variable it will either use the uni v3 pool to swap or a CRV pool specified in + * crvPool state variable + * @param _tokenFrom, adress of token to swap from + * @param _tokenTo, address of token to swap to + * @param _amountIn, amount of _tokenIn to swap for _tokenTo + * @return swapped amount + */ + function swap( + address _tokenFrom, + address _tokenTo, + uint256 _amountIn, + uint256 _minOutAmount + ) internal override returns (uint256) { + require(_tokenTo == tokenA || _tokenTo == tokenB); // dev: must be a or b + require(_tokenFrom == tokenA || _tokenFrom == tokenB); // dev: must be a or b + uint256 prevBalance = IERC20(_tokenTo).balanceOf(address(this)); + if (useCRVPool) { + // Do NOT use uni pool use CRV pool + ICRVPool _pool = ICRVPool(crvPool); + + // Allow necessary amount for CRV pool + _checkAllowance(address(_pool), IERC20(_tokenFrom), _amountIn); + // Perform swap + _pool.exchange( + _getCRVPoolIndex(_tokenFrom, _pool), + _getCRVPoolIndex(_tokenTo, _pool), + _amountIn, + 0 + ); + uint256 result = IERC20(_tokenTo).balanceOf(address(this)) - prevBalance; + require(result >= _minOutAmount); + return (result); + } else { + // Use uni v3 pool to swap + // Order of swap + bool zeroForOne = _tokenFrom < _tokenTo; + + // Use swap function of uni v3 pool, will use the implemented swap callback to + // receive the corresponding tokens + (int256 _amount0, int256 _amount1) = IUniswapV3Pool(pool).swap( + // recipient + address(this), + // Order of swap + zeroForOne, + // amountSpecified + _amountIn.toInt256(), + // Price limit + zeroForOne ? MIN_SQRT_RATIO + 1 : MAX_SQRT_RATIO - 1, + // additonal calldata + "" + ); + uint256 result = zeroForOne ? uint256(-_amount1) : uint256(-_amount0); + require(result >= _minOutAmount); + // Ensure amounts are returned in right order and sign (uni returns negative numbers) + return result; + } + + } + + /* + * @notice + * Function used internally to quote a potential rebalancing swap without actually + * executing it. Same as the swap function, will simulate the trade either on the uni v3 + * pool or CRV pool based on useCRVPool + * @param _tokenFrom, adress of token to swap from + * @param _tokenTo, address of token to swap to + * @param _amountIn, amount of _tokenIn to swap for _tokenTo + * @return simulated swapped amount + */ + function quote( + address _tokenFrom, + address _tokenTo, + uint256 _amountIn + ) internal view override returns (uint256) { + require(_tokenTo == tokenA || _tokenTo == tokenB); // dev: must be a or b + require(_tokenFrom == tokenA || _tokenFrom == tokenB); // dev: must be a or b + if(useCRVPool){ + // Do NOT use uni pool use CRV pool + + ICRVPool _pool = ICRVPool(crvPool); + + // Call the quote function in CRV pool + return _pool.get_dy( + _getCRVPoolIndex(_tokenFrom, _pool), + _getCRVPoolIndex(_tokenTo, _pool), + _amountIn + ); + } else { + // Use uni v3 pool to swap + // Order of swap + bool zeroForOne = _tokenFrom < _tokenTo; + + // Use the uniswap helper view to simulate the swap in the uni v3 pool + (int256 _amount0, int256 _amount1) = UniswapHelperViews.simulateSwap( + // pool to use + pool, + // order of swap + zeroForOne, + // amountSpecified + _amountIn.toInt256(), + // price limit + zeroForOne ? MIN_SQRT_RATIO + 1 : MAX_SQRT_RATIO - 1 + ); + + // Ensure amounts are returned in right order and sign (uni returns negative numbers) + return zeroForOne ? uint256(-_amount1) : uint256(-_amount0); + } + + } + + /* + * @notice + * Function used internally to retrieve the CRV index for a token in a CRV pool, for example + * 3Pool uses: + * - 0 is DAI + * - 1 is USDC + * - 2 is USDT + * @return in128 containing the token's pool index + */ + function _getCRVPoolIndex(address _token, ICRVPool _pool) internal view returns(int128) { + uint8 i = 0; + int128 poolIndex = 0; + while (i < 5) { + if (_pool.coins(i) == _token) { + return poolIndex; + } + i++; + poolIndex++; + } + } + + /* + * @notice + * Function used internally to retrieve the details of the joint's LP position: + * - the amount of liquidity owned by this position + * - fee growth per unit of liquidity as of the last update to liquidity or fees owed + * - the fees owed to the position owner in token0/token1 + * @return PositionInfo struct containing the position details + */ + function _positionInfo() + private + view + returns ( + uint128 liquidity, + uint256 feeGrowthInside0LastX128, + uint256 feeGrowthInside1LastX128, + uint128 tokensOwed0, + uint128 tokensOwed1 + ) + { + bytes32 key = keccak256( + abi.encodePacked(address(this), minTick, maxTick) + ); + return IUniswapV3Pool(pool).positions(key); + } + + /* + * @notice + * Function used by governance to swap tokens manually if needed, can be used when closing + * the LP position manually and need some re-balancing before sending funds back to the + * providers + * @param swapPath, path of addresses to swap, should be 2 and always tokenA <> tokenB + * @param swapInAmount, amount of swapPath[0] to swap for swapPath[1] + * @param minOutAmount, minimum amount of want out + * @return swapped amount + */ + function swapTokenForTokenManually( + bool sellA, + uint256 swapInAmount, + uint256 minOutAmount + ) external onlyGovernance override returns (uint256) { + + if(sellA) { + return swap( + tokenA, + tokenB, + swapInAmount, + minOutAmount + ); + } else { + return swap( + tokenB, + tokenA, + swapInAmount, + minOutAmount + ); + } + + + } + + // check if the current baseFee is below our external target + function isBaseFeeAcceptable() internal view returns (bool) { + return + IBaseFee(0xb5e1CAcB567d98faaDB60a1fD4820720141f064F) + .isCurrentBaseFeeAcceptable(); + } + + /* + * @notice + * Function used by keepers to assess whether to harvest the joint and compound generated + * fees into the existing position, checks whether both pending fee amounts (tokenA and B) + * are greater than minRewardToHarvest + * @param callCost, call cost parameter + * @return bool amount assessing whether to harvest or not + */ + function harvestTrigger(uint256 callCost) external view override returns (bool) { + + uint256 _minRewardToHarvest = minRewardToHarvest; + if (_minRewardToHarvest == 0) { + return false; + } + + // check if the base fee gas price is higher than we allow. if it is, block harvests. + if (!isBaseFeeAcceptable()) { + return false; + } + + uint256[] memory _pendingRewards = pendingRewards(); + + if (_pendingRewards[0] >= _minRewardToHarvest * (10**IERC20Extended(rewardTokens[0]).decimals()) / RATIO_PRECISION && + _pendingRewards[1] >= _minRewardToHarvest * (10**IERC20Extended(rewardTokens[1]).decimals()) / RATIO_PRECISION + ) { + return true; + } + + } + + /* + * @notice + * Function used by harvest trigger in the providers to assess whether to harvest it as + * the joint may have gone out of bounds. If debt ratio is kept in the vaults, the joint + * re-centers, if debt ratio is 0, the joint is simpley closed and funds are sent back + * to each provider + * @return bool amount assessing whether to end the epoch or not + */ + function shouldEndEpoch() external view override returns (bool) { + (,int24 _tick,,,,,) = IUniswapV3Pool(pool).slot0(); + (uint128 liquidity,,,,) = _positionInfo(); + if((_tick < minTick || _tick >= maxTick) && (liquidity > 0)) { + return true; + } + } + + /* + * @notice + * Function used by keepers to compound the generated feed into the existing position + * in the joint. There may be some funds not used in the position and left idle in the + * joint + */ + function harvest() external override onlyKeepers { + getReward(); + + uint256 amount0; + uint256 amount1; + + // Make sure tokens are in order + if (tokenA < tokenB) { + amount0 = balanceOfA(); + amount1 = balanceOfB(); + } else { + amount0 = balanceOfB(); + amount1 = balanceOfA(); + } + + // Minimum tick to enter + int24 _minTick = minTick; + // Maximum tick to enter + int24 _maxTick = maxTick; + + // Calculate the amount of liquidity the joint can provided based on current situation + // and amount of tokens available + IUniswapV3Pool _pool = IUniswapV3Pool(pool); + (uint160 sqrtPriceX96,,,,,,) = _pool.slot0(); + uint128 liquidityAmount = LiquidityAmounts.getLiquidityForAmounts( + sqrtPriceX96, + TickMath.getSqrtRatioAtTick(_minTick), + TickMath.getSqrtRatioAtTick(_maxTick), + amount0, + amount1 + ); + + // Mint the LP position - we are not yet in the LP, needs to go through the mint + // callback first + _pool.mint(address(this), _minTick, _maxTick, liquidityAmount, ""); + + } +} diff --git a/contracts/Hedges/HedgilJoint.sol b/contracts/Hedges/HedgilJoint.sol deleted file mode 100644 index 5006db6..0000000 --- a/contracts/Hedges/HedgilJoint.sol +++ /dev/null @@ -1,298 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0 -pragma solidity 0.6.12; -pragma experimental ABIEncoderV2; - -import { - SafeERC20, - SafeMath, - IERC20, - Address -} from "@openzeppelin/contracts/token/ERC20/SafeERC20.sol"; -import "@openzeppelin/contracts/math/Math.sol"; -import "../libraries/LPHedgingLib.sol"; -import "../Joint.sol"; - -interface IHedgilPool { - function getTimeToMaturity(uint256 hedgeID) external view returns (uint256); - - function getHedgeProfit(uint256 hedgeID) external view returns (uint256); - - function getHedgeStrike(uint256 hedgeID) external view returns (uint256); - - function getCurrentPayout(uint256 hedgeID) external view returns (uint256); - - function hedgeLPToken( - address pair, - uint256 protectionRange, - uint256 period - ) external returns (uint256, uint256); - - function closeHedge(uint256 hedgedID) - external - returns (uint256 payoff, uint256 exercisePrice); -} - -abstract contract HedgilJoint is Joint { - using SafeERC20 for IERC20; - using Address for address; - using SafeMath for uint256; - - uint256 public activeHedgeID; - - uint256 public hedgeBudget; - uint256 public protectionRange; - uint256 public period; - - uint256 private minTimeToMaturity; - - bool public skipManipulatedCheck; - bool public isHedgingEnabled; - - uint256 private constant PRICE_DECIMALS = 1e18; - uint256 public maxSlippageOpen; - uint256 public maxSlippageClose; - - address public hedgilPool; - - constructor( - address _providerA, - address _providerB, - address _router, - address _weth, - address _reward, - address _hedgilPool - ) public Joint(_providerA, _providerB, _router, _weth, _reward) { - _initializeHedgilJoint(_hedgilPool); - } - - function _initializeHedgilJoint(address _hedgilPool) internal { - hedgilPool = _hedgilPool; - - hedgeBudget = 50; // 0.5% per hedging period - protectionRange = 1000; // 10% - period = 7 days; - minTimeToMaturity = 3600; // 1 hour - maxSlippageOpen = 100; // 1% - maxSlippageClose = 100; // 1% - - isHedgingEnabled = true; - - IERC20(tokenB).approve(_hedgilPool, type(uint256).max); - } - - function getHedgeBudget(address token) - public - view - override - returns (uint256) - { - // Hedgil only accepts the quote token - if (token == address(tokenB)) { - return hedgeBudget; - } - - return 0; - } - - function getTimeToMaturity() public view returns (uint256) { - return IHedgilPool(hedgilPool).getTimeToMaturity(activeHedgeID); - } - - function getHedgeProfit() public view override returns (uint256, uint256) { - return (0, IHedgilPool(hedgilPool).getCurrentPayout(activeHedgeID)); - } - - function setSkipManipulatedCheck(bool _skipManipulatedCheck) - external - onlyVaultManagers - { - skipManipulatedCheck = _skipManipulatedCheck; - } - - function setMaxSlippageClose(uint256 _maxSlippageClose) - external - onlyVaultManagers - { - require(_maxSlippageClose <= RATIO_PRECISION); // dev: !boundary - maxSlippageClose = _maxSlippageClose; - } - - function setMaxSlippageOpen(uint256 _maxSlippageOpen) - external - onlyVaultManagers - { - require(_maxSlippageOpen <= RATIO_PRECISION); // dev: !boundary - maxSlippageOpen = _maxSlippageOpen; - } - - function setMinTimeToMaturity(uint256 _minTimeToMaturity) - external - onlyVaultManagers - { - require(_minTimeToMaturity <= period); // avoid incorrect settings - minTimeToMaturity = _minTimeToMaturity; - } - - function setIsHedgingEnabled(bool _isHedgingEnabled, bool force) - external - onlyVaultManagers - { - // if there is an active hedge, we need to force the disabling - if (force || (activeHedgeID == 0)) { - isHedgingEnabled = _isHedgingEnabled; - } - } - - function setHedgeBudget(uint256 _hedgeBudget) external onlyVaultManagers { - require(_hedgeBudget <= RATIO_PRECISION); - hedgeBudget = _hedgeBudget; - } - - function setHedgingPeriod(uint256 _period) external onlyVaultManagers { - require(_period <= 90 days); - period = _period; - } - - function setProtectionRange(uint256 _protectionRange) - external - onlyVaultManagers - { - require(_protectionRange <= RATIO_PRECISION); - protectionRange = _protectionRange; - } - - function closeHedgeManually() external onlyVaultManagers { - _closeHedge(); - } - - function resetHedge() external onlyGovernance { - activeHedgeID = 0; - } - - function getHedgeStrike() internal view returns (uint256) { - return IHedgilPool(hedgilPool).getHedgeStrike(activeHedgeID); - } - - function hedgeLP() - internal - override - returns (uint256 costA, uint256 costB) - { - if (hedgeBudget == 0 || !isHedgingEnabled) { - return (0, 0); - } - - // take into account that if hedgeBudget is not enough, it will revert - IERC20 _pair = IERC20(getPair()); - uint256 initialBalanceA = balanceOfA(); - uint256 initialBalanceB = balanceOfB(); - // Only able to open a new position if no active options - require(activeHedgeID == 0); // dev: already-open - uint256 strikePrice; - (activeHedgeID, strikePrice) = IHedgilPool(hedgilPool).hedgeLPToken( - address(_pair), - protectionRange, - period - ); - - require( - _isWithinRange(strikePrice, maxSlippageOpen) || skipManipulatedCheck - ); // dev: !open-price - - // NOTE: hedge is always paid in tokenB, so costA is always = 0 - // costA = initialBalanceA.sub(balanceOfA()); - costB = initialBalanceB.sub(balanceOfB()); - } - - function closeHedge() internal override { - // only close hedge if a hedge is open - if (activeHedgeID == 0 || !isHedgingEnabled) { - return; - } - - _closeHedge(); - } - - function _closeHedge() internal { - (, uint256 exercisePrice) = - IHedgilPool(hedgilPool).closeHedge(activeHedgeID); - - require( - _isWithinRange(exercisePrice, maxSlippageClose) || - skipManipulatedCheck - ); // dev: !close-price - activeHedgeID = 0; - } - - function _isWithinRange(uint256 oraclePrice, uint256 maxSlippage) - internal - view - returns (bool) - { - if (oraclePrice == 0) { - return false; - } - uint256 tokenADecimals = - uint256(10)**uint256(IERC20Extended(tokenA).decimals()); - uint256 tokenBDecimals = - uint256(10)**uint256(IERC20Extended(tokenB).decimals()); - - (uint256 reserveA, uint256 reserveB) = getReserves(); - uint256 currentPairPrice = - reserveB.mul(tokenADecimals).mul(PRICE_DECIMALS).div(reserveA).div( - tokenBDecimals - ); - // This is a price check to avoid manipulated pairs. It checks current pair price vs hedging protocol oracle price (i.e. exercise) - // we need pairPrice ⁄ oraclePrice to be within (1+maxSlippage) and (1-maxSlippage) - // otherwise, we consider the price manipulated - return - currentPairPrice > oraclePrice - ? currentPairPrice.mul(RATIO_PRECISION).div(oraclePrice) < - RATIO_PRECISION.add(maxSlippage) - : currentPairPrice.mul(RATIO_PRECISION).div(oraclePrice) > - RATIO_PRECISION.sub(maxSlippage); - } - - function shouldEndEpoch() public view override returns (bool) { - // End epoch if price moved too much (above / below the protectionRange) or hedge is about to expire - if (activeHedgeID == 0) { - return false; - } - // if Time to Maturity of hedge is lower than min threshold, need to end epoch NOW - if ( - IHedgilPool(hedgilPool).getTimeToMaturity(activeHedgeID) <= - minTimeToMaturity - ) { - return true; - } - - // NOTE: the initial price is calculated using the added liquidity - uint256 tokenADecimals = - uint256(10)**uint256(IERC20Extended(tokenA).decimals()); - uint256 tokenBDecimals = - uint256(10)**uint256(IERC20Extended(tokenB).decimals()); - uint256 initPrice = - investedB - .mul(tokenADecimals) - .mul(PRICE_DECIMALS) - .div(investedA) - .div(tokenBDecimals); - return !_isWithinRange(initPrice, protectionRange); - } - - // this function is called by Joint to see if it needs to stop initiating new epochs due to too high volatility - function _autoProtect() internal view override returns (bool) { - if (activeHedgeID == 0) { - return false; - } - - // if we are closing the position before 50% of hedge period has passed, we did something wrong so auto-init is stopped - uint256 timeToMaturity = getTimeToMaturity(); - - // NOTE: if timeToMaturity is 0, it means that the epoch has finished without being exercised - // Something might be wrong so we don't start new epochs - if (timeToMaturity == 0 || timeToMaturity > period.mul(50).div(100)) { - return true; - } - } -} diff --git a/contracts/Hedges/HedgilV2Joint.sol b/contracts/Hedges/HedgilV2Joint.sol deleted file mode 100644 index 5154d30..0000000 --- a/contracts/Hedges/HedgilV2Joint.sol +++ /dev/null @@ -1,298 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0 -pragma solidity 0.6.12; -pragma experimental ABIEncoderV2; - -import { - SafeERC20, - SafeMath, - IERC20, - Address -} from "@openzeppelin/contracts/token/ERC20/SafeERC20.sol"; -import "@openzeppelin/contracts/math/Math.sol"; -import "../Joint.sol"; - -interface IHedgilPool { - function quoteToken() external view returns (address); - - function getTimeToMaturity(uint256 hedgeID) external view returns (uint256); - - function getCurrentPayout(uint256 hedgeID) external view returns (uint256); - - function hedgeLPToken( - address pair, - uint256 protectionRange, - uint256 period - ) external returns (uint256, uint256); - - function closeHedge(uint256 hedgedID) - external - returns (uint256 payoff, uint256 exercisePrice); -} - -abstract contract HedgilV2Joint is Joint { - using SafeERC20 for IERC20; - using Address for address; - using SafeMath for uint256; - - uint256 public activeHedgeID; - - uint256 public hedgeBudget; - uint256 public protectionRange; - uint256 public period; - - uint256 private minTimeToMaturity; - - bool public skipManipulatedCheck; - bool public isHedgingEnabled; - - uint256 public maxSlippageOpen; - uint256 public maxSlippageClose; - - address public hedgilPool; - - uint256 private constant PRICE_DECIMALS = 1e18; - - constructor( - address _providerA, - address _providerB, - address _router, - address _weth, - address _reward, - address _hedgilPool - ) public Joint(_providerA, _providerB, _router, _weth, _reward) { - _initializeHedgilJoint(_hedgilPool); - } - - function _initializeHedgilJoint(address _hedgilPool) internal { - hedgilPool = _hedgilPool; - require(IHedgilPool(_hedgilPool).quoteToken() == tokenB); // dev: tokenB != quotetoken - - hedgeBudget = 25; // 0.25% per hedging period - protectionRange = 1000; // 10% - period = 7 days; - minTimeToMaturity = 3600; // 1 hour - maxSlippageOpen = 100; // 1% - maxSlippageClose = 100; // 1% - - isHedgingEnabled = true; - - IERC20(tokenB).approve(_hedgilPool, type(uint256).max); - } - - function getHedgeBudget(address token) - public - view - override - returns (uint256) - { - // Hedgil only accepts the quote token - if (token == address(tokenB)) { - return hedgeBudget; - } - - return 0; - } - - function getTimeToMaturity() public view returns (uint256) { - return IHedgilPool(hedgilPool).getTimeToMaturity(activeHedgeID); - } - - function getHedgeProfit() public view override returns (uint256, uint256) { - // Handle the case where hedgil is closed but estimatedTotalAssets is called in any of the - // Provider strats (happens when closing epoch and vault.report calls estimatedTotalAssets) - if (activeHedgeID == 0) { - return (0, 0); - } - return (0, IHedgilPool(hedgilPool).getCurrentPayout(activeHedgeID)); - } - - function setSkipManipulatedCheck(bool _skipManipulatedCheck) - external - onlyVaultManagers - { - skipManipulatedCheck = _skipManipulatedCheck; - } - - function setMaxSlippageClose(uint256 _maxSlippageClose) - external - onlyVaultManagers - { - require(_maxSlippageClose <= RATIO_PRECISION); // dev: !boundary - maxSlippageClose = _maxSlippageClose; - } - - function setMaxSlippageOpen(uint256 _maxSlippageOpen) - external - onlyVaultManagers - { - require(_maxSlippageOpen <= RATIO_PRECISION); // dev: !boundary - maxSlippageOpen = _maxSlippageOpen; - } - - function setMinTimeToMaturity(uint256 _minTimeToMaturity) - external - onlyVaultManagers - { - require(_minTimeToMaturity <= period); // avoid incorrect settings - minTimeToMaturity = _minTimeToMaturity; - } - - function setIsHedgingEnabled(bool _isHedgingEnabled, bool force) - external - onlyVaultManagers - { - // if there is an active hedge, we need to force the disabling - if (force || (activeHedgeID == 0)) { - isHedgingEnabled = _isHedgingEnabled; - } - } - - function setHedgeBudget(uint256 _hedgeBudget) external onlyVaultManagers { - require(_hedgeBudget <= RATIO_PRECISION); - hedgeBudget = _hedgeBudget; - } - - function setHedgingPeriod(uint256 _period) external onlyVaultManagers { - require(_period <= 90 days); - period = _period; - } - - function setProtectionRange(uint256 _protectionRange) - external - onlyVaultManagers - { - require(_protectionRange <= RATIO_PRECISION); - protectionRange = _protectionRange; - } - - function closeHedgeManually() external onlyVaultManagers { - _closeHedge(); - } - - function resetHedge() external onlyGovernance { - activeHedgeID = 0; - } - - function hedgeLP() - internal - override - returns (uint256 costA, uint256 costB) - { - if (hedgeBudget == 0 || !isHedgingEnabled) { - return (0, 0); - } - - // take into account that if hedgeBudget is not enough, it will revert - IERC20 _pair = IERC20(getPair()); - uint256 initialBalanceA = balanceOfA(); - uint256 initialBalanceB = balanceOfB(); - // Only able to open a new position if no active options - require(activeHedgeID == 0); // dev: already-open - uint256 strikePrice; - (activeHedgeID, strikePrice) = IHedgilPool(hedgilPool).hedgeLPToken( - address(_pair), - protectionRange, - period - ); - - require( - _isWithinRange(strikePrice, maxSlippageOpen) || skipManipulatedCheck - ); // dev: !open-price - - // NOTE: hedge is always paid in tokenB, so costA is always = 0 - costB = initialBalanceB.sub(balanceOfB()); - } - - function closeHedge() internal override { - // only close hedge if a hedge is open - if (activeHedgeID == 0 || !isHedgingEnabled) { - return; - } - - _closeHedge(); - } - - function _closeHedge() internal { - (, uint256 exercisePrice) = - IHedgilPool(hedgilPool).closeHedge(activeHedgeID); - - require( - _isWithinRange(exercisePrice, maxSlippageClose) || - skipManipulatedCheck - ); // dev: !close-price - activeHedgeID = 0; - } - - function _isWithinRange(uint256 oraclePrice, uint256 maxSlippage) - internal - view - returns (bool) - { - if (oraclePrice == 0) { - return false; - } - - uint256 tokenADecimals = - uint256(10)**uint256(IERC20Extended(tokenA).decimals()); - uint256 tokenBDecimals = - uint256(10)**uint256(IERC20Extended(tokenB).decimals()); - - (uint256 reserveA, uint256 reserveB) = getReserves(); - uint256 currentPairPrice = - reserveB.mul(tokenADecimals).mul(PRICE_DECIMALS).div(reserveA).div( - tokenBDecimals - ); - // This is a price check to avoid manipulated pairs. It checks current pair price vs hedging protocol oracle price (i.e. exercise) - // we need pairPrice ⁄ oraclePrice to be within (1+maxSlippage) and (1-maxSlippage) - // otherwise, we consider the price manipulated - return - currentPairPrice > oraclePrice - ? currentPairPrice.mul(RATIO_PRECISION).div(oraclePrice) < - RATIO_PRECISION.add(maxSlippage) - : currentPairPrice.mul(RATIO_PRECISION).div(oraclePrice) > - RATIO_PRECISION.sub(maxSlippage); - } - - function shouldEndEpoch() public view override returns (bool) { - // End epoch if price moved too much (above / below the protectionRange) or hedge is about to expire - if (activeHedgeID == 0) { - return false; - } - // if Time to Maturity of hedge is lower than min threshold, need to end epoch NOW - if ( - IHedgilPool(hedgilPool).getTimeToMaturity(activeHedgeID) <= - minTimeToMaturity - ) { - return true; - } - - // NOTE: the initial price is calculated using the added liquidity - uint256 tokenADecimals = - uint256(10)**uint256(IERC20Extended(tokenA).decimals()); - uint256 tokenBDecimals = - uint256(10)**uint256(IERC20Extended(tokenB).decimals()); - uint256 initPrice = - investedB - .mul(tokenADecimals) - .mul(PRICE_DECIMALS) - .div(investedA) - .div(tokenBDecimals); - return !_isWithinRange(initPrice, protectionRange); - } - - // this function is called by Joint to see if it needs to stop initiating new epochs due to too high volatility - function _autoProtect() internal view override returns (bool) { - if (activeHedgeID == 0) { - return false; - } - - // if we are closing the position before 50% of hedge period has passed, we did something wrong so auto-init is stopped - uint256 timeToMaturity = getTimeToMaturity(); - - // NOTE: if timeToMaturity is 0, it means that the epoch has finished without being exercised - // Something might be wrong so we don't start new epochs - if (timeToMaturity == 0 || timeToMaturity > period.mul(50).div(100)) { - return true; - } - } -} diff --git a/contracts/Hedges/HegicJoint.sol b/contracts/Hedges/HegicJoint.sol deleted file mode 100644 index 0c1ba48..0000000 --- a/contracts/Hedges/HegicJoint.sol +++ /dev/null @@ -1,287 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0 -pragma solidity 0.6.12; -pragma experimental ABIEncoderV2; - -import { - SafeERC20, - SafeMath, - IERC20, - Address -} from "@openzeppelin/contracts/token/ERC20/SafeERC20.sol"; -import "@openzeppelin/contracts/math/Math.sol"; -import "../libraries/LPHedgingLib.sol"; -import "../Joint.sol"; - -abstract contract HegicJoint is Joint { - using SafeERC20 for IERC20; - using Address for address; - using SafeMath for uint256; - - uint256 public activeCallID; - uint256 public activePutID; - - uint256 public hedgeBudget; - uint256 public protectionRange; - uint256 public period; - - uint256 private minTimeToMaturity; - - bool public skipManipulatedCheck; - bool public isHedgingEnabled; - - uint256 private constant PRICE_DECIMALS = 1e8; - uint256 public maxSlippageOpen; - uint256 public maxSlippageClose; - - address public hegicCallOptionsPool; - address public hegicPutOptionsPool; - - constructor( - address _providerA, - address _providerB, - address _router, - address _weth, - address _reward, - address _hegicCallOptionsPool, - address _hegicPutOptionsPool - ) public Joint(_providerA, _providerB, _router, _weth, _reward) { - _initializeHegicJoint(_hegicCallOptionsPool, _hegicPutOptionsPool); - } - - function _initializeHegicJoint( - address _hegicCallOptionsPool, - address _hegicPutOptionsPool - ) internal { - hegicCallOptionsPool = _hegicCallOptionsPool; - hegicPutOptionsPool = _hegicPutOptionsPool; - - hedgeBudget = 50; // 0.5% per hedging period - protectionRange = 1000; // 10% - period = 7 days; - minTimeToMaturity = 3600; // 1 hour - maxSlippageOpen = 100; // 1% - maxSlippageClose = 100; // 1% - - isHedgingEnabled = true; - } - - function onERC721Received( - address, - address, - uint256, - bytes calldata - ) public pure virtual returns (bytes4) { - return this.onERC721Received.selector; - } - - function getHedgeBudget(address token) - public - view - override - returns (uint256) - { - return hedgeBudget; - } - - function getTimeToMaturity() public view returns (uint256) { - return LPHedgingLib.getTimeToMaturity(activeCallID, activePutID); - } - - function getHedgeProfit() public view override returns (uint256, uint256) { - return LPHedgingLib.getOptionsProfit(activeCallID, activePutID); - } - - function setSkipManipulatedCheck(bool _skipManipulatedCheck) - external - onlyVaultManagers - { - skipManipulatedCheck = _skipManipulatedCheck; - } - - function setMaxSlippageClose(uint256 _maxSlippageClose) - external - onlyVaultManagers - { - require(_maxSlippageClose <= RATIO_PRECISION); // dev: !boundary - maxSlippageClose = _maxSlippageClose; - } - - function setMaxSlippageOpen(uint256 _maxSlippageOpen) - external - onlyVaultManagers - { - require(_maxSlippageOpen <= RATIO_PRECISION); // dev: !boundary - maxSlippageOpen = _maxSlippageOpen; - } - - function setMinTimeToMaturity(uint256 _minTimeToMaturity) - external - onlyVaultManagers - { - require(_minTimeToMaturity <= period); // avoid incorrect settings - minTimeToMaturity = _minTimeToMaturity; - } - - function setIsHedgingEnabled(bool _isHedgingEnabled, bool force) - external - onlyVaultManagers - { - // if there is an active hedge, we need to force the disabling - if (force || (activeCallID == 0 && activePutID == 0)) { - isHedgingEnabled = _isHedgingEnabled; - } - } - - function setHedgeBudget(uint256 _hedgeBudget) external onlyVaultManagers { - require(_hedgeBudget < RATIO_PRECISION); - hedgeBudget = _hedgeBudget; - } - - function setHedgingPeriod(uint256 _period) external onlyVaultManagers { - require(_period < 90 days); - period = _period; - } - - function setProtectionRange(uint256 _protectionRange) - external - onlyVaultManagers - { - require(_protectionRange < RATIO_PRECISION); - protectionRange = _protectionRange; - } - - function resetHedge() external onlyGovernance { - activeCallID = 0; - activePutID = 0; - } - - function getHedgeStrike() internal view returns (uint256) { - return LPHedgingLib.getHedgeStrike(activeCallID, activePutID); - } - - function closeHedgeManually(uint256 callID, uint256 putID) - external - onlyVaultManagers - { - (, , uint256 exercisePrice) = LPHedgingLib.closeHedge(callID, putID); - require( - _isWithinRange(exercisePrice, maxSlippageClose) || - skipManipulatedCheck - ); // dev: !close-price - activeCallID = 0; - activePutID = 0; - } - - function hedgeLP() - internal - override - returns (uint256 costA, uint256 costB) - { - if (hedgeBudget > 0 && isHedgingEnabled) { - // take into account that if hedgeBudget is not enough, it will revert - IERC20 _pair = IERC20(getPair()); - uint256 initialBalanceA = balanceOfA(); - uint256 initialBalanceB = balanceOfB(); - // Only able to open a new position if no active options - require(activeCallID == 0 && activePutID == 0); // dev: opened - uint256 strikePrice; - (activeCallID, activePutID, strikePrice) = LPHedgingLib - .hedgeLPToken(address(_pair), protectionRange, period); - - require( - _isWithinRange(strikePrice, maxSlippageOpen) || - skipManipulatedCheck - ); // dev: !open-price - - costA = initialBalanceA.sub(balanceOfA()); - costB = initialBalanceB.sub(balanceOfB()); - } - } - - function closeHedge() internal override { - uint256 exercisePrice; - // only close hedge if a hedge is open - if (activeCallID != 0 && activePutID != 0 && isHedgingEnabled) { - (, , exercisePrice) = LPHedgingLib.closeHedge( - activeCallID, - activePutID - ); - require( - _isWithinRange(exercisePrice, maxSlippageClose) || - skipManipulatedCheck - ); // dev: !close-price - activeCallID = 0; - activePutID = 0; - } - } - - function _isWithinRange(uint256 oraclePrice, uint256 maxSlippage) - internal - view - returns (bool) - { - if (oraclePrice == 0) { - return false; - } - uint256 tokenADecimals = - uint256(10)**uint256(IERC20Extended(tokenA).decimals()); - uint256 tokenBDecimals = - uint256(10)**uint256(IERC20Extended(tokenB).decimals()); - - (uint256 reserveA, uint256 reserveB) = getReserves(); - uint256 currentPairPrice = - reserveB.mul(tokenADecimals).mul(PRICE_DECIMALS).div(reserveA).div( - tokenBDecimals - ); - // This is a price check to avoid manipulated pairs. It checks current pair price vs hedging protocol oracle price (i.e. exercise) - // we need pairPrice ⁄ oraclePrice to be within (1+maxSlippage) and (1-maxSlippage) - // otherwise, we consider the price manipulated - return - currentPairPrice > oraclePrice - ? currentPairPrice.mul(RATIO_PRECISION).div(oraclePrice) < - RATIO_PRECISION.add(maxSlippage) - : currentPairPrice.mul(RATIO_PRECISION).div(oraclePrice) > - RATIO_PRECISION.sub(maxSlippage); - } - - function shouldEndEpoch() public view override returns (bool) { - // End epoch if price moved too much (above / below the protectionRange) or hedge is about to expire - if (activeCallID != 0 || activePutID != 0) { - // if Time to Maturity of hedge is lower than min threshold, need to end epoch NOW - if ( - LPHedgingLib.getTimeToMaturity(activeCallID, activePutID) <= - minTimeToMaturity - ) { - return true; - } - - // NOTE: the initial price is calculated using the added liquidity - uint256 tokenADecimals = - uint256(10)**uint256(IERC20Extended(tokenA).decimals()); - uint256 tokenBDecimals = - uint256(10)**uint256(IERC20Extended(tokenB).decimals()); - uint256 initPrice = - investedB - .mul(tokenADecimals) - .mul(PRICE_DECIMALS) - .div(investedA) - .div(tokenBDecimals); - return !_isWithinRange(initPrice, protectionRange); - } - } - - // this function is called by Joint to see if it needs to stop initiating new epochs due to too high volatility - function _autoProtect() internal view override returns (bool) { - // if we are closing the position before 50% of hedge period has passed, we did something wrong so auto-init is stopped - uint256 timeToMaturity = getTimeToMaturity(); - if (activeCallID != 0 && activePutID != 0) { - // NOTE: if timeToMaturity is 0, it means that the epoch has finished without being exercised - // Something might be wrong so we don't start new epochs - if ( - timeToMaturity == 0 || timeToMaturity > period.mul(50).div(100) - ) { - return true; - } - } - } -} diff --git a/contracts/Hedges/NoHedgeJoint.sol b/contracts/Hedges/NoHedgeJoint.sol index 0aaa135..293c334 100644 --- a/contracts/Hedges/NoHedgeJoint.sol +++ b/contracts/Hedges/NoHedgeJoint.sol @@ -1,28 +1,16 @@ // SPDX-License-Identifier: AGPL-3.0 -pragma solidity 0.6.12; +pragma solidity 0.8.12; pragma experimental ABIEncoderV2; -import { - SafeERC20, - SafeMath, - IERC20, - Address -} from "@openzeppelin/contracts/token/ERC20/SafeERC20.sol"; -import "@openzeppelin/contracts/math/Math.sol"; import "../Joint.sol"; abstract contract NoHedgeJoint is Joint { - using SafeERC20 for IERC20; - using Address for address; - using SafeMath for uint256; - constructor( address _providerA, address _providerB, - address _router, address _weth, - address _reward - ) public Joint(_providerA, _providerB, _router, _weth, _reward) {} + address _pool + ) Joint(_providerA, _providerB, _weth, _pool) {} function getHedgeBudget(address token) public @@ -55,10 +43,6 @@ abstract contract NoHedgeJoint is Joint { return; } - function shouldEndEpoch() public view override returns (bool) { - return false; - } - // this function is called by Joint to see if it needs to stop initiating new epochs due to too high volatility function _autoProtect() internal view override returns (bool) { return false; diff --git a/contracts/Joint.sol b/contracts/Joint.sol index 21e97a6..a8b6a3f 100644 --- a/contracts/Joint.sol +++ b/contracts/Joint.sol @@ -1,24 +1,16 @@ // SPDX-License-Identifier: AGPL-3.0 -pragma solidity 0.6.12; +pragma solidity 0.8.12; pragma experimental ABIEncoderV2; -import { - SafeERC20, - SafeMath, - IERC20, - Address -} from "@openzeppelin/contracts/token/ERC20/SafeERC20.sol"; -import "@openzeppelin/contracts/math/Math.sol"; -import "../interfaces/uni/IUniswapV2Router02.sol"; -import "../interfaces/uni/IUniswapV2Factory.sol"; -import "../interfaces/uni/IUniswapV2Pair.sol"; -import "../interfaces/IMasterChef.sol"; +import {Address} from "@openzeppelin/contracts/utils/Address.sol"; +import {IERC20} from "@openzeppelin/contracts/token/ERC20/IERC20.sol"; +import {SafeERC20} from "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol"; +import "@openzeppelin/contracts/utils/math/Math.sol"; + import "../interfaces/IERC20Extended.sol"; import "./ySwapper.sol"; -import {UniswapV2Library} from "./libraries/UniswapV2Library.sol"; - import {VaultAPI} from "@yearnvaults/contracts/BaseStrategy.sol"; interface ProviderStrategy { @@ -33,35 +25,43 @@ interface ProviderStrategy { function totalDebt() external view returns (uint256); } -abstract contract Joint is ySwapper { +abstract contract Joint { using SafeERC20 for IERC20; using Address for address; - using SafeMath for uint256; - - uint256 internal constant RATIO_PRECISION = 1e4; - + // Constant to use in ratio calculations + uint256 internal constant RATIO_PRECISION = 1e18; + // Provider strategy of tokenA ProviderStrategy public providerA; + // Provider strategy of tokenB ProviderStrategy public providerB; + // Address of tokenA address public tokenA; + // Address of tokenB address public tokenB; - address public WETH; - address public reward; - address public router; + // Reference token to use in swaps: WETH, WFTM... + address public referenceToken; + // Array containing reward tokens + address[] public rewardTokens; - IUniswapV2Pair public pair; + // Address of the pool to LP + address public pool; + // Amounts that actually go into the LP position uint256 public investedA; uint256 public investedB; + // Boolean values protecting against re-investing into the pool bool public dontInvestWant; bool public autoProtectionDisabled; + // Thresholds to operate the strat uint256 public minAmountToSell; uint256 public maxPercentageLoss; uint256 public minRewardToHarvest; + // Modifiers needed for access control normally inherited from BaseStrategy modifier onlyGovernance() { checkGovernance(); _; @@ -98,77 +98,104 @@ abstract contract Joint is ySwapper { require(isProvider()); } - function isGovernance() internal returns (bool) { + function isGovernance() internal view returns (bool) { return msg.sender == providerA.vault().governance() || msg.sender == providerB.vault().governance(); } - function isVaultManager() internal returns (bool) { + function isVaultManager() internal view returns (bool) { return msg.sender == providerA.vault().management() || msg.sender == providerB.vault().management(); } - function isKeeper() internal returns (bool) { + function isKeeper() internal view returns (bool) { return (msg.sender == providerA.keeper()) || (msg.sender == providerB.keeper()); } - function isProvider() internal returns (bool) { + function isProvider() internal view returns (bool) { return msg.sender == address(providerA) || msg.sender == address(providerB); } + /* + * @notice + * Constructor, only called during original deploy + * @param _providerA, provider strategy of tokenA + * @param _providerB, provider strategy of tokenB + * @param _referenceToken, token to use as reference, for pricing oracles and paying hedging costs (if any) + * @param _pool, Pool to LP + */ constructor( address _providerA, address _providerB, - address _router, - address _weth, - address _reward - ) public { - _initialize(_providerA, _providerB, _router, _weth, _reward); - } - + address _referenceToken, + address _pool + ) { + _initialize(_providerA, _providerB, _referenceToken, _pool); + } + + /* + * @notice + * Constructor equivalent for clones, initializing the joint and the specifics of UniV3Joint + * @param _providerA, provider strategy of tokenA + * @param _providerB, provider strategy of tokenB + * @param _referenceToken, token to use as reference, for pricing oracles and paying hedging costs (if any) + * @param _pool, Pool to LP + */ function _initialize( address _providerA, address _providerB, - address _router, - address _weth, - address _reward + address _referenceToken, + address _pool ) internal virtual { require(address(providerA) == address(0), "Joint already initialized"); providerA = ProviderStrategy(_providerA); providerB = ProviderStrategy(_providerB); - router = _router; - WETH = _weth; - reward = _reward; - - tradeFactory = address(0xD3f89C21719Ec5961a3E6B0f9bBf9F9b4180E9e9); + referenceToken = _referenceToken; + pool = _pool; // NOTE: we let some loss to avoid getting locked in the position if something goes slightly wrong - maxPercentageLoss = 10; // 0.10% + maxPercentageLoss = RATIO_PRECISION / 1_000; // 0.10% tokenA = address(providerA.want()); tokenB = address(providerB.want()); require(tokenA != tokenB, "!same-want"); - pair = IUniswapV2Pair(getPair()); - - IERC20(tokenA).approve(address(_router), type(uint256).max); - IERC20(tokenB).approve(address(_router), type(uint256).max); - IERC20(_reward).approve(address(_router), type(uint256).max); - IERC20(address(pair)).approve(address(_router), type(uint256).max); } function name() external view virtual returns (string memory); - function shouldEndEpoch() public view virtual returns (bool); + function shouldEndEpoch() external view virtual returns (bool); function _autoProtect() internal view virtual returns (bool); - function shouldStartEpoch() public view returns (bool) { + /* + * @notice + * Check wether a token address is part of rewards or not + * @param token, token address to check + * @return wether the provided token address is a reward for the strar or not + */ + function _isReward(address token) internal view returns (bool) { + for (uint256 i = 0; i < rewardTokens.length; i++) { + if (rewardTokens[i] == token) { + return true; + } + } + + return false; + } + + /* + * @notice + * Function used in harvestTrigger in providers to decide wether an epoch can be started or not: + * - if there is balance of tokens but no position open, return true + * @return wether to start a new epoch or not + */ + function shouldStartEpoch() external view returns (bool) { // return true if we have balance of A or balance of B while the position is closed return (balanceOfA() > 0 || balanceOfB() > 0) && @@ -176,6 +203,12 @@ abstract contract Joint is ySwapper { investedB == 0; } + /* + * @notice + * Function available for vault managers to set the boolean value deciding wether + * to re-invest into the LP or not + * @param _dontInvestWant, new booelan value to use + */ function setDontInvestWant(bool _dontInvestWant) external onlyVaultManagers @@ -183,6 +216,11 @@ abstract contract Joint is ySwapper { dontInvestWant = _dontInvestWant; } + /* + * @notice + * Function available for vault managers to set the minimum reward to harvest + * @param _minRewardToHarvest, new value to use + */ function setMinRewardToHarvest(uint256 _minRewardToHarvest) external onlyVaultManagers @@ -190,6 +228,11 @@ abstract contract Joint is ySwapper { minRewardToHarvest = _minRewardToHarvest; } + /* + * @notice + * Function available for vault managers to set the minimum amount to sell + * @param _minAmountToSell, new value to use + */ function setMinAmountToSell(uint256 _minAmountToSell) external onlyVaultManagers @@ -197,6 +240,11 @@ abstract contract Joint is ySwapper { minAmountToSell = _minAmountToSell; } + /* + * @notice + * Function available for vault managers to set the auto protection + * @param _autoProtectionDisabled, new value to use + */ function setAutoProtectionDisabled(bool _autoProtectionDisabled) external onlyVaultManagers @@ -204,6 +252,11 @@ abstract contract Joint is ySwapper { autoProtectionDisabled = _autoProtectionDisabled; } + /* + * @notice + * Function available for vault managers to set the maximum allowed loss + * @param _maxPercentageLoss, new value to use + */ function setMaxPercentageLoss(uint256 _maxPercentageLoss) external onlyVaultManagers @@ -212,8 +265,14 @@ abstract contract Joint is ySwapper { maxPercentageLoss = _maxPercentageLoss; } + /* + * @notice + * Function available for providers to close the joint position and return the funds to each + * provider strategy + */ function closePositionReturnFunds() external onlyProviders { - // Check if it needs to stop starting new epochs after finishing this one. _autoProtect is implemented in children + // Check if it needs to stop starting new epochs after finishing this one. + // _autoProtect is implemented in children if (_autoProtect() && !autoProtectionDisabled) { dontInvestWant = true; } @@ -232,32 +291,28 @@ abstract contract Joint is ySwapper { (uint256 currentBalanceA, uint256 currentBalanceB) = _closePosition(); // 2. SELL REWARDS FOR WANT - (address rewardSwappedTo, uint256 rewardSwapOutAmount) = - swapReward(balanceOfReward()); - if (rewardSwappedTo == tokenA) { - currentBalanceA = currentBalanceA.add(rewardSwapOutAmount); - } else if (rewardSwappedTo == tokenB) { - currentBalanceB = currentBalanceB.add(rewardSwapOutAmount); - } + (uint256 rewardsSwappedToA, uint256 rewardsSwappedToB) = swapRewardTokens(); + currentBalanceA += rewardsSwappedToA; + currentBalanceB += rewardsSwappedToB; // 3. REBALANCE PORTFOLIO // Calculate rebalance operation - // It will return which of the tokens (A or B) we need to sell and how much of it to leave the position with the initial proportions - (address sellToken, uint256 sellAmount) = - calculateSellToBalance( - currentBalanceA, - currentBalanceB, - investedA, - investedB - ); - + // It will return which of the tokens (A or B) we need to sell and how much of it + // to leave the position with the initial proportions + (address sellToken, uint256 sellAmount) = calculateSellToBalance( + currentBalanceA, + currentBalanceB, + investedA, + investedB + ); + // Perform the swap to balance the tokens if (sellToken != address(0) && sellAmount > minAmountToSell) { - uint256 buyAmount = - sellCapital( - sellToken, - sellToken == tokenA ? tokenB : tokenA, - sellAmount - ); + uint256 buyAmount = swap( + sellToken, + sellToken == tokenA ? tokenB : tokenA, + sellAmount, + 0 + ); } // reset invested balances @@ -265,25 +320,30 @@ abstract contract Joint is ySwapper { _returnLooseToProviders(); // Check that we have returned with no losses - // + require( IERC20(tokenA).balanceOf(address(providerA)) >= - providerA - .totalDebt() - .mul(RATIO_PRECISION.sub(maxPercentageLoss)) - .div(RATIO_PRECISION), + (providerA.totalDebt() * + (RATIO_PRECISION - maxPercentageLoss)) / + RATIO_PRECISION, "!wrong-balanceA" ); require( IERC20(tokenB).balanceOf(address(providerB)) >= - providerB - .totalDebt() - .mul(RATIO_PRECISION.sub(maxPercentageLoss)) - .div(RATIO_PRECISION), + (providerB.totalDebt() * + (RATIO_PRECISION - maxPercentageLoss)) / + RATIO_PRECISION, "!wrong-balanceB" ); } - + + /* + * @notice + * Function available for providers to open the joint position: + * - open the LP position + * - open the hedginf position if necessary + * - deposit the LPs if necessary + */ function openPosition() external onlyProviders { // No capital, nothing to do if (balanceOfA() == 0 || balanceOfB() == 0) { @@ -292,369 +352,412 @@ abstract contract Joint is ySwapper { require( balanceOfStake() == 0 && - balanceOfPair() == 0 && + balanceOfPool() == 0 && investedA == 0 && investedB == 0 ); // don't create LP if we are already invested - (uint256 amountA, uint256 amountB, ) = createLP(); + // Open the LP position + (uint256 amountA, uint256 amountB) = createLP(); + // Open hedge (uint256 costHedgeA, uint256 costHedgeB) = hedgeLP(); - investedA = amountA.add(costHedgeA); - investedB = amountB.add(costHedgeB); + // Set invested amounts + investedA = amountA + costHedgeA; + investedB = amountB + costHedgeB; + // Deposit LPs (if any) depositLP(); - if (tradesEnabled == false && tradeFactory != address(0)) { - _setUpTradeFactory(); - } - - if (balanceOfStake() != 0 || balanceOfPair() != 0) { + // If there is loose balance, return it + if (balanceOfStake() != 0 || balanceOfPool() != 0) { _returnLooseToProviders(); } } - function getYSwapTokens() - internal - view - virtual - override - returns (address[] memory, address[] memory) - {} - - function removeTradeFactoryPermissions() - external - virtual - override - onlyVaultManagers - {} - - function updateTradeFactoryPermissions(address _newTradeFactory) - external - virtual - override - onlyGovernance - {} - // Keepers will claim and sell rewards mid-epoch (otherwise we sell only in the end) - function harvest() external onlyKeepers { + function harvest() external virtual onlyKeepers { getReward(); } - function harvestTrigger() external view returns (bool) { - return balanceOfReward() > minRewardToHarvest; + function harvestTrigger(uint256 callCost) external view virtual returns (bool) { + return balanceOfRewardToken()[0] > minRewardToHarvest; } function getHedgeProfit() public view virtual returns (uint256, uint256); + /* + * @notice + * Function estimating the current assets in the joint, taking into account: + * - current balance of tokens in the LP + * - pending rewards from the LP (if any) + * - hedge profit (if any) + * - rebalancing of tokens to maintain token ratios + * @return _aBalance, _bBalance, estimated tokenA and tokenB balances + */ function estimatedTotalAssetsAfterBalance() public view - virtual returns (uint256 _aBalance, uint256 _bBalance) { - uint256 rewardsPending = pendingReward().add(balanceOfReward()); - + // Current status of tokens in LP (includes potential IL) (_aBalance, _bBalance) = balanceOfTokensInLP(); - _aBalance = _aBalance.add(balanceOfA()); - _bBalance = _bBalance.add(balanceOfB()); + // Add remaining balance in joint (if any) + _aBalance = _aBalance + balanceOfA(); + _bBalance = _bBalance + balanceOfB(); + // Include hedge payoffs (uint256 callProfit, uint256 putProfit) = getHedgeProfit(); - _aBalance = _aBalance.add(callProfit); - _bBalance = _bBalance.add(putProfit); - - if (reward == tokenA) { - _aBalance = _aBalance.add(rewardsPending); - } else if (reward == tokenB) { - _bBalance = _bBalance.add(rewardsPending); - } else if (rewardsPending != 0) { - address swapTo = findSwapTo(reward); - uint256[] memory outAmounts = - IUniswapV2Router02(router).getAmountsOut( - rewardsPending, - getTokenOutPath(reward, swapTo) + _aBalance = _aBalance + callProfit; + _bBalance = _bBalance + putProfit; + + // Include rewards (swapping them if not tokenA or tokenB) + uint256[] memory _rewardsPending = pendingRewards(); + for (uint256 i = 0; i < rewardTokens.length; i++) { + address reward = rewardTokens[i]; + if (reward == tokenA) { + _aBalance = _aBalance + _rewardsPending[i]; + } else if (reward == tokenB) { + _bBalance = _bBalance + _rewardsPending[i]; + } else if (_rewardsPending[i] != 0) { + address swapTo = findSwapTo(reward); + uint256 outAmount = quote( + reward, + swapTo, + _rewardsPending[i] + IERC20(reward).balanceOf(address(this)) ); - if (swapTo == tokenA) { - _aBalance = _aBalance.add(outAmounts[outAmounts.length - 1]); - } else if (swapTo == tokenB) { - _bBalance = _bBalance.add(outAmounts[outAmounts.length - 1]); + if (swapTo == tokenA) { + _aBalance = _aBalance + outAmount; + } else if (swapTo == tokenB) { + _bBalance = _bBalance + outAmount; + } } } - (address sellToken, uint256 sellAmount) = - calculateSellToBalance(_aBalance, _bBalance, investedA, investedB); - - (uint256 reserveA, uint256 reserveB) = getReserves(); + // Calculate rebalancing operation needed + (address sellToken, uint256 sellAmount) = calculateSellToBalance( + _aBalance, + _bBalance, + investedA, + investedB + ); + // Update amounts with rebalancing operation if (sellToken == tokenA) { - uint256 buyAmount = - UniswapV2Library.getAmountOut(sellAmount, reserveA, reserveB); - _aBalance = _aBalance.sub(sellAmount); - _bBalance = _bBalance.add(buyAmount); + uint256 buyAmount = quote(sellToken, tokenB, sellAmount); + _aBalance = _aBalance - sellAmount; + _bBalance = _bBalance + buyAmount; } else if (sellToken == tokenB) { - uint256 buyAmount = - UniswapV2Library.getAmountOut(sellAmount, reserveB, reserveA); - _bBalance = _bBalance.sub(sellAmount); - _aBalance = _aBalance.add(buyAmount); - } - } - - function estimatedTotalAssetsInToken(address token) - public - view - returns (uint256 _balance) - { - if (token == tokenA) { - (_balance, ) = estimatedTotalAssetsAfterBalance(); - } else if (token == tokenB) { - (, _balance) = estimatedTotalAssetsAfterBalance(); + uint256 buyAmount = quote(sellToken, tokenA, sellAmount); + _bBalance = _bBalance - sellAmount; + _aBalance = _aBalance + buyAmount; } } - function getHedgeBudget(address token) - public - view - virtual - returns (uint256); - - function hedgeLP() internal virtual returns (uint256, uint256); - - function closeHedge() internal virtual; - + /* + * @notice + * Function available internally calculating the necessary operation to rebalance + * the tokenA and tokenB balances to initial ratios + * @param currentA, current balance of tokenA + * @param currentB, current balance of tokenB + * @param startingA, initial balance of tokenA + * @param startingB, initial balance of tokenB + * @return _sellToken, address of the token needed to sell + * @return _sellAmount, amount needed to sell + */ function calculateSellToBalance( uint256 currentA, uint256 currentB, uint256 startingA, uint256 startingB - ) internal view virtual returns (address _sellToken, uint256 _sellAmount) { + ) internal view returns (address _sellToken, uint256 _sellAmount) { + // If no position, no calculation needed if (startingA == 0 || startingB == 0) return (address(0), 0); - (uint256 ratioA, uint256 ratioB) = - getRatios(currentA, currentB, startingA, startingB); + // Get the current ratio between current and starting balance for each token + (uint256 ratioA, uint256 ratioB) = getRatios( + currentA, + currentB, + startingA, + startingB + ); + // if already balanced, no action needed if (ratioA == ratioB) return (address(0), 0); - (uint256 reserveA, uint256 reserveB) = getReserves(); - + // If ratioA is higher, there is excess of tokenA if (ratioA > ratioB) { _sellToken = tokenA; + // Simulate the swap and assess the received amount _sellAmount = _calculateSellToBalance( + _sellToken, currentA, currentB, startingA, startingB, - reserveA, - reserveB, 10**uint256(IERC20Extended(tokenA).decimals()) ); } else { + // ratioB is higher, excess of tokenB _sellToken = tokenB; + // Simulate the swap and assess the received amount _sellAmount = _calculateSellToBalance( + _sellToken, currentB, currentA, startingB, startingA, - reserveB, - reserveA, 10**uint256(IERC20Extended(tokenB).decimals()) ); } } + /* + * @notice + * Function available internally calculating and simulating the necessary swap to + * rebalance the tokens + * @param sellToken, address of the token to sell + * @param current0, current balance of token + * @param current1, current balance of other token + * @param starting0, initial balance of token + * @param starting1, initial balance of other token + * @param precision, constant value ensuring precision is preserved + * @return _sellAmount, amount needed to sell + */ function _calculateSellToBalance( + address sellToken, uint256 current0, uint256 current1, uint256 starting0, uint256 starting1, - uint256 reserve0, - uint256 reserve1, uint256 precision - ) internal pure returns (uint256 _sellAmount) { - uint256 numerator = - current0.sub(starting0.mul(current1).div(starting1)).mul(precision); - uint256 denominator; - uint256 exchangeRate; + ) internal view returns (uint256 _sellAmount) { + uint256 numerator = (current0 - ((starting0 * current1) / starting1)) * + precision; + uint256 exchangeRate = quote( + sellToken, + sellToken == tokenA ? tokenB : tokenA, + precision + ); // First time to approximate - exchangeRate = UniswapV2Library.getAmountOut( - precision, - reserve0, - reserve1 - ); - denominator = precision + starting0.mul(exchangeRate).div(starting1); - _sellAmount = numerator.div(denominator); + _sellAmount = + numerator / + (precision + ((starting0 * exchangeRate) / starting1)); // Shortcut to avoid Uniswap amountIn == 0 revert if (_sellAmount == 0) { return 0; } // Second time to account for price impact - exchangeRate = UniswapV2Library - .getAmountOut(_sellAmount, reserve0, reserve1) - .mul(precision) - .div(_sellAmount); - denominator = precision + starting0.mul(exchangeRate).div(starting1); - _sellAmount = numerator.div(denominator); - } - - function getRatios( - uint256 currentA, - uint256 currentB, - uint256 startingA, - uint256 startingB - ) internal pure returns (uint256 _a, uint256 _b) { - _a = currentA.mul(RATIO_PRECISION).div(startingA); - _b = currentB.mul(RATIO_PRECISION).div(startingB); - } - - function getReserves() + exchangeRate = + (quote( + sellToken, + sellToken == tokenA ? tokenB : tokenA, + _sellAmount + ) * precision) / + _sellAmount; + _sellAmount = + numerator / + (precision + ((starting0 * exchangeRate) / starting1)); + } + + /* + * @notice + * Function available publicly estimating the balance of one of the providers + * (one of the tokens). Re-uses the estimatedTotalAssetsAfterBalance function but oonly uses + * one the 2 returned values + * @param _provider, address of the provider of interest + * @return _balance, balance of the requested provider + */ + function estimatedTotalProviderAssets(address _provider) public view - returns (uint256 reserveA, uint256 reserveB) + returns (uint256 _balance) { - if (tokenA == pair.token0()) { - (reserveA, reserveB, ) = pair.getReserves(); - } else { - (reserveB, reserveA, ) = pair.getReserves(); + if (_provider == address(providerA)) { + (_balance, ) = estimatedTotalAssetsAfterBalance(); + } else if (_provider == address(providerB)) { + (, _balance) = estimatedTotalAssetsAfterBalance(); } } - function createLP() - internal + function getHedgeBudget(address token) + public + view virtual - returns ( - uint256, - uint256, - uint256 - ) - { - // **WARNING**: This call is sandwichable, care should be taken - // to always execute with a private relay - return - IUniswapV2Router02(router).addLiquidity( - tokenA, - tokenB, - balanceOfA() - .mul(RATIO_PRECISION.sub(getHedgeBudget(tokenA))) - .div(RATIO_PRECISION), - balanceOfB() - .mul(RATIO_PRECISION.sub(getHedgeBudget(tokenB))) - .div(RATIO_PRECISION), - 0, - 0, - address(this), - now - ); - } + returns (uint256); + + function hedgeLP() internal virtual returns (uint256, uint256); + + function closeHedge() internal virtual; - function findSwapTo(address token) internal view returns (address) { - if (tokenA == token) { + /* + * @notice + * Function available publicly estimating the balancing ratios for the 2 tokens in the form: + * ratio = currentBalance / investedBalance + * @param currentA, current balance of tokenA + * @param currentB, current balance of tokenB + * @param startingA, initial balance of tokenA + * @param startingB, initial balance of tokenB + * @return _a, _b, ratios for tokenA and tokenB + */ + function getRatios( + uint256 currentA, + uint256 currentB, + uint256 startingA, + uint256 startingB + ) public pure returns (uint256 _a, uint256 _b) { + _a = (currentA * RATIO_PRECISION) / startingA; + _b = (currentB * RATIO_PRECISION) / startingB; + } + + function createLP() internal virtual returns (uint256, uint256); + + function burnLP(uint256 amount) internal virtual; + + /* + * @notice + * Function available internally deciding what to swap agaisnt the requested token: + * - if token is either tokenA or B, swap to the other + * - if token is not A or B but is a reward, swap to the reference token if it's + * either A or B, if not, swap to tokenA + * @param token, address of the token to swap from + * @return address of the token to swap to + */ + function findSwapTo(address from_token) internal view returns (address) { + if (tokenA == from_token) { return tokenB; - } else if (tokenB == token) { - return tokenA; - } else if (reward == token) { - if (tokenA == WETH || tokenB == WETH) { - return WETH; - } + } else if (tokenB == from_token) { return tokenA; - } else { - revert("!swapTo"); } + if (tokenA == referenceToken || tokenB == referenceToken) { + return referenceToken; + } + return tokenA; } + /* + * @notice + * Function available internally deciding the swapping path to follow + * @param _token_in, address of the token to swap from + * @param _token_to, address of the token to swap to + * @return address array of the swap path to follow + */ function getTokenOutPath(address _token_in, address _token_out) internal view returns (address[] memory _path) - { - bool is_weth = - _token_in == address(WETH) || _token_out == address(WETH); - bool is_internal = - (_token_in == tokenA && _token_out == tokenB) || - (_token_in == tokenB && _token_out == tokenA); - _path = new address[](is_weth || is_internal ? 2 : 3); + { + address _tokenA = tokenA; + address _tokenB = tokenB; + bool isReferenceToken = _token_in == address(referenceToken) || + _token_out == address(referenceToken); + bool is_internal = (_token_in == _tokenA && _token_out == _tokenB) || + (_token_in == _tokenB && _token_out == _tokenA); + _path = new address[](isReferenceToken || is_internal ? 2 : 3); _path[0] = _token_in; - if (is_weth || is_internal) { + if (isReferenceToken || is_internal) { _path[1] = _token_out; } else { - _path[1] = address(WETH); + _path[1] = address(referenceToken); _path[2] = _token_out; } } function getReward() internal virtual; - function depositLP() internal virtual; + function depositLP() internal virtual {} - function withdrawLP() internal virtual; + function withdrawLP() internal virtual {} - function swapReward(uint256 _rewardBal) + /* + * @notice + * Function available internally swapping amounts necessary to swap rewards + * @return amounts exchanged to tokenA and tokenB + */ + function swapRewardTokens() internal virtual - returns (address, uint256) + returns (uint256 swappedToA, uint256 swappedToB) { - if (reward == tokenA || reward == tokenB || _rewardBal == 0) { - return (reward, 0); - } - - if (tokenA == WETH || tokenB == WETH) { - return (WETH, sellCapital(reward, WETH, _rewardBal)); - } - - // Assume that position has already been liquidated - (uint256 ratioA, uint256 ratioB) = - getRatios(balanceOfA(), balanceOfB(), investedA, investedB); - if (ratioA >= ratioB) { - return (tokenB, sellCapital(reward, tokenB, _rewardBal)); + address _tokenA = tokenA; + address _tokenB = tokenB; + for (uint256 i = 0; i < rewardTokens.length; i++) { + address reward = rewardTokens[i]; + uint256 _rewardBal = IERC20(reward).balanceOf(address(this)); + // If the reward token is either A or B, don't swap + if (reward == _tokenA || reward == _tokenB || _rewardBal == 0) { + continue; + // If the referenceToken is either A or B, swap rewards against it + } else if (_tokenA == referenceToken) { + swappedToA += swap(reward, referenceToken, _rewardBal, 0); + } else if (_tokenB == referenceToken) { + swappedToB += swap(reward, referenceToken, _rewardBal, 0); + } else { + // Assume that position has already been liquidated + (uint256 ratioA, uint256 ratioB) = getRatios( + balanceOfA(), + balanceOfB(), + investedA, + investedB + ); + + if (ratioA >= ratioB) { + swappedToB += swap(reward, _tokenB, _rewardBal, 0); + } else { + swappedToA += swap(reward, _tokenA, _rewardBal, 0); + } + } } - return (tokenA, sellCapital(reward, tokenA, _rewardBal)); + return (swappedToA, swappedToB); } - // If there is a lot of impermanent loss, some capital will need to be sold - // To make both sides even - function sellCapital( + function swap( address _tokenFrom, address _tokenTo, - uint256 _amountIn - ) internal virtual returns (uint256 _amountOut) { - uint256[] memory amounts = - IUniswapV2Router02(router).swapExactTokensForTokens( - _amountIn, - 0, - getTokenOutPath(_tokenFrom, _tokenTo), - address(this), - now - ); - _amountOut = amounts[amounts.length - 1]; - } + uint256 _amountIn, + uint256 _minOutAmount + ) internal virtual returns (uint256 _amountOut); - function _closePosition() internal virtual returns (uint256, uint256) { + function quote( + address _tokenFrom, + address _tokenTo, + uint256 _amountIn + ) internal view virtual returns (uint256 _amountOut); + + /* + * @notice + * Function available internally closing the joint postion: + * - withdraw LPs (if any) + * - close hedging position (if any) + * - close LP position + * @return balance of tokenA and tokenB + */ + function _closePosition() internal returns (uint256, uint256) { // Unstake LP from staking contract withdrawLP(); // Close the hedge closeHedge(); - if (balanceOfPair() == 0) { + if (balanceOfPool() == 0) { return (0, 0); } // **WARNING**: This call is sandwichable, care should be taken // to always execute with a private relay - IUniswapV2Router02(router).removeLiquidity( - tokenA, - tokenB, - balanceOfPair(), - 0, - 0, - address(this), - now - ); + burnLP(balanceOfPool()); return (balanceOfA(), balanceOfB()); } + /* + * @notice + * Function available internally sending back all funds to provuder strategies + * @return balance of tokenA and tokenB + */ function _returnLooseToProviders() internal returns (uint256 balanceA, uint256 balanceB) @@ -670,45 +773,56 @@ abstract contract Joint is ySwapper { } } - function getPair() internal view virtual returns (address) { - address factory = IUniswapV2Router02(router).factory(); - return IUniswapV2Factory(factory).getPair(tokenA, tokenB); - } - - function balanceOfPair() public view returns (uint256) { - return IERC20(getPair()).balanceOf(address(this)); - } - + /* + * @notice + * Function available publicly returning the joint's balance of tokenA + * @return balance of tokenA + */ function balanceOfA() public view returns (uint256) { return IERC20(tokenA).balanceOf(address(this)); } + /* + * @notice + * Function available publicly returning the joint's balance of tokenB + * @return balance of tokenB + */ function balanceOfB() public view returns (uint256) { return IERC20(tokenB).balanceOf(address(this)); } - function balanceOfReward() public view returns (uint256) { - return IERC20(reward).balanceOf(address(this)); + function balanceOfPool() public view virtual returns (uint256); + + /* + * @notice + * Function available publicly returning the joint's balance of rewards + * @return array of balances + */ + function balanceOfRewardToken() public view returns (uint256[] memory) { + uint256[] memory _balances = new uint256[](rewardTokens.length); + for (uint8 i = 0; i < rewardTokens.length; i++) { + _balances[i] = IERC20(rewardTokens[i]).balanceOf(address(this)); + } + return _balances; } - function balanceOfStake() public view virtual returns (uint256); + function balanceOfStake() public view virtual returns (uint256 _balance) {} function balanceOfTokensInLP() public view - returns (uint256 _balanceA, uint256 _balanceB) - { - (uint256 reserveA, uint256 reserveB) = getReserves(); - uint256 lpBal = balanceOfStake().add(balanceOfPair()); - uint256 pairPrecision = 10**uint256(pair.decimals()); - uint256 percentTotal = lpBal.mul(pairPrecision).div(pair.totalSupply()); - _balanceA = reserveA.mul(percentTotal).div(pairPrecision); - _balanceB = reserveB.mul(percentTotal).div(pairPrecision); - } + virtual + returns (uint256 _balanceA, uint256 _balanceB); - function pendingReward() public view virtual returns (uint256); + function pendingRewards() public view virtual returns (uint256[] memory); // --- MANAGEMENT FUNCTIONS --- + /* + * @notice + * Function available to vault managers closing the joint position manually + * @param expectedBalanceA, expected balance of tokenA to receive + * @param expectedBalanceB, expected balance of tokenB to receive + */ function liquidatePositionManually( uint256 expectedBalanceA, uint256 expectedBalanceB @@ -718,46 +832,41 @@ abstract contract Joint is ySwapper { require(expectedBalanceB <= balanceB, "!sandwidched"); } + /* + * @notice + * Function available to vault managers returning the funds to the providers manually + */ function returnLooseToProvidersManually() external onlyVaultManagers { _returnLooseToProviders(); } + /* + * @notice + * Function available to vault managers closing the LP position manually + * @param expectedBalanceA, expected balance of tokenA to receive + * @param expectedBalanceB, expected balance of tokenB to receive + */ function removeLiquidityManually( uint256 amount, uint256 expectedBalanceA, uint256 expectedBalanceB ) external virtual onlyVaultManagers { - IUniswapV2Router02(router).removeLiquidity( - tokenA, - tokenB, - amount, - 0, - 0, - address(this), - now - ); + burnLP(amount); require(expectedBalanceA <= balanceOfA(), "!sandwidched"); require(expectedBalanceB <= balanceOfB(), "!sandwidched"); } function swapTokenForTokenManually( - address[] memory swapPath, + bool sellA, uint256 swapInAmount, uint256 minOutAmount - ) external onlyGovernance returns (uint256) { - address swapTo = swapPath[swapPath.length - 1]; - require(swapTo == tokenA || swapTo == tokenB); // swapTo must be tokenA or tokenB - uint256[] memory amounts = - IUniswapV2Router02(router).swapExactTokensForTokens( - swapInAmount, - minOutAmount, - swapPath, - address(this), - now - ); - return amounts[amounts.length - 1]; - } + ) external virtual returns (uint256); + /* + * @notice + * Function available to governance sweeping a specified token but tokenA and B + * @param _token, address of the token to sweep + */ function sweep(address _token) external onlyGovernance { require(_token != address(tokenA)); require(_token != address(tokenB)); @@ -769,6 +878,11 @@ abstract contract Joint is ySwapper { ); } + /* + * @notice + * Function available to providers to change the provider addresses + * @param _newProvider, new address of provider + */ function migrateProvider(address _newProvider) external onlyProviders { ProviderStrategy newProvider = ProviderStrategy(_newProvider); if (address(newProvider.want()) == tokenA) { @@ -779,4 +893,23 @@ abstract contract Joint is ySwapper { revert("Unsupported token"); } } + + /* + * @notice + * Internal function checking if allowance is already enough for the contract + * and if not, safely sets it to max + * @param _contract, spender contract + * @param _token, token to approve spend + * @param _amount, _amoun to approve + */ + function _checkAllowance( + address _contract, + IERC20 _token, + uint256 _amount + ) internal { + if (_token.allowance(address(this), _contract) < _amount) { + _token.safeApprove(_contract, 0); + _token.safeApprove(_contract, _amount); + } + } } diff --git a/contracts/ProviderStrategy.sol b/contracts/ProviderStrategy.sol index dbfc53c..2ee9e67 100644 --- a/contracts/ProviderStrategy.sol +++ b/contracts/ProviderStrategy.sol @@ -1,19 +1,13 @@ // SPDX-License-Identifier: AGPL-3.0 -pragma solidity 0.6.12; +pragma solidity ^0.8.12; pragma experimental ABIEncoderV2; -import { - SafeERC20, - SafeMath, - IERC20, - Address -} from "@openzeppelin/contracts/token/ERC20/SafeERC20.sol"; -import "../interfaces/uni/IUniswapV2Router02.sol"; +import {Address} from "@openzeppelin/contracts/utils/Address.sol"; +import {IERC20} from "@openzeppelin/contracts/token/ERC20/IERC20.sol"; +import {SafeERC20} from "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol"; + import "../interfaces/IERC20Extended.sol"; -import "@openzeppelin/contracts/math/Math.sol"; -import { - BaseStrategyInitializable -} from "@yearnvaults/contracts/BaseStrategy.sol"; +import {BaseStrategyInitializable} from "@yearnvaults/contracts/BaseStrategy.sol"; interface JointAPI { function closePositionReturnFunds() external; @@ -24,7 +18,7 @@ interface JointAPI { function providerB() external view returns (address); - function estimatedTotalAssetsInToken(address token) + function estimatedTotalProviderAssets(address provider) external view returns (uint256); @@ -36,7 +30,7 @@ interface JointAPI { function migrateProvider(address _newProvider) external; function shouldEndEpoch() external view returns (bool); - + function shouldStartEpoch() external view returns (bool); function dontInvestWant() external view returns (bool); @@ -45,11 +39,11 @@ interface JointAPI { contract ProviderStrategy is BaseStrategyInitializable { using SafeERC20 for IERC20; using Address for address; - using SafeMath for uint256; address public joint; bool public forceLiquidate; + bool public launchHarvest; constructor(address _vault) public BaseStrategyInitializable(_vault) {} @@ -67,15 +61,18 @@ contract ProviderStrategy is BaseStrategyInitializable { function estimatedTotalAssets() public view override returns (uint256) { return - want.balanceOf(address(this)).add( - JointAPI(joint).estimatedTotalAssetsInToken(address(want)) - ); + want.balanceOf(address(this)) + + JointAPI(joint).estimatedTotalProviderAssets(address(this)); } function totalDebt() public view returns (uint256) { return vault.strategies(address(this)).totalDebt; } + function setLaunchHarvest(bool _newLaunchHarvest) external onlyVaultManagers { + launchHarvest = _newLaunchHarvest; + } + function prepareReturn(uint256 _debtOutstanding) internal override @@ -85,6 +82,9 @@ contract ProviderStrategy is BaseStrategyInitializable { uint256 _debtPayment ) { + if (launchHarvest) { + launchHarvest = false; + } // NOTE: this strategy is operated following epochs. These begin during adjustPosition and end during prepareReturn // The Provider will always ask the joint to close the position before harvesting JointAPI(joint).closePositionReturnFunds(); @@ -95,14 +95,14 @@ contract ProviderStrategy is BaseStrategyInitializable { if (_totalDebt > totalAssets) { // we have losses - _loss = _totalDebt.sub(totalAssets); + _loss = _totalDebt - totalAssets; } else { // we have profit - _profit = totalAssets.sub(_totalDebt); + _profit = totalAssets - _totalDebt; } uint256 amountAvailable = totalAssets; - uint256 amountRequired = _debtOutstanding.add(_profit); + uint256 amountRequired = _debtOutstanding + _profit; if (amountRequired > amountAvailable) { if (_debtOutstanding > amountAvailable) { @@ -115,13 +115,13 @@ contract ProviderStrategy is BaseStrategyInitializable { // NOTE: amountRequired is always equal or greater than _debtOutstanding // important to use amountAvailable just in case amountRequired is > amountAvailable _debtPayment = _debtOutstanding; - _profit = amountAvailable.sub(_debtPayment); + _profit = amountAvailable - _debtPayment; } } else { _debtPayment = _debtOutstanding; // profit remains unchanged unless there is not enough to pay it - if (amountRequired.sub(_debtPayment) < _profit) { - _profit = amountRequired.sub(_debtPayment); + if (amountRequired - _debtPayment < _profit) { + _profit = amountRequired - _debtPayment; } } } @@ -133,7 +133,9 @@ contract ProviderStrategy is BaseStrategyInitializable { returns (bool) { // Delegating decision to joint - return (JointAPI(joint).shouldStartEpoch() && balanceOfWant() > 0) || JointAPI(joint).shouldEndEpoch(); + return + (JointAPI(joint).shouldStartEpoch() && balanceOfWant() > 0) || + JointAPI(joint).shouldEndEpoch() || launchHarvest; } function dontInvestWant() public view returns (bool) { @@ -149,7 +151,7 @@ contract ProviderStrategy is BaseStrategyInitializable { // Using a push approach (instead of pull) uint256 wantBalance = balanceOfWant(); if (wantBalance > 0) { - want.transfer(joint, wantBalance); + want.safeTransfer(joint, wantBalance); } JointAPI(joint).openPosition(); @@ -163,7 +165,7 @@ contract ProviderStrategy is BaseStrategyInitializable { uint256 availableAssets = want.balanceOf(address(this)); if (_amountNeeded > availableAssets) { _liquidatedAmount = availableAssets; - _loss = _amountNeeded.sub(availableAssets); + _loss = _amountNeeded - availableAssets; } else { _liquidatedAmount = _amountNeeded; } @@ -211,8 +213,7 @@ contract ProviderStrategy is BaseStrategyInitializable { _amountFreed = balanceOfWant(); // NOTE: we accept a 1% difference before reverting require( - forceLiquidate || - expectedBalance.mul(9_900).div(10_000) < _amountFreed, + forceLiquidate || (expectedBalance * 9_900) / 10_000 < _amountFreed, "!liquidation" ); } @@ -233,17 +234,9 @@ contract ProviderStrategy is BaseStrategyInitializable { view returns (uint256) { - if (amount == 0 || address(want) == token) { - return amount; - } - - uint256[] memory amounts = - IUniswapV2Router02(JointAPI(joint).router()).getAmountsOut( - amount, - getTokenOutPath(token, address(want)) - ); - - return amounts[amounts.length - 1]; + // if (amount == 0 || address(want) == token) { + return amount; + // } } function getTokenOutPath(address _token_in, address _token_out) @@ -251,9 +244,8 @@ contract ProviderStrategy is BaseStrategyInitializable { view returns (address[] memory _path) { - bool is_weth = - _token_in == address(JointAPI(joint).WETH()) || - _token_out == address(JointAPI(joint).WETH()); + bool is_weth = _token_in == address(JointAPI(joint).WETH()) || + _token_out == address(JointAPI(joint).WETH()); _path = new address[](is_weth ? 2 : 3); _path[0] = _token_in; diff --git a/contracts/libraries/BitMath.sol b/contracts/libraries/BitMath.sol new file mode 100644 index 0000000..4e22e1b --- /dev/null +++ b/contracts/libraries/BitMath.sol @@ -0,0 +1,98 @@ +// SPDX-License-Identifier: GPL-2.0-or-later +pragma solidity ^0.8.0; + +/// @title BitMath +/// @dev This library provides functionality for computing bit properties of an unsigned integer +library BitMath { + /// @notice Returns the index of the most significant bit of the number, + /// where the least significant bit is at index 0 and the most significant bit is at index 255 + /// @dev The function satisfies the property: + /// x >= 2**mostSignificantBit(x) and x < 2**(mostSignificantBit(x)+1) + /// @param x the value for which to compute the most significant bit, must be greater than 0 + /// @return r the index of the most significant bit + function mostSignificantBit(uint256 x) internal pure returns (uint8 r) { + require(x > 0); + + unchecked { + if (x >= 0x100000000000000000000000000000000) { + x >>= 128; + r += 128; + } + if (x >= 0x10000000000000000) { + x >>= 64; + r += 64; + } + if (x >= 0x100000000) { + x >>= 32; + r += 32; + } + if (x >= 0x10000) { + x >>= 16; + r += 16; + } + if (x >= 0x100) { + x >>= 8; + r += 8; + } + if (x >= 0x10) { + x >>= 4; + r += 4; + } + if (x >= 0x4) { + x >>= 2; + r += 2; + } + if (x >= 0x2) r += 1; + } + } + + /// @notice Returns the index of the least significant bit of the number, + /// where the least significant bit is at index 0 and the most significant bit is at index 255 + /// @dev The function satisfies the property: + /// (x & 2**leastSignificantBit(x)) != 0 and (x & (2**(leastSignificantBit(x)) - 1)) == 0) + /// @param x the value for which to compute the least significant bit, must be greater than 0 + /// @return r the index of the least significant bit + function leastSignificantBit(uint256 x) internal pure returns (uint8 r) { + require(x > 0); + + unchecked { + r = 255; + if (x & type(uint128).max > 0) { + r -= 128; + } else { + x >>= 128; + } + if (x & type(uint64).max > 0) { + r -= 64; + } else { + x >>= 64; + } + if (x & type(uint32).max > 0) { + r -= 32; + } else { + x >>= 32; + } + if (x & type(uint16).max > 0) { + r -= 16; + } else { + x >>= 16; + } + if (x & type(uint8).max > 0) { + r -= 8; + } else { + x >>= 8; + } + if (x & 0xf > 0) { + r -= 4; + } else { + x >>= 4; + } + if (x & 0x3 > 0) { + r -= 2; + } else { + x >>= 2; + } + if (x & 0x1 > 0) r -= 1; + } + } +} diff --git a/contracts/libraries/FixedPoint128.sol b/contracts/libraries/FixedPoint128.sol new file mode 100644 index 0000000..6d6948b --- /dev/null +++ b/contracts/libraries/FixedPoint128.sol @@ -0,0 +1,8 @@ +// SPDX-License-Identifier: GPL-2.0-or-later +pragma solidity >=0.4.0; + +/// @title FixedPoint128 +/// @notice A library for handling binary fixed point numbers, see https://en.wikipedia.org/wiki/Q_(number_format) +library FixedPoint128 { + uint256 internal constant Q128 = 0x100000000000000000000000000000000; +} diff --git a/contracts/libraries/FixedPoint96.sol b/contracts/libraries/FixedPoint96.sol new file mode 100644 index 0000000..63b42c2 --- /dev/null +++ b/contracts/libraries/FixedPoint96.sol @@ -0,0 +1,10 @@ +// SPDX-License-Identifier: GPL-2.0-or-later +pragma solidity >=0.4.0; + +/// @title FixedPoint96 +/// @notice A library for handling binary fixed point numbers, see https://en.wikipedia.org/wiki/Q_(number_format) +/// @dev Used in SqrtPriceMath.sol +library FixedPoint96 { + uint8 internal constant RESOLUTION = 96; + uint256 internal constant Q96 = 0x1000000000000000000000000; +} diff --git a/contracts/libraries/FullMath.sol b/contracts/libraries/FullMath.sol new file mode 100644 index 0000000..e357426 --- /dev/null +++ b/contracts/libraries/FullMath.sol @@ -0,0 +1,128 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.0; + +/// @title Contains 512-bit math functions +/// @notice Facilitates multiplication and division that can have overflow of an intermediate value without any loss of precision +/// @dev Handles "phantom overflow" i.e., allows multiplication and division where an intermediate value overflows 256 bits +library FullMath { + /// @notice Calculates floor(a×b÷denominator) with full precision. Throws if result overflows a uint256 or denominator == 0 + /// @param a The multiplicand + /// @param b The multiplier + /// @param denominator The divisor + /// @return result The 256-bit result + /// @dev Credit to Remco Bloemen under MIT license https://xn--2-umb.com/21/muldiv + function mulDiv( + uint256 a, + uint256 b, + uint256 denominator + ) internal pure returns (uint256 result) { + unchecked { + // 512-bit multiply [prod1 prod0] = a * b + // Compute the product mod 2**256 and mod 2**256 - 1 + // then use the Chinese Remainder Theorem to reconstruct + // the 512 bit result. The result is stored in two 256 + // variables such that product = prod1 * 2**256 + prod0 + uint256 prod0; // Least significant 256 bits of the product + uint256 prod1; // Most significant 256 bits of the product + assembly { + let mm := mulmod(a, b, not(0)) + prod0 := mul(a, b) + prod1 := sub(sub(mm, prod0), lt(mm, prod0)) + } + + // Handle non-overflow cases, 256 by 256 division + if (prod1 == 0) { + require(denominator > 0); + assembly { + result := div(prod0, denominator) + } + return result; + } + + // Make sure the result is less than 2**256. + // Also prevents denominator == 0 + require(denominator > prod1); + + /////////////////////////////////////////////// + // 512 by 256 division. + /////////////////////////////////////////////// + + // Make division exact by subtracting the remainder from [prod1 prod0] + // Compute remainder using mulmod + uint256 remainder; + assembly { + remainder := mulmod(a, b, denominator) + } + // Subtract 256 bit number from 512 bit number + assembly { + prod1 := sub(prod1, gt(remainder, prod0)) + prod0 := sub(prod0, remainder) + } + + // Factor powers of two out of denominator + // Compute largest power of two divisor of denominator. + // Always >= 1. + uint256 twos = (0 - denominator) & denominator; + // Divide denominator by power of two + assembly { + denominator := div(denominator, twos) + } + + // Divide [prod1 prod0] by the factors of two + assembly { + prod0 := div(prod0, twos) + } + // Shift in bits from prod1 into prod0. For this we need + // to flip `twos` such that it is 2**256 / twos. + // If twos is zero, then it becomes one + assembly { + twos := add(div(sub(0, twos), twos), 1) + } + prod0 |= prod1 * twos; + + // Invert denominator mod 2**256 + // Now that denominator is an odd number, it has an inverse + // modulo 2**256 such that denominator * inv = 1 mod 2**256. + // Compute the inverse by starting with a seed that is correct + // correct for four bits. That is, denominator * inv = 1 mod 2**4 + uint256 inv = (3 * denominator) ^ 2; + // Now use Newton-Raphson iteration to improve the precision. + // Thanks to Hensel's lifting lemma, this also works in modular + // arithmetic, doubling the correct bits in each step. + inv *= 2 - denominator * inv; // inverse mod 2**8 + inv *= 2 - denominator * inv; // inverse mod 2**16 + inv *= 2 - denominator * inv; // inverse mod 2**32 + inv *= 2 - denominator * inv; // inverse mod 2**64 + inv *= 2 - denominator * inv; // inverse mod 2**128 + inv *= 2 - denominator * inv; // inverse mod 2**256 + + // Because the division is now exact we can divide by multiplying + // with the modular inverse of denominator. This will give us the + // correct result modulo 2**256. Since the precoditions guarantee + // that the outcome is less than 2**256, this is the final result. + // We don't need to compute the high bits of the result and prod1 + // is no longer required. + result = prod0 * inv; + return result; + } + } + + /// @notice Calculates ceil(a×b÷denominator) with full precision. Throws if result overflows a uint256 or denominator == 0 + /// @param a The multiplicand + /// @param b The multiplier + /// @param denominator The divisor + /// @return result The 256-bit result + function mulDivRoundingUp( + uint256 a, + uint256 b, + uint256 denominator + ) internal pure returns (uint256 result) { + unchecked { + result = mulDiv(a, b, denominator); + if (mulmod(a, b, denominator) > 0) { + require(result < type(uint256).max); + result++; + } + } + } +} diff --git a/contracts/libraries/LPHedgingLib.sol b/contracts/libraries/LPHedgingLib.sol index ce4576d..31cb0d4 100644 --- a/contracts/libraries/LPHedgingLib.sol +++ b/contracts/libraries/LPHedgingLib.sol @@ -1,13 +1,11 @@ -pragma solidity 0.6.12; - -import { - SafeERC20, - SafeMath, - IERC20, - Address -} from "@openzeppelin/contracts/token/ERC20/SafeERC20.sol"; -import "@openzeppelin/contracts/math/Math.sol"; -import "../../interfaces/uni/IUniswapV2Pair.sol"; +pragma solidity 0.8.12; + +import {Address} from "@openzeppelin/contracts/utils/Address.sol"; +import {IERC20} from "@openzeppelin/contracts/token/ERC20/IERC20.sol"; +import {SafeERC20} from "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol"; +import {SafeMath} from "@openzeppelin/contracts/utils/math/SafeMath.sol"; + +import "../../interfaces/uniswap/V2/IUniswapV2Pair.sol"; import "../../interfaces/hegic/IHegicOptions.sol"; import "../../interfaces/IERC20Extended.sol"; @@ -31,9 +29,9 @@ interface HegicJointAPI { } library LPHedgingLib { - using SafeMath for uint256; using SafeERC20 for IERC20; using Address for address; + using SafeMath for uint256; address public constant hegicOptionsManager = 0x1BA4b447d0dF64DA64024e5Ec47dA94458C1e97f; @@ -66,8 +64,9 @@ library LPHedgingLib { } function getCurrentPrice() public returns (uint256) { - IPriceProvider pp = - IPriceProvider(_hegicCallOptionsPool().priceProvider()); + IPriceProvider pp = IPriceProvider( + _hegicCallOptionsPool().priceProvider() + ); (, int256 answer, , , ) = pp.latestRoundData(); return uint256(answer); } @@ -113,8 +112,11 @@ library LPHedgingLib { uint256 amount ) public view returns (uint256) { // Strike = 0 means ATM option - (uint256 premium, uint256 settlementFee) = - pool.calculateTotalPremium(period, amount, 0); + (uint256 premium, uint256 settlementFee) = pool.calculateTotalPremium( + period, + amount, + 0 + ); return premium + settlementFee; } @@ -246,10 +248,12 @@ library LPHedgingLib { if (callID == 0 || putID == 0) { return 0; } - (, , , , uint256 expiredCall, , ) = - _hegicCallOptionsPool().options(callID); - (, , , , uint256 expiredPut, , ) = - _hegicPutOptionsPool().options(putID); + (, , , , uint256 expiredCall, , ) = _hegicCallOptionsPool().options( + callID + ); + (, , , , uint256 expiredPut, , ) = _hegicPutOptionsPool().options( + putID + ); // use lowest time to maturity (should be the same) uint256 expired = expiredCall > expiredPut ? expiredPut : expiredCall; if (expired < block.timestamp) { @@ -264,8 +268,9 @@ library LPHedgingLib { returns (uint256) { // NOTE: strike is the same for both options - (, uint256 strikeCall, , , , , ) = - _hegicCallOptionsPool().options(callID); + (, uint256 strikeCall, , , , , ) = _hegicCallOptionsPool().options( + callID + ); return strikeCall; } diff --git a/contracts/libraries/LiquidityAmounts.sol b/contracts/libraries/LiquidityAmounts.sol new file mode 100644 index 0000000..082e8aa --- /dev/null +++ b/contracts/libraries/LiquidityAmounts.sol @@ -0,0 +1,198 @@ +// SPDX-License-Identifier: GPL-2.0-or-later +pragma solidity >=0.5.0; + +import "./FullMath.sol"; +import "./FixedPoint96.sol"; + +/// @title Liquidity amount functions +/// @notice Provides functions for computing liquidity amounts from token amounts and prices +library LiquidityAmounts { + /// @notice Downcasts uint256 to uint128 + /// @param x The uint258 to be downcasted + /// @return y The passed value, downcasted to uint128 + function toUint128(uint256 x) private pure returns (uint128 y) { + require((y = uint128(x)) == x); + } + + /// @notice Computes the amount of liquidity received for a given amount of token0 and price range + /// @dev Calculates amount0 * (sqrt(upper) * sqrt(lower)) / (sqrt(upper) - sqrt(lower)) + /// @param sqrtRatioAX96 A sqrt price representing the first tick boundary + /// @param sqrtRatioBX96 A sqrt price representing the second tick boundary + /// @param amount0 The amount0 being sent in + /// @return liquidity The amount of returned liquidity + function getLiquidityForAmount0( + uint160 sqrtRatioAX96, + uint160 sqrtRatioBX96, + uint256 amount0 + ) internal pure returns (uint128 liquidity) { + if (sqrtRatioAX96 > sqrtRatioBX96) + (sqrtRatioAX96, sqrtRatioBX96) = (sqrtRatioBX96, sqrtRatioAX96); + uint256 intermediate = FullMath.mulDiv( + sqrtRatioAX96, + sqrtRatioBX96, + FixedPoint96.Q96 + ); + return + toUint128( + FullMath.mulDiv( + amount0, + intermediate, + sqrtRatioBX96 - sqrtRatioAX96 + ) + ); + } + + /// @notice Computes the amount of liquidity received for a given amount of token1 and price range + /// @dev Calculates amount1 / (sqrt(upper) - sqrt(lower)). + /// @param sqrtRatioAX96 A sqrt price representing the first tick boundary + /// @param sqrtRatioBX96 A sqrt price representing the second tick boundary + /// @param amount1 The amount1 being sent in + /// @return liquidity The amount of returned liquidity + function getLiquidityForAmount1( + uint160 sqrtRatioAX96, + uint160 sqrtRatioBX96, + uint256 amount1 + ) internal pure returns (uint128 liquidity) { + if (sqrtRatioAX96 > sqrtRatioBX96) + (sqrtRatioAX96, sqrtRatioBX96) = (sqrtRatioBX96, sqrtRatioAX96); + return + toUint128( + FullMath.mulDiv( + amount1, + FixedPoint96.Q96, + sqrtRatioBX96 - sqrtRatioAX96 + ) + ); + } + + /// @notice Computes the maximum amount of liquidity received for a given amount of token0, token1, the current + /// pool prices and the prices at the tick boundaries + /// @param sqrtRatioX96 A sqrt price representing the current pool prices + /// @param sqrtRatioAX96 A sqrt price representing the first tick boundary + /// @param sqrtRatioBX96 A sqrt price representing the second tick boundary + /// @param amount0 The amount of token0 being sent in + /// @param amount1 The amount of token1 being sent in + /// @return liquidity The maximum amount of liquidity received + function getLiquidityForAmounts( + uint160 sqrtRatioX96, + uint160 sqrtRatioAX96, + uint160 sqrtRatioBX96, + uint256 amount0, + uint256 amount1 + ) internal pure returns (uint128 liquidity) { + if (sqrtRatioAX96 > sqrtRatioBX96) + (sqrtRatioAX96, sqrtRatioBX96) = (sqrtRatioBX96, sqrtRatioAX96); + + if (sqrtRatioX96 <= sqrtRatioAX96) { + liquidity = getLiquidityForAmount0( + sqrtRatioAX96, + sqrtRatioBX96, + amount0 + ); + } else if (sqrtRatioX96 < sqrtRatioBX96) { + uint128 liquidity0 = getLiquidityForAmount0( + sqrtRatioX96, + sqrtRatioBX96, + amount0 + ); + uint128 liquidity1 = getLiquidityForAmount1( + sqrtRatioAX96, + sqrtRatioX96, + amount1 + ); + + liquidity = liquidity0 < liquidity1 ? liquidity0 : liquidity1; + } else { + liquidity = getLiquidityForAmount1( + sqrtRatioAX96, + sqrtRatioBX96, + amount1 + ); + } + } + + /// @notice Computes the amount of token0 for a given amount of liquidity and a price range + /// @param sqrtRatioAX96 A sqrt price representing the first tick boundary + /// @param sqrtRatioBX96 A sqrt price representing the second tick boundary + /// @param liquidity The liquidity being valued + /// @return amount0 The amount of token0 + function getAmount0ForLiquidity( + uint160 sqrtRatioAX96, + uint160 sqrtRatioBX96, + uint128 liquidity + ) internal pure returns (uint256 amount0) { + if (sqrtRatioAX96 > sqrtRatioBX96) + (sqrtRatioAX96, sqrtRatioBX96) = (sqrtRatioBX96, sqrtRatioAX96); + + return + FullMath.mulDiv( + uint256(liquidity) << FixedPoint96.RESOLUTION, + sqrtRatioBX96 - sqrtRatioAX96, + sqrtRatioBX96 + ) / sqrtRatioAX96; + } + + /// @notice Computes the amount of token1 for a given amount of liquidity and a price range + /// @param sqrtRatioAX96 A sqrt price representing the first tick boundary + /// @param sqrtRatioBX96 A sqrt price representing the second tick boundary + /// @param liquidity The liquidity being valued + /// @return amount1 The amount of token1 + function getAmount1ForLiquidity( + uint160 sqrtRatioAX96, + uint160 sqrtRatioBX96, + uint128 liquidity + ) internal pure returns (uint256 amount1) { + if (sqrtRatioAX96 > sqrtRatioBX96) + (sqrtRatioAX96, sqrtRatioBX96) = (sqrtRatioBX96, sqrtRatioAX96); + + return + FullMath.mulDiv( + liquidity, + sqrtRatioBX96 - sqrtRatioAX96, + FixedPoint96.Q96 + ); + } + + /// @notice Computes the token0 and token1 value for a given amount of liquidity, the current + /// pool prices and the prices at the tick boundaries + /// @param sqrtRatioX96 A sqrt price representing the current pool prices + /// @param sqrtRatioAX96 A sqrt price representing the first tick boundary + /// @param sqrtRatioBX96 A sqrt price representing the second tick boundary + /// @param liquidity The liquidity being valued + /// @return amount0 The amount of token0 + /// @return amount1 The amount of token1 + function getAmountsForLiquidity( + uint160 sqrtRatioX96, + uint160 sqrtRatioAX96, + uint160 sqrtRatioBX96, + uint128 liquidity + ) internal pure returns (uint256 amount0, uint256 amount1) { + if (sqrtRatioAX96 > sqrtRatioBX96) + (sqrtRatioAX96, sqrtRatioBX96) = (sqrtRatioBX96, sqrtRatioAX96); + + if (sqrtRatioX96 <= sqrtRatioAX96) { + amount0 = getAmount0ForLiquidity( + sqrtRatioAX96, + sqrtRatioBX96, + liquidity + ); + } else if (sqrtRatioX96 < sqrtRatioBX96) { + amount0 = getAmount0ForLiquidity( + sqrtRatioX96, + sqrtRatioBX96, + liquidity + ); + amount1 = getAmount1ForLiquidity( + sqrtRatioAX96, + sqrtRatioX96, + liquidity + ); + } else { + amount1 = getAmount1ForLiquidity( + sqrtRatioAX96, + sqrtRatioBX96, + liquidity + ); + } + } +} diff --git a/contracts/libraries/SafeCast.sol b/contracts/libraries/SafeCast.sol new file mode 100644 index 0000000..a8ea229 --- /dev/null +++ b/contracts/libraries/SafeCast.sol @@ -0,0 +1,28 @@ +// SPDX-License-Identifier: GPL-2.0-or-later +pragma solidity >=0.5.0; + +/// @title Safe casting methods +/// @notice Contains methods for safely casting between types +library SafeCast { + /// @notice Cast a uint256 to a uint160, revert on overflow + /// @param y The uint256 to be downcasted + /// @return z The downcasted integer, now type uint160 + function toUint160(uint256 y) internal pure returns (uint160 z) { + require((z = uint160(y)) == y); + } + + /// @notice Cast a int256 to a int128, revert on overflow or underflow + /// @param y The int256 to be downcasted + /// @return z The downcasted integer, now type int128 + function toInt128(int256 y) internal pure returns (int128 z) { + require((z = int128(y)) == y); + } + + /// @notice Cast a uint256 to a int256, revert on overflow + /// @param y The uint256 to be casted + /// @return z The casted integer, now type int256 + function toInt256(uint256 y) internal pure returns (int256 z) { + require(y < 2**255); + z = int256(y); + } +} diff --git a/contracts/libraries/SqrtPriceMath.sol b/contracts/libraries/SqrtPriceMath.sol new file mode 100644 index 0000000..0adab14 --- /dev/null +++ b/contracts/libraries/SqrtPriceMath.sol @@ -0,0 +1,318 @@ +// SPDX-License-Identifier: BUSL-1.1 +pragma solidity ^0.8.0; + +import {SafeCast} from "./SafeCast.sol"; + +import {FullMath} from "./FullMath.sol"; +import {UnsafeMath} from "./UnsafeMath.sol"; +import {FixedPoint96} from "./FixedPoint96.sol"; + +/// @title Functions based on Q64.96 sqrt price and liquidity +/// @notice Contains the math that uses square root of price as a Q64.96 and liquidity to compute deltas +library SqrtPriceMath { + using SafeCast for uint256; + + /// @notice Gets the next sqrt price given a delta of token0 + /// @dev Always rounds up, because in the exact output case (increasing price) we need to move the price at least + /// far enough to get the desired output amount, and in the exact input case (decreasing price) we need to move the + /// price less in order to not send too much output. + /// The most precise formula for this is liquidity * sqrtPX96 / (liquidity +- amount * sqrtPX96), + /// if this is impossible because of overflow, we calculate liquidity / (liquidity / sqrtPX96 +- amount). + /// @param sqrtPX96 The starting price, i.e. before accounting for the token0 delta + /// @param liquidity The amount of usable liquidity + /// @param amount How much of token0 to add or remove from virtual reserves + /// @param add Whether to add or remove the amount of token0 + /// @return The price after adding or removing amount, depending on add + function getNextSqrtPriceFromAmount0RoundingUp( + uint160 sqrtPX96, + uint128 liquidity, + uint256 amount, + bool add + ) internal pure returns (uint160) { + // we short circuit amount == 0 because the result is otherwise not guaranteed to equal the input price + if (amount == 0) return sqrtPX96; + uint256 numerator1 = uint256(liquidity) << FixedPoint96.RESOLUTION; + + if (add) { + unchecked { + uint256 product; + if ((product = amount * sqrtPX96) / amount == sqrtPX96) { + uint256 denominator = numerator1 + product; + if (denominator >= numerator1) + // always fits in 160 bits + return + uint160( + FullMath.mulDivRoundingUp( + numerator1, + sqrtPX96, + denominator + ) + ); + } + } + // denominator is checked for overflow + return + uint160( + UnsafeMath.divRoundingUp( + numerator1, + (numerator1 / sqrtPX96) + amount + ) + ); + } else { + unchecked { + uint256 product; + // if the product overflows, we know the denominator underflows + // in addition, we must check that the denominator does not underflow + require( + (product = amount * sqrtPX96) / amount == sqrtPX96 && + numerator1 > product + ); + uint256 denominator = numerator1 - product; + return + FullMath + .mulDivRoundingUp(numerator1, sqrtPX96, denominator) + .toUint160(); + } + } + } + + /// @notice Gets the next sqrt price given a delta of token1 + /// @dev Always rounds down, because in the exact output case (decreasing price) we need to move the price at least + /// far enough to get the desired output amount, and in the exact input case (increasing price) we need to move the + /// price less in order to not send too much output. + /// The formula we compute is within <1 wei of the lossless version: sqrtPX96 +- amount / liquidity + /// @param sqrtPX96 The starting price, i.e., before accounting for the token1 delta + /// @param liquidity The amount of usable liquidity + /// @param amount How much of token1 to add, or remove, from virtual reserves + /// @param add Whether to add, or remove, the amount of token1 + /// @return The price after adding or removing `amount` + function getNextSqrtPriceFromAmount1RoundingDown( + uint160 sqrtPX96, + uint128 liquidity, + uint256 amount, + bool add + ) internal pure returns (uint160) { + // if we're adding (subtracting), rounding down requires rounding the quotient down (up) + // in both cases, avoid a mulDiv for most inputs + if (add) { + uint256 quotient = ( + amount <= type(uint160).max + ? (amount << FixedPoint96.RESOLUTION) / liquidity + : FullMath.mulDiv(amount, FixedPoint96.Q96, liquidity) + ); + + return (uint256(sqrtPX96) + quotient).toUint160(); + } else { + uint256 quotient = ( + amount <= type(uint160).max + ? UnsafeMath.divRoundingUp( + amount << FixedPoint96.RESOLUTION, + liquidity + ) + : FullMath.mulDivRoundingUp( + amount, + FixedPoint96.Q96, + liquidity + ) + ); + + require(sqrtPX96 > quotient); + // always fits 160 bits + unchecked { + return uint160(sqrtPX96 - quotient); + } + } + } + + /// @notice Gets the next sqrt price given an input amount of token0 or token1 + /// @dev Throws if price or liquidity are 0, or if the next price is out of bounds + /// @param sqrtPX96 The starting price, i.e., before accounting for the input amount + /// @param liquidity The amount of usable liquidity + /// @param amountIn How much of token0, or token1, is being swapped in + /// @param zeroForOne Whether the amount in is token0 or token1 + /// @return sqrtQX96 The price after adding the input amount to token0 or token1 + function getNextSqrtPriceFromInput( + uint160 sqrtPX96, + uint128 liquidity, + uint256 amountIn, + bool zeroForOne + ) internal pure returns (uint160 sqrtQX96) { + require(sqrtPX96 > 0); + require(liquidity > 0); + + // round to make sure that we don't pass the target price + return + zeroForOne + ? getNextSqrtPriceFromAmount0RoundingUp( + sqrtPX96, + liquidity, + amountIn, + true + ) + : getNextSqrtPriceFromAmount1RoundingDown( + sqrtPX96, + liquidity, + amountIn, + true + ); + } + + /// @notice Gets the next sqrt price given an output amount of token0 or token1 + /// @dev Throws if price or liquidity are 0 or the next price is out of bounds + /// @param sqrtPX96 The starting price before accounting for the output amount + /// @param liquidity The amount of usable liquidity + /// @param amountOut How much of token0, or token1, is being swapped out + /// @param zeroForOne Whether the amount out is token0 or token1 + /// @return sqrtQX96 The price after removing the output amount of token0 or token1 + function getNextSqrtPriceFromOutput( + uint160 sqrtPX96, + uint128 liquidity, + uint256 amountOut, + bool zeroForOne + ) internal pure returns (uint160 sqrtQX96) { + require(sqrtPX96 > 0); + require(liquidity > 0); + + // round to make sure that we pass the target price + return + zeroForOne + ? getNextSqrtPriceFromAmount1RoundingDown( + sqrtPX96, + liquidity, + amountOut, + false + ) + : getNextSqrtPriceFromAmount0RoundingUp( + sqrtPX96, + liquidity, + amountOut, + false + ); + } + + /// @notice Gets the amount0 delta between two prices + /// @dev Calculates liquidity / sqrt(lower) - liquidity / sqrt(upper), + /// i.e. liquidity * (sqrt(upper) - sqrt(lower)) / (sqrt(upper) * sqrt(lower)) + /// @param sqrtRatioAX96 A sqrt price + /// @param sqrtRatioBX96 Another sqrt price + /// @param liquidity The amount of usable liquidity + /// @param roundUp Whether to round the amount up or down + /// @return amount0 Amount of token0 required to cover a position of size liquidity between the two passed prices + function getAmount0Delta( + uint160 sqrtRatioAX96, + uint160 sqrtRatioBX96, + uint128 liquidity, + bool roundUp + ) internal pure returns (uint256 amount0) { + unchecked { + if (sqrtRatioAX96 > sqrtRatioBX96) + (sqrtRatioAX96, sqrtRatioBX96) = (sqrtRatioBX96, sqrtRatioAX96); + + uint256 numerator1 = uint256(liquidity) << FixedPoint96.RESOLUTION; + uint256 numerator2 = sqrtRatioBX96 - sqrtRatioAX96; + + require(sqrtRatioAX96 > 0); + + return + roundUp + ? UnsafeMath.divRoundingUp( + FullMath.mulDivRoundingUp( + numerator1, + numerator2, + sqrtRatioBX96 + ), + sqrtRatioAX96 + ) + : FullMath.mulDiv(numerator1, numerator2, sqrtRatioBX96) / + sqrtRatioAX96; + } + } + + /// @notice Gets the amount1 delta between two prices + /// @dev Calculates liquidity * (sqrt(upper) - sqrt(lower)) + /// @param sqrtRatioAX96 A sqrt price + /// @param sqrtRatioBX96 Another sqrt price + /// @param liquidity The amount of usable liquidity + /// @param roundUp Whether to round the amount up, or down + /// @return amount1 Amount of token1 required to cover a position of size liquidity between the two passed prices + function getAmount1Delta( + uint160 sqrtRatioAX96, + uint160 sqrtRatioBX96, + uint128 liquidity, + bool roundUp + ) internal pure returns (uint256 amount1) { + unchecked { + if (sqrtRatioAX96 > sqrtRatioBX96) + (sqrtRatioAX96, sqrtRatioBX96) = (sqrtRatioBX96, sqrtRatioAX96); + + return + roundUp + ? FullMath.mulDivRoundingUp( + liquidity, + sqrtRatioBX96 - sqrtRatioAX96, + FixedPoint96.Q96 + ) + : FullMath.mulDiv( + liquidity, + sqrtRatioBX96 - sqrtRatioAX96, + FixedPoint96.Q96 + ); + } + } + + /// @notice Helper that gets signed token0 delta + /// @param sqrtRatioAX96 A sqrt price + /// @param sqrtRatioBX96 Another sqrt price + /// @param liquidity The change in liquidity for which to compute the amount0 delta + /// @return amount0 Amount of token0 corresponding to the passed liquidityDelta between the two prices + function getAmount0Delta( + uint160 sqrtRatioAX96, + uint160 sqrtRatioBX96, + int128 liquidity + ) internal pure returns (int256 amount0) { + unchecked { + return + liquidity < 0 + ? -getAmount0Delta( + sqrtRatioAX96, + sqrtRatioBX96, + uint128(-liquidity), + false + ).toInt256() + : getAmount0Delta( + sqrtRatioAX96, + sqrtRatioBX96, + uint128(liquidity), + true + ).toInt256(); + } + } + + /// @notice Helper that gets signed token1 delta + /// @param sqrtRatioAX96 A sqrt price + /// @param sqrtRatioBX96 Another sqrt price + /// @param liquidity The change in liquidity for which to compute the amount1 delta + /// @return amount1 Amount of token1 corresponding to the passed liquidityDelta between the two prices + function getAmount1Delta( + uint160 sqrtRatioAX96, + uint160 sqrtRatioBX96, + int128 liquidity + ) internal pure returns (int256 amount1) { + unchecked { + return + liquidity < 0 + ? -getAmount1Delta( + sqrtRatioAX96, + sqrtRatioBX96, + uint128(-liquidity), + false + ).toInt256() + : getAmount1Delta( + sqrtRatioAX96, + sqrtRatioBX96, + uint128(liquidity), + true + ).toInt256(); + } + } +} diff --git a/contracts/libraries/SwapMath.sol b/contracts/libraries/SwapMath.sol new file mode 100644 index 0000000..3984d40 --- /dev/null +++ b/contracts/libraries/SwapMath.sol @@ -0,0 +1,150 @@ +// SPDX-License-Identifier: BUSL-1.1 +pragma solidity ^0.8.0; + +import {FullMath} from "./FullMath.sol"; +import {SqrtPriceMath} from "./SqrtPriceMath.sol"; + +/// @title Computes the result of a swap within ticks +/// @notice Contains methods for computing the result of a swap within a single tick price range, i.e., a single tick. +library SwapMath { + /// @notice Computes the result of swapping some amount in, or amount out, given the parameters of the swap + /// @dev The fee, plus the amount in, will never exceed the amount remaining if the swap's `amountSpecified` is positive + /// @param sqrtRatioCurrentX96 The current sqrt price of the pool + /// @param sqrtRatioTargetX96 The price that cannot be exceeded, from which the direction of the swap is inferred + /// @param liquidity The usable liquidity + /// @param amountRemaining How much input or output amount is remaining to be swapped in/out + /// @param feePips The fee taken from the input amount, expressed in hundredths of a bip + /// @return sqrtRatioNextX96 The price after swapping the amount in/out, not to exceed the price target + /// @return amountIn The amount to be swapped in, of either token0 or token1, based on the direction of the swap + /// @return amountOut The amount to be received, of either token0 or token1, based on the direction of the swap + /// @return feeAmount The amount of input that will be taken as a fee + function computeSwapStep( + uint160 sqrtRatioCurrentX96, + uint160 sqrtRatioTargetX96, + uint128 liquidity, + int256 amountRemaining, + uint24 feePips + ) + internal + pure + returns ( + uint160 sqrtRatioNextX96, + uint256 amountIn, + uint256 amountOut, + uint256 feeAmount + ) + { + unchecked { + bool zeroForOne = sqrtRatioCurrentX96 >= sqrtRatioTargetX96; + bool exactIn = amountRemaining >= 0; + + if (exactIn) { + uint256 amountRemainingLessFee = FullMath.mulDiv( + uint256(amountRemaining), + 1e6 - feePips, + 1e6 + ); + amountIn = zeroForOne + ? SqrtPriceMath.getAmount0Delta( + sqrtRatioTargetX96, + sqrtRatioCurrentX96, + liquidity, + true + ) + : SqrtPriceMath.getAmount1Delta( + sqrtRatioCurrentX96, + sqrtRatioTargetX96, + liquidity, + true + ); + if (amountRemainingLessFee >= amountIn) + sqrtRatioNextX96 = sqrtRatioTargetX96; + else + sqrtRatioNextX96 = SqrtPriceMath.getNextSqrtPriceFromInput( + sqrtRatioCurrentX96, + liquidity, + amountRemainingLessFee, + zeroForOne + ); + } else { + amountOut = zeroForOne + ? SqrtPriceMath.getAmount1Delta( + sqrtRatioTargetX96, + sqrtRatioCurrentX96, + liquidity, + false + ) + : SqrtPriceMath.getAmount0Delta( + sqrtRatioCurrentX96, + sqrtRatioTargetX96, + liquidity, + false + ); + if (uint256(-amountRemaining) >= amountOut) + sqrtRatioNextX96 = sqrtRatioTargetX96; + else + sqrtRatioNextX96 = SqrtPriceMath.getNextSqrtPriceFromOutput( + sqrtRatioCurrentX96, + liquidity, + uint256(-amountRemaining), + zeroForOne + ); + } + + bool max = sqrtRatioTargetX96 == sqrtRatioNextX96; + + // get the input/output amounts + if (zeroForOne) { + amountIn = max && exactIn + ? amountIn + : SqrtPriceMath.getAmount0Delta( + sqrtRatioNextX96, + sqrtRatioCurrentX96, + liquidity, + true + ); + amountOut = max && !exactIn + ? amountOut + : SqrtPriceMath.getAmount1Delta( + sqrtRatioNextX96, + sqrtRatioCurrentX96, + liquidity, + false + ); + } else { + amountIn = max && exactIn + ? amountIn + : SqrtPriceMath.getAmount1Delta( + sqrtRatioCurrentX96, + sqrtRatioNextX96, + liquidity, + true + ); + amountOut = max && !exactIn + ? amountOut + : SqrtPriceMath.getAmount0Delta( + sqrtRatioCurrentX96, + sqrtRatioNextX96, + liquidity, + false + ); + } + + // cap the output amount to not exceed the remaining output amount + if (!exactIn && amountOut > uint256(-amountRemaining)) { + amountOut = uint256(-amountRemaining); + } + + if (exactIn && sqrtRatioNextX96 != sqrtRatioTargetX96) { + // we didn't reach the target, so take the remainder of the maximum input as fee + feeAmount = uint256(amountRemaining) - amountIn; + } else { + feeAmount = FullMath.mulDivRoundingUp( + amountIn, + feePips, + 1e6 - feePips + ); + } + } + } +} diff --git a/contracts/libraries/TestingLibrary.sol b/contracts/libraries/TestingLibrary.sol new file mode 100644 index 0000000..4d7b6e9 --- /dev/null +++ b/contracts/libraries/TestingLibrary.sol @@ -0,0 +1,50 @@ +// SPDX-License-Identifier: BUSL-1.1 + +pragma solidity ^0.8.9; + +import {TickMath} from "./TickMath.sol"; +import {LiquidityAmounts} from "./LiquidityAmounts.sol"; + +/// @title Testing library conrtaining useful functions for the test suite +library TestingLibrary { + + function getSqrtRatioAtTick(int24 tick) + external + pure + returns (uint160 sqrtPriceX96) + { + return TickMath.getSqrtRatioAtTick(tick); + } + + function getTickAtSqrtRatio(uint160 sqrtPriceX96) + external + pure + returns (int24 tick) + { + return TickMath.getTickAtSqrtRatio(sqrtPriceX96); + } + + function getAmountsForLiquidity( + uint160 sqrtRatioX96, + uint160 sqrtRatioAX96, + uint160 sqrtRatioBX96, + uint128 liquidity + ) external pure returns (uint256 amount0, uint256 amount1) { + return LiquidityAmounts.getAmountsForLiquidity(sqrtRatioX96, sqrtRatioAX96, sqrtRatioBX96, liquidity); + } + + function getLiquidityForAmounts( + uint160 sqrtRatioX96, + uint160 sqrtRatioAX96, + uint160 sqrtRatioBX96, + uint256 amount0, + uint256 amount1 + ) external pure returns (uint128 liquidity) { + return LiquidityAmounts.getLiquidityForAmounts(sqrtRatioX96, + sqrtRatioAX96, + sqrtRatioBX96, + amount0, + amount1 + ); + } +} diff --git a/contracts/libraries/TickBitmapExtended.sol b/contracts/libraries/TickBitmapExtended.sol new file mode 100644 index 0000000..b582969 --- /dev/null +++ b/contracts/libraries/TickBitmapExtended.sol @@ -0,0 +1,75 @@ +// SPDX-License-Identifier: BUSL-1.1 + +pragma solidity ^0.8.9; + +import {BitMath} from "./BitMath.sol"; + +/// @title Tick bitmap extended functions +/// @dev Uses the bitmap from UniswapV3Pool +library TickBitmapExtended { + /// @notice Computes the position in the mapping where the initialized bit for a tick lives + /// @param tick The tick for which to compute the position + /// @return wordPos The key in the mapping containing the word in which the bit is stored + /// @return bitPos The bit position in the word where the flag is stored + function position(int24 tick) + private + pure + returns (int16 wordPos, uint8 bitPos) + { + wordPos = int16(tick >> 8); + bitPos = uint8(uint24(tick % 256)); + } + + /// @notice Returns the next initialized tick contained in the same word (or adjacent word) as the tick that is either + /// to the left (less than or equal to) or right (greater than) of the given tick + /// @param self The mapping in which to compute the next initialized tick + /// @param tick The starting tick + /// @param tickSpacing The spacing between usable ticks + /// @param lte Whether to search for the next initialized tick to the left (less than or equal to the starting tick) + /// @return next The next initialized or uninitialized tick up to 256 ticks away from the current tick + /// @return initialized Whether the next tick is initialized, as the function only searches within up to 256 ticks + function nextInitializedTickWithinOneWord( + function(int16) external view returns (uint256) self, + int24 tick, + int24 tickSpacing, + bool lte + ) internal view returns (int24 next, bool initialized) { + int24 compressed = tick / tickSpacing; + if (tick < 0 && tick % tickSpacing != 0) compressed--; // round towards negative infinity + + if (lte) { + (int16 wordPos, uint8 bitPos) = position(compressed); + // all the 1s at or to the right of the current bitPos + uint256 mask = (1 << bitPos) - 1 + (1 << bitPos); + uint256 masked = self(wordPos) & mask; + + // if there are no initialized ticks to the right of or at the current tick, return rightmost in the word + initialized = masked != 0; + // overflow/underflow is possible, but prevented externally by limiting both tickSpacing and tick + next = initialized + ? (compressed - + int24( + uint24(bitPos - BitMath.mostSignificantBit(masked)) + )) * tickSpacing + : (compressed - int24(uint24(bitPos))) * tickSpacing; + } else { + // start from the word of the next tick, since the current tick state doesn't matter + (int16 wordPos, uint8 bitPos) = position(compressed + 1); + // all the 1s at or to the left of the bitPos + uint256 mask = ~((1 << bitPos) - 1); + uint256 masked = self(wordPos) & mask; + + // if there are no initialized ticks to the left of the current tick, return leftmost in the word + initialized = masked != 0; + // overflow/underflow is possible, but prevented externally by limiting both tickSpacing and tick + next = initialized + ? (compressed + + 1 + + int24( + uint24(BitMath.leastSignificantBit(masked) - bitPos) + )) * tickSpacing + : (compressed + 1 + int24(uint24(type(uint8).max - bitPos))) * + tickSpacing; + } + } +} diff --git a/contracts/libraries/TickMath.sol b/contracts/libraries/TickMath.sol new file mode 100644 index 0000000..33fbfee --- /dev/null +++ b/contracts/libraries/TickMath.sol @@ -0,0 +1,257 @@ +// SPDX-License-Identifier: GPL-2.0-or-later +pragma solidity ^0.8.12; + +/// @title Math library for computing sqrt prices from ticks and vice versa +/// @notice Computes sqrt price for ticks of size 1.0001, i.e. sqrt(1.0001^tick) as fixed point Q64.96 numbers. Supports +/// prices between 2**-128 and 2**128 +library TickMath { + error T(); + error R(); + + /// @dev The minimum tick that may be passed to #getSqrtRatioAtTick computed from log base 1.0001 of 2**-128 + int24 internal constant MIN_TICK = -887272; + /// @dev The maximum tick that may be passed to #getSqrtRatioAtTick computed from log base 1.0001 of 2**128 + int24 internal constant MAX_TICK = -MIN_TICK; + + /// @dev The minimum value that can be returned from #getSqrtRatioAtTick. Equivalent to getSqrtRatioAtTick(MIN_TICK) + uint160 internal constant MIN_SQRT_RATIO = 4295128739; + /// @dev The maximum value that can be returned from #getSqrtRatioAtTick. Equivalent to getSqrtRatioAtTick(MAX_TICK) + uint160 internal constant MAX_SQRT_RATIO = + 1461446703485210103287273052203988822378723970342; + + /// @notice Calculates sqrt(1.0001^tick) * 2^96 + /// @dev Throws if |tick| > max tick + /// @param tick The input tick for the above formula + /// @return sqrtPriceX96 A Fixed point Q64.96 number representing the sqrt of the ratio of the two assets (token1/token0) + /// at the given tick + function getSqrtRatioAtTick(int24 tick) + internal + pure + returns (uint160 sqrtPriceX96) + { + unchecked { + uint256 absTick = tick < 0 + ? uint256(-int256(tick)) + : uint256(int256(tick)); + if (absTick > uint256(int256(MAX_TICK))) revert T(); + + uint256 ratio = absTick & 0x1 != 0 + ? 0xfffcb933bd6fad37aa2d162d1a594001 + : 0x100000000000000000000000000000000; + if (absTick & 0x2 != 0) + ratio = (ratio * 0xfff97272373d413259a46990580e213a) >> 128; + if (absTick & 0x4 != 0) + ratio = (ratio * 0xfff2e50f5f656932ef12357cf3c7fdcc) >> 128; + if (absTick & 0x8 != 0) + ratio = (ratio * 0xffe5caca7e10e4e61c3624eaa0941cd0) >> 128; + if (absTick & 0x10 != 0) + ratio = (ratio * 0xffcb9843d60f6159c9db58835c926644) >> 128; + if (absTick & 0x20 != 0) + ratio = (ratio * 0xff973b41fa98c081472e6896dfb254c0) >> 128; + if (absTick & 0x40 != 0) + ratio = (ratio * 0xff2ea16466c96a3843ec78b326b52861) >> 128; + if (absTick & 0x80 != 0) + ratio = (ratio * 0xfe5dee046a99a2a811c461f1969c3053) >> 128; + if (absTick & 0x100 != 0) + ratio = (ratio * 0xfcbe86c7900a88aedcffc83b479aa3a4) >> 128; + if (absTick & 0x200 != 0) + ratio = (ratio * 0xf987a7253ac413176f2b074cf7815e54) >> 128; + if (absTick & 0x400 != 0) + ratio = (ratio * 0xf3392b0822b70005940c7a398e4b70f3) >> 128; + if (absTick & 0x800 != 0) + ratio = (ratio * 0xe7159475a2c29b7443b29c7fa6e889d9) >> 128; + if (absTick & 0x1000 != 0) + ratio = (ratio * 0xd097f3bdfd2022b8845ad8f792aa5825) >> 128; + if (absTick & 0x2000 != 0) + ratio = (ratio * 0xa9f746462d870fdf8a65dc1f90e061e5) >> 128; + if (absTick & 0x4000 != 0) + ratio = (ratio * 0x70d869a156d2a1b890bb3df62baf32f7) >> 128; + if (absTick & 0x8000 != 0) + ratio = (ratio * 0x31be135f97d08fd981231505542fcfa6) >> 128; + if (absTick & 0x10000 != 0) + ratio = (ratio * 0x9aa508b5b7a84e1c677de54f3e99bc9) >> 128; + if (absTick & 0x20000 != 0) + ratio = (ratio * 0x5d6af8dedb81196699c329225ee604) >> 128; + if (absTick & 0x40000 != 0) + ratio = (ratio * 0x2216e584f5fa1ea926041bedfe98) >> 128; + if (absTick & 0x80000 != 0) + ratio = (ratio * 0x48a170391f7dc42444e8fa2) >> 128; + + if (tick > 0) ratio = type(uint256).max / ratio; + + // this divides by 1<<32 rounding up to go from a Q128.128 to a Q128.96. + // we then downcast because we know the result always fits within 160 bits due to our tick input constraint + // we round up in the division so getTickAtSqrtRatio of the output price is always consistent + sqrtPriceX96 = uint160( + (ratio >> 32) + (ratio % (1 << 32) == 0 ? 0 : 1) + ); + } + } + + /// @notice Calculates the greatest tick value such that getRatioAtTick(tick) <= ratio + /// @dev Throws in case sqrtPriceX96 < MIN_SQRT_RATIO, as MIN_SQRT_RATIO is the lowest value getRatioAtTick may + /// ever return. + /// @param sqrtPriceX96 The sqrt ratio for which to compute the tick as a Q64.96 + /// @return tick The greatest tick for which the ratio is less than or equal to the input ratio + function getTickAtSqrtRatio(uint160 sqrtPriceX96) + internal + pure + returns (int24 tick) + { + unchecked { + // second inequality must be < because the price can never reach the price at the max tick + if ( + !(sqrtPriceX96 >= MIN_SQRT_RATIO && + sqrtPriceX96 < MAX_SQRT_RATIO) + ) revert R(); + uint256 ratio = uint256(sqrtPriceX96) << 32; + + uint256 r = ratio; + uint256 msb = 0; + + assembly { + let f := shl(7, gt(r, 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF)) + msb := or(msb, f) + r := shr(f, r) + } + assembly { + let f := shl(6, gt(r, 0xFFFFFFFFFFFFFFFF)) + msb := or(msb, f) + r := shr(f, r) + } + assembly { + let f := shl(5, gt(r, 0xFFFFFFFF)) + msb := or(msb, f) + r := shr(f, r) + } + assembly { + let f := shl(4, gt(r, 0xFFFF)) + msb := or(msb, f) + r := shr(f, r) + } + assembly { + let f := shl(3, gt(r, 0xFF)) + msb := or(msb, f) + r := shr(f, r) + } + assembly { + let f := shl(2, gt(r, 0xF)) + msb := or(msb, f) + r := shr(f, r) + } + assembly { + let f := shl(1, gt(r, 0x3)) + msb := or(msb, f) + r := shr(f, r) + } + assembly { + let f := gt(r, 0x1) + msb := or(msb, f) + } + + if (msb >= 128) r = ratio >> (msb - 127); + else r = ratio << (127 - msb); + + int256 log_2 = (int256(msb) - 128) << 64; + + assembly { + r := shr(127, mul(r, r)) + let f := shr(128, r) + log_2 := or(log_2, shl(63, f)) + r := shr(f, r) + } + assembly { + r := shr(127, mul(r, r)) + let f := shr(128, r) + log_2 := or(log_2, shl(62, f)) + r := shr(f, r) + } + assembly { + r := shr(127, mul(r, r)) + let f := shr(128, r) + log_2 := or(log_2, shl(61, f)) + r := shr(f, r) + } + assembly { + r := shr(127, mul(r, r)) + let f := shr(128, r) + log_2 := or(log_2, shl(60, f)) + r := shr(f, r) + } + assembly { + r := shr(127, mul(r, r)) + let f := shr(128, r) + log_2 := or(log_2, shl(59, f)) + r := shr(f, r) + } + assembly { + r := shr(127, mul(r, r)) + let f := shr(128, r) + log_2 := or(log_2, shl(58, f)) + r := shr(f, r) + } + assembly { + r := shr(127, mul(r, r)) + let f := shr(128, r) + log_2 := or(log_2, shl(57, f)) + r := shr(f, r) + } + assembly { + r := shr(127, mul(r, r)) + let f := shr(128, r) + log_2 := or(log_2, shl(56, f)) + r := shr(f, r) + } + assembly { + r := shr(127, mul(r, r)) + let f := shr(128, r) + log_2 := or(log_2, shl(55, f)) + r := shr(f, r) + } + assembly { + r := shr(127, mul(r, r)) + let f := shr(128, r) + log_2 := or(log_2, shl(54, f)) + r := shr(f, r) + } + assembly { + r := shr(127, mul(r, r)) + let f := shr(128, r) + log_2 := or(log_2, shl(53, f)) + r := shr(f, r) + } + assembly { + r := shr(127, mul(r, r)) + let f := shr(128, r) + log_2 := or(log_2, shl(52, f)) + r := shr(f, r) + } + assembly { + r := shr(127, mul(r, r)) + let f := shr(128, r) + log_2 := or(log_2, shl(51, f)) + r := shr(f, r) + } + assembly { + r := shr(127, mul(r, r)) + let f := shr(128, r) + log_2 := or(log_2, shl(50, f)) + } + + int256 log_sqrt10001 = log_2 * 255738958999603826347141; // 128.128 number + + int24 tickLow = int24( + (log_sqrt10001 - 3402992956809132418596140100660247210) >> 128 + ); + int24 tickHi = int24( + (log_sqrt10001 + 291339464771989622907027621153398088495) >> 128 + ); + + tick = tickLow == tickHi + ? tickLow + : getSqrtRatioAtTick(tickHi) <= sqrtPriceX96 + ? tickHi + : tickLow; + } + } +} diff --git a/contracts/libraries/UniswapHelperViews.sol b/contracts/libraries/UniswapHelperViews.sol new file mode 100644 index 0000000..e70c90d --- /dev/null +++ b/contracts/libraries/UniswapHelperViews.sol @@ -0,0 +1,149 @@ +// SPDX-License-Identifier: BUSL-1.1 + +pragma solidity ^0.8.9; + +import {FullMath} from "./FullMath.sol"; +import {FixedPoint128} from "./FixedPoint128.sol"; +import {SwapMath} from "./SwapMath.sol"; +import {SafeCast} from "./SafeCast.sol"; +import {TickMath} from "./TickMath.sol"; +import {LiquidityAmounts} from "./LiquidityAmounts.sol"; +import {TickBitmapExtended} from "./TickBitmapExtended.sol"; +import {IUniswapV3Factory} from "../../interfaces/uniswap/V3/IUniswapV3Factory.sol"; + +import {Simulate} from "@uniswap/contracts/libraries/Simulate.sol"; +import {IUniswapV3Pool} from "@uniswap/contracts/interfaces/IUniswapV3Pool.sol"; + +/// @title Uniswap V3 necessary views for the strategy +library UniswapHelperViews { + using SafeCast for uint256; + using TickBitmapExtended for function(int16) + external + view + returns (uint256); + + error ZeroAmount(); + error InvalidSqrtPriceLimit(uint160 sqrtPriceLimitX96); + + IUniswapV3Factory public constant uniV3factory = IUniswapV3Factory(0x1F98431c8aD98523631AE4a59f267346ea31F984); + + uint256 public constant PRECISION = 1e18; + + function checkExistingPool( + address tokenA, + address tokenB, + uint24 feeTier, + address poolToCheck + ) external view returns(bool) { + if (uniV3factory.getPool(tokenA, tokenB, feeTier) == poolToCheck) { + return true; + } + return false; + } + + /// @notice Simulates a swap over an Uniswap V3 Pool, allowing to handle tick crosses. + /// @param v3Pool uniswap v3 pool address + /// @param zeroForOne direction of swap, true means swap zero for one + /// @param amountSpecified amount to swap in/out + /// @param sqrtPriceLimitX96 the maximum price to swap to, if this price is reached, then the swap is stopped partially + /// @return amount0 token0 amount + /// @return amount1 token1 amount + function simulateSwap( + address v3Pool, + bool zeroForOne, + int256 amountSpecified, + uint160 sqrtPriceLimitX96 + ) + external + view + returns ( + int256, int256 + ) + { + return Simulate.simulateSwap(IUniswapV3Pool(v3Pool), zeroForOne, amountSpecified, sqrtPriceLimitX96); + } + + struct feesEarnedParams { + address v3Pool; + uint128 liquidity; + int24 tickCurrent; + int24 tickLower; + int24 tickUpper; + uint256 feeGrowthGlobal0X128; + uint256 feeGrowthGlobal1X128; + uint256 feeGrowthInside0LastX128; + uint256 feeGrowthInside1LastX128; + } + + /// @notice Retrieves owed fee data for a specific position + /// @param _feesEarnedParams Custom struct containing: + /// - liquidity Position's liquidity + /// - tickCurrent The current tick + /// - tickLower The lower tick boundary of the position + /// - tickUpper The upper tick boundary of the position + /// - feeGrowthGlobal0X128 The all-time global fee growth, per unit of liquidity, in token0 + /// - feeGrowthGlobal1X128 The all-time global fee growth, per unit of liquidity, in token1 + /// - feeGrowthInside0X128 The all-time fee growth in token0, per unit of liquidity, inside the position's tick boundaries + /// - feeGrowthInside1X128 The all-time fee growth in token1, per unit of liquidity, inside the position's tick boundaries + function getFeesEarned( + feesEarnedParams memory _feesEarnedParams + ) internal view returns (uint128 tokensOwed0, uint128 tokensOwed1) { + uint256 feeGrowthBelow0X128; + uint256 feeGrowthBelow1X128; + IUniswapV3Pool _pool = IUniswapV3Pool(_feesEarnedParams.v3Pool); + (,,uint256 lower_feeGrowthOutside0X128, uint256 lower_feeGrowthOutside1X128,,,,) = _pool.ticks(_feesEarnedParams.tickLower); + (,,uint256 upper_feeGrowthOutside0X128, uint256 upper_feeGrowthOutside1X128,,,,) = _pool.ticks(_feesEarnedParams.tickUpper); + + if (_feesEarnedParams.tickCurrent >= _feesEarnedParams.tickLower) { + feeGrowthBelow0X128 = lower_feeGrowthOutside0X128; + feeGrowthBelow1X128 = lower_feeGrowthOutside1X128; + } else { + feeGrowthBelow0X128 = + _feesEarnedParams.feeGrowthGlobal0X128 - + lower_feeGrowthOutside0X128; + feeGrowthBelow1X128 = + _feesEarnedParams.feeGrowthGlobal1X128 - + lower_feeGrowthOutside1X128; + } + + // calculate fee growth above + uint256 feeGrowthAbove0X128; + uint256 feeGrowthAbove1X128; + if (_feesEarnedParams.tickCurrent < _feesEarnedParams.tickUpper) { + feeGrowthAbove0X128 = upper_feeGrowthOutside0X128; + feeGrowthAbove1X128 = upper_feeGrowthOutside1X128; + } else { + feeGrowthAbove0X128 = + _feesEarnedParams.feeGrowthGlobal0X128 - + upper_feeGrowthOutside0X128; + feeGrowthAbove1X128 = + _feesEarnedParams.feeGrowthGlobal1X128 - + upper_feeGrowthOutside1X128; + } + + uint256 feeGrowthInside0X128 = _feesEarnedParams.feeGrowthGlobal0X128 - + feeGrowthBelow0X128 - + feeGrowthAbove0X128; + uint256 feeGrowthInside1X128 = _feesEarnedParams.feeGrowthGlobal1X128 - + feeGrowthBelow1X128 - + feeGrowthAbove1X128; + + // calculate accumulated fees + tokensOwed0 = uint128( + FullMath.mulDiv( + feeGrowthInside0X128 - + _feesEarnedParams.feeGrowthInside0LastX128, + _feesEarnedParams.liquidity, + FixedPoint128.Q128 + ) + ); + tokensOwed1 = uint128( + FullMath.mulDiv( + feeGrowthInside1X128 - + _feesEarnedParams.feeGrowthInside1LastX128, + _feesEarnedParams.liquidity, + FixedPoint128.Q128 + ) + ); + } +} diff --git a/contracts/libraries/UniswapV2Library.sol b/contracts/libraries/UniswapV2Library.sol index ef22427..b66658a 100644 --- a/contracts/libraries/UniswapV2Library.sol +++ b/contracts/libraries/UniswapV2Library.sol @@ -2,7 +2,7 @@ pragma solidity >=0.5.0; -import "../../interfaces/uni/IUniswapV2Pair.sol"; +import "../../interfaces/uniswap/V2/IUniswapV2Pair.sol"; library SafeMathUniswap { function add(uint256 x, uint256 y) internal pure returns (uint256 z) { @@ -42,13 +42,15 @@ library UniswapV2Library { ) internal pure returns (address pair) { (address token0, address token1) = sortTokens(tokenA, tokenB); pair = address( - uint256( - keccak256( - abi.encodePacked( - hex"ff", - factory, - keccak256(abi.encodePacked(token0, token1)), - hex"e18a34eb0e04b04f7a0ac29a6e80748dca96319b42c54d679cb821dca90c6303" // init code hash + uint160( + uint256( + keccak256( + abi.encodePacked( + hex"ff", + factory, + keccak256(abi.encodePacked(token0, token1)), + hex"e18a34eb0e04b04f7a0ac29a6e80748dca96319b42c54d679cb821dca90c6303" // init code hash + ) ) ) ) @@ -62,8 +64,9 @@ library UniswapV2Library { address tokenB ) internal view returns (uint256 reserveA, uint256 reserveB) { (address token0, ) = sortTokens(tokenA, tokenB); - (uint256 reserve0, uint256 reserve1, ) = - IUniswapV2Pair(pairFor(factory, tokenA, tokenB)).getReserves(); + (uint256 reserve0, uint256 reserve1, ) = IUniswapV2Pair( + pairFor(factory, tokenA, tokenB) + ).getReserves(); (reserveA, reserveB) = tokenA == token0 ? (reserve0, reserve1) : (reserve1, reserve0); @@ -126,8 +129,11 @@ library UniswapV2Library { amounts = new uint256[](path.length); amounts[0] = amountIn; for (uint256 i; i < path.length - 1; i++) { - (uint256 reserveIn, uint256 reserveOut) = - getReserves(factory, path[i], path[i + 1]); + (uint256 reserveIn, uint256 reserveOut) = getReserves( + factory, + path[i], + path[i + 1] + ); amounts[i + 1] = getAmountOut(amounts[i], reserveIn, reserveOut); } } @@ -142,8 +148,11 @@ library UniswapV2Library { amounts = new uint256[](path.length); amounts[amounts.length - 1] = amountOut; for (uint256 i = path.length - 1; i > 0; i--) { - (uint256 reserveIn, uint256 reserveOut) = - getReserves(factory, path[i - 1], path[i]); + (uint256 reserveIn, uint256 reserveOut) = getReserves( + factory, + path[i - 1], + path[i] + ); amounts[i - 1] = getAmountIn(amounts[i], reserveIn, reserveOut); } } diff --git a/contracts/libraries/UnsafeMath.sol b/contracts/libraries/UnsafeMath.sol new file mode 100644 index 0000000..eda37a2 --- /dev/null +++ b/contracts/libraries/UnsafeMath.sol @@ -0,0 +1,21 @@ +// SPDX-License-Identifier: GPL-2.0-or-later +pragma solidity >=0.5.0; + +/// @title Math functions that do not check inputs or outputs +/// @notice Contains methods that perform common math functions but do not do any overflow or underflow checks +library UnsafeMath { + /// @notice Returns ceil(x / y) + /// @dev division by 0 has unspecified behavior, and must be checked externally + /// @param x The dividend + /// @param y The divisor + /// @return z The quotient, ceil(x / y) + function divRoundingUp(uint256 x, uint256 y) + internal + pure + returns (uint256 z) + { + assembly { + z := add(div(x, y), gt(mod(x, y), 0)) + } + } +} diff --git a/contracts/ySwapper.sol b/contracts/ySwapper.sol index 86a0a4f..4aafb80 100644 --- a/contracts/ySwapper.sol +++ b/contracts/ySwapper.sol @@ -1,11 +1,10 @@ // SPDX-License-Identifier: AGPL-3.0 -pragma solidity 0.6.12; +pragma solidity 0.8.12; pragma experimental ABIEncoderV2; -import { - SafeERC20, - IERC20 -} from "@openzeppelin/contracts/token/ERC20/SafeERC20.sol"; +import {Address} from "@openzeppelin/contracts/utils/Address.sol"; +import {IERC20} from "@openzeppelin/contracts/token/ERC20/IERC20.sol"; +import {SafeERC20} from "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol"; interface ITradeFactory { function enable(address, address) external; @@ -13,45 +12,54 @@ interface ITradeFactory { abstract contract ySwapper { using SafeERC20 for IERC20; - // TODO: not working for clonables ! + // TODO: not working for clonables ! address public tradeFactory = address(0xD3f89C21719Ec5961a3E6B0f9bBf9F9b4180E9e9); bool public tradesEnabled; - - // Implement in contract using ySwaps. + + // Implement in contract using ySwaps. // should return the list of tokens to be swapped and a list of tokens to be swapped to - function getYSwapTokens() internal view virtual returns (address[] memory, address[] memory); + function getYSwapTokens() + internal + view + virtual + returns (address[] memory, address[] memory); // WARNING this is a manual permissioned function // should call internalFunction and use onlyROLEs // if you don't want this function, just override with empty function function removeTradeFactoryPermissions() external virtual; - + // WARNING this is a manual permissioned function // should call internalFunction and use onlyROLEs // if you don't want this function, just override with empty function - function updateTradeFactoryPermissions(address _tradeFactory) external virtual; + function updateTradeFactoryPermissions(address _tradeFactory) + external + virtual; function _setUpTradeFactory() internal { //approve and set up trade factory tradesEnabled = true; - (address[] memory tokensToEnable, address[] memory toTokens) = getYSwapTokens(); + ( + address[] memory tokensToEnable, + address[] memory toTokens + ) = getYSwapTokens(); - for(uint i; i < tokensToEnable.length; i++) { + for (uint256 i; i < tokensToEnable.length; i++) { _enableTradeFactoryForToken(tokensToEnable[i], toTokens[i]); } } - - function _enableTradeFactoryForToken(address fromToken, address toToken) internal { + + function _enableTradeFactoryForToken(address fromToken, address toToken) + internal + { ITradeFactory tf = ITradeFactory(tradeFactory); IERC20(fromToken).safeApprove(address(tf), type(uint256).max); tf.enable(fromToken, toToken); } - function _updateTradeFactory(address _newTradeFactory) - internal - { + function _updateTradeFactory(address _newTradeFactory) internal { if (tradeFactory != address(0)) { _removeTradeFactory(); } @@ -62,10 +70,10 @@ abstract contract ySwapper { function _removeTradeFactory() internal { address _tradeFactory = tradeFactory; - + (address[] memory tokens, ) = getYSwapTokens(); - for(uint i = 0; i < tokens.length; i++) { + for (uint256 i = 0; i < tokens.length; i++) { IERC20(tokens[i]).safeApprove(_tradeFactory, 0); } diff --git a/flattened_library_univ3.txt b/flattened_library_univ3.txt new file mode 100644 index 0000000..e236abc --- /dev/null +++ b/flattened_library_univ3.txt @@ -0,0 +1,2245 @@ +// SPDX-License-Identifier: AGPL-3.0 +pragma solidity ^0.8.9; + +// File: BitMath.sol + +/// @title BitMath +/// @dev This library provides functionality for computing bit properties of an unsigned integer +library BitMath { + /// @notice Returns the index of the most significant bit of the number, + /// where the least significant bit is at index 0 and the most significant bit is at index 255 + /// @dev The function satisfies the property: + /// x >= 2**mostSignificantBit(x) and x < 2**(mostSignificantBit(x)+1) + /// @param x the value for which to compute the most significant bit, must be greater than 0 + /// @return r the index of the most significant bit + function mostSignificantBit(uint256 x) internal pure returns (uint8 r) { + require(x > 0); + + unchecked { + if (x >= 0x100000000000000000000000000000000) { + x >>= 128; + r += 128; + } + if (x >= 0x10000000000000000) { + x >>= 64; + r += 64; + } + if (x >= 0x100000000) { + x >>= 32; + r += 32; + } + if (x >= 0x10000) { + x >>= 16; + r += 16; + } + if (x >= 0x100) { + x >>= 8; + r += 8; + } + if (x >= 0x10) { + x >>= 4; + r += 4; + } + if (x >= 0x4) { + x >>= 2; + r += 2; + } + if (x >= 0x2) r += 1; + } + } + + /// @notice Returns the index of the least significant bit of the number, + /// where the least significant bit is at index 0 and the most significant bit is at index 255 + /// @dev The function satisfies the property: + /// (x & 2**leastSignificantBit(x)) != 0 and (x & (2**(leastSignificantBit(x)) - 1)) == 0) + /// @param x the value for which to compute the least significant bit, must be greater than 0 + /// @return r the index of the least significant bit + function leastSignificantBit(uint256 x) internal pure returns (uint8 r) { + require(x > 0); + + unchecked { + r = 255; + if (x & type(uint128).max > 0) { + r -= 128; + } else { + x >>= 128; + } + if (x & type(uint64).max > 0) { + r -= 64; + } else { + x >>= 64; + } + if (x & type(uint32).max > 0) { + r -= 32; + } else { + x >>= 32; + } + if (x & type(uint16).max > 0) { + r -= 16; + } else { + x >>= 16; + } + if (x & type(uint8).max > 0) { + r -= 8; + } else { + x >>= 8; + } + if (x & 0xf > 0) { + r -= 4; + } else { + x >>= 4; + } + if (x & 0x3 > 0) { + r -= 2; + } else { + x >>= 2; + } + if (x & 0x1 > 0) r -= 1; + } + } +} + +// File: FixedPoint128.sol + +/// @title FixedPoint128 +/// @notice A library for handling binary fixed point numbers, see https://en.wikipedia.org/wiki/Q_(number_format) +library FixedPoint128 { + uint256 internal constant Q128 = 0x100000000000000000000000000000000; +} + +// File: FixedPoint96.sol + +/// @title FixedPoint96 +/// @notice A library for handling binary fixed point numbers, see https://en.wikipedia.org/wiki/Q_(number_format) +/// @dev Used in SqrtPriceMath.sol +library FixedPoint96 { + uint8 internal constant RESOLUTION = 96; + uint256 internal constant Q96 = 0x1000000000000000000000000; +} + +// File: FullMath.sol + +/// @title Contains 512-bit math functions +/// @notice Facilitates multiplication and division that can have overflow of an intermediate value without any loss of precision +/// @dev Handles "phantom overflow" i.e., allows multiplication and division where an intermediate value overflows 256 bits +library FullMath { + /// @notice Calculates floor(a×b÷denominator) with full precision. Throws if result overflows a uint256 or denominator == 0 + /// @param a The multiplicand + /// @param b The multiplier + /// @param denominator The divisor + /// @return result The 256-bit result + /// @dev Credit to Remco Bloemen under MIT license https://xn--2-umb.com/21/muldiv + function mulDiv( + uint256 a, + uint256 b, + uint256 denominator + ) internal pure returns (uint256 result) { + unchecked { + // 512-bit multiply [prod1 prod0] = a * b + // Compute the product mod 2**256 and mod 2**256 - 1 + // then use the Chinese Remainder Theorem to reconstruct + // the 512 bit result. The result is stored in two 256 + // variables such that product = prod1 * 2**256 + prod0 + uint256 prod0; // Least significant 256 bits of the product + uint256 prod1; // Most significant 256 bits of the product + assembly { + let mm := mulmod(a, b, not(0)) + prod0 := mul(a, b) + prod1 := sub(sub(mm, prod0), lt(mm, prod0)) + } + + // Handle non-overflow cases, 256 by 256 division + if (prod1 == 0) { + require(denominator > 0); + assembly { + result := div(prod0, denominator) + } + return result; + } + + // Make sure the result is less than 2**256. + // Also prevents denominator == 0 + require(denominator > prod1); + + /////////////////////////////////////////////// + // 512 by 256 division. + /////////////////////////////////////////////// + + // Make division exact by subtracting the remainder from [prod1 prod0] + // Compute remainder using mulmod + uint256 remainder; + assembly { + remainder := mulmod(a, b, denominator) + } + // Subtract 256 bit number from 512 bit number + assembly { + prod1 := sub(prod1, gt(remainder, prod0)) + prod0 := sub(prod0, remainder) + } + + // Factor powers of two out of denominator + // Compute largest power of two divisor of denominator. + // Always >= 1. + uint256 twos = (0 - denominator) & denominator; + // Divide denominator by power of two + assembly { + denominator := div(denominator, twos) + } + + // Divide [prod1 prod0] by the factors of two + assembly { + prod0 := div(prod0, twos) + } + // Shift in bits from prod1 into prod0. For this we need + // to flip `twos` such that it is 2**256 / twos. + // If twos is zero, then it becomes one + assembly { + twos := add(div(sub(0, twos), twos), 1) + } + prod0 |= prod1 * twos; + + // Invert denominator mod 2**256 + // Now that denominator is an odd number, it has an inverse + // modulo 2**256 such that denominator * inv = 1 mod 2**256. + // Compute the inverse by starting with a seed that is correct + // correct for four bits. That is, denominator * inv = 1 mod 2**4 + uint256 inv = (3 * denominator) ^ 2; + // Now use Newton-Raphson iteration to improve the precision. + // Thanks to Hensel's lifting lemma, this also works in modular + // arithmetic, doubling the correct bits in each step. + inv *= 2 - denominator * inv; // inverse mod 2**8 + inv *= 2 - denominator * inv; // inverse mod 2**16 + inv *= 2 - denominator * inv; // inverse mod 2**32 + inv *= 2 - denominator * inv; // inverse mod 2**64 + inv *= 2 - denominator * inv; // inverse mod 2**128 + inv *= 2 - denominator * inv; // inverse mod 2**256 + + // Because the division is now exact we can divide by multiplying + // with the modular inverse of denominator. This will give us the + // correct result modulo 2**256. Since the precoditions guarantee + // that the outcome is less than 2**256, this is the final result. + // We don't need to compute the high bits of the result and prod1 + // is no longer required. + result = prod0 * inv; + return result; + } + } + + /// @notice Calculates ceil(a×b÷denominator) with full precision. Throws if result overflows a uint256 or denominator == 0 + /// @param a The multiplicand + /// @param b The multiplier + /// @param denominator The divisor + /// @return result The 256-bit result + function mulDivRoundingUp( + uint256 a, + uint256 b, + uint256 denominator + ) internal pure returns (uint256 result) { + unchecked { + result = mulDiv(a, b, denominator); + if (mulmod(a, b, denominator) > 0) { + require(result < type(uint256).max); + result++; + } + } + } +} + +// File: IUniswapV3Factory.sol + +/// @title The interface for the Uniswap V3 Factory +/// @notice The Uniswap V3 Factory facilitates creation of Uniswap V3 pools and control over the protocol fees +interface IUniswapV3Factory { + /// @notice Emitted when the owner of the factory is changed + /// @param oldOwner The owner before the owner was changed + /// @param newOwner The owner after the owner was changed + event OwnerChanged(address indexed oldOwner, address indexed newOwner); + + /// @notice Emitted when a pool is created + /// @param token0 The first token of the pool by address sort order + /// @param token1 The second token of the pool by address sort order + /// @param fee The fee collected upon every swap in the pool, denominated in hundredths of a bip + /// @param tickSpacing The minimum number of ticks between initialized ticks + /// @param pool The address of the created pool + event PoolCreated( + address indexed token0, + address indexed token1, + uint24 indexed fee, + int24 tickSpacing, + address pool + ); + + /// @notice Emitted when a new fee amount is enabled for pool creation via the factory + /// @param fee The enabled fee, denominated in hundredths of a bip + /// @param tickSpacing The minimum number of ticks between initialized ticks for pools created with the given fee + event FeeAmountEnabled(uint24 indexed fee, int24 indexed tickSpacing); + + /// @notice Returns the current owner of the factory + /// @dev Can be changed by the current owner via setOwner + /// @return The address of the factory owner + function owner() external view returns (address); + + /// @notice Returns the tick spacing for a given fee amount, if enabled, or 0 if not enabled + /// @dev A fee amount can never be removed, so this value should be hard coded or cached in the calling context + /// @param fee The enabled fee, denominated in hundredths of a bip. Returns 0 in case of unenabled fee + /// @return The tick spacing + function feeAmountTickSpacing(uint24 fee) external view returns (int24); + + /// @notice Returns the pool address for a given pair of tokens and a fee, or address 0 if it does not exist + /// @dev tokenA and tokenB may be passed in either token0/token1 or token1/token0 order + /// @param tokenA The contract address of either token0 or token1 + /// @param tokenB The contract address of the other token + /// @param fee The fee collected upon every swap in the pool, denominated in hundredths of a bip + /// @return pool The pool address + function getPool( + address tokenA, + address tokenB, + uint24 fee + ) external view returns (address pool); + + /// @notice Creates a pool for the given two tokens and fee + /// @param tokenA One of the two tokens in the desired pool + /// @param tokenB The other of the two tokens in the desired pool + /// @param fee The desired fee for the pool + /// @dev tokenA and tokenB may be passed in either order: token0/token1 or token1/token0. tickSpacing is retrieved + /// from the fee. The call will revert if the pool already exists, the fee is invalid, or the token arguments + /// are invalid. + /// @return pool The address of the newly created pool + function createPool( + address tokenA, + address tokenB, + uint24 fee + ) external returns (address pool); + + /// @notice Updates the owner of the factory + /// @dev Must be called by the current owner + /// @param _owner The new owner of the factory + function setOwner(address _owner) external; + + /// @notice Enables a fee amount with the given tickSpacing + /// @dev Fee amounts may never be removed once enabled + /// @param fee The fee amount to enable, denominated in hundredths of a bip (i.e. 1e-6) + /// @param tickSpacing The spacing between ticks to be enforced for all pools created with the given fee amount + function enableFeeAmount(uint24 fee, int24 tickSpacing) external; +} +// File: IUniswapV3PoolActions.sol + +/// @title Permissionless pool actions +/// @notice Contains pool methods that can be called by anyone +interface IUniswapV3PoolActions { + /// @notice Sets the initial price for the pool + /// @dev Price is represented as a sqrt(amountToken1/amountToken0) Q64.96 value + /// @param sqrtPriceX96 the initial sqrt price of the pool as a Q64.96 + function initialize(uint160 sqrtPriceX96) external; + + /// @notice Adds liquidity for the given recipient/tickLower/tickUpper position + /// @dev The caller of this method receives a callback in the form of IUniswapV3MintCallback#uniswapV3MintCallback + /// in which they must pay any token0 or token1 owed for the liquidity. The amount of token0/token1 due depends + /// on tickLower, tickUpper, the amount of liquidity, and the current price. + /// @param recipient The address for which the liquidity will be created + /// @param tickLower The lower tick of the position in which to add liquidity + /// @param tickUpper The upper tick of the position in which to add liquidity + /// @param amount The amount of liquidity to mint + /// @param data Any data that should be passed through to the callback + /// @return amount0 The amount of token0 that was paid to mint the given amount of liquidity. Matches the value in the callback + /// @return amount1 The amount of token1 that was paid to mint the given amount of liquidity. Matches the value in the callback + function mint( + address recipient, + int24 tickLower, + int24 tickUpper, + uint128 amount, + bytes calldata data + ) external returns (uint256 amount0, uint256 amount1); + + /// @notice Collects tokens owed to a position + /// @dev Does not recompute fees earned, which must be done either via mint or burn of any amount of liquidity. + /// Collect must be called by the position owner. To withdraw only token0 or only token1, amount0Requested or + /// amount1Requested may be set to zero. To withdraw all tokens owed, caller may pass any value greater than the + /// actual tokens owed, e.g. type(uint128).max. Tokens owed may be from accumulated swap fees or burned liquidity. + /// @param recipient The address which should receive the fees collected + /// @param tickLower The lower tick of the position for which to collect fees + /// @param tickUpper The upper tick of the position for which to collect fees + /// @param amount0Requested How much token0 should be withdrawn from the fees owed + /// @param amount1Requested How much token1 should be withdrawn from the fees owed + /// @return amount0 The amount of fees collected in token0 + /// @return amount1 The amount of fees collected in token1 + function collect( + address recipient, + int24 tickLower, + int24 tickUpper, + uint128 amount0Requested, + uint128 amount1Requested + ) external returns (uint128 amount0, uint128 amount1); + + /// @notice Burn liquidity from the sender and account tokens owed for the liquidity to the position + /// @dev Can be used to trigger a recalculation of fees owed to a position by calling with an amount of 0 + /// @dev Fees must be collected separately via a call to #collect + /// @param tickLower The lower tick of the position for which to burn liquidity + /// @param tickUpper The upper tick of the position for which to burn liquidity + /// @param amount How much liquidity to burn + /// @return amount0 The amount of token0 sent to the recipient + /// @return amount1 The amount of token1 sent to the recipient + function burn( + int24 tickLower, + int24 tickUpper, + uint128 amount + ) external returns (uint256 amount0, uint256 amount1); + + /// @notice Swap token0 for token1, or token1 for token0 + /// @dev The caller of this method receives a callback in the form of IUniswapV3SwapCallback#uniswapV3SwapCallback + /// @param recipient The address to receive the output of the swap + /// @param zeroForOne The direction of the swap, true for token0 to token1, false for token1 to token0 + /// @param amountSpecified The amount of the swap, which implicitly configures the swap as exact input (positive), or exact output (negative) + /// @param sqrtPriceLimitX96 The Q64.96 sqrt price limit. If zero for one, the price cannot be less than this + /// value after the swap. If one for zero, the price cannot be greater than this value after the swap + /// @param data Any data to be passed through to the callback + /// @return amount0 The delta of the balance of token0 of the pool, exact when negative, minimum when positive + /// @return amount1 The delta of the balance of token1 of the pool, exact when negative, minimum when positive + function swap( + address recipient, + bool zeroForOne, + int256 amountSpecified, + uint160 sqrtPriceLimitX96, + bytes calldata data + ) external returns (int256 amount0, int256 amount1); + + /// @notice Receive token0 and/or token1 and pay it back, plus a fee, in the callback + /// @dev The caller of this method receives a callback in the form of IUniswapV3FlashCallback#uniswapV3FlashCallback + /// @dev Can be used to donate underlying tokens pro-rata to currently in-range liquidity providers by calling + /// with 0 amount{0,1} and sending the donation amount(s) from the callback + /// @param recipient The address which will receive the token0 and token1 amounts + /// @param amount0 The amount of token0 to send + /// @param amount1 The amount of token1 to send + /// @param data Any data to be passed through to the callback + function flash( + address recipient, + uint256 amount0, + uint256 amount1, + bytes calldata data + ) external; + + /// @notice Increase the maximum number of price and liquidity observations that this pool will store + /// @dev This method is no-op if the pool already has an observationCardinalityNext greater than or equal to + /// the input observationCardinalityNext. + /// @param observationCardinalityNext The desired minimum number of observations for the pool to store + function increaseObservationCardinalityNext(uint16 observationCardinalityNext) external; +} + +// File: IUniswapV3PoolDerivedState.sol + +/// @title Pool state that is not stored +/// @notice Contains view functions to provide information about the pool that is computed rather than stored on the +/// blockchain. The functions here may have variable gas costs. +interface IUniswapV3PoolDerivedState { + /// @notice Returns the cumulative tick and liquidity as of each timestamp `secondsAgo` from the current block timestamp + /// @dev To get a time weighted average tick or liquidity-in-range, you must call this with two values, one representing + /// the beginning of the period and another for the end of the period. E.g., to get the last hour time-weighted average tick, + /// you must call it with secondsAgos = [3600, 0]. + /// @dev The time weighted average tick represents the geometric time weighted average price of the pool, in + /// log base sqrt(1.0001) of token1 / token0. The TickMath library can be used to go from a tick value to a ratio. + /// @param secondsAgos From how long ago each cumulative tick and liquidity value should be returned + /// @return tickCumulatives Cumulative tick values as of each `secondsAgos` from the current block timestamp + /// @return secondsPerLiquidityCumulativeX128s Cumulative seconds per liquidity-in-range value as of each `secondsAgos` from the current block + /// timestamp + function observe(uint32[] calldata secondsAgos) + external + view + returns (int56[] memory tickCumulatives, uint160[] memory secondsPerLiquidityCumulativeX128s); + + /// @notice Returns a snapshot of the tick cumulative, seconds per liquidity and seconds inside a tick range + /// @dev Snapshots must only be compared to other snapshots, taken over a period for which a position existed. + /// I.e., snapshots cannot be compared if a position is not held for the entire period between when the first + /// snapshot is taken and the second snapshot is taken. + /// @param tickLower The lower tick of the range + /// @param tickUpper The upper tick of the range + /// @return tickCumulativeInside The snapshot of the tick accumulator for the range + /// @return secondsPerLiquidityInsideX128 The snapshot of seconds per liquidity for the range + /// @return secondsInside The snapshot of seconds per liquidity for the range + function snapshotCumulativesInside(int24 tickLower, int24 tickUpper) + external + view + returns ( + int56 tickCumulativeInside, + uint160 secondsPerLiquidityInsideX128, + uint32 secondsInside + ); +} + +// File: IUniswapV3PoolErrors.sol + +/// @title Errors emitted by a pool +/// @notice Contains all events emitted by the pool +interface IUniswapV3PoolErrors { + error LOK(); + error TLU(); + error TLM(); + error TUM(); + error AI(); + error M0(); + error M1(); + error AS(); + error IIA(); + error L(); + error F0(); + error F1(); +} + +// File: IUniswapV3PoolEvents.sol + +/// @title Events emitted by a pool +/// @notice Contains all events emitted by the pool +interface IUniswapV3PoolEvents { + /// @notice Emitted exactly once by a pool when #initialize is first called on the pool + /// @dev Mint/Burn/Swap cannot be emitted by the pool before Initialize + /// @param sqrtPriceX96 The initial sqrt price of the pool, as a Q64.96 + /// @param tick The initial tick of the pool, i.e. log base 1.0001 of the starting price of the pool + event Initialize(uint160 sqrtPriceX96, int24 tick); + + /// @notice Emitted when liquidity is minted for a given position + /// @param sender The address that minted the liquidity + /// @param owner The owner of the position and recipient of any minted liquidity + /// @param tickLower The lower tick of the position + /// @param tickUpper The upper tick of the position + /// @param amount The amount of liquidity minted to the position range + /// @param amount0 How much token0 was required for the minted liquidity + /// @param amount1 How much token1 was required for the minted liquidity + event Mint( + address sender, + address indexed owner, + int24 indexed tickLower, + int24 indexed tickUpper, + uint128 amount, + uint256 amount0, + uint256 amount1 + ); + + /// @notice Emitted when fees are collected by the owner of a position + /// @dev Collect events may be emitted with zero amount0 and amount1 when the caller chooses not to collect fees + /// @param owner The owner of the position for which fees are collected + /// @param tickLower The lower tick of the position + /// @param tickUpper The upper tick of the position + /// @param amount0 The amount of token0 fees collected + /// @param amount1 The amount of token1 fees collected + event Collect( + address indexed owner, + address recipient, + int24 indexed tickLower, + int24 indexed tickUpper, + uint128 amount0, + uint128 amount1 + ); + + /// @notice Emitted when a position's liquidity is removed + /// @dev Does not withdraw any fees earned by the liquidity position, which must be withdrawn via #collect + /// @param owner The owner of the position for which liquidity is removed + /// @param tickLower The lower tick of the position + /// @param tickUpper The upper tick of the position + /// @param amount The amount of liquidity to remove + /// @param amount0 The amount of token0 withdrawn + /// @param amount1 The amount of token1 withdrawn + event Burn( + address indexed owner, + int24 indexed tickLower, + int24 indexed tickUpper, + uint128 amount, + uint256 amount0, + uint256 amount1 + ); + + /// @notice Emitted by the pool for any swaps between token0 and token1 + /// @param sender The address that initiated the swap call, and that received the callback + /// @param recipient The address that received the output of the swap + /// @param amount0 The delta of the token0 balance of the pool + /// @param amount1 The delta of the token1 balance of the pool + /// @param sqrtPriceX96 The sqrt(price) of the pool after the swap, as a Q64.96 + /// @param liquidity The liquidity of the pool after the swap + /// @param tick The log base 1.0001 of price of the pool after the swap + event Swap( + address indexed sender, + address indexed recipient, + int256 amount0, + int256 amount1, + uint160 sqrtPriceX96, + uint128 liquidity, + int24 tick + ); + + /// @notice Emitted by the pool for any flashes of token0/token1 + /// @param sender The address that initiated the swap call, and that received the callback + /// @param recipient The address that received the tokens from flash + /// @param amount0 The amount of token0 that was flashed + /// @param amount1 The amount of token1 that was flashed + /// @param paid0 The amount of token0 paid for the flash, which can exceed the amount0 plus the fee + /// @param paid1 The amount of token1 paid for the flash, which can exceed the amount1 plus the fee + event Flash( + address indexed sender, + address indexed recipient, + uint256 amount0, + uint256 amount1, + uint256 paid0, + uint256 paid1 + ); + + /// @notice Emitted by the pool for increases to the number of observations that can be stored + /// @dev observationCardinalityNext is not the observation cardinality until an observation is written at the index + /// just before a mint/swap/burn. + /// @param observationCardinalityNextOld The previous value of the next observation cardinality + /// @param observationCardinalityNextNew The updated value of the next observation cardinality + event IncreaseObservationCardinalityNext( + uint16 observationCardinalityNextOld, + uint16 observationCardinalityNextNew + ); + + /// @notice Emitted when the protocol fee is changed by the pool + /// @param feeProtocol0Old The previous value of the token0 protocol fee + /// @param feeProtocol1Old The previous value of the token1 protocol fee + /// @param feeProtocol0New The updated value of the token0 protocol fee + /// @param feeProtocol1New The updated value of the token1 protocol fee + event SetFeeProtocol(uint8 feeProtocol0Old, uint8 feeProtocol1Old, uint8 feeProtocol0New, uint8 feeProtocol1New); + + /// @notice Emitted when the collected protocol fees are withdrawn by the factory owner + /// @param sender The address that collects the protocol fees + /// @param recipient The address that receives the collected protocol fees + /// @param amount0 The amount of token0 protocol fees that is withdrawn + /// @param amount0 The amount of token1 protocol fees that is withdrawn + event CollectProtocol(address indexed sender, address indexed recipient, uint128 amount0, uint128 amount1); +} + +// File: IUniswapV3PoolImmutables.sol + +/// @title Pool state that never changes +/// @notice These parameters are fixed for a pool forever, i.e., the methods will always return the same values +interface IUniswapV3PoolImmutables { + /// @notice The contract that deployed the pool, which must adhere to the IUniswapV3Factory interface + /// @return The contract address + function factory() external view returns (address); + + /// @notice The first of the two tokens of the pool, sorted by address + /// @return The token contract address + function token0() external view returns (address); + + /// @notice The second of the two tokens of the pool, sorted by address + /// @return The token contract address + function token1() external view returns (address); + + /// @notice The pool's fee in hundredths of a bip, i.e. 1e-6 + /// @return The fee + function fee() external view returns (uint24); + + /// @notice The pool tick spacing + /// @dev Ticks can only be used at multiples of this value, minimum of 1 and always positive + /// e.g.: a tickSpacing of 3 means ticks can be initialized every 3rd tick, i.e., ..., -6, -3, 0, 3, 6, ... + /// This value is an int24 to avoid casting even though it is always positive. + /// @return The tick spacing + function tickSpacing() external view returns (int24); + + /// @notice The maximum amount of position liquidity that can use any tick in the range + /// @dev This parameter is enforced per tick to prevent liquidity from overflowing a uint128 at any point, and + /// also prevents out-of-range liquidity from being used to prevent adding in-range liquidity to a pool + /// @return The max amount of liquidity per tick + function maxLiquidityPerTick() external view returns (uint128); +} + +// File: IUniswapV3PoolOwnerActions.sol + +/// @title Permissioned pool actions +/// @notice Contains pool methods that may only be called by the factory owner +interface IUniswapV3PoolOwnerActions { + /// @notice Set the denominator of the protocol's % share of the fees + /// @param feeProtocol0 new protocol fee for token0 of the pool + /// @param feeProtocol1 new protocol fee for token1 of the pool + function setFeeProtocol(uint8 feeProtocol0, uint8 feeProtocol1) external; + + /// @notice Collect the protocol fee accrued to the pool + /// @param recipient The address to which collected protocol fees should be sent + /// @param amount0Requested The maximum amount of token0 to send, can be 0 to collect fees in only token1 + /// @param amount1Requested The maximum amount of token1 to send, can be 0 to collect fees in only token0 + /// @return amount0 The protocol fee collected in token0 + /// @return amount1 The protocol fee collected in token1 + function collectProtocol( + address recipient, + uint128 amount0Requested, + uint128 amount1Requested + ) external returns (uint128 amount0, uint128 amount1); +} + +// File: IUniswapV3PoolState.sol + +/// @title Pool state that can change +/// @notice These methods compose the pool's state, and can change with any frequency including multiple times +/// per transaction +interface IUniswapV3PoolState { + /// @notice The 0th storage slot in the pool stores many values, and is exposed as a single method to save gas + /// when accessed externally. + /// @return sqrtPriceX96 The current price of the pool as a sqrt(token1/token0) Q64.96 value + /// @return tick The current tick of the pool, i.e. according to the last tick transition that was run. + /// This value may not always be equal to SqrtTickMath.getTickAtSqrtRatio(sqrtPriceX96) if the price is on a tick + /// boundary. + /// @return observationIndex The index of the last oracle observation that was written, + /// @return observationCardinality The current maximum number of observations stored in the pool, + /// @return observationCardinalityNext The next maximum number of observations, to be updated when the observation. + /// @return feeProtocol The protocol fee for both tokens of the pool. + /// Encoded as two 4 bit values, where the protocol fee of token1 is shifted 4 bits and the protocol fee of token0 + /// is the lower 4 bits. Used as the denominator of a fraction of the swap fee, e.g. 4 means 1/4th of the swap fee. + /// unlocked Whether the pool is currently locked to reentrancy + function slot0() + external + view + returns ( + uint160 sqrtPriceX96, + int24 tick, + uint16 observationIndex, + uint16 observationCardinality, + uint16 observationCardinalityNext, + uint8 feeProtocol, + bool unlocked + ); + + /// @notice The fee growth as a Q128.128 fees of token0 collected per unit of liquidity for the entire life of the pool + /// @dev This value can overflow the uint256 + function feeGrowthGlobal0X128() external view returns (uint256); + + /// @notice The fee growth as a Q128.128 fees of token1 collected per unit of liquidity for the entire life of the pool + /// @dev This value can overflow the uint256 + function feeGrowthGlobal1X128() external view returns (uint256); + + /// @notice The amounts of token0 and token1 that are owed to the protocol + /// @dev Protocol fees will never exceed uint128 max in either token + function protocolFees() external view returns (uint128 token0, uint128 token1); + + /// @notice The currently in range liquidity available to the pool + /// @dev This value has no relationship to the total liquidity across all ticks + /// @return The liquidity at the current price of the pool + function liquidity() external view returns (uint128); + + /// @notice Look up information about a specific tick in the pool + /// @param tick The tick to look up + /// @return liquidityGross the total amount of position liquidity that uses the pool either as tick lower or + /// tick upper + /// @return liquidityNet how much liquidity changes when the pool price crosses the tick, + /// @return feeGrowthOutside0X128 the fee growth on the other side of the tick from the current tick in token0, + /// @return feeGrowthOutside1X128 the fee growth on the other side of the tick from the current tick in token1, + /// @return tickCumulativeOutside the cumulative tick value on the other side of the tick from the current tick + /// @return secondsPerLiquidityOutsideX128 the seconds spent per liquidity on the other side of the tick from the current tick, + /// @return secondsOutside the seconds spent on the other side of the tick from the current tick, + /// @return initialized Set to true if the tick is initialized, i.e. liquidityGross is greater than 0, otherwise equal to false. + /// Outside values can only be used if the tick is initialized, i.e. if liquidityGross is greater than 0. + /// In addition, these values are only relative and must be used only in comparison to previous snapshots for + /// a specific position. + function ticks(int24 tick) + external + view + returns ( + uint128 liquidityGross, + int128 liquidityNet, + uint256 feeGrowthOutside0X128, + uint256 feeGrowthOutside1X128, + int56 tickCumulativeOutside, + uint160 secondsPerLiquidityOutsideX128, + uint32 secondsOutside, + bool initialized + ); + + /// @notice Returns 256 packed tick initialized boolean values. See TickBitmap for more information + function tickBitmap(int16 wordPosition) external view returns (uint256); + + /// @notice Returns the information about a position by the position's key + /// @param key The position's key is a hash of a preimage composed by the owner, tickLower and tickUpper + /// @return liquidity The amount of liquidity in the position, + /// @return feeGrowthInside0LastX128 fee growth of token0 inside the tick range as of the last mint/burn/poke, + /// @return feeGrowthInside1LastX128 fee growth of token1 inside the tick range as of the last mint/burn/poke, + /// @return tokensOwed0 the computed amount of token0 owed to the position as of the last mint/burn/poke, + /// @return tokensOwed1 the computed amount of token1 owed to the position as of the last mint/burn/poke + function positions(bytes32 key) + external + view + returns ( + uint128 liquidity, + uint256 feeGrowthInside0LastX128, + uint256 feeGrowthInside1LastX128, + uint128 tokensOwed0, + uint128 tokensOwed1 + ); + + /// @notice Returns data about a specific observation index + /// @param index The element of the observations array to fetch + /// @dev You most likely want to use #observe() instead of this method to get an observation as of some amount of time + /// ago, rather than at a specific index in the array. + /// @return blockTimestamp The timestamp of the observation, + /// @return tickCumulative the tick multiplied by seconds elapsed for the life of the pool as of the observation timestamp, + /// @return secondsPerLiquidityCumulativeX128 the seconds per in range liquidity for the life of the pool as of the observation timestamp, + /// @return initialized whether the observation has been initialized and the values are safe to use + function observations(uint256 index) + external + view + returns ( + uint32 blockTimestamp, + int56 tickCumulative, + uint160 secondsPerLiquidityCumulativeX128, + bool initialized + ); +} + +// File: SafeCast.sol + +/// @title Safe casting methods +/// @notice Contains methods for safely casting between types +library SafeCast { + /// @notice Cast a uint256 to a uint160, revert on overflow + /// @param y The uint256 to be downcasted + /// @return z The downcasted integer, now type uint160 + function toUint160(uint256 y) internal pure returns (uint160 z) { + require((z = uint160(y)) == y); + } + + /// @notice Cast a int256 to a int128, revert on overflow or underflow + /// @param y The int256 to be downcasted + /// @return z The downcasted integer, now type int128 + function toInt128(int256 y) internal pure returns (int128 z) { + require((z = int128(y)) == y); + } + + /// @notice Cast a uint256 to a int256, revert on overflow + /// @param y The uint256 to be casted + /// @return z The casted integer, now type int256 + function toInt256(uint256 y) internal pure returns (int256 z) { + require(y < 2**255); + z = int256(y); + } +} + +// File: TickMath.sol + +/// @title Math library for computing sqrt prices from ticks and vice versa +/// @notice Computes sqrt price for ticks of size 1.0001, i.e. sqrt(1.0001^tick) as fixed point Q64.96 numbers. Supports +/// prices between 2**-128 and 2**128 +library TickMath { + error T(); + error R(); + + /// @dev The minimum tick that may be passed to #getSqrtRatioAtTick computed from log base 1.0001 of 2**-128 + int24 internal constant MIN_TICK = -887272; + /// @dev The maximum tick that may be passed to #getSqrtRatioAtTick computed from log base 1.0001 of 2**128 + int24 internal constant MAX_TICK = -MIN_TICK; + + /// @dev The minimum value that can be returned from #getSqrtRatioAtTick. Equivalent to getSqrtRatioAtTick(MIN_TICK) + uint160 internal constant MIN_SQRT_RATIO = 4295128739; + /// @dev The maximum value that can be returned from #getSqrtRatioAtTick. Equivalent to getSqrtRatioAtTick(MAX_TICK) + uint160 internal constant MAX_SQRT_RATIO = + 1461446703485210103287273052203988822378723970342; + + /// @notice Calculates sqrt(1.0001^tick) * 2^96 + /// @dev Throws if |tick| > max tick + /// @param tick The input tick for the above formula + /// @return sqrtPriceX96 A Fixed point Q64.96 number representing the sqrt of the ratio of the two assets (token1/token0) + /// at the given tick + function getSqrtRatioAtTick(int24 tick) + internal + pure + returns (uint160 sqrtPriceX96) + { + unchecked { + uint256 absTick = tick < 0 + ? uint256(-int256(tick)) + : uint256(int256(tick)); + if (absTick > uint256(int256(MAX_TICK))) revert T(); + + uint256 ratio = absTick & 0x1 != 0 + ? 0xfffcb933bd6fad37aa2d162d1a594001 + : 0x100000000000000000000000000000000; + if (absTick & 0x2 != 0) + ratio = (ratio * 0xfff97272373d413259a46990580e213a) >> 128; + if (absTick & 0x4 != 0) + ratio = (ratio * 0xfff2e50f5f656932ef12357cf3c7fdcc) >> 128; + if (absTick & 0x8 != 0) + ratio = (ratio * 0xffe5caca7e10e4e61c3624eaa0941cd0) >> 128; + if (absTick & 0x10 != 0) + ratio = (ratio * 0xffcb9843d60f6159c9db58835c926644) >> 128; + if (absTick & 0x20 != 0) + ratio = (ratio * 0xff973b41fa98c081472e6896dfb254c0) >> 128; + if (absTick & 0x40 != 0) + ratio = (ratio * 0xff2ea16466c96a3843ec78b326b52861) >> 128; + if (absTick & 0x80 != 0) + ratio = (ratio * 0xfe5dee046a99a2a811c461f1969c3053) >> 128; + if (absTick & 0x100 != 0) + ratio = (ratio * 0xfcbe86c7900a88aedcffc83b479aa3a4) >> 128; + if (absTick & 0x200 != 0) + ratio = (ratio * 0xf987a7253ac413176f2b074cf7815e54) >> 128; + if (absTick & 0x400 != 0) + ratio = (ratio * 0xf3392b0822b70005940c7a398e4b70f3) >> 128; + if (absTick & 0x800 != 0) + ratio = (ratio * 0xe7159475a2c29b7443b29c7fa6e889d9) >> 128; + if (absTick & 0x1000 != 0) + ratio = (ratio * 0xd097f3bdfd2022b8845ad8f792aa5825) >> 128; + if (absTick & 0x2000 != 0) + ratio = (ratio * 0xa9f746462d870fdf8a65dc1f90e061e5) >> 128; + if (absTick & 0x4000 != 0) + ratio = (ratio * 0x70d869a156d2a1b890bb3df62baf32f7) >> 128; + if (absTick & 0x8000 != 0) + ratio = (ratio * 0x31be135f97d08fd981231505542fcfa6) >> 128; + if (absTick & 0x10000 != 0) + ratio = (ratio * 0x9aa508b5b7a84e1c677de54f3e99bc9) >> 128; + if (absTick & 0x20000 != 0) + ratio = (ratio * 0x5d6af8dedb81196699c329225ee604) >> 128; + if (absTick & 0x40000 != 0) + ratio = (ratio * 0x2216e584f5fa1ea926041bedfe98) >> 128; + if (absTick & 0x80000 != 0) + ratio = (ratio * 0x48a170391f7dc42444e8fa2) >> 128; + + if (tick > 0) ratio = type(uint256).max / ratio; + + // this divides by 1<<32 rounding up to go from a Q128.128 to a Q128.96. + // we then downcast because we know the result always fits within 160 bits due to our tick input constraint + // we round up in the division so getTickAtSqrtRatio of the output price is always consistent + sqrtPriceX96 = uint160( + (ratio >> 32) + (ratio % (1 << 32) == 0 ? 0 : 1) + ); + } + } + + /// @notice Calculates the greatest tick value such that getRatioAtTick(tick) <= ratio + /// @dev Throws in case sqrtPriceX96 < MIN_SQRT_RATIO, as MIN_SQRT_RATIO is the lowest value getRatioAtTick may + /// ever return. + /// @param sqrtPriceX96 The sqrt ratio for which to compute the tick as a Q64.96 + /// @return tick The greatest tick for which the ratio is less than or equal to the input ratio + function getTickAtSqrtRatio(uint160 sqrtPriceX96) + internal + pure + returns (int24 tick) + { + unchecked { + // second inequality must be < because the price can never reach the price at the max tick + if ( + !(sqrtPriceX96 >= MIN_SQRT_RATIO && + sqrtPriceX96 < MAX_SQRT_RATIO) + ) revert R(); + uint256 ratio = uint256(sqrtPriceX96) << 32; + + uint256 r = ratio; + uint256 msb = 0; + + assembly { + let f := shl(7, gt(r, 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF)) + msb := or(msb, f) + r := shr(f, r) + } + assembly { + let f := shl(6, gt(r, 0xFFFFFFFFFFFFFFFF)) + msb := or(msb, f) + r := shr(f, r) + } + assembly { + let f := shl(5, gt(r, 0xFFFFFFFF)) + msb := or(msb, f) + r := shr(f, r) + } + assembly { + let f := shl(4, gt(r, 0xFFFF)) + msb := or(msb, f) + r := shr(f, r) + } + assembly { + let f := shl(3, gt(r, 0xFF)) + msb := or(msb, f) + r := shr(f, r) + } + assembly { + let f := shl(2, gt(r, 0xF)) + msb := or(msb, f) + r := shr(f, r) + } + assembly { + let f := shl(1, gt(r, 0x3)) + msb := or(msb, f) + r := shr(f, r) + } + assembly { + let f := gt(r, 0x1) + msb := or(msb, f) + } + + if (msb >= 128) r = ratio >> (msb - 127); + else r = ratio << (127 - msb); + + int256 log_2 = (int256(msb) - 128) << 64; + + assembly { + r := shr(127, mul(r, r)) + let f := shr(128, r) + log_2 := or(log_2, shl(63, f)) + r := shr(f, r) + } + assembly { + r := shr(127, mul(r, r)) + let f := shr(128, r) + log_2 := or(log_2, shl(62, f)) + r := shr(f, r) + } + assembly { + r := shr(127, mul(r, r)) + let f := shr(128, r) + log_2 := or(log_2, shl(61, f)) + r := shr(f, r) + } + assembly { + r := shr(127, mul(r, r)) + let f := shr(128, r) + log_2 := or(log_2, shl(60, f)) + r := shr(f, r) + } + assembly { + r := shr(127, mul(r, r)) + let f := shr(128, r) + log_2 := or(log_2, shl(59, f)) + r := shr(f, r) + } + assembly { + r := shr(127, mul(r, r)) + let f := shr(128, r) + log_2 := or(log_2, shl(58, f)) + r := shr(f, r) + } + assembly { + r := shr(127, mul(r, r)) + let f := shr(128, r) + log_2 := or(log_2, shl(57, f)) + r := shr(f, r) + } + assembly { + r := shr(127, mul(r, r)) + let f := shr(128, r) + log_2 := or(log_2, shl(56, f)) + r := shr(f, r) + } + assembly { + r := shr(127, mul(r, r)) + let f := shr(128, r) + log_2 := or(log_2, shl(55, f)) + r := shr(f, r) + } + assembly { + r := shr(127, mul(r, r)) + let f := shr(128, r) + log_2 := or(log_2, shl(54, f)) + r := shr(f, r) + } + assembly { + r := shr(127, mul(r, r)) + let f := shr(128, r) + log_2 := or(log_2, shl(53, f)) + r := shr(f, r) + } + assembly { + r := shr(127, mul(r, r)) + let f := shr(128, r) + log_2 := or(log_2, shl(52, f)) + r := shr(f, r) + } + assembly { + r := shr(127, mul(r, r)) + let f := shr(128, r) + log_2 := or(log_2, shl(51, f)) + r := shr(f, r) + } + assembly { + r := shr(127, mul(r, r)) + let f := shr(128, r) + log_2 := or(log_2, shl(50, f)) + } + + int256 log_sqrt10001 = log_2 * 255738958999603826347141; // 128.128 number + + int24 tickLow = int24( + (log_sqrt10001 - 3402992956809132418596140100660247210) >> 128 + ); + int24 tickHi = int24( + (log_sqrt10001 + 291339464771989622907027621153398088495) >> 128 + ); + + tick = tickLow == tickHi + ? tickLow + : getSqrtRatioAtTick(tickHi) <= sqrtPriceX96 + ? tickHi + : tickLow; + } + } +} + +// File: UnsafeMath.sol + +/// @title Math functions that do not check inputs or outputs +/// @notice Contains methods that perform common math functions but do not do any overflow or underflow checks +library UnsafeMath { + /// @notice Returns ceil(x / y) + /// @dev division by 0 has unspecified behavior, and must be checked externally + /// @param x The dividend + /// @param y The divisor + /// @return z The quotient, ceil(x / y) + function divRoundingUp(uint256 x, uint256 y) + internal + pure + returns (uint256 z) + { + assembly { + z := add(div(x, y), gt(mod(x, y), 0)) + } + } +} + +// File: IUniswapV3Pool.sol + +/// @title The interface for a Uniswap V3 Pool +/// @notice A Uniswap pool facilitates swapping and automated market making between any two assets that strictly conform +/// to the ERC20 specification +/// @dev The pool interface is broken up into many smaller pieces +interface IUniswapV3Pool is + IUniswapV3PoolImmutables, + IUniswapV3PoolState, + IUniswapV3PoolDerivedState, + IUniswapV3PoolActions, + IUniswapV3PoolOwnerActions, + IUniswapV3PoolErrors, + IUniswapV3PoolEvents +{ + +} + +// File: LiquidityAmounts.sol + +/// @title Liquidity amount functions +/// @notice Provides functions for computing liquidity amounts from token amounts and prices +library LiquidityAmounts { + /// @notice Downcasts uint256 to uint128 + /// @param x The uint258 to be downcasted + /// @return y The passed value, downcasted to uint128 + function toUint128(uint256 x) private pure returns (uint128 y) { + require((y = uint128(x)) == x); + } + + /// @notice Computes the amount of liquidity received for a given amount of token0 and price range + /// @dev Calculates amount0 * (sqrt(upper) * sqrt(lower)) / (sqrt(upper) - sqrt(lower)) + /// @param sqrtRatioAX96 A sqrt price representing the first tick boundary + /// @param sqrtRatioBX96 A sqrt price representing the second tick boundary + /// @param amount0 The amount0 being sent in + /// @return liquidity The amount of returned liquidity + function getLiquidityForAmount0( + uint160 sqrtRatioAX96, + uint160 sqrtRatioBX96, + uint256 amount0 + ) internal pure returns (uint128 liquidity) { + if (sqrtRatioAX96 > sqrtRatioBX96) + (sqrtRatioAX96, sqrtRatioBX96) = (sqrtRatioBX96, sqrtRatioAX96); + uint256 intermediate = FullMath.mulDiv( + sqrtRatioAX96, + sqrtRatioBX96, + FixedPoint96.Q96 + ); + return + toUint128( + FullMath.mulDiv( + amount0, + intermediate, + sqrtRatioBX96 - sqrtRatioAX96 + ) + ); + } + + /// @notice Computes the amount of liquidity received for a given amount of token1 and price range + /// @dev Calculates amount1 / (sqrt(upper) - sqrt(lower)). + /// @param sqrtRatioAX96 A sqrt price representing the first tick boundary + /// @param sqrtRatioBX96 A sqrt price representing the second tick boundary + /// @param amount1 The amount1 being sent in + /// @return liquidity The amount of returned liquidity + function getLiquidityForAmount1( + uint160 sqrtRatioAX96, + uint160 sqrtRatioBX96, + uint256 amount1 + ) internal pure returns (uint128 liquidity) { + if (sqrtRatioAX96 > sqrtRatioBX96) + (sqrtRatioAX96, sqrtRatioBX96) = (sqrtRatioBX96, sqrtRatioAX96); + return + toUint128( + FullMath.mulDiv( + amount1, + FixedPoint96.Q96, + sqrtRatioBX96 - sqrtRatioAX96 + ) + ); + } + + /// @notice Computes the maximum amount of liquidity received for a given amount of token0, token1, the current + /// pool prices and the prices at the tick boundaries + /// @param sqrtRatioX96 A sqrt price representing the current pool prices + /// @param sqrtRatioAX96 A sqrt price representing the first tick boundary + /// @param sqrtRatioBX96 A sqrt price representing the second tick boundary + /// @param amount0 The amount of token0 being sent in + /// @param amount1 The amount of token1 being sent in + /// @return liquidity The maximum amount of liquidity received + function getLiquidityForAmounts( + uint160 sqrtRatioX96, + uint160 sqrtRatioAX96, + uint160 sqrtRatioBX96, + uint256 amount0, + uint256 amount1 + ) internal pure returns (uint128 liquidity) { + if (sqrtRatioAX96 > sqrtRatioBX96) + (sqrtRatioAX96, sqrtRatioBX96) = (sqrtRatioBX96, sqrtRatioAX96); + + if (sqrtRatioX96 <= sqrtRatioAX96) { + liquidity = getLiquidityForAmount0( + sqrtRatioAX96, + sqrtRatioBX96, + amount0 + ); + } else if (sqrtRatioX96 < sqrtRatioBX96) { + uint128 liquidity0 = getLiquidityForAmount0( + sqrtRatioX96, + sqrtRatioBX96, + amount0 + ); + uint128 liquidity1 = getLiquidityForAmount1( + sqrtRatioAX96, + sqrtRatioX96, + amount1 + ); + + liquidity = liquidity0 < liquidity1 ? liquidity0 : liquidity1; + } else { + liquidity = getLiquidityForAmount1( + sqrtRatioAX96, + sqrtRatioBX96, + amount1 + ); + } + } + + /// @notice Computes the amount of token0 for a given amount of liquidity and a price range + /// @param sqrtRatioAX96 A sqrt price representing the first tick boundary + /// @param sqrtRatioBX96 A sqrt price representing the second tick boundary + /// @param liquidity The liquidity being valued + /// @return amount0 The amount of token0 + function getAmount0ForLiquidity( + uint160 sqrtRatioAX96, + uint160 sqrtRatioBX96, + uint128 liquidity + ) internal pure returns (uint256 amount0) { + if (sqrtRatioAX96 > sqrtRatioBX96) + (sqrtRatioAX96, sqrtRatioBX96) = (sqrtRatioBX96, sqrtRatioAX96); + + return + FullMath.mulDiv( + uint256(liquidity) << FixedPoint96.RESOLUTION, + sqrtRatioBX96 - sqrtRatioAX96, + sqrtRatioBX96 + ) / sqrtRatioAX96; + } + + /// @notice Computes the amount of token1 for a given amount of liquidity and a price range + /// @param sqrtRatioAX96 A sqrt price representing the first tick boundary + /// @param sqrtRatioBX96 A sqrt price representing the second tick boundary + /// @param liquidity The liquidity being valued + /// @return amount1 The amount of token1 + function getAmount1ForLiquidity( + uint160 sqrtRatioAX96, + uint160 sqrtRatioBX96, + uint128 liquidity + ) internal pure returns (uint256 amount1) { + if (sqrtRatioAX96 > sqrtRatioBX96) + (sqrtRatioAX96, sqrtRatioBX96) = (sqrtRatioBX96, sqrtRatioAX96); + + return + FullMath.mulDiv( + liquidity, + sqrtRatioBX96 - sqrtRatioAX96, + FixedPoint96.Q96 + ); + } + + /// @notice Computes the token0 and token1 value for a given amount of liquidity, the current + /// pool prices and the prices at the tick boundaries + /// @param sqrtRatioX96 A sqrt price representing the current pool prices + /// @param sqrtRatioAX96 A sqrt price representing the first tick boundary + /// @param sqrtRatioBX96 A sqrt price representing the second tick boundary + /// @param liquidity The liquidity being valued + /// @return amount0 The amount of token0 + /// @return amount1 The amount of token1 + function getAmountsForLiquidity( + uint160 sqrtRatioX96, + uint160 sqrtRatioAX96, + uint160 sqrtRatioBX96, + uint128 liquidity + ) internal pure returns (uint256 amount0, uint256 amount1) { + if (sqrtRatioAX96 > sqrtRatioBX96) + (sqrtRatioAX96, sqrtRatioBX96) = (sqrtRatioBX96, sqrtRatioAX96); + + if (sqrtRatioX96 <= sqrtRatioAX96) { + amount0 = getAmount0ForLiquidity( + sqrtRatioAX96, + sqrtRatioBX96, + liquidity + ); + } else if (sqrtRatioX96 < sqrtRatioBX96) { + amount0 = getAmount0ForLiquidity( + sqrtRatioX96, + sqrtRatioBX96, + liquidity + ); + amount1 = getAmount1ForLiquidity( + sqrtRatioAX96, + sqrtRatioX96, + liquidity + ); + } else { + amount1 = getAmount1ForLiquidity( + sqrtRatioAX96, + sqrtRatioBX96, + liquidity + ); + } + } +} + +// File: SqrtPriceMath.sol + +/// @title Functions based on Q64.96 sqrt price and liquidity +/// @notice Contains the math that uses square root of price as a Q64.96 and liquidity to compute deltas +library SqrtPriceMath { + using SafeCast for uint256; + + /// @notice Gets the next sqrt price given a delta of token0 + /// @dev Always rounds up, because in the exact output case (increasing price) we need to move the price at least + /// far enough to get the desired output amount, and in the exact input case (decreasing price) we need to move the + /// price less in order to not send too much output. + /// The most precise formula for this is liquidity * sqrtPX96 / (liquidity +- amount * sqrtPX96), + /// if this is impossible because of overflow, we calculate liquidity / (liquidity / sqrtPX96 +- amount). + /// @param sqrtPX96 The starting price, i.e. before accounting for the token0 delta + /// @param liquidity The amount of usable liquidity + /// @param amount How much of token0 to add or remove from virtual reserves + /// @param add Whether to add or remove the amount of token0 + /// @return The price after adding or removing amount, depending on add + function getNextSqrtPriceFromAmount0RoundingUp( + uint160 sqrtPX96, + uint128 liquidity, + uint256 amount, + bool add + ) internal pure returns (uint160) { + // we short circuit amount == 0 because the result is otherwise not guaranteed to equal the input price + if (amount == 0) return sqrtPX96; + uint256 numerator1 = uint256(liquidity) << FixedPoint96.RESOLUTION; + + if (add) { + unchecked { + uint256 product; + if ((product = amount * sqrtPX96) / amount == sqrtPX96) { + uint256 denominator = numerator1 + product; + if (denominator >= numerator1) + // always fits in 160 bits + return + uint160( + FullMath.mulDivRoundingUp( + numerator1, + sqrtPX96, + denominator + ) + ); + } + } + // denominator is checked for overflow + return + uint160( + UnsafeMath.divRoundingUp( + numerator1, + (numerator1 / sqrtPX96) + amount + ) + ); + } else { + unchecked { + uint256 product; + // if the product overflows, we know the denominator underflows + // in addition, we must check that the denominator does not underflow + require( + (product = amount * sqrtPX96) / amount == sqrtPX96 && + numerator1 > product + ); + uint256 denominator = numerator1 - product; + return + FullMath + .mulDivRoundingUp(numerator1, sqrtPX96, denominator) + .toUint160(); + } + } + } + + /// @notice Gets the next sqrt price given a delta of token1 + /// @dev Always rounds down, because in the exact output case (decreasing price) we need to move the price at least + /// far enough to get the desired output amount, and in the exact input case (increasing price) we need to move the + /// price less in order to not send too much output. + /// The formula we compute is within <1 wei of the lossless version: sqrtPX96 +- amount / liquidity + /// @param sqrtPX96 The starting price, i.e., before accounting for the token1 delta + /// @param liquidity The amount of usable liquidity + /// @param amount How much of token1 to add, or remove, from virtual reserves + /// @param add Whether to add, or remove, the amount of token1 + /// @return The price after adding or removing `amount` + function getNextSqrtPriceFromAmount1RoundingDown( + uint160 sqrtPX96, + uint128 liquidity, + uint256 amount, + bool add + ) internal pure returns (uint160) { + // if we're adding (subtracting), rounding down requires rounding the quotient down (up) + // in both cases, avoid a mulDiv for most inputs + if (add) { + uint256 quotient = ( + amount <= type(uint160).max + ? (amount << FixedPoint96.RESOLUTION) / liquidity + : FullMath.mulDiv(amount, FixedPoint96.Q96, liquidity) + ); + + return (uint256(sqrtPX96) + quotient).toUint160(); + } else { + uint256 quotient = ( + amount <= type(uint160).max + ? UnsafeMath.divRoundingUp( + amount << FixedPoint96.RESOLUTION, + liquidity + ) + : FullMath.mulDivRoundingUp( + amount, + FixedPoint96.Q96, + liquidity + ) + ); + + require(sqrtPX96 > quotient); + // always fits 160 bits + unchecked { + return uint160(sqrtPX96 - quotient); + } + } + } + + /// @notice Gets the next sqrt price given an input amount of token0 or token1 + /// @dev Throws if price or liquidity are 0, or if the next price is out of bounds + /// @param sqrtPX96 The starting price, i.e., before accounting for the input amount + /// @param liquidity The amount of usable liquidity + /// @param amountIn How much of token0, or token1, is being swapped in + /// @param zeroForOne Whether the amount in is token0 or token1 + /// @return sqrtQX96 The price after adding the input amount to token0 or token1 + function getNextSqrtPriceFromInput( + uint160 sqrtPX96, + uint128 liquidity, + uint256 amountIn, + bool zeroForOne + ) internal pure returns (uint160 sqrtQX96) { + require(sqrtPX96 > 0); + require(liquidity > 0); + + // round to make sure that we don't pass the target price + return + zeroForOne + ? getNextSqrtPriceFromAmount0RoundingUp( + sqrtPX96, + liquidity, + amountIn, + true + ) + : getNextSqrtPriceFromAmount1RoundingDown( + sqrtPX96, + liquidity, + amountIn, + true + ); + } + + /// @notice Gets the next sqrt price given an output amount of token0 or token1 + /// @dev Throws if price or liquidity are 0 or the next price is out of bounds + /// @param sqrtPX96 The starting price before accounting for the output amount + /// @param liquidity The amount of usable liquidity + /// @param amountOut How much of token0, or token1, is being swapped out + /// @param zeroForOne Whether the amount out is token0 or token1 + /// @return sqrtQX96 The price after removing the output amount of token0 or token1 + function getNextSqrtPriceFromOutput( + uint160 sqrtPX96, + uint128 liquidity, + uint256 amountOut, + bool zeroForOne + ) internal pure returns (uint160 sqrtQX96) { + require(sqrtPX96 > 0); + require(liquidity > 0); + + // round to make sure that we pass the target price + return + zeroForOne + ? getNextSqrtPriceFromAmount1RoundingDown( + sqrtPX96, + liquidity, + amountOut, + false + ) + : getNextSqrtPriceFromAmount0RoundingUp( + sqrtPX96, + liquidity, + amountOut, + false + ); + } + + /// @notice Gets the amount0 delta between two prices + /// @dev Calculates liquidity / sqrt(lower) - liquidity / sqrt(upper), + /// i.e. liquidity * (sqrt(upper) - sqrt(lower)) / (sqrt(upper) * sqrt(lower)) + /// @param sqrtRatioAX96 A sqrt price + /// @param sqrtRatioBX96 Another sqrt price + /// @param liquidity The amount of usable liquidity + /// @param roundUp Whether to round the amount up or down + /// @return amount0 Amount of token0 required to cover a position of size liquidity between the two passed prices + function getAmount0Delta( + uint160 sqrtRatioAX96, + uint160 sqrtRatioBX96, + uint128 liquidity, + bool roundUp + ) internal pure returns (uint256 amount0) { + unchecked { + if (sqrtRatioAX96 > sqrtRatioBX96) + (sqrtRatioAX96, sqrtRatioBX96) = (sqrtRatioBX96, sqrtRatioAX96); + + uint256 numerator1 = uint256(liquidity) << FixedPoint96.RESOLUTION; + uint256 numerator2 = sqrtRatioBX96 - sqrtRatioAX96; + + require(sqrtRatioAX96 > 0); + + return + roundUp + ? UnsafeMath.divRoundingUp( + FullMath.mulDivRoundingUp( + numerator1, + numerator2, + sqrtRatioBX96 + ), + sqrtRatioAX96 + ) + : FullMath.mulDiv(numerator1, numerator2, sqrtRatioBX96) / + sqrtRatioAX96; + } + } + + /// @notice Gets the amount1 delta between two prices + /// @dev Calculates liquidity * (sqrt(upper) - sqrt(lower)) + /// @param sqrtRatioAX96 A sqrt price + /// @param sqrtRatioBX96 Another sqrt price + /// @param liquidity The amount of usable liquidity + /// @param roundUp Whether to round the amount up, or down + /// @return amount1 Amount of token1 required to cover a position of size liquidity between the two passed prices + function getAmount1Delta( + uint160 sqrtRatioAX96, + uint160 sqrtRatioBX96, + uint128 liquidity, + bool roundUp + ) internal pure returns (uint256 amount1) { + unchecked { + if (sqrtRatioAX96 > sqrtRatioBX96) + (sqrtRatioAX96, sqrtRatioBX96) = (sqrtRatioBX96, sqrtRatioAX96); + + return + roundUp + ? FullMath.mulDivRoundingUp( + liquidity, + sqrtRatioBX96 - sqrtRatioAX96, + FixedPoint96.Q96 + ) + : FullMath.mulDiv( + liquidity, + sqrtRatioBX96 - sqrtRatioAX96, + FixedPoint96.Q96 + ); + } + } + + /// @notice Helper that gets signed token0 delta + /// @param sqrtRatioAX96 A sqrt price + /// @param sqrtRatioBX96 Another sqrt price + /// @param liquidity The change in liquidity for which to compute the amount0 delta + /// @return amount0 Amount of token0 corresponding to the passed liquidityDelta between the two prices + function getAmount0Delta( + uint160 sqrtRatioAX96, + uint160 sqrtRatioBX96, + int128 liquidity + ) internal pure returns (int256 amount0) { + unchecked { + return + liquidity < 0 + ? -getAmount0Delta( + sqrtRatioAX96, + sqrtRatioBX96, + uint128(-liquidity), + false + ).toInt256() + : getAmount0Delta( + sqrtRatioAX96, + sqrtRatioBX96, + uint128(liquidity), + true + ).toInt256(); + } + } + + /// @notice Helper that gets signed token1 delta + /// @param sqrtRatioAX96 A sqrt price + /// @param sqrtRatioBX96 Another sqrt price + /// @param liquidity The change in liquidity for which to compute the amount1 delta + /// @return amount1 Amount of token1 corresponding to the passed liquidityDelta between the two prices + function getAmount1Delta( + uint160 sqrtRatioAX96, + uint160 sqrtRatioBX96, + int128 liquidity + ) internal pure returns (int256 amount1) { + unchecked { + return + liquidity < 0 + ? -getAmount1Delta( + sqrtRatioAX96, + sqrtRatioBX96, + uint128(-liquidity), + false + ).toInt256() + : getAmount1Delta( + sqrtRatioAX96, + sqrtRatioBX96, + uint128(liquidity), + true + ).toInt256(); + } + } +} + +// File: TickBitmap.sol + +/// @title Packed tick initialized state library +/// @notice Stores a packed mapping of tick index to its initialized state +/// @dev The mapping uses int16 for keys since ticks are represented as int24 and there are 256 (2^8) values per word. +library TickBitmap { + /// @notice Computes the position in the mapping where the initialized bit for a tick lives + /// @param tick The tick for which to compute the position + /// @return wordPos The key in the mapping containing the word in which the bit is stored + /// @return bitPos The bit position in the word where the flag is stored + function position(int24 tick) internal pure returns (int16 wordPos, uint8 bitPos) { + unchecked { + wordPos = int16(tick >> 8); + bitPos = uint8(int8(tick % 256)); + } + } + + /// @notice Flips the initialized state for a given tick from false to true, or vice versa + /// @param self The mapping in which to flip the tick + /// @param tick The tick to flip + /// @param tickSpacing The spacing between usable ticks + function flipTick( + mapping(int16 => uint256) storage self, + int24 tick, + int24 tickSpacing + ) internal { + unchecked { + require(tick % tickSpacing == 0); // ensure that the tick is spaced + (int16 wordPos, uint8 bitPos) = position(tick / tickSpacing); + uint256 mask = 1 << bitPos; + self[wordPos] ^= mask; + } + } + + /// @notice Returns the next initialized tick contained in the same word (or adjacent word) as the tick that is either + /// to the left (less than or equal to) or right (greater than) of the given tick + /// @param self The mapping in which to compute the next initialized tick + /// @param tick The starting tick + /// @param tickSpacing The spacing between usable ticks + /// @param lte Whether to search for the next initialized tick to the left (less than or equal to the starting tick) + /// @return next The next initialized or uninitialized tick up to 256 ticks away from the current tick + /// @return initialized Whether the next tick is initialized, as the function only searches within up to 256 ticks + function nextInitializedTickWithinOneWord( + mapping(int16 => uint256) storage self, + int24 tick, + int24 tickSpacing, + bool lte + ) internal view returns (int24 next, bool initialized) { + unchecked { + int24 compressed = tick / tickSpacing; + if (tick < 0 && tick % tickSpacing != 0) compressed--; // round towards negative infinity + + if (lte) { + (int16 wordPos, uint8 bitPos) = position(compressed); + // all the 1s at or to the right of the current bitPos + uint256 mask = (1 << bitPos) - 1 + (1 << bitPos); + uint256 masked = self[wordPos] & mask; + + // if there are no initialized ticks to the right of or at the current tick, return rightmost in the word + initialized = masked != 0; + // overflow/underflow is possible, but prevented externally by limiting both tickSpacing and tick + next = initialized + ? (compressed - int24(uint24(bitPos - BitMath.mostSignificantBit(masked)))) * tickSpacing + : (compressed - int24(uint24(bitPos))) * tickSpacing; + } else { + // start from the word of the next tick, since the current tick state doesn't matter + (int16 wordPos, uint8 bitPos) = position(compressed + 1); + // all the 1s at or to the left of the bitPos + uint256 mask = ~((1 << bitPos) - 1); + uint256 masked = self[wordPos] & mask; + + // if there are no initialized ticks to the left of the current tick, return leftmost in the word + initialized = masked != 0; + // overflow/underflow is possible, but prevented externally by limiting both tickSpacing and tick + next = initialized + ? (compressed + 1 + int24(uint24(BitMath.leastSignificantBit(masked) - bitPos))) * tickSpacing + : (compressed + 1 + int24(uint24(type(uint8).max - bitPos))) * tickSpacing; + } + } + } +} + +// File: TickBitmapExtended.sol + +/// @title Tick bitmap extended functions +/// @dev Uses the bitmap from UniswapV3Pool +library TickBitmapExtended { + /// @notice Computes the position in the mapping where the initialized bit for a tick lives + /// @param tick The tick for which to compute the position + /// @return wordPos The key in the mapping containing the word in which the bit is stored + /// @return bitPos The bit position in the word where the flag is stored + function position(int24 tick) + private + pure + returns (int16 wordPos, uint8 bitPos) + { + wordPos = int16(tick >> 8); + bitPos = uint8(uint24(tick % 256)); + } + + /// @notice Returns the next initialized tick contained in the same word (or adjacent word) as the tick that is either + /// to the left (less than or equal to) or right (greater than) of the given tick + /// @param self The mapping in which to compute the next initialized tick + /// @param tick The starting tick + /// @param tickSpacing The spacing between usable ticks + /// @param lte Whether to search for the next initialized tick to the left (less than or equal to the starting tick) + /// @return next The next initialized or uninitialized tick up to 256 ticks away from the current tick + /// @return initialized Whether the next tick is initialized, as the function only searches within up to 256 ticks + function nextInitializedTickWithinOneWord( + function(int16) external view returns (uint256) self, + int24 tick, + int24 tickSpacing, + bool lte + ) internal view returns (int24 next, bool initialized) { + int24 compressed = tick / tickSpacing; + if (tick < 0 && tick % tickSpacing != 0) compressed--; // round towards negative infinity + + if (lte) { + (int16 wordPos, uint8 bitPos) = position(compressed); + // all the 1s at or to the right of the current bitPos + uint256 mask = (1 << bitPos) - 1 + (1 << bitPos); + uint256 masked = self(wordPos) & mask; + + // if there are no initialized ticks to the right of or at the current tick, return rightmost in the word + initialized = masked != 0; + // overflow/underflow is possible, but prevented externally by limiting both tickSpacing and tick + next = initialized + ? (compressed - + int24( + uint24(bitPos - BitMath.mostSignificantBit(masked)) + )) * tickSpacing + : (compressed - int24(uint24(bitPos))) * tickSpacing; + } else { + // start from the word of the next tick, since the current tick state doesn't matter + (int16 wordPos, uint8 bitPos) = position(compressed + 1); + // all the 1s at or to the left of the bitPos + uint256 mask = ~((1 << bitPos) - 1); + uint256 masked = self(wordPos) & mask; + + // if there are no initialized ticks to the left of the current tick, return leftmost in the word + initialized = masked != 0; + // overflow/underflow is possible, but prevented externally by limiting both tickSpacing and tick + next = initialized + ? (compressed + + 1 + + int24( + uint24(BitMath.leastSignificantBit(masked) - bitPos) + )) * tickSpacing + : (compressed + 1 + int24(uint24(type(uint8).max - bitPos))) * + tickSpacing; + } + } +} + +// File: SwapMath.sol + +/// @title Computes the result of a swap within ticks +/// @notice Contains methods for computing the result of a swap within a single tick price range, i.e., a single tick. +library SwapMath { + /// @notice Computes the result of swapping some amount in, or amount out, given the parameters of the swap + /// @dev The fee, plus the amount in, will never exceed the amount remaining if the swap's `amountSpecified` is positive + /// @param sqrtRatioCurrentX96 The current sqrt price of the pool + /// @param sqrtRatioTargetX96 The price that cannot be exceeded, from which the direction of the swap is inferred + /// @param liquidity The usable liquidity + /// @param amountRemaining How much input or output amount is remaining to be swapped in/out + /// @param feePips The fee taken from the input amount, expressed in hundredths of a bip + /// @return sqrtRatioNextX96 The price after swapping the amount in/out, not to exceed the price target + /// @return amountIn The amount to be swapped in, of either token0 or token1, based on the direction of the swap + /// @return amountOut The amount to be received, of either token0 or token1, based on the direction of the swap + /// @return feeAmount The amount of input that will be taken as a fee + function computeSwapStep( + uint160 sqrtRatioCurrentX96, + uint160 sqrtRatioTargetX96, + uint128 liquidity, + int256 amountRemaining, + uint24 feePips + ) + internal + pure + returns ( + uint160 sqrtRatioNextX96, + uint256 amountIn, + uint256 amountOut, + uint256 feeAmount + ) + { + unchecked { + bool zeroForOne = sqrtRatioCurrentX96 >= sqrtRatioTargetX96; + bool exactIn = amountRemaining >= 0; + + if (exactIn) { + uint256 amountRemainingLessFee = FullMath.mulDiv( + uint256(amountRemaining), + 1e6 - feePips, + 1e6 + ); + amountIn = zeroForOne + ? SqrtPriceMath.getAmount0Delta( + sqrtRatioTargetX96, + sqrtRatioCurrentX96, + liquidity, + true + ) + : SqrtPriceMath.getAmount1Delta( + sqrtRatioCurrentX96, + sqrtRatioTargetX96, + liquidity, + true + ); + if (amountRemainingLessFee >= amountIn) + sqrtRatioNextX96 = sqrtRatioTargetX96; + else + sqrtRatioNextX96 = SqrtPriceMath.getNextSqrtPriceFromInput( + sqrtRatioCurrentX96, + liquidity, + amountRemainingLessFee, + zeroForOne + ); + } else { + amountOut = zeroForOne + ? SqrtPriceMath.getAmount1Delta( + sqrtRatioTargetX96, + sqrtRatioCurrentX96, + liquidity, + false + ) + : SqrtPriceMath.getAmount0Delta( + sqrtRatioCurrentX96, + sqrtRatioTargetX96, + liquidity, + false + ); + if (uint256(-amountRemaining) >= amountOut) + sqrtRatioNextX96 = sqrtRatioTargetX96; + else + sqrtRatioNextX96 = SqrtPriceMath.getNextSqrtPriceFromOutput( + sqrtRatioCurrentX96, + liquidity, + uint256(-amountRemaining), + zeroForOne + ); + } + + bool max = sqrtRatioTargetX96 == sqrtRatioNextX96; + + // get the input/output amounts + if (zeroForOne) { + amountIn = max && exactIn + ? amountIn + : SqrtPriceMath.getAmount0Delta( + sqrtRatioNextX96, + sqrtRatioCurrentX96, + liquidity, + true + ); + amountOut = max && !exactIn + ? amountOut + : SqrtPriceMath.getAmount1Delta( + sqrtRatioNextX96, + sqrtRatioCurrentX96, + liquidity, + false + ); + } else { + amountIn = max && exactIn + ? amountIn + : SqrtPriceMath.getAmount1Delta( + sqrtRatioCurrentX96, + sqrtRatioNextX96, + liquidity, + true + ); + amountOut = max && !exactIn + ? amountOut + : SqrtPriceMath.getAmount0Delta( + sqrtRatioCurrentX96, + sqrtRatioNextX96, + liquidity, + false + ); + } + + // cap the output amount to not exceed the remaining output amount + if (!exactIn && amountOut > uint256(-amountRemaining)) { + amountOut = uint256(-amountRemaining); + } + + if (exactIn && sqrtRatioNextX96 != sqrtRatioTargetX96) { + // we didn't reach the target, so take the remainder of the maximum input as fee + feeAmount = uint256(amountRemaining) - amountIn; + } else { + feeAmount = FullMath.mulDivRoundingUp( + amountIn, + feePips, + 1e6 - feePips + ); + } + } + } +} + +// File: Simulate.sol + +/// @title Library for simulating swaps. +/// @notice By fully replicating the swap logic, we can make a static call to get a quote. +library Simulate { + using SafeCast for uint256; + + struct Cache { + // price at the beginning of the swap + uint160 sqrtPriceX96Start; + // tick at the beginning of the swap + int24 tickStart; + // liquidity at the beginning of the swap + uint128 liquidityStart; + // the lp fee of the pool + uint24 fee; + // the tick spacing of the pool + int24 tickSpacing; + } + + struct State { + // the amount remaining to be swapped in/out of the input/output asset + int256 amountSpecifiedRemaining; + // the amount already swapped out/in of the output/input asset + int256 amountCalculated; + // current sqrt(price) + uint160 sqrtPriceX96; + // the tick associated with the current price + int24 tick; + // the current liquidity in range + uint128 liquidity; + } + + // copied from UniswapV3Pool to avoid pragma issues associated with importing it + struct StepComputations { + // the price at the beginning of the step + uint160 sqrtPriceStartX96; + // the next tick to swap to from the current tick in the swap direction + int24 tickNext; + // whether tickNext is initialized or not + bool initialized; + // sqrt(price) for the next tick (1/0) + uint160 sqrtPriceNextX96; + // how much is being swapped in in this step + uint256 amountIn; + // how much is being swapped out + uint256 amountOut; + // how much fee is being paid in + uint256 feeAmount; + } + + function simulateSwap( + IUniswapV3Pool pool, + bool zeroForOne, + int256 amountSpecified, + uint160 sqrtPriceLimitX96 + ) internal view returns (int256 amount0, int256 amount1) { + require(amountSpecified != 0, 'AS'); + + (uint160 sqrtPriceX96, int24 tick, , , , , ) = pool.slot0(); + + require( + zeroForOne + ? sqrtPriceLimitX96 < sqrtPriceX96 && sqrtPriceLimitX96 > TickMath.MIN_SQRT_RATIO + : sqrtPriceLimitX96 > sqrtPriceX96 && sqrtPriceLimitX96 < TickMath.MAX_SQRT_RATIO, + 'SPL' + ); + + Cache memory cache = Cache({ + sqrtPriceX96Start: sqrtPriceX96, + tickStart: tick, + liquidityStart: pool.liquidity(), + fee: pool.fee(), + tickSpacing: pool.tickSpacing() + }); + + bool exactInput = amountSpecified > 0; + + State memory state = State({ + amountSpecifiedRemaining: amountSpecified, + amountCalculated: 0, + sqrtPriceX96: cache.sqrtPriceX96Start, + tick: cache.tickStart, + liquidity: cache.liquidityStart + }); + + while (state.amountSpecifiedRemaining != 0 && state.sqrtPriceX96 != sqrtPriceLimitX96) { + StepComputations memory step; + + step.sqrtPriceStartX96 = state.sqrtPriceX96; + + (step.tickNext, step.initialized) = nextInitializedTickWithinOneWord( + pool.tickBitmap, + state.tick, + cache.tickSpacing, + zeroForOne + ); + + if (step.tickNext < TickMath.MIN_TICK) { + step.tickNext = TickMath.MIN_TICK; + } else if (step.tickNext > TickMath.MAX_TICK) { + step.tickNext = TickMath.MAX_TICK; + } + + step.sqrtPriceNextX96 = TickMath.getSqrtRatioAtTick(step.tickNext); + + (state.sqrtPriceX96, step.amountIn, step.amountOut, step.feeAmount) = SwapMath.computeSwapStep( + state.sqrtPriceX96, + (zeroForOne ? step.sqrtPriceNextX96 < sqrtPriceLimitX96 : step.sqrtPriceNextX96 > sqrtPriceLimitX96) + ? sqrtPriceLimitX96 + : step.sqrtPriceNextX96, + state.liquidity, + state.amountSpecifiedRemaining, + cache.fee + ); + + if (exactInput) { + unchecked { + state.amountSpecifiedRemaining -= (step.amountIn + step.feeAmount).toInt256(); + } + state.amountCalculated -= step.amountOut.toInt256(); + } else { + unchecked { + state.amountSpecifiedRemaining += step.amountOut.toInt256(); + } + state.amountCalculated += (step.amountIn + step.feeAmount).toInt256(); + } + + if (state.sqrtPriceX96 == step.sqrtPriceNextX96) { + if (step.initialized) { + (, int128 liquidityNet, , , , , , ) = pool.ticks(step.tickNext); + unchecked { + if (zeroForOne) liquidityNet = -liquidityNet; + } + + state.liquidity = liquidityNet < 0 + ? state.liquidity - uint128(-liquidityNet) + : state.liquidity + uint128(liquidityNet); + } + + unchecked { + state.tick = zeroForOne ? step.tickNext - 1 : step.tickNext; + } + } else if (state.sqrtPriceX96 != step.sqrtPriceStartX96) { + // recompute unless we're on a lower tick boundary (i.e. already transitioned ticks), and haven't moved + state.tick = TickMath.getTickAtSqrtRatio(state.sqrtPriceX96); + } + } + + (amount0, amount1) = zeroForOne == exactInput + ? (amountSpecified - state.amountSpecifiedRemaining, state.amountCalculated) + : (state.amountCalculated, amountSpecified - state.amountSpecifiedRemaining); + } + + // This function replicates TickBitmap, but accepts a function pointer argument. + // It's private because it's messy, and shouldn't be re-used. + function nextInitializedTickWithinOneWord( + function(int16) external view returns (uint256) self, + int24 tick, + int24 tickSpacing, + bool lte + ) private view returns (int24 next, bool initialized) { + unchecked { + int24 compressed = tick / tickSpacing; + if (tick < 0 && tick % tickSpacing != 0) compressed--; // round towards negative infinity + + if (lte) { + (int16 wordPos, uint8 bitPos) = TickBitmap.position(compressed); + // all the 1s at or to the right of the current bitPos + uint256 mask = (1 << bitPos) - 1 + (1 << bitPos); + uint256 masked = self(wordPos) & mask; + + // if there are no initialized ticks to the right of or at the current tick, return rightmost in the word + initialized = masked != 0; + // overflow/underflow is possible, but prevented externally by limiting both tickSpacing and tick + next = initialized + ? (compressed - int24(uint24(bitPos - BitMath.mostSignificantBit(masked)))) * tickSpacing + : (compressed - int24(uint24(bitPos))) * tickSpacing; + } else { + // start from the word of the next tick, since the current tick state doesn't matter + (int16 wordPos, uint8 bitPos) = TickBitmap.position(compressed + 1); + // all the 1s at or to the left of the bitPos + uint256 mask = ~((1 << bitPos) - 1); + uint256 masked = self(wordPos) & mask; + + // if there are no initialized ticks to the left of the current tick, return leftmost in the word + initialized = masked != 0; + // overflow/underflow is possible, but prevented externally by limiting both tickSpacing and tick + next = initialized + ? (compressed + 1 + int24(uint24(BitMath.leastSignificantBit(masked) - bitPos))) * tickSpacing + : (compressed + 1 + int24(uint24(type(uint8).max - bitPos))) * tickSpacing; + } + } + } +} + +// File: UniswapHelperViews.sol + +/// @title Uniswap V3 necessary views for the strategy +library UniswapHelperViews { + using SafeCast for uint256; + using TickBitmapExtended for function(int16) + external + view + returns (uint256); + + error ZeroAmount(); + error InvalidSqrtPriceLimit(uint160 sqrtPriceLimitX96); + + IUniswapV3Factory public constant uniV3factory = IUniswapV3Factory(0x1F98431c8aD98523631AE4a59f267346ea31F984); + + uint256 public constant PRECISION = 1e18; + + function checkExistingPool( + address tokenA, + address tokenB, + uint24 feeTier, + address poolToCheck + ) external view returns(bool) { + if (uniV3factory.getPool(tokenA, tokenB, feeTier) == poolToCheck) { + return true; + } + return false; + } + + /// @notice Simulates a swap over an Uniswap V3 Pool, allowing to handle tick crosses. + /// @param v3Pool uniswap v3 pool address + /// @param zeroForOne direction of swap, true means swap zero for one + /// @param amountSpecified amount to swap in/out + /// @param sqrtPriceLimitX96 the maximum price to swap to, if this price is reached, then the swap is stopped partially + /// @return amount0 token0 amount + /// @return amount1 token1 amount + function simulateSwap( + address v3Pool, + bool zeroForOne, + int256 amountSpecified, + uint160 sqrtPriceLimitX96 + ) + external + view + returns ( + int256, int256 + ) + { + return Simulate.simulateSwap(IUniswapV3Pool(v3Pool), zeroForOne, amountSpecified, sqrtPriceLimitX96); + } + + struct feesEarnedParams { + address v3Pool; + uint128 liquidity; + int24 tickCurrent; + int24 tickLower; + int24 tickUpper; + uint256 feeGrowthGlobal0X128; + uint256 feeGrowthGlobal1X128; + uint256 feeGrowthInside0LastX128; + uint256 feeGrowthInside1LastX128; + } + + /// @notice Retrieves owed fee data for a specific position + /// @param _feesEarnedParams Custom struct containing: + /// - liquidity Position's liquidity + /// - tickCurrent The current tick + /// - tickLower The lower tick boundary of the position + /// - tickUpper The upper tick boundary of the position + /// - feeGrowthGlobal0X128 The all-time global fee growth, per unit of liquidity, in token0 + /// - feeGrowthGlobal1X128 The all-time global fee growth, per unit of liquidity, in token1 + /// - feeGrowthInside0X128 The all-time fee growth in token0, per unit of liquidity, inside the position's tick boundaries + /// - feeGrowthInside1X128 The all-time fee growth in token1, per unit of liquidity, inside the position's tick boundaries + function getFeesEarned( + feesEarnedParams memory _feesEarnedParams + ) internal view returns (uint128 tokensOwed0, uint128 tokensOwed1) { + uint256 feeGrowthBelow0X128; + uint256 feeGrowthBelow1X128; + IUniswapV3Pool _pool = IUniswapV3Pool(_feesEarnedParams.v3Pool); + (,,uint256 lower_feeGrowthOutside0X128, uint256 lower_feeGrowthOutside1X128,,,,) = _pool.ticks(_feesEarnedParams.tickLower); + (,,uint256 upper_feeGrowthOutside0X128, uint256 upper_feeGrowthOutside1X128,,,,) = _pool.ticks(_feesEarnedParams.tickUpper); + + if (_feesEarnedParams.tickCurrent >= _feesEarnedParams.tickLower) { + feeGrowthBelow0X128 = lower_feeGrowthOutside0X128; + feeGrowthBelow1X128 = lower_feeGrowthOutside1X128; + } else { + feeGrowthBelow0X128 = + _feesEarnedParams.feeGrowthGlobal0X128 - + lower_feeGrowthOutside0X128; + feeGrowthBelow1X128 = + _feesEarnedParams.feeGrowthGlobal1X128 - + lower_feeGrowthOutside1X128; + } + + // calculate fee growth above + uint256 feeGrowthAbove0X128; + uint256 feeGrowthAbove1X128; + if (_feesEarnedParams.tickCurrent < _feesEarnedParams.tickUpper) { + feeGrowthAbove0X128 = upper_feeGrowthOutside0X128; + feeGrowthAbove1X128 = upper_feeGrowthOutside1X128; + } else { + feeGrowthAbove0X128 = + _feesEarnedParams.feeGrowthGlobal0X128 - + upper_feeGrowthOutside0X128; + feeGrowthAbove1X128 = + _feesEarnedParams.feeGrowthGlobal1X128 - + upper_feeGrowthOutside1X128; + } + + uint256 feeGrowthInside0X128 = _feesEarnedParams.feeGrowthGlobal0X128 - + feeGrowthBelow0X128 - + feeGrowthAbove0X128; + uint256 feeGrowthInside1X128 = _feesEarnedParams.feeGrowthGlobal1X128 - + feeGrowthBelow1X128 - + feeGrowthAbove1X128; + + // calculate accumulated fees + tokensOwed0 = uint128( + FullMath.mulDiv( + feeGrowthInside0X128 - + _feesEarnedParams.feeGrowthInside0LastX128, + _feesEarnedParams.liquidity, + FixedPoint128.Q128 + ) + ); + tokensOwed1 = uint128( + FullMath.mulDiv( + feeGrowthInside1X128 - + _feesEarnedParams.feeGrowthInside1LastX128, + _feesEarnedParams.liquidity, + FixedPoint128.Q128 + ) + ); + } +} diff --git a/flattened_provider_univ3.txt b/flattened_provider_univ3.txt new file mode 100644 index 0000000..491694a --- /dev/null +++ b/flattened_provider_univ3.txt @@ -0,0 +1,2001 @@ +// SPDX-License-Identifier: AGPL-3.0 +pragma solidity ^0.8.12; +pragma experimental ABIEncoderV2; + +// File: Address.sol + +// OpenZeppelin Contracts v4.4.1 (utils/Address.sol) + +/** + * @dev Collection of functions related to the address type + */ +library Address { + /** + * @dev Returns true if `account` is a contract. + * + * [IMPORTANT] + * ==== + * It is unsafe to assume that an address for which this function returns + * false is an externally-owned account (EOA) and not a contract. + * + * Among others, `isContract` will return false for the following + * types of addresses: + * + * - an externally-owned account + * - a contract in construction + * - an address where a contract will be created + * - an address where a contract lived, but was destroyed + * ==== + */ + function isContract(address account) internal view returns (bool) { + // This method relies on extcodesize, which returns 0 for contracts in + // construction, since the code is only stored at the end of the + // constructor execution. + + uint256 size; + assembly { + size := extcodesize(account) + } + return size > 0; + } + + /** + * @dev Replacement for Solidity's `transfer`: sends `amount` wei to + * `recipient`, forwarding all available gas and reverting on errors. + * + * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost + * of certain opcodes, possibly making contracts go over the 2300 gas limit + * imposed by `transfer`, making them unable to receive funds via + * `transfer`. {sendValue} removes this limitation. + * + * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more]. + * + * IMPORTANT: because control is transferred to `recipient`, care must be + * taken to not create reentrancy vulnerabilities. Consider using + * {ReentrancyGuard} or the + * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern]. + */ + function sendValue(address payable recipient, uint256 amount) internal { + require(address(this).balance >= amount, "Address: insufficient balance"); + + (bool success, ) = recipient.call{value: amount}(""); + require(success, "Address: unable to send value, recipient may have reverted"); + } + + /** + * @dev Performs a Solidity function call using a low level `call`. A + * plain `call` is an unsafe replacement for a function call: use this + * function instead. + * + * If `target` reverts with a revert reason, it is bubbled up by this + * function (like regular Solidity function calls). + * + * Returns the raw returned data. To convert to the expected return value, + * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`]. + * + * Requirements: + * + * - `target` must be a contract. + * - calling `target` with `data` must not revert. + * + * _Available since v3.1._ + */ + function functionCall(address target, bytes memory data) internal returns (bytes memory) { + return functionCall(target, data, "Address: low-level call failed"); + } + + /** + * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with + * `errorMessage` as a fallback revert reason when `target` reverts. + * + * _Available since v3.1._ + */ + function functionCall( + address target, + bytes memory data, + string memory errorMessage + ) internal returns (bytes memory) { + return functionCallWithValue(target, data, 0, errorMessage); + } + + /** + * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], + * but also transferring `value` wei to `target`. + * + * Requirements: + * + * - the calling contract must have an ETH balance of at least `value`. + * - the called Solidity function must be `payable`. + * + * _Available since v3.1._ + */ + function functionCallWithValue( + address target, + bytes memory data, + uint256 value + ) internal returns (bytes memory) { + return functionCallWithValue(target, data, value, "Address: low-level call with value failed"); + } + + /** + * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but + * with `errorMessage` as a fallback revert reason when `target` reverts. + * + * _Available since v3.1._ + */ + function functionCallWithValue( + address target, + bytes memory data, + uint256 value, + string memory errorMessage + ) internal returns (bytes memory) { + require(address(this).balance >= value, "Address: insufficient balance for call"); + require(isContract(target), "Address: call to non-contract"); + + (bool success, bytes memory returndata) = target.call{value: value}(data); + return verifyCallResult(success, returndata, errorMessage); + } + + /** + * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], + * but performing a static call. + * + * _Available since v3.3._ + */ + function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) { + return functionStaticCall(target, data, "Address: low-level static call failed"); + } + + /** + * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], + * but performing a static call. + * + * _Available since v3.3._ + */ + function functionStaticCall( + address target, + bytes memory data, + string memory errorMessage + ) internal view returns (bytes memory) { + require(isContract(target), "Address: static call to non-contract"); + + (bool success, bytes memory returndata) = target.staticcall(data); + return verifyCallResult(success, returndata, errorMessage); + } + + /** + * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], + * but performing a delegate call. + * + * _Available since v3.4._ + */ + function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) { + return functionDelegateCall(target, data, "Address: low-level delegate call failed"); + } + + /** + * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], + * but performing a delegate call. + * + * _Available since v3.4._ + */ + function functionDelegateCall( + address target, + bytes memory data, + string memory errorMessage + ) internal returns (bytes memory) { + require(isContract(target), "Address: delegate call to non-contract"); + + (bool success, bytes memory returndata) = target.delegatecall(data); + return verifyCallResult(success, returndata, errorMessage); + } + + /** + * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the + * revert reason using the provided one. + * + * _Available since v4.3._ + */ + function verifyCallResult( + bool success, + bytes memory returndata, + string memory errorMessage + ) internal pure returns (bytes memory) { + if (success) { + return returndata; + } else { + // Look for revert reason and bubble it up if present + if (returndata.length > 0) { + // The easiest way to bubble the revert reason is using memory via assembly + + assembly { + let returndata_size := mload(returndata) + revert(add(32, returndata), returndata_size) + } + } else { + revert(errorMessage); + } + } + } +} + +// File: Context.sol + +// OpenZeppelin Contracts v4.4.1 (utils/Context.sol) + +/** + * @dev Provides information about the current execution context, including the + * sender of the transaction and its data. While these are generally available + * via msg.sender and msg.data, they should not be accessed in such a direct + * manner, since when dealing with meta-transactions the account sending and + * paying for execution may not be the actual sender (as far as an application + * is concerned). + * + * This contract is only required for intermediate, library-like contracts. + */ +abstract contract Context { + function _msgSender() internal view virtual returns (address) { + return msg.sender; + } + + function _msgData() internal view virtual returns (bytes calldata) { + return msg.data; + } +} + +// File: IERC20.sol + +// OpenZeppelin Contracts v4.4.1 (token/ERC20/IERC20.sol) + +/** + * @dev Interface of the ERC20 standard as defined in the EIP. + */ +interface IERC20 { + /** + * @dev Returns the amount of tokens in existence. + */ + function totalSupply() external view returns (uint256); + + /** + * @dev Returns the amount of tokens owned by `account`. + */ + function balanceOf(address account) external view returns (uint256); + + /** + * @dev Moves `amount` tokens from the caller's account to `recipient`. + * + * Returns a boolean value indicating whether the operation succeeded. + * + * Emits a {Transfer} event. + */ + function transfer(address recipient, uint256 amount) external returns (bool); + + /** + * @dev Returns the remaining number of tokens that `spender` will be + * allowed to spend on behalf of `owner` through {transferFrom}. This is + * zero by default. + * + * This value changes when {approve} or {transferFrom} are called. + */ + function allowance(address owner, address spender) external view returns (uint256); + + /** + * @dev Sets `amount` as the allowance of `spender` over the caller's tokens. + * + * Returns a boolean value indicating whether the operation succeeded. + * + * IMPORTANT: Beware that changing an allowance with this method brings the risk + * that someone may use both the old and the new allowance by unfortunate + * transaction ordering. One possible solution to mitigate this race + * condition is to first reduce the spender's allowance to 0 and set the + * desired value afterwards: + * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 + * + * Emits an {Approval} event. + */ + function approve(address spender, uint256 amount) external returns (bool); + + /** + * @dev Moves `amount` tokens from `sender` to `recipient` using the + * allowance mechanism. `amount` is then deducted from the caller's + * allowance. + * + * Returns a boolean value indicating whether the operation succeeded. + * + * Emits a {Transfer} event. + */ + function transferFrom( + address sender, + address recipient, + uint256 amount + ) external returns (bool); + + /** + * @dev Emitted when `value` tokens are moved from one account (`from`) to + * another (`to`). + * + * Note that `value` may be zero. + */ + event Transfer(address indexed from, address indexed to, uint256 value); + + /** + * @dev Emitted when the allowance of a `spender` for an `owner` is set by + * a call to {approve}. `value` is the new allowance. + */ + event Approval(address indexed owner, address indexed spender, uint256 value); +} + +// File: IERC20Extended.sol + +interface IERC20Extended is IERC20 { + function decimals() external view returns (uint8); + + function name() external view returns (string memory); + + function symbol() external view returns (string memory); +} + +// File: IERC20Metadata.sol + +// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/IERC20Metadata.sol) + +/** + * @dev Interface for the optional metadata functions from the ERC20 standard. + * + * _Available since v4.1._ + */ +interface IERC20Metadata is IERC20 { + /** + * @dev Returns the name of the token. + */ + function name() external view returns (string memory); + + /** + * @dev Returns the symbol of the token. + */ + function symbol() external view returns (string memory); + + /** + * @dev Returns the decimals places of the token. + */ + function decimals() external view returns (uint8); +} + +// File: SafeERC20.sol + +// OpenZeppelin Contracts v4.4.1 (token/ERC20/utils/SafeERC20.sol) + +/** + * @title SafeERC20 + * @dev Wrappers around ERC20 operations that throw on failure (when the token + * contract returns false). Tokens that return no value (and instead revert or + * throw on failure) are also supported, non-reverting calls are assumed to be + * successful. + * To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract, + * which allows you to call the safe operations as `token.safeTransfer(...)`, etc. + */ +library SafeERC20 { + using Address for address; + + function safeTransfer( + IERC20 token, + address to, + uint256 value + ) internal { + _callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value)); + } + + function safeTransferFrom( + IERC20 token, + address from, + address to, + uint256 value + ) internal { + _callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value)); + } + + /** + * @dev Deprecated. This function has issues similar to the ones found in + * {IERC20-approve}, and its usage is discouraged. + * + * Whenever possible, use {safeIncreaseAllowance} and + * {safeDecreaseAllowance} instead. + */ + function safeApprove( + IERC20 token, + address spender, + uint256 value + ) internal { + // safeApprove should only be called when setting an initial allowance, + // or when resetting it to zero. To increase and decrease it, use + // 'safeIncreaseAllowance' and 'safeDecreaseAllowance' + require( + (value == 0) || (token.allowance(address(this), spender) == 0), + "SafeERC20: approve from non-zero to non-zero allowance" + ); + _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value)); + } + + function safeIncreaseAllowance( + IERC20 token, + address spender, + uint256 value + ) internal { + uint256 newAllowance = token.allowance(address(this), spender) + value; + _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance)); + } + + function safeDecreaseAllowance( + IERC20 token, + address spender, + uint256 value + ) internal { + unchecked { + uint256 oldAllowance = token.allowance(address(this), spender); + require(oldAllowance >= value, "SafeERC20: decreased allowance below zero"); + uint256 newAllowance = oldAllowance - value; + _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance)); + } + } + + /** + * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement + * on the return value: the return value is optional (but if data is returned, it must not be false). + * @param token The token targeted by the call. + * @param data The call data (encoded using abi.encode or one of its variants). + */ + function _callOptionalReturn(IERC20 token, bytes memory data) private { + // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since + // we're implementing it ourselves. We use {Address.functionCall} to perform this call, which verifies that + // the target address contains contract code and also asserts for success in the low-level call. + + bytes memory returndata = address(token).functionCall(data, "SafeERC20: low-level call failed"); + if (returndata.length > 0) { + // Return data is optional + require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed"); + } + } +} + +// File: ERC20.sol + +// OpenZeppelin Contracts v4.4.1 (token/ERC20/ERC20.sol) + +/** + * @dev Implementation of the {IERC20} interface. + * + * This implementation is agnostic to the way tokens are created. This means + * that a supply mechanism has to be added in a derived contract using {_mint}. + * For a generic mechanism see {ERC20PresetMinterPauser}. + * + * TIP: For a detailed writeup see our guide + * https://forum.zeppelin.solutions/t/how-to-implement-erc20-supply-mechanisms/226[How + * to implement supply mechanisms]. + * + * We have followed general OpenZeppelin Contracts guidelines: functions revert + * instead returning `false` on failure. This behavior is nonetheless + * conventional and does not conflict with the expectations of ERC20 + * applications. + * + * Additionally, an {Approval} event is emitted on calls to {transferFrom}. + * This allows applications to reconstruct the allowance for all accounts just + * by listening to said events. Other implementations of the EIP may not emit + * these events, as it isn't required by the specification. + * + * Finally, the non-standard {decreaseAllowance} and {increaseAllowance} + * functions have been added to mitigate the well-known issues around setting + * allowances. See {IERC20-approve}. + */ +contract ERC20 is Context, IERC20, IERC20Metadata { + mapping(address => uint256) private _balances; + + mapping(address => mapping(address => uint256)) private _allowances; + + uint256 private _totalSupply; + + string private _name; + string private _symbol; + + /** + * @dev Sets the values for {name} and {symbol}. + * + * The default value of {decimals} is 18. To select a different value for + * {decimals} you should overload it. + * + * All two of these values are immutable: they can only be set once during + * construction. + */ + constructor(string memory name_, string memory symbol_) { + _name = name_; + _symbol = symbol_; + } + + /** + * @dev Returns the name of the token. + */ + function name() public view virtual override returns (string memory) { + return _name; + } + + /** + * @dev Returns the symbol of the token, usually a shorter version of the + * name. + */ + function symbol() public view virtual override returns (string memory) { + return _symbol; + } + + /** + * @dev Returns the number of decimals used to get its user representation. + * For example, if `decimals` equals `2`, a balance of `505` tokens should + * be displayed to a user as `5.05` (`505 / 10 ** 2`). + * + * Tokens usually opt for a value of 18, imitating the relationship between + * Ether and Wei. This is the value {ERC20} uses, unless this function is + * overridden; + * + * NOTE: This information is only used for _display_ purposes: it in + * no way affects any of the arithmetic of the contract, including + * {IERC20-balanceOf} and {IERC20-transfer}. + */ + function decimals() public view virtual override returns (uint8) { + return 18; + } + + /** + * @dev See {IERC20-totalSupply}. + */ + function totalSupply() public view virtual override returns (uint256) { + return _totalSupply; + } + + /** + * @dev See {IERC20-balanceOf}. + */ + function balanceOf(address account) public view virtual override returns (uint256) { + return _balances[account]; + } + + /** + * @dev See {IERC20-transfer}. + * + * Requirements: + * + * - `recipient` cannot be the zero address. + * - the caller must have a balance of at least `amount`. + */ + function transfer(address recipient, uint256 amount) public virtual override returns (bool) { + _transfer(_msgSender(), recipient, amount); + return true; + } + + /** + * @dev See {IERC20-allowance}. + */ + function allowance(address owner, address spender) public view virtual override returns (uint256) { + return _allowances[owner][spender]; + } + + /** + * @dev See {IERC20-approve}. + * + * Requirements: + * + * - `spender` cannot be the zero address. + */ + function approve(address spender, uint256 amount) public virtual override returns (bool) { + _approve(_msgSender(), spender, amount); + return true; + } + + /** + * @dev See {IERC20-transferFrom}. + * + * Emits an {Approval} event indicating the updated allowance. This is not + * required by the EIP. See the note at the beginning of {ERC20}. + * + * Requirements: + * + * - `sender` and `recipient` cannot be the zero address. + * - `sender` must have a balance of at least `amount`. + * - the caller must have allowance for ``sender``'s tokens of at least + * `amount`. + */ + function transferFrom( + address sender, + address recipient, + uint256 amount + ) public virtual override returns (bool) { + _transfer(sender, recipient, amount); + + uint256 currentAllowance = _allowances[sender][_msgSender()]; + require(currentAllowance >= amount, "ERC20: transfer amount exceeds allowance"); + unchecked { + _approve(sender, _msgSender(), currentAllowance - amount); + } + + return true; + } + + /** + * @dev Atomically increases the allowance granted to `spender` by the caller. + * + * This is an alternative to {approve} that can be used as a mitigation for + * problems described in {IERC20-approve}. + * + * Emits an {Approval} event indicating the updated allowance. + * + * Requirements: + * + * - `spender` cannot be the zero address. + */ + function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) { + _approve(_msgSender(), spender, _allowances[_msgSender()][spender] + addedValue); + return true; + } + + /** + * @dev Atomically decreases the allowance granted to `spender` by the caller. + * + * This is an alternative to {approve} that can be used as a mitigation for + * problems described in {IERC20-approve}. + * + * Emits an {Approval} event indicating the updated allowance. + * + * Requirements: + * + * - `spender` cannot be the zero address. + * - `spender` must have allowance for the caller of at least + * `subtractedValue`. + */ + function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) { + uint256 currentAllowance = _allowances[_msgSender()][spender]; + require(currentAllowance >= subtractedValue, "ERC20: decreased allowance below zero"); + unchecked { + _approve(_msgSender(), spender, currentAllowance - subtractedValue); + } + + return true; + } + + /** + * @dev Moves `amount` of tokens from `sender` to `recipient`. + * + * This internal function is equivalent to {transfer}, and can be used to + * e.g. implement automatic token fees, slashing mechanisms, etc. + * + * Emits a {Transfer} event. + * + * Requirements: + * + * - `sender` cannot be the zero address. + * - `recipient` cannot be the zero address. + * - `sender` must have a balance of at least `amount`. + */ + function _transfer( + address sender, + address recipient, + uint256 amount + ) internal virtual { + require(sender != address(0), "ERC20: transfer from the zero address"); + require(recipient != address(0), "ERC20: transfer to the zero address"); + + _beforeTokenTransfer(sender, recipient, amount); + + uint256 senderBalance = _balances[sender]; + require(senderBalance >= amount, "ERC20: transfer amount exceeds balance"); + unchecked { + _balances[sender] = senderBalance - amount; + } + _balances[recipient] += amount; + + emit Transfer(sender, recipient, amount); + + _afterTokenTransfer(sender, recipient, amount); + } + + /** @dev Creates `amount` tokens and assigns them to `account`, increasing + * the total supply. + * + * Emits a {Transfer} event with `from` set to the zero address. + * + * Requirements: + * + * - `account` cannot be the zero address. + */ + function _mint(address account, uint256 amount) internal virtual { + require(account != address(0), "ERC20: mint to the zero address"); + + _beforeTokenTransfer(address(0), account, amount); + + _totalSupply += amount; + _balances[account] += amount; + emit Transfer(address(0), account, amount); + + _afterTokenTransfer(address(0), account, amount); + } + + /** + * @dev Destroys `amount` tokens from `account`, reducing the + * total supply. + * + * Emits a {Transfer} event with `to` set to the zero address. + * + * Requirements: + * + * - `account` cannot be the zero address. + * - `account` must have at least `amount` tokens. + */ + function _burn(address account, uint256 amount) internal virtual { + require(account != address(0), "ERC20: burn from the zero address"); + + _beforeTokenTransfer(account, address(0), amount); + + uint256 accountBalance = _balances[account]; + require(accountBalance >= amount, "ERC20: burn amount exceeds balance"); + unchecked { + _balances[account] = accountBalance - amount; + } + _totalSupply -= amount; + + emit Transfer(account, address(0), amount); + + _afterTokenTransfer(account, address(0), amount); + } + + /** + * @dev Sets `amount` as the allowance of `spender` over the `owner` s tokens. + * + * This internal function is equivalent to `approve`, and can be used to + * e.g. set automatic allowances for certain subsystems, etc. + * + * Emits an {Approval} event. + * + * Requirements: + * + * - `owner` cannot be the zero address. + * - `spender` cannot be the zero address. + */ + function _approve( + address owner, + address spender, + uint256 amount + ) internal virtual { + require(owner != address(0), "ERC20: approve from the zero address"); + require(spender != address(0), "ERC20: approve to the zero address"); + + _allowances[owner][spender] = amount; + emit Approval(owner, spender, amount); + } + + /** + * @dev Hook that is called before any transfer of tokens. This includes + * minting and burning. + * + * Calling conditions: + * + * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens + * will be transferred to `to`. + * - when `from` is zero, `amount` tokens will be minted for `to`. + * - when `to` is zero, `amount` of ``from``'s tokens will be burned. + * - `from` and `to` are never both zero. + * + * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks]. + */ + function _beforeTokenTransfer( + address from, + address to, + uint256 amount + ) internal virtual {} + + /** + * @dev Hook that is called after any transfer of tokens. This includes + * minting and burning. + * + * Calling conditions: + * + * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens + * has been transferred to `to`. + * - when `from` is zero, `amount` tokens have been minted for `to`. + * - when `to` is zero, `amount` of ``from``'s tokens have been burned. + * - `from` and `to` are never both zero. + * + * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks]. + */ + function _afterTokenTransfer( + address from, + address to, + uint256 amount + ) internal virtual {} +} + +// File: BaseStrategy.sol + +struct StrategyParams { + uint256 performanceFee; + uint256 activation; + uint256 debtRatio; + uint256 minDebtPerHarvest; + uint256 maxDebtPerHarvest; + uint256 lastReport; + uint256 totalDebt; + uint256 totalGain; + uint256 totalLoss; +} + +interface VaultAPI is IERC20 { + function name() external view returns (string calldata); + + function symbol() external view returns (string calldata); + + function decimals() external view returns (uint256); + + function apiVersion() external pure returns (string memory); + + function permit( + address owner, + address spender, + uint256 amount, + uint256 expiry, + bytes calldata signature + ) external returns (bool); + + // NOTE: Vyper produces multiple signatures for a given function with "default" args + function deposit() external returns (uint256); + + function deposit(uint256 amount) external returns (uint256); + + function deposit(uint256 amount, address recipient) external returns (uint256); + + // NOTE: Vyper produces multiple signatures for a given function with "default" args + function withdraw() external returns (uint256); + + function withdraw(uint256 maxShares) external returns (uint256); + + function withdraw(uint256 maxShares, address recipient) external returns (uint256); + + function token() external view returns (address); + + function strategies(address _strategy) external view returns (StrategyParams memory); + + function pricePerShare() external view returns (uint256); + + function totalAssets() external view returns (uint256); + + function depositLimit() external view returns (uint256); + + function maxAvailableShares() external view returns (uint256); + + /** + * View how much the Vault would increase this Strategy's borrow limit, + * based on its present performance (since its last report). Can be used to + * determine expectedReturn in your Strategy. + */ + function creditAvailable() external view returns (uint256); + + /** + * View how much the Vault would like to pull back from the Strategy, + * based on its present performance (since its last report). Can be used to + * determine expectedReturn in your Strategy. + */ + function debtOutstanding() external view returns (uint256); + + /** + * View how much the Vault expect this Strategy to return at the current + * block, based on its present performance (since its last report). Can be + * used to determine expectedReturn in your Strategy. + */ + function expectedReturn() external view returns (uint256); + + /** + * This is the main contact point where the Strategy interacts with the + * Vault. It is critical that this call is handled as intended by the + * Strategy. Therefore, this function will be called by BaseStrategy to + * make sure the integration is correct. + */ + function report( + uint256 _gain, + uint256 _loss, + uint256 _debtPayment + ) external returns (uint256); + + /** + * This function should only be used in the scenario where the Strategy is + * being retired but no migration of the positions are possible, or in the + * extreme scenario that the Strategy needs to be put into "Emergency Exit" + * mode in order for it to exit as quickly as possible. The latter scenario + * could be for any reason that is considered "critical" that the Strategy + * exits its position as fast as possible, such as a sudden change in + * market conditions leading to losses, or an imminent failure in an + * external dependency. + */ + function revokeStrategy() external; + + /** + * View the governance address of the Vault to assert privileged functions + * can only be called by governance. The Strategy serves the Vault, so it + * is subject to governance defined by the Vault. + */ + function governance() external view returns (address); + + /** + * View the management address of the Vault to assert privileged functions + * can only be called by management. The Strategy serves the Vault, so it + * is subject to management defined by the Vault. + */ + function management() external view returns (address); + + /** + * View the guardian address of the Vault to assert privileged functions + * can only be called by guardian. The Strategy serves the Vault, so it + * is subject to guardian defined by the Vault. + */ + function guardian() external view returns (address); +} + +/** + * This interface is here for the keeper bot to use. + */ +interface StrategyAPI { + function name() external view returns (string memory); + + function vault() external view returns (address); + + function want() external view returns (address); + + function apiVersion() external pure returns (string memory); + + function keeper() external view returns (address); + + function isActive() external view returns (bool); + + function delegatedAssets() external view returns (uint256); + + function estimatedTotalAssets() external view returns (uint256); + + function tendTrigger(uint256 callCost) external view returns (bool); + + function tend() external; + + function harvestTrigger(uint256 callCost) external view returns (bool); + + function harvest() external; + + event Harvested(uint256 profit, uint256 loss, uint256 debtPayment, uint256 debtOutstanding); +} + +interface HealthCheck { + function check( + uint256 profit, + uint256 loss, + uint256 debtPayment, + uint256 debtOutstanding, + uint256 totalDebt + ) external view returns (bool); +} + +/** + * @title Yearn Base Strategy + * @author yearn.finance + * @notice + * BaseStrategy implements all of the required functionality to interoperate + * closely with the Vault contract. This contract should be inherited and the + * abstract methods implemented to adapt the Strategy to the particular needs + * it has to create a return. + * + * Of special interest is the relationship between `harvest()` and + * `vault.report()'. `harvest()` may be called simply because enough time has + * elapsed since the last report, and not because any funds need to be moved + * or positions adjusted. This is critical so that the Vault may maintain an + * accurate picture of the Strategy's performance. See `vault.report()`, + * `harvest()`, and `harvestTrigger()` for further details. + */ + +abstract contract BaseStrategy { + using SafeERC20 for IERC20; + string public metadataURI; + + // health checks + bool public doHealthCheck; + address public healthCheck; + + /** + * @notice + * Used to track which version of `StrategyAPI` this Strategy + * implements. + * @dev The Strategy's version must match the Vault's `API_VERSION`. + * @return A string which holds the current API version of this contract. + */ + function apiVersion() public pure returns (string memory) { + return "0.4.3"; + } + + /** + * @notice This Strategy's name. + * @dev + * You can use this field to manage the "version" of this Strategy, e.g. + * `StrategySomethingOrOtherV1`. However, "API Version" is managed by + * `apiVersion()` function above. + * @return This Strategy's name. + */ + function name() external view virtual returns (string memory); + + /** + * @notice + * The amount (priced in want) of the total assets managed by this strategy should not count + * towards Yearn's TVL calculations. + * @dev + * You can override this field to set it to a non-zero value if some of the assets of this + * Strategy is somehow delegated inside another part of of Yearn's ecosystem e.g. another Vault. + * Note that this value must be strictly less than or equal to the amount provided by + * `estimatedTotalAssets()` below, as the TVL calc will be total assets minus delegated assets. + * Also note that this value is used to determine the total assets under management by this + * strategy, for the purposes of computing the management fee in `Vault` + * @return + * The amount of assets this strategy manages that should not be included in Yearn's Total Value + * Locked (TVL) calculation across it's ecosystem. + */ + function delegatedAssets() external view virtual returns (uint256) { + return 0; + } + + VaultAPI public vault; + address public strategist; + address public rewards; + address public keeper; + + IERC20 public want; + + // So indexers can keep track of this + event Harvested(uint256 profit, uint256 loss, uint256 debtPayment, uint256 debtOutstanding); + + event UpdatedStrategist(address newStrategist); + + event UpdatedKeeper(address newKeeper); + + event UpdatedRewards(address rewards); + + event UpdatedMinReportDelay(uint256 delay); + + event UpdatedMaxReportDelay(uint256 delay); + + event UpdatedProfitFactor(uint256 profitFactor); + + event UpdatedDebtThreshold(uint256 debtThreshold); + + event EmergencyExitEnabled(); + + event UpdatedMetadataURI(string metadataURI); + + event SetHealthCheck(address); + event SetDoHealthCheck(bool); + + // The minimum number of seconds between harvest calls. See + // `setMinReportDelay()` for more details. + uint256 public minReportDelay; + + // The maximum number of seconds between harvest calls. See + // `setMaxReportDelay()` for more details. + uint256 public maxReportDelay; + + // The minimum multiple that `callCost` must be above the credit/profit to + // be "justifiable". See `setProfitFactor()` for more details. + uint256 public profitFactor; + + // Use this to adjust the threshold at which running a debt causes a + // harvest trigger. See `setDebtThreshold()` for more details. + uint256 public debtThreshold; + + // See note on `setEmergencyExit()`. + bool public emergencyExit; + + // modifiers + modifier onlyAuthorized() { + require(msg.sender == strategist || msg.sender == governance(), "!authorized"); + _; + } + + modifier onlyEmergencyAuthorized() { + require( + msg.sender == strategist || msg.sender == governance() || msg.sender == vault.guardian() || msg.sender == vault.management(), + "!authorized" + ); + _; + } + + modifier onlyStrategist() { + require(msg.sender == strategist, "!strategist"); + _; + } + + modifier onlyGovernance() { + require(msg.sender == governance(), "!authorized"); + _; + } + + modifier onlyKeepers() { + require( + msg.sender == keeper || + msg.sender == strategist || + msg.sender == governance() || + msg.sender == vault.guardian() || + msg.sender == vault.management(), + "!authorized" + ); + _; + } + + modifier onlyVaultManagers() { + require(msg.sender == vault.management() || msg.sender == governance(), "!authorized"); + _; + } + + constructor(address _vault) { + _initialize(_vault, msg.sender, msg.sender, msg.sender); + } + + /** + * @notice + * Initializes the Strategy, this is called only once, when the + * contract is deployed. + * @dev `_vault` should implement `VaultAPI`. + * @param _vault The address of the Vault responsible for this Strategy. + * @param _strategist The address to assign as `strategist`. + * The strategist is able to change the reward address + * @param _rewards The address to use for pulling rewards. + * @param _keeper The adddress of the _keeper. _keeper + * can harvest and tend a strategy. + */ + function _initialize( + address _vault, + address _strategist, + address _rewards, + address _keeper + ) internal { + require(address(want) == address(0), "Strategy already initialized"); + + vault = VaultAPI(_vault); + want = IERC20(vault.token()); + want.safeApprove(_vault, type(uint256).max); // Give Vault unlimited access (might save gas) + strategist = _strategist; + rewards = _rewards; + keeper = _keeper; + + // initialize variables + minReportDelay = 0; + maxReportDelay = 86400; + profitFactor = 100; + debtThreshold = 0; + + vault.approve(rewards, type(uint256).max); // Allow rewards to be pulled + } + + function setHealthCheck(address _healthCheck) external onlyVaultManagers { + emit SetHealthCheck(_healthCheck); + healthCheck = _healthCheck; + } + + function setDoHealthCheck(bool _doHealthCheck) external onlyVaultManagers { + emit SetDoHealthCheck(_doHealthCheck); + doHealthCheck = _doHealthCheck; + } + + /** + * @notice + * Used to change `strategist`. + * + * This may only be called by governance or the existing strategist. + * @param _strategist The new address to assign as `strategist`. + */ + function setStrategist(address _strategist) external onlyAuthorized { + require(_strategist != address(0)); + strategist = _strategist; + emit UpdatedStrategist(_strategist); + } + + /** + * @notice + * Used to change `keeper`. + * + * `keeper` is the only address that may call `tend()` or `harvest()`, + * other than `governance()` or `strategist`. However, unlike + * `governance()` or `strategist`, `keeper` may *only* call `tend()` + * and `harvest()`, and no other authorized functions, following the + * principle of least privilege. + * + * This may only be called by governance or the strategist. + * @param _keeper The new address to assign as `keeper`. + */ + function setKeeper(address _keeper) external onlyAuthorized { + require(_keeper != address(0)); + keeper = _keeper; + emit UpdatedKeeper(_keeper); + } + + /** + * @notice + * Used to change `rewards`. EOA or smart contract which has the permission + * to pull rewards from the vault. + * + * This may only be called by the strategist. + * @param _rewards The address to use for pulling rewards. + */ + function setRewards(address _rewards) external onlyStrategist { + require(_rewards != address(0)); + vault.approve(rewards, 0); + rewards = _rewards; + vault.approve(rewards, type(uint256).max); + emit UpdatedRewards(_rewards); + } + + /** + * @notice + * Used to change `minReportDelay`. `minReportDelay` is the minimum number + * of blocks that should pass for `harvest()` to be called. + * + * For external keepers (such as the Keep3r network), this is the minimum + * time between jobs to wait. (see `harvestTrigger()` + * for more details.) + * + * This may only be called by governance or the strategist. + * @param _delay The minimum number of seconds to wait between harvests. + */ + function setMinReportDelay(uint256 _delay) external onlyAuthorized { + minReportDelay = _delay; + emit UpdatedMinReportDelay(_delay); + } + + /** + * @notice + * Used to change `maxReportDelay`. `maxReportDelay` is the maximum number + * of blocks that should pass for `harvest()` to be called. + * + * For external keepers (such as the Keep3r network), this is the maximum + * time between jobs to wait. (see `harvestTrigger()` + * for more details.) + * + * This may only be called by governance or the strategist. + * @param _delay The maximum number of seconds to wait between harvests. + */ + function setMaxReportDelay(uint256 _delay) external onlyAuthorized { + maxReportDelay = _delay; + emit UpdatedMaxReportDelay(_delay); + } + + /** + * @notice + * Used to change `profitFactor`. `profitFactor` is used to determine + * if it's worthwhile to harvest, given gas costs. (See `harvestTrigger()` + * for more details.) + * + * This may only be called by governance or the strategist. + * @param _profitFactor A ratio to multiply anticipated + * `harvest()` gas cost against. + */ + function setProfitFactor(uint256 _profitFactor) external onlyAuthorized { + profitFactor = _profitFactor; + emit UpdatedProfitFactor(_profitFactor); + } + + /** + * @notice + * Sets how far the Strategy can go into loss without a harvest and report + * being required. + * + * By default this is 0, meaning any losses would cause a harvest which + * will subsequently report the loss to the Vault for tracking. (See + * `harvestTrigger()` for more details.) + * + * This may only be called by governance or the strategist. + * @param _debtThreshold How big of a loss this Strategy may carry without + * being required to report to the Vault. + */ + function setDebtThreshold(uint256 _debtThreshold) external onlyAuthorized { + debtThreshold = _debtThreshold; + emit UpdatedDebtThreshold(_debtThreshold); + } + + /** + * @notice + * Used to change `metadataURI`. `metadataURI` is used to store the URI + * of the file describing the strategy. + * + * This may only be called by governance or the strategist. + * @param _metadataURI The URI that describe the strategy. + */ + function setMetadataURI(string calldata _metadataURI) external onlyAuthorized { + metadataURI = _metadataURI; + emit UpdatedMetadataURI(_metadataURI); + } + + /** + * Resolve governance address from Vault contract, used to make assertions + * on protected functions in the Strategy. + */ + function governance() internal view returns (address) { + return vault.governance(); + } + + /** + * @notice + * Provide an accurate conversion from `_amtInWei` (denominated in wei) + * to `want` (using the native decimal characteristics of `want`). + * @dev + * Care must be taken when working with decimals to assure that the conversion + * is compatible. As an example: + * + * given 1e17 wei (0.1 ETH) as input, and want is USDC (6 decimals), + * with USDC/ETH = 1800, this should give back 1800000000 (180 USDC) + * + * @param _amtInWei The amount (in wei/1e-18 ETH) to convert to `want` + * @return The amount in `want` of `_amtInEth` converted to `want` + **/ + function ethToWant(uint256 _amtInWei) public view virtual returns (uint256); + + /** + * @notice + * Provide an accurate estimate for the total amount of assets + * (principle + return) that this Strategy is currently managing, + * denominated in terms of `want` tokens. + * + * This total should be "realizable" e.g. the total value that could + * *actually* be obtained from this Strategy if it were to divest its + * entire position based on current on-chain conditions. + * @dev + * Care must be taken in using this function, since it relies on external + * systems, which could be manipulated by the attacker to give an inflated + * (or reduced) value produced by this function, based on current on-chain + * conditions (e.g. this function is possible to influence through + * flashloan attacks, oracle manipulations, or other DeFi attack + * mechanisms). + * + * It is up to governance to use this function to correctly order this + * Strategy relative to its peers in the withdrawal queue to minimize + * losses for the Vault based on sudden withdrawals. This value should be + * higher than the total debt of the Strategy and higher than its expected + * value to be "safe". + * @return The estimated total assets in this Strategy. + */ + function estimatedTotalAssets() public view virtual returns (uint256); + + /* + * @notice + * Provide an indication of whether this strategy is currently "active" + * in that it is managing an active position, or will manage a position in + * the future. This should correlate to `harvest()` activity, so that Harvest + * events can be tracked externally by indexing agents. + * @return True if the strategy is actively managing a position. + */ + function isActive() public view returns (bool) { + return vault.strategies(address(this)).debtRatio > 0 || estimatedTotalAssets() > 0; + } + + /** + * Perform any Strategy unwinding or other calls necessary to capture the + * "free return" this Strategy has generated since the last time its core + * position(s) were adjusted. Examples include unwrapping extra rewards. + * This call is only used during "normal operation" of a Strategy, and + * should be optimized to minimize losses as much as possible. + * + * This method returns any realized profits and/or realized losses + * incurred, and should return the total amounts of profits/losses/debt + * payments (in `want` tokens) for the Vault's accounting (e.g. + * `want.balanceOf(this) >= _debtPayment + _profit`). + * + * `_debtOutstanding` will be 0 if the Strategy is not past the configured + * debt limit, otherwise its value will be how far past the debt limit + * the Strategy is. The Strategy's debt limit is configured in the Vault. + * + * NOTE: `_debtPayment` should be less than or equal to `_debtOutstanding`. + * It is okay for it to be less than `_debtOutstanding`, as that + * should only used as a guide for how much is left to pay back. + * Payments should be made to minimize loss from slippage, debt, + * withdrawal fees, etc. + * + * See `vault.debtOutstanding()`. + */ + function prepareReturn(uint256 _debtOutstanding) + internal + virtual + returns ( + uint256 _profit, + uint256 _loss, + uint256 _debtPayment + ); + + /** + * Perform any adjustments to the core position(s) of this Strategy given + * what change the Vault made in the "investable capital" available to the + * Strategy. Note that all "free capital" in the Strategy after the report + * was made is available for reinvestment. Also note that this number + * could be 0, and you should handle that scenario accordingly. + * + * See comments regarding `_debtOutstanding` on `prepareReturn()`. + */ + function adjustPosition(uint256 _debtOutstanding) internal virtual; + + /** + * Liquidate up to `_amountNeeded` of `want` of this strategy's positions, + * irregardless of slippage. Any excess will be re-invested with `adjustPosition()`. + * This function should return the amount of `want` tokens made available by the + * liquidation. If there is a difference between them, `_loss` indicates whether the + * difference is due to a realized loss, or if there is some other sitution at play + * (e.g. locked funds) where the amount made available is less than what is needed. + * + * NOTE: The invariant `_liquidatedAmount + _loss <= _amountNeeded` should always be maintained + */ + function liquidatePosition(uint256 _amountNeeded) internal virtual returns (uint256 _liquidatedAmount, uint256 _loss); + + /** + * Liquidate everything and returns the amount that got freed. + * This function is used during emergency exit instead of `prepareReturn()` to + * liquidate all of the Strategy's positions back to the Vault. + */ + + function liquidateAllPositions() internal virtual returns (uint256 _amountFreed); + + /** + * @notice + * Provide a signal to the keeper that `tend()` should be called. The + * keeper will provide the estimated gas cost that they would pay to call + * `tend()`, and this function should use that estimate to make a + * determination if calling it is "worth it" for the keeper. This is not + * the only consideration into issuing this trigger, for example if the + * position would be negatively affected if `tend()` is not called + * shortly, then this can return `true` even if the keeper might be + * "at a loss" (keepers are always reimbursed by Yearn). + * @dev + * `callCostInWei` must be priced in terms of `wei` (1e-18 ETH). + * + * This call and `harvestTrigger()` should never return `true` at the same + * time. + * @param callCostInWei The keeper's estimated gas cost to call `tend()` (in wei). + * @return `true` if `tend()` should be called, `false` otherwise. + */ + function tendTrigger(uint256 callCostInWei) public view virtual returns (bool) { + // We usually don't need tend, but if there are positions that need + // active maintainence, overriding this function is how you would + // signal for that. + // If your implementation uses the cost of the call in want, you can + // use uint256 callCost = ethToWant(callCostInWei); + + return false; + } + + /** + * @notice + * Adjust the Strategy's position. The purpose of tending isn't to + * realize gains, but to maximize yield by reinvesting any returns. + * + * See comments on `adjustPosition()`. + * + * This may only be called by governance, the strategist, or the keeper. + */ + function tend() external onlyKeepers { + // Don't take profits with this call, but adjust for better gains + adjustPosition(vault.debtOutstanding()); + } + + /** + * @notice + * Provide a signal to the keeper that `harvest()` should be called. The + * keeper will provide the estimated gas cost that they would pay to call + * `harvest()`, and this function should use that estimate to make a + * determination if calling it is "worth it" for the keeper. This is not + * the only consideration into issuing this trigger, for example if the + * position would be negatively affected if `harvest()` is not called + * shortly, then this can return `true` even if the keeper might be "at a + * loss" (keepers are always reimbursed by Yearn). + * @dev + * `callCostInWei` must be priced in terms of `wei` (1e-18 ETH). + * + * This call and `tendTrigger` should never return `true` at the + * same time. + * + * See `min/maxReportDelay`, `profitFactor`, `debtThreshold` to adjust the + * strategist-controlled parameters that will influence whether this call + * returns `true` or not. These parameters will be used in conjunction + * with the parameters reported to the Vault (see `params`) to determine + * if calling `harvest()` is merited. + * + * It is expected that an external system will check `harvestTrigger()`. + * This could be a script run off a desktop or cloud bot (e.g. + * https://github.com/iearn-finance/yearn-vaults/blob/main/scripts/keep.py), + * or via an integration with the Keep3r network (e.g. + * https://github.com/Macarse/GenericKeep3rV2/blob/master/contracts/keep3r/GenericKeep3rV2.sol). + * @param callCostInWei The keeper's estimated gas cost to call `harvest()` (in wei). + * @return `true` if `harvest()` should be called, `false` otherwise. + */ + function harvestTrigger(uint256 callCostInWei) public view virtual returns (bool) { + uint256 callCost = ethToWant(callCostInWei); + StrategyParams memory params = vault.strategies(address(this)); + + // Should not trigger if Strategy is not activated + if (params.activation == 0) return false; + + // Should not trigger if we haven't waited long enough since previous harvest + if (block.timestamp - params.lastReport < minReportDelay) return false; + + // Should trigger if hasn't been called in a while + if (block.timestamp - params.lastReport >= maxReportDelay) return true; + + // If some amount is owed, pay it back + // NOTE: Since debt is based on deposits, it makes sense to guard against large + // changes to the value from triggering a harvest directly through user + // behavior. This should ensure reasonable resistance to manipulation + // from user-initiated withdrawals as the outstanding debt fluctuates. + uint256 outstanding = vault.debtOutstanding(); + if (outstanding > debtThreshold) return true; + + // Check for profits and losses + uint256 total = estimatedTotalAssets(); + // Trigger if we have a loss to report + if (total + debtThreshold < params.totalDebt) return true; + + uint256 profit = 0; + if (total > params.totalDebt) profit = total - params.totalDebt; // We've earned a profit! + + // Otherwise, only trigger if it "makes sense" economically (gas cost + // is debtOutstanding) { + profit = amountFreed - debtOutstanding; + } + debtPayment = debtOutstanding - loss; + } else { + // Free up returns for Vault to pull + (profit, loss, debtPayment) = prepareReturn(debtOutstanding); + } + + // Allow Vault to take up to the "harvested" balance of this contract, + // which is the amount it has earned since the last time it reported to + // the Vault. + uint256 totalDebt = vault.strategies(address(this)).totalDebt; + debtOutstanding = vault.report(profit, loss, debtPayment); + + // Check if free returns are left, and re-invest them + adjustPosition(debtOutstanding); + + // call healthCheck contract + if (doHealthCheck && healthCheck != address(0)) { + require(HealthCheck(healthCheck).check(profit, loss, debtPayment, debtOutstanding, totalDebt), "!healthcheck"); + } else { + doHealthCheck = true; + } + + emit Harvested(profit, loss, debtPayment, debtOutstanding); + } + + /** + * @notice + * Withdraws `_amountNeeded` to `vault`. + * + * This may only be called by the Vault. + * @param _amountNeeded How much `want` to withdraw. + * @return _loss Any realized losses + */ + function withdraw(uint256 _amountNeeded) external returns (uint256 _loss) { + require(msg.sender == address(vault), "!vault"); + // Liquidate as much as possible to `want`, up to `_amountNeeded` + uint256 amountFreed; + (amountFreed, _loss) = liquidatePosition(_amountNeeded); + // Send it directly back (NOTE: Using `msg.sender` saves some gas here) + want.safeTransfer(msg.sender, amountFreed); + // NOTE: Reinvest anything leftover on next `tend`/`harvest` + } + + /** + * Do anything necessary to prepare this Strategy for migration, such as + * transferring any reserve or LP tokens, CDPs, or other tokens or stores of + * value. + */ + function prepareMigration(address _newStrategy) internal virtual; + + /** + * @notice + * Transfers all `want` from this Strategy to `_newStrategy`. + * + * This may only be called by the Vault. + * @dev + * The new Strategy's Vault must be the same as this Strategy's Vault. + * The migration process should be carefully performed to make sure all + * the assets are migrated to the new address, which should have never + * interacted with the vault before. + * @param _newStrategy The Strategy to migrate to. + */ + function migrate(address _newStrategy) external { + require(msg.sender == address(vault)); + require(BaseStrategy(_newStrategy).vault() == vault); + prepareMigration(_newStrategy); + want.safeTransfer(_newStrategy, want.balanceOf(address(this))); + } + + /** + * @notice + * Activates emergency exit. Once activated, the Strategy will exit its + * position upon the next harvest, depositing all funds into the Vault as + * quickly as is reasonable given on-chain conditions. + * + * This may only be called by governance or the strategist. + * @dev + * See `vault.setEmergencyShutdown()` and `harvest()` for further details. + */ + function setEmergencyExit() external onlyEmergencyAuthorized { + emergencyExit = true; + vault.revokeStrategy(); + + emit EmergencyExitEnabled(); + } + + /** + * Override this to add all tokens/tokenized positions this contract + * manages on a *persistent* basis (e.g. not just for swapping back to + * want ephemerally). + * + * NOTE: Do *not* include `want`, already included in `sweep` below. + * + * Example: + * ``` + * function protectedTokens() internal override view returns (address[] memory) { + * address[] memory protected = new address[](3); + * protected[0] = tokenA; + * protected[1] = tokenB; + * protected[2] = tokenC; + * return protected; + * } + * ``` + */ + function protectedTokens() internal view virtual returns (address[] memory); + + /** + * @notice + * Removes tokens from this Strategy that are not the type of tokens + * managed by this Strategy. This may be used in case of accidentally + * sending the wrong kind of token to this Strategy. + * + * Tokens will be sent to `governance()`. + * + * This will fail if an attempt is made to sweep `want`, or any tokens + * that are protected by this Strategy. + * + * This may only be called by governance. + * @dev + * Implement `protectedTokens()` to specify any additional tokens that + * should be protected from sweeping in addition to `want`. + * @param _token The token to transfer out of this vault. + */ + function sweep(address _token) external onlyGovernance { + require(_token != address(want), "!want"); + require(_token != address(vault), "!shares"); + + address[] memory _protectedTokens = protectedTokens(); + for (uint256 i; i < _protectedTokens.length; i++) require(_token != _protectedTokens[i], "!protected"); + + IERC20(_token).safeTransfer(governance(), IERC20(_token).balanceOf(address(this))); + } +} + +abstract contract BaseStrategyInitializable is BaseStrategy { + bool public isOriginal = true; + event Cloned(address indexed clone); + + constructor(address _vault) BaseStrategy(_vault) {} + + function initialize( + address _vault, + address _strategist, + address _rewards, + address _keeper + ) external virtual { + _initialize(_vault, _strategist, _rewards, _keeper); + } + + function clone(address _vault) external returns (address) { + require(isOriginal, "!clone"); + return this.clone(_vault, msg.sender, msg.sender, msg.sender); + } + + function clone( + address _vault, + address _strategist, + address _rewards, + address _keeper + ) external returns (address newStrategy) { + // Copied from https://github.com/optionality/clone-factory/blob/master/contracts/CloneFactory.sol + bytes20 addressBytes = bytes20(address(this)); + + assembly { + // EIP-1167 bytecode + let clone_code := mload(0x40) + mstore(clone_code, 0x3d602d80600a3d3981f3363d3d373d3d3d363d73000000000000000000000000) + mstore(add(clone_code, 0x14), addressBytes) + mstore(add(clone_code, 0x28), 0x5af43d82803e903d91602b57fd5bf30000000000000000000000000000000000) + newStrategy := create(0, clone_code, 0x37) + } + + BaseStrategyInitializable(newStrategy).initialize(_vault, _strategist, _rewards, _keeper); + + emit Cloned(newStrategy); + } +} + +// File: ProviderStrategy.sol + +interface JointAPI { + function closePositionReturnFunds() external; + + function openPosition() external; + + function providerA() external view returns (address); + + function providerB() external view returns (address); + + function estimatedTotalProviderAssets(address provider) + external + view + returns (uint256); + + function WETH() external view returns (address); + + function router() external view returns (address); + + function migrateProvider(address _newProvider) external; + + function shouldEndEpoch() external view returns (bool); + + function shouldStartEpoch() external view returns (bool); + + function dontInvestWant() external view returns (bool); +} + +contract ProviderStrategy is BaseStrategyInitializable { + using SafeERC20 for IERC20; + using Address for address; + + address public joint; + + bool public forceLiquidate; + bool public launchHarvest; + + constructor(address _vault) public BaseStrategyInitializable(_vault) {} + + function name() external view override returns (string memory) { + return + string( + abi.encodePacked( + "Strategy_ProviderOf", + IERC20Extended(address(want)).symbol(), + "To", + IERC20Extended(address(joint)).name() + ) + ); + } + + function estimatedTotalAssets() public view override returns (uint256) { + return + want.balanceOf(address(this)) + + JointAPI(joint).estimatedTotalProviderAssets(address(this)); + } + + function totalDebt() public view returns (uint256) { + return vault.strategies(address(this)).totalDebt; + } + + function setLaunchHarvest(bool _newLaunchHarvest) external onlyVaultManagers { + launchHarvest = _newLaunchHarvest; + } + + function prepareReturn(uint256 _debtOutstanding) + internal + override + returns ( + uint256 _profit, + uint256 _loss, + uint256 _debtPayment + ) + { + if (launchHarvest) { + launchHarvest = false; + } + // NOTE: this strategy is operated following epochs. These begin during adjustPosition and end during prepareReturn + // The Provider will always ask the joint to close the position before harvesting + JointAPI(joint).closePositionReturnFunds(); + + // After closePosition, the provider will always have funds in its own balance (not in joint) + uint256 _totalDebt = totalDebt(); + uint256 totalAssets = balanceOfWant(); + + if (_totalDebt > totalAssets) { + // we have losses + _loss = _totalDebt - totalAssets; + } else { + // we have profit + _profit = totalAssets - _totalDebt; + } + + uint256 amountAvailable = totalAssets; + uint256 amountRequired = _debtOutstanding + _profit; + + if (amountRequired > amountAvailable) { + if (_debtOutstanding > amountAvailable) { + // available funds are lower than the repayment that we need to do + _profit = 0; + _debtPayment = amountAvailable; + // we dont report losses here as the strategy might not be able to return in this harvest + // but it will still be there for the next harvest + } else { + // NOTE: amountRequired is always equal or greater than _debtOutstanding + // important to use amountAvailable just in case amountRequired is > amountAvailable + _debtPayment = _debtOutstanding; + _profit = amountAvailable - _debtPayment; + } + } else { + _debtPayment = _debtOutstanding; + // profit remains unchanged unless there is not enough to pay it + if (amountRequired - _debtPayment < _profit) { + _profit = amountRequired - _debtPayment; + } + } + } + + function harvestTrigger(uint256 callCost) + public + view + override + returns (bool) + { + // Delegating decision to joint + return + (JointAPI(joint).shouldStartEpoch() && balanceOfWant() > 0) || + JointAPI(joint).shouldEndEpoch() || launchHarvest; + } + + function dontInvestWant() public view returns (bool) { + // Delegating decision to joint + return JointAPI(joint).dontInvestWant(); + } + + function adjustPosition(uint256 _debtOutstanding) internal override { + if (emergencyExit || dontInvestWant()) { + return; + } + + // Using a push approach (instead of pull) + uint256 wantBalance = balanceOfWant(); + if (wantBalance > 0) { + want.safeTransfer(joint, wantBalance); + } + + JointAPI(joint).openPosition(); + } + + function liquidatePosition(uint256 _amountNeeded) + internal + override + returns (uint256 _liquidatedAmount, uint256 _loss) + { + uint256 availableAssets = want.balanceOf(address(this)); + if (_amountNeeded > availableAssets) { + _liquidatedAmount = availableAssets; + _loss = _amountNeeded - availableAssets; + } else { + _liquidatedAmount = _amountNeeded; + } + } + + function prepareMigration(address _newStrategy) internal override { + JointAPI(joint).migrateProvider(_newStrategy); + } + + function protectedTokens() + internal + view + override + returns (address[] memory) + {} + + function balanceOfWant() public view returns (uint256) { + return IERC20(want).balanceOf(address(this)); + } + + function setJoint(address _joint) external onlyGovernance { + require( + JointAPI(_joint).providerA() == address(this) || + JointAPI(_joint).providerB() == address(this) + ); // dev: providers uncorrectly set + require(healthCheck != address(0)); // dev: healthCheck + joint = _joint; + } + + function setForceLiquidate(bool _forceLiquidate) + external + onlyEmergencyAuthorized + { + forceLiquidate = _forceLiquidate; + } + + function liquidateAllPositions() + internal + virtual + override + returns (uint256 _amountFreed) + { + uint256 expectedBalance = estimatedTotalAssets(); + JointAPI(joint).closePositionReturnFunds(); + _amountFreed = balanceOfWant(); + // NOTE: we accept a 1% difference before reverting + require( + forceLiquidate || (expectedBalance * 9_900) / 10_000 < _amountFreed, + "!liquidation" + ); + } + + function ethToWant(uint256 _amtInWei) + public + view + override + returns (uint256) + { + // NOTE: using joint params to avoid changing fixed values for other chains + // gas price is not important as this will only be used in triggers (queried from off-chain) + return tokenToWant(JointAPI(joint).WETH(), _amtInWei); + } + + function tokenToWant(address token, uint256 amount) + internal + view + returns (uint256) + { + // if (amount == 0 || address(want) == token) { + return amount; + // } + } + + function getTokenOutPath(address _token_in, address _token_out) + internal + view + returns (address[] memory _path) + { + bool is_weth = _token_in == address(JointAPI(joint).WETH()) || + _token_out == address(JointAPI(joint).WETH()); + _path = new address[](is_weth ? 2 : 3); + _path[0] = _token_in; + + if (is_weth) { + _path[1] = _token_out; + } else { + _path[1] = address(JointAPI(joint).WETH()); + _path[2] = _token_out; + } + } +} diff --git a/flattened_stable_joint_univ3.txt b/flattened_stable_joint_univ3.txt new file mode 100644 index 0000000..daabf84 --- /dev/null +++ b/flattened_stable_joint_univ3.txt @@ -0,0 +1,5870 @@ +// SPDX-License-Identifier: AGPL-3.0 +pragma solidity 0.8.12; +pragma experimental ABIEncoderV2; + +// File: Address.sol + +// OpenZeppelin Contracts v4.4.1 (utils/Address.sol) + +/** + * @dev Collection of functions related to the address type + */ +library Address { + /** + * @dev Returns true if `account` is a contract. + * + * [IMPORTANT] + * ==== + * It is unsafe to assume that an address for which this function returns + * false is an externally-owned account (EOA) and not a contract. + * + * Among others, `isContract` will return false for the following + * types of addresses: + * + * - an externally-owned account + * - a contract in construction + * - an address where a contract will be created + * - an address where a contract lived, but was destroyed + * ==== + */ + function isContract(address account) internal view returns (bool) { + // This method relies on extcodesize, which returns 0 for contracts in + // construction, since the code is only stored at the end of the + // constructor execution. + + uint256 size; + assembly { + size := extcodesize(account) + } + return size > 0; + } + + /** + * @dev Replacement for Solidity's `transfer`: sends `amount` wei to + * `recipient`, forwarding all available gas and reverting on errors. + * + * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost + * of certain opcodes, possibly making contracts go over the 2300 gas limit + * imposed by `transfer`, making them unable to receive funds via + * `transfer`. {sendValue} removes this limitation. + * + * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more]. + * + * IMPORTANT: because control is transferred to `recipient`, care must be + * taken to not create reentrancy vulnerabilities. Consider using + * {ReentrancyGuard} or the + * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern]. + */ + function sendValue(address payable recipient, uint256 amount) internal { + require(address(this).balance >= amount, "Address: insufficient balance"); + + (bool success, ) = recipient.call{value: amount}(""); + require(success, "Address: unable to send value, recipient may have reverted"); + } + + /** + * @dev Performs a Solidity function call using a low level `call`. A + * plain `call` is an unsafe replacement for a function call: use this + * function instead. + * + * If `target` reverts with a revert reason, it is bubbled up by this + * function (like regular Solidity function calls). + * + * Returns the raw returned data. To convert to the expected return value, + * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`]. + * + * Requirements: + * + * - `target` must be a contract. + * - calling `target` with `data` must not revert. + * + * _Available since v3.1._ + */ + function functionCall(address target, bytes memory data) internal returns (bytes memory) { + return functionCall(target, data, "Address: low-level call failed"); + } + + /** + * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with + * `errorMessage` as a fallback revert reason when `target` reverts. + * + * _Available since v3.1._ + */ + function functionCall( + address target, + bytes memory data, + string memory errorMessage + ) internal returns (bytes memory) { + return functionCallWithValue(target, data, 0, errorMessage); + } + + /** + * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], + * but also transferring `value` wei to `target`. + * + * Requirements: + * + * - the calling contract must have an ETH balance of at least `value`. + * - the called Solidity function must be `payable`. + * + * _Available since v3.1._ + */ + function functionCallWithValue( + address target, + bytes memory data, + uint256 value + ) internal returns (bytes memory) { + return functionCallWithValue(target, data, value, "Address: low-level call with value failed"); + } + + /** + * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but + * with `errorMessage` as a fallback revert reason when `target` reverts. + * + * _Available since v3.1._ + */ + function functionCallWithValue( + address target, + bytes memory data, + uint256 value, + string memory errorMessage + ) internal returns (bytes memory) { + require(address(this).balance >= value, "Address: insufficient balance for call"); + require(isContract(target), "Address: call to non-contract"); + + (bool success, bytes memory returndata) = target.call{value: value}(data); + return verifyCallResult(success, returndata, errorMessage); + } + + /** + * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], + * but performing a static call. + * + * _Available since v3.3._ + */ + function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) { + return functionStaticCall(target, data, "Address: low-level static call failed"); + } + + /** + * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], + * but performing a static call. + * + * _Available since v3.3._ + */ + function functionStaticCall( + address target, + bytes memory data, + string memory errorMessage + ) internal view returns (bytes memory) { + require(isContract(target), "Address: static call to non-contract"); + + (bool success, bytes memory returndata) = target.staticcall(data); + return verifyCallResult(success, returndata, errorMessage); + } + + /** + * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], + * but performing a delegate call. + * + * _Available since v3.4._ + */ + function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) { + return functionDelegateCall(target, data, "Address: low-level delegate call failed"); + } + + /** + * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], + * but performing a delegate call. + * + * _Available since v3.4._ + */ + function functionDelegateCall( + address target, + bytes memory data, + string memory errorMessage + ) internal returns (bytes memory) { + require(isContract(target), "Address: delegate call to non-contract"); + + (bool success, bytes memory returndata) = target.delegatecall(data); + return verifyCallResult(success, returndata, errorMessage); + } + + /** + * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the + * revert reason using the provided one. + * + * _Available since v4.3._ + */ + function verifyCallResult( + bool success, + bytes memory returndata, + string memory errorMessage + ) internal pure returns (bytes memory) { + if (success) { + return returndata; + } else { + // Look for revert reason and bubble it up if present + if (returndata.length > 0) { + // The easiest way to bubble the revert reason is using memory via assembly + + assembly { + let returndata_size := mload(returndata) + revert(add(32, returndata), returndata_size) + } + } else { + revert(errorMessage); + } + } + } +} + +// File: BitMath.sol + +/// @title BitMath +/// @dev This library provides functionality for computing bit properties of an unsigned integer +library BitMath { + /// @notice Returns the index of the most significant bit of the number, + /// where the least significant bit is at index 0 and the most significant bit is at index 255 + /// @dev The function satisfies the property: + /// x >= 2**mostSignificantBit(x) and x < 2**(mostSignificantBit(x)+1) + /// @param x the value for which to compute the most significant bit, must be greater than 0 + /// @return r the index of the most significant bit + function mostSignificantBit(uint256 x) internal pure returns (uint8 r) { + require(x > 0); + + unchecked { + if (x >= 0x100000000000000000000000000000000) { + x >>= 128; + r += 128; + } + if (x >= 0x10000000000000000) { + x >>= 64; + r += 64; + } + if (x >= 0x100000000) { + x >>= 32; + r += 32; + } + if (x >= 0x10000) { + x >>= 16; + r += 16; + } + if (x >= 0x100) { + x >>= 8; + r += 8; + } + if (x >= 0x10) { + x >>= 4; + r += 4; + } + if (x >= 0x4) { + x >>= 2; + r += 2; + } + if (x >= 0x2) r += 1; + } + } + + /// @notice Returns the index of the least significant bit of the number, + /// where the least significant bit is at index 0 and the most significant bit is at index 255 + /// @dev The function satisfies the property: + /// (x & 2**leastSignificantBit(x)) != 0 and (x & (2**(leastSignificantBit(x)) - 1)) == 0) + /// @param x the value for which to compute the least significant bit, must be greater than 0 + /// @return r the index of the least significant bit + function leastSignificantBit(uint256 x) internal pure returns (uint8 r) { + require(x > 0); + + unchecked { + r = 255; + if (x & type(uint128).max > 0) { + r -= 128; + } else { + x >>= 128; + } + if (x & type(uint64).max > 0) { + r -= 64; + } else { + x >>= 64; + } + if (x & type(uint32).max > 0) { + r -= 32; + } else { + x >>= 32; + } + if (x & type(uint16).max > 0) { + r -= 16; + } else { + x >>= 16; + } + if (x & type(uint8).max > 0) { + r -= 8; + } else { + x >>= 8; + } + if (x & 0xf > 0) { + r -= 4; + } else { + x >>= 4; + } + if (x & 0x3 > 0) { + r -= 2; + } else { + x >>= 2; + } + if (x & 0x1 > 0) r -= 1; + } + } +} + +// File: Context.sol + +// OpenZeppelin Contracts v4.4.1 (utils/Context.sol) + +/** + * @dev Provides information about the current execution context, including the + * sender of the transaction and its data. While these are generally available + * via msg.sender and msg.data, they should not be accessed in such a direct + * manner, since when dealing with meta-transactions the account sending and + * paying for execution may not be the actual sender (as far as an application + * is concerned). + * + * This contract is only required for intermediate, library-like contracts. + */ +abstract contract Context { + function _msgSender() internal view virtual returns (address) { + return msg.sender; + } + + function _msgData() internal view virtual returns (bytes calldata) { + return msg.data; + } +} + +// File: FixedPoint128.sol + +/// @title FixedPoint128 +/// @notice A library for handling binary fixed point numbers, see https://en.wikipedia.org/wiki/Q_(number_format) +library FixedPoint128 { + uint256 internal constant Q128 = 0x100000000000000000000000000000000; +} + +// File: FixedPoint96.sol + +/// @title FixedPoint96 +/// @notice A library for handling binary fixed point numbers, see https://en.wikipedia.org/wiki/Q_(number_format) +/// @dev Used in SqrtPriceMath.sol +library FixedPoint96 { + uint8 internal constant RESOLUTION = 96; + uint256 internal constant Q96 = 0x1000000000000000000000000; +} + +// File: FullMath.sol + +/// @title Contains 512-bit math functions +/// @notice Facilitates multiplication and division that can have overflow of an intermediate value without any loss of precision +/// @dev Handles "phantom overflow" i.e., allows multiplication and division where an intermediate value overflows 256 bits +library FullMath { + /// @notice Calculates floor(a×b÷denominator) with full precision. Throws if result overflows a uint256 or denominator == 0 + /// @param a The multiplicand + /// @param b The multiplier + /// @param denominator The divisor + /// @return result The 256-bit result + /// @dev Credit to Remco Bloemen under MIT license https://xn--2-umb.com/21/muldiv + function mulDiv( + uint256 a, + uint256 b, + uint256 denominator + ) internal pure returns (uint256 result) { + unchecked { + // 512-bit multiply [prod1 prod0] = a * b + // Compute the product mod 2**256 and mod 2**256 - 1 + // then use the Chinese Remainder Theorem to reconstruct + // the 512 bit result. The result is stored in two 256 + // variables such that product = prod1 * 2**256 + prod0 + uint256 prod0; // Least significant 256 bits of the product + uint256 prod1; // Most significant 256 bits of the product + assembly { + let mm := mulmod(a, b, not(0)) + prod0 := mul(a, b) + prod1 := sub(sub(mm, prod0), lt(mm, prod0)) + } + + // Handle non-overflow cases, 256 by 256 division + if (prod1 == 0) { + require(denominator > 0); + assembly { + result := div(prod0, denominator) + } + return result; + } + + // Make sure the result is less than 2**256. + // Also prevents denominator == 0 + require(denominator > prod1); + + /////////////////////////////////////////////// + // 512 by 256 division. + /////////////////////////////////////////////// + + // Make division exact by subtracting the remainder from [prod1 prod0] + // Compute remainder using mulmod + uint256 remainder; + assembly { + remainder := mulmod(a, b, denominator) + } + // Subtract 256 bit number from 512 bit number + assembly { + prod1 := sub(prod1, gt(remainder, prod0)) + prod0 := sub(prod0, remainder) + } + + // Factor powers of two out of denominator + // Compute largest power of two divisor of denominator. + // Always >= 1. + uint256 twos = (0 - denominator) & denominator; + // Divide denominator by power of two + assembly { + denominator := div(denominator, twos) + } + + // Divide [prod1 prod0] by the factors of two + assembly { + prod0 := div(prod0, twos) + } + // Shift in bits from prod1 into prod0. For this we need + // to flip `twos` such that it is 2**256 / twos. + // If twos is zero, then it becomes one + assembly { + twos := add(div(sub(0, twos), twos), 1) + } + prod0 |= prod1 * twos; + + // Invert denominator mod 2**256 + // Now that denominator is an odd number, it has an inverse + // modulo 2**256 such that denominator * inv = 1 mod 2**256. + // Compute the inverse by starting with a seed that is correct + // correct for four bits. That is, denominator * inv = 1 mod 2**4 + uint256 inv = (3 * denominator) ^ 2; + // Now use Newton-Raphson iteration to improve the precision. + // Thanks to Hensel's lifting lemma, this also works in modular + // arithmetic, doubling the correct bits in each step. + inv *= 2 - denominator * inv; // inverse mod 2**8 + inv *= 2 - denominator * inv; // inverse mod 2**16 + inv *= 2 - denominator * inv; // inverse mod 2**32 + inv *= 2 - denominator * inv; // inverse mod 2**64 + inv *= 2 - denominator * inv; // inverse mod 2**128 + inv *= 2 - denominator * inv; // inverse mod 2**256 + + // Because the division is now exact we can divide by multiplying + // with the modular inverse of denominator. This will give us the + // correct result modulo 2**256. Since the precoditions guarantee + // that the outcome is less than 2**256, this is the final result. + // We don't need to compute the high bits of the result and prod1 + // is no longer required. + result = prod0 * inv; + return result; + } + } + + /// @notice Calculates ceil(a×b÷denominator) with full precision. Throws if result overflows a uint256 or denominator == 0 + /// @param a The multiplicand + /// @param b The multiplier + /// @param denominator The divisor + /// @return result The 256-bit result + function mulDivRoundingUp( + uint256 a, + uint256 b, + uint256 denominator + ) internal pure returns (uint256 result) { + unchecked { + result = mulDiv(a, b, denominator); + if (mulmod(a, b, denominator) > 0) { + require(result < type(uint256).max); + result++; + } + } + } +} + +// File: ICRVPool.sol + +interface ICRVPool { + function get_dy(int128 i, int128 j, uint256 dx) external view returns (uint256); + + function exchange(int128 i, int128 j, uint256 dx, uint256 min_dy) external; + + function coins(uint256 arg0) external view returns (address); +} + +// File: IERC20.sol + +// OpenZeppelin Contracts v4.4.1 (token/ERC20/IERC20.sol) + +/** + * @dev Interface of the ERC20 standard as defined in the EIP. + */ +interface IERC20 { + /** + * @dev Returns the amount of tokens in existence. + */ + function totalSupply() external view returns (uint256); + + /** + * @dev Returns the amount of tokens owned by `account`. + */ + function balanceOf(address account) external view returns (uint256); + + /** + * @dev Moves `amount` tokens from the caller's account to `recipient`. + * + * Returns a boolean value indicating whether the operation succeeded. + * + * Emits a {Transfer} event. + */ + function transfer(address recipient, uint256 amount) external returns (bool); + + /** + * @dev Returns the remaining number of tokens that `spender` will be + * allowed to spend on behalf of `owner` through {transferFrom}. This is + * zero by default. + * + * This value changes when {approve} or {transferFrom} are called. + */ + function allowance(address owner, address spender) external view returns (uint256); + + /** + * @dev Sets `amount` as the allowance of `spender` over the caller's tokens. + * + * Returns a boolean value indicating whether the operation succeeded. + * + * IMPORTANT: Beware that changing an allowance with this method brings the risk + * that someone may use both the old and the new allowance by unfortunate + * transaction ordering. One possible solution to mitigate this race + * condition is to first reduce the spender's allowance to 0 and set the + * desired value afterwards: + * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 + * + * Emits an {Approval} event. + */ + function approve(address spender, uint256 amount) external returns (bool); + + /** + * @dev Moves `amount` tokens from `sender` to `recipient` using the + * allowance mechanism. `amount` is then deducted from the caller's + * allowance. + * + * Returns a boolean value indicating whether the operation succeeded. + * + * Emits a {Transfer} event. + */ + function transferFrom( + address sender, + address recipient, + uint256 amount + ) external returns (bool); + + /** + * @dev Emitted when `value` tokens are moved from one account (`from`) to + * another (`to`). + * + * Note that `value` may be zero. + */ + event Transfer(address indexed from, address indexed to, uint256 value); + + /** + * @dev Emitted when the allowance of a `spender` for an `owner` is set by + * a call to {approve}. `value` is the new allowance. + */ + event Approval(address indexed owner, address indexed spender, uint256 value); +} + +// File: IUniswapV3Factory.sol + +/// @title The interface for the Uniswap V3 Factory +/// @notice The Uniswap V3 Factory facilitates creation of Uniswap V3 pools and control over the protocol fees +interface IUniswapV3Factory { + /// @notice Emitted when the owner of the factory is changed + /// @param oldOwner The owner before the owner was changed + /// @param newOwner The owner after the owner was changed + event OwnerChanged(address indexed oldOwner, address indexed newOwner); + + /// @notice Emitted when a pool is created + /// @param token0 The first token of the pool by address sort order + /// @param token1 The second token of the pool by address sort order + /// @param fee The fee collected upon every swap in the pool, denominated in hundredths of a bip + /// @param tickSpacing The minimum number of ticks between initialized ticks + /// @param pool The address of the created pool + event PoolCreated( + address indexed token0, + address indexed token1, + uint24 indexed fee, + int24 tickSpacing, + address pool + ); + + /// @notice Emitted when a new fee amount is enabled for pool creation via the factory + /// @param fee The enabled fee, denominated in hundredths of a bip + /// @param tickSpacing The minimum number of ticks between initialized ticks for pools created with the given fee + event FeeAmountEnabled(uint24 indexed fee, int24 indexed tickSpacing); + + /// @notice Returns the current owner of the factory + /// @dev Can be changed by the current owner via setOwner + /// @return The address of the factory owner + function owner() external view returns (address); + + /// @notice Returns the tick spacing for a given fee amount, if enabled, or 0 if not enabled + /// @dev A fee amount can never be removed, so this value should be hard coded or cached in the calling context + /// @param fee The enabled fee, denominated in hundredths of a bip. Returns 0 in case of unenabled fee + /// @return The tick spacing + function feeAmountTickSpacing(uint24 fee) external view returns (int24); + + /// @notice Returns the pool address for a given pair of tokens and a fee, or address 0 if it does not exist + /// @dev tokenA and tokenB may be passed in either token0/token1 or token1/token0 order + /// @param tokenA The contract address of either token0 or token1 + /// @param tokenB The contract address of the other token + /// @param fee The fee collected upon every swap in the pool, denominated in hundredths of a bip + /// @return pool The pool address + function getPool( + address tokenA, + address tokenB, + uint24 fee + ) external view returns (address pool); + + /// @notice Creates a pool for the given two tokens and fee + /// @param tokenA One of the two tokens in the desired pool + /// @param tokenB The other of the two tokens in the desired pool + /// @param fee The desired fee for the pool + /// @dev tokenA and tokenB may be passed in either order: token0/token1 or token1/token0. tickSpacing is retrieved + /// from the fee. The call will revert if the pool already exists, the fee is invalid, or the token arguments + /// are invalid. + /// @return pool The address of the newly created pool + function createPool( + address tokenA, + address tokenB, + uint24 fee + ) external returns (address pool); + + /// @notice Updates the owner of the factory + /// @dev Must be called by the current owner + /// @param _owner The new owner of the factory + function setOwner(address _owner) external; + + /// @notice Enables a fee amount with the given tickSpacing + /// @dev Fee amounts may never be removed once enabled + /// @param fee The fee amount to enable, denominated in hundredths of a bip (i.e. 1e-6) + /// @param tickSpacing The spacing between ticks to be enforced for all pools created with the given fee amount + function enableFeeAmount(uint24 fee, int24 tickSpacing) external; +} +// File: IUniswapV3PoolActions.sol + +/// @title Permissionless pool actions +/// @notice Contains pool methods that can be called by anyone +interface IUniswapV3PoolActions { + /// @notice Sets the initial price for the pool + /// @dev Price is represented as a sqrt(amountToken1/amountToken0) Q64.96 value + /// @param sqrtPriceX96 the initial sqrt price of the pool as a Q64.96 + function initialize(uint160 sqrtPriceX96) external; + + /// @notice Adds liquidity for the given recipient/tickLower/tickUpper position + /// @dev The caller of this method receives a callback in the form of IUniswapV3MintCallback#uniswapV3MintCallback + /// in which they must pay any token0 or token1 owed for the liquidity. The amount of token0/token1 due depends + /// on tickLower, tickUpper, the amount of liquidity, and the current price. + /// @param recipient The address for which the liquidity will be created + /// @param tickLower The lower tick of the position in which to add liquidity + /// @param tickUpper The upper tick of the position in which to add liquidity + /// @param amount The amount of liquidity to mint + /// @param data Any data that should be passed through to the callback + /// @return amount0 The amount of token0 that was paid to mint the given amount of liquidity. Matches the value in the callback + /// @return amount1 The amount of token1 that was paid to mint the given amount of liquidity. Matches the value in the callback + function mint( + address recipient, + int24 tickLower, + int24 tickUpper, + uint128 amount, + bytes calldata data + ) external returns (uint256 amount0, uint256 amount1); + + /// @notice Collects tokens owed to a position + /// @dev Does not recompute fees earned, which must be done either via mint or burn of any amount of liquidity. + /// Collect must be called by the position owner. To withdraw only token0 or only token1, amount0Requested or + /// amount1Requested may be set to zero. To withdraw all tokens owed, caller may pass any value greater than the + /// actual tokens owed, e.g. type(uint128).max. Tokens owed may be from accumulated swap fees or burned liquidity. + /// @param recipient The address which should receive the fees collected + /// @param tickLower The lower tick of the position for which to collect fees + /// @param tickUpper The upper tick of the position for which to collect fees + /// @param amount0Requested How much token0 should be withdrawn from the fees owed + /// @param amount1Requested How much token1 should be withdrawn from the fees owed + /// @return amount0 The amount of fees collected in token0 + /// @return amount1 The amount of fees collected in token1 + function collect( + address recipient, + int24 tickLower, + int24 tickUpper, + uint128 amount0Requested, + uint128 amount1Requested + ) external returns (uint128 amount0, uint128 amount1); + + /// @notice Burn liquidity from the sender and account tokens owed for the liquidity to the position + /// @dev Can be used to trigger a recalculation of fees owed to a position by calling with an amount of 0 + /// @dev Fees must be collected separately via a call to #collect + /// @param tickLower The lower tick of the position for which to burn liquidity + /// @param tickUpper The upper tick of the position for which to burn liquidity + /// @param amount How much liquidity to burn + /// @return amount0 The amount of token0 sent to the recipient + /// @return amount1 The amount of token1 sent to the recipient + function burn( + int24 tickLower, + int24 tickUpper, + uint128 amount + ) external returns (uint256 amount0, uint256 amount1); + + /// @notice Swap token0 for token1, or token1 for token0 + /// @dev The caller of this method receives a callback in the form of IUniswapV3SwapCallback#uniswapV3SwapCallback + /// @param recipient The address to receive the output of the swap + /// @param zeroForOne The direction of the swap, true for token0 to token1, false for token1 to token0 + /// @param amountSpecified The amount of the swap, which implicitly configures the swap as exact input (positive), or exact output (negative) + /// @param sqrtPriceLimitX96 The Q64.96 sqrt price limit. If zero for one, the price cannot be less than this + /// value after the swap. If one for zero, the price cannot be greater than this value after the swap + /// @param data Any data to be passed through to the callback + /// @return amount0 The delta of the balance of token0 of the pool, exact when negative, minimum when positive + /// @return amount1 The delta of the balance of token1 of the pool, exact when negative, minimum when positive + function swap( + address recipient, + bool zeroForOne, + int256 amountSpecified, + uint160 sqrtPriceLimitX96, + bytes calldata data + ) external returns (int256 amount0, int256 amount1); + + /// @notice Receive token0 and/or token1 and pay it back, plus a fee, in the callback + /// @dev The caller of this method receives a callback in the form of IUniswapV3FlashCallback#uniswapV3FlashCallback + /// @dev Can be used to donate underlying tokens pro-rata to currently in-range liquidity providers by calling + /// with 0 amount{0,1} and sending the donation amount(s) from the callback + /// @param recipient The address which will receive the token0 and token1 amounts + /// @param amount0 The amount of token0 to send + /// @param amount1 The amount of token1 to send + /// @param data Any data to be passed through to the callback + function flash( + address recipient, + uint256 amount0, + uint256 amount1, + bytes calldata data + ) external; + + /// @notice Increase the maximum number of price and liquidity observations that this pool will store + /// @dev This method is no-op if the pool already has an observationCardinalityNext greater than or equal to + /// the input observationCardinalityNext. + /// @param observationCardinalityNext The desired minimum number of observations for the pool to store + function increaseObservationCardinalityNext(uint16 observationCardinalityNext) external; +} + +// File: IUniswapV3PoolDerivedState.sol + +/// @title Pool state that is not stored +/// @notice Contains view functions to provide information about the pool that is computed rather than stored on the +/// blockchain. The functions here may have variable gas costs. +interface IUniswapV3PoolDerivedState { + /// @notice Returns the cumulative tick and liquidity as of each timestamp `secondsAgo` from the current block timestamp + /// @dev To get a time weighted average tick or liquidity-in-range, you must call this with two values, one representing + /// the beginning of the period and another for the end of the period. E.g., to get the last hour time-weighted average tick, + /// you must call it with secondsAgos = [3600, 0]. + /// @dev The time weighted average tick represents the geometric time weighted average price of the pool, in + /// log base sqrt(1.0001) of token1 / token0. The TickMath library can be used to go from a tick value to a ratio. + /// @param secondsAgos From how long ago each cumulative tick and liquidity value should be returned + /// @return tickCumulatives Cumulative tick values as of each `secondsAgos` from the current block timestamp + /// @return secondsPerLiquidityCumulativeX128s Cumulative seconds per liquidity-in-range value as of each `secondsAgos` from the current block + /// timestamp + function observe(uint32[] calldata secondsAgos) + external + view + returns (int56[] memory tickCumulatives, uint160[] memory secondsPerLiquidityCumulativeX128s); + + /// @notice Returns a snapshot of the tick cumulative, seconds per liquidity and seconds inside a tick range + /// @dev Snapshots must only be compared to other snapshots, taken over a period for which a position existed. + /// I.e., snapshots cannot be compared if a position is not held for the entire period between when the first + /// snapshot is taken and the second snapshot is taken. + /// @param tickLower The lower tick of the range + /// @param tickUpper The upper tick of the range + /// @return tickCumulativeInside The snapshot of the tick accumulator for the range + /// @return secondsPerLiquidityInsideX128 The snapshot of seconds per liquidity for the range + /// @return secondsInside The snapshot of seconds per liquidity for the range + function snapshotCumulativesInside(int24 tickLower, int24 tickUpper) + external + view + returns ( + int56 tickCumulativeInside, + uint160 secondsPerLiquidityInsideX128, + uint32 secondsInside + ); +} + +// File: IUniswapV3PoolErrors.sol + +/// @title Errors emitted by a pool +/// @notice Contains all events emitted by the pool +interface IUniswapV3PoolErrors { + error LOK(); + error TLU(); + error TLM(); + error TUM(); + error AI(); + error M0(); + error M1(); + error AS(); + error IIA(); + error L(); + error F0(); + error F1(); +} + +// File: IUniswapV3PoolEvents.sol + +/// @title Events emitted by a pool +/// @notice Contains all events emitted by the pool +interface IUniswapV3PoolEvents { + /// @notice Emitted exactly once by a pool when #initialize is first called on the pool + /// @dev Mint/Burn/Swap cannot be emitted by the pool before Initialize + /// @param sqrtPriceX96 The initial sqrt price of the pool, as a Q64.96 + /// @param tick The initial tick of the pool, i.e. log base 1.0001 of the starting price of the pool + event Initialize(uint160 sqrtPriceX96, int24 tick); + + /// @notice Emitted when liquidity is minted for a given position + /// @param sender The address that minted the liquidity + /// @param owner The owner of the position and recipient of any minted liquidity + /// @param tickLower The lower tick of the position + /// @param tickUpper The upper tick of the position + /// @param amount The amount of liquidity minted to the position range + /// @param amount0 How much token0 was required for the minted liquidity + /// @param amount1 How much token1 was required for the minted liquidity + event Mint( + address sender, + address indexed owner, + int24 indexed tickLower, + int24 indexed tickUpper, + uint128 amount, + uint256 amount0, + uint256 amount1 + ); + + /// @notice Emitted when fees are collected by the owner of a position + /// @dev Collect events may be emitted with zero amount0 and amount1 when the caller chooses not to collect fees + /// @param owner The owner of the position for which fees are collected + /// @param tickLower The lower tick of the position + /// @param tickUpper The upper tick of the position + /// @param amount0 The amount of token0 fees collected + /// @param amount1 The amount of token1 fees collected + event Collect( + address indexed owner, + address recipient, + int24 indexed tickLower, + int24 indexed tickUpper, + uint128 amount0, + uint128 amount1 + ); + + /// @notice Emitted when a position's liquidity is removed + /// @dev Does not withdraw any fees earned by the liquidity position, which must be withdrawn via #collect + /// @param owner The owner of the position for which liquidity is removed + /// @param tickLower The lower tick of the position + /// @param tickUpper The upper tick of the position + /// @param amount The amount of liquidity to remove + /// @param amount0 The amount of token0 withdrawn + /// @param amount1 The amount of token1 withdrawn + event Burn( + address indexed owner, + int24 indexed tickLower, + int24 indexed tickUpper, + uint128 amount, + uint256 amount0, + uint256 amount1 + ); + + /// @notice Emitted by the pool for any swaps between token0 and token1 + /// @param sender The address that initiated the swap call, and that received the callback + /// @param recipient The address that received the output of the swap + /// @param amount0 The delta of the token0 balance of the pool + /// @param amount1 The delta of the token1 balance of the pool + /// @param sqrtPriceX96 The sqrt(price) of the pool after the swap, as a Q64.96 + /// @param liquidity The liquidity of the pool after the swap + /// @param tick The log base 1.0001 of price of the pool after the swap + event Swap( + address indexed sender, + address indexed recipient, + int256 amount0, + int256 amount1, + uint160 sqrtPriceX96, + uint128 liquidity, + int24 tick + ); + + /// @notice Emitted by the pool for any flashes of token0/token1 + /// @param sender The address that initiated the swap call, and that received the callback + /// @param recipient The address that received the tokens from flash + /// @param amount0 The amount of token0 that was flashed + /// @param amount1 The amount of token1 that was flashed + /// @param paid0 The amount of token0 paid for the flash, which can exceed the amount0 plus the fee + /// @param paid1 The amount of token1 paid for the flash, which can exceed the amount1 plus the fee + event Flash( + address indexed sender, + address indexed recipient, + uint256 amount0, + uint256 amount1, + uint256 paid0, + uint256 paid1 + ); + + /// @notice Emitted by the pool for increases to the number of observations that can be stored + /// @dev observationCardinalityNext is not the observation cardinality until an observation is written at the index + /// just before a mint/swap/burn. + /// @param observationCardinalityNextOld The previous value of the next observation cardinality + /// @param observationCardinalityNextNew The updated value of the next observation cardinality + event IncreaseObservationCardinalityNext( + uint16 observationCardinalityNextOld, + uint16 observationCardinalityNextNew + ); + + /// @notice Emitted when the protocol fee is changed by the pool + /// @param feeProtocol0Old The previous value of the token0 protocol fee + /// @param feeProtocol1Old The previous value of the token1 protocol fee + /// @param feeProtocol0New The updated value of the token0 protocol fee + /// @param feeProtocol1New The updated value of the token1 protocol fee + event SetFeeProtocol(uint8 feeProtocol0Old, uint8 feeProtocol1Old, uint8 feeProtocol0New, uint8 feeProtocol1New); + + /// @notice Emitted when the collected protocol fees are withdrawn by the factory owner + /// @param sender The address that collects the protocol fees + /// @param recipient The address that receives the collected protocol fees + /// @param amount0 The amount of token0 protocol fees that is withdrawn + /// @param amount0 The amount of token1 protocol fees that is withdrawn + event CollectProtocol(address indexed sender, address indexed recipient, uint128 amount0, uint128 amount1); +} + +// File: IUniswapV3PoolImmutables.sol + +/// @title Pool state that never changes +/// @notice These parameters are fixed for a pool forever, i.e., the methods will always return the same values +interface IUniswapV3PoolImmutables { + /// @notice The contract that deployed the pool, which must adhere to the IUniswapV3Factory interface + /// @return The contract address + function factory() external view returns (address); + + /// @notice The first of the two tokens of the pool, sorted by address + /// @return The token contract address + function token0() external view returns (address); + + /// @notice The second of the two tokens of the pool, sorted by address + /// @return The token contract address + function token1() external view returns (address); + + /// @notice The pool's fee in hundredths of a bip, i.e. 1e-6 + /// @return The fee + function fee() external view returns (uint24); + + /// @notice The pool tick spacing + /// @dev Ticks can only be used at multiples of this value, minimum of 1 and always positive + /// e.g.: a tickSpacing of 3 means ticks can be initialized every 3rd tick, i.e., ..., -6, -3, 0, 3, 6, ... + /// This value is an int24 to avoid casting even though it is always positive. + /// @return The tick spacing + function tickSpacing() external view returns (int24); + + /// @notice The maximum amount of position liquidity that can use any tick in the range + /// @dev This parameter is enforced per tick to prevent liquidity from overflowing a uint128 at any point, and + /// also prevents out-of-range liquidity from being used to prevent adding in-range liquidity to a pool + /// @return The max amount of liquidity per tick + function maxLiquidityPerTick() external view returns (uint128); +} + +// File: IUniswapV3PoolOwnerActions.sol + +/// @title Permissioned pool actions +/// @notice Contains pool methods that may only be called by the factory owner +interface IUniswapV3PoolOwnerActions { + /// @notice Set the denominator of the protocol's % share of the fees + /// @param feeProtocol0 new protocol fee for token0 of the pool + /// @param feeProtocol1 new protocol fee for token1 of the pool + function setFeeProtocol(uint8 feeProtocol0, uint8 feeProtocol1) external; + + /// @notice Collect the protocol fee accrued to the pool + /// @param recipient The address to which collected protocol fees should be sent + /// @param amount0Requested The maximum amount of token0 to send, can be 0 to collect fees in only token1 + /// @param amount1Requested The maximum amount of token1 to send, can be 0 to collect fees in only token0 + /// @return amount0 The protocol fee collected in token0 + /// @return amount1 The protocol fee collected in token1 + function collectProtocol( + address recipient, + uint128 amount0Requested, + uint128 amount1Requested + ) external returns (uint128 amount0, uint128 amount1); +} + +// File: IUniswapV3PoolState.sol + +/// @title Pool state that can change +/// @notice These methods compose the pool's state, and can change with any frequency including multiple times +/// per transaction +interface IUniswapV3PoolState { + /// @notice The 0th storage slot in the pool stores many values, and is exposed as a single method to save gas + /// when accessed externally. + /// @return sqrtPriceX96 The current price of the pool as a sqrt(token1/token0) Q64.96 value + /// @return tick The current tick of the pool, i.e. according to the last tick transition that was run. + /// This value may not always be equal to SqrtTickMath.getTickAtSqrtRatio(sqrtPriceX96) if the price is on a tick + /// boundary. + /// @return observationIndex The index of the last oracle observation that was written, + /// @return observationCardinality The current maximum number of observations stored in the pool, + /// @return observationCardinalityNext The next maximum number of observations, to be updated when the observation. + /// @return feeProtocol The protocol fee for both tokens of the pool. + /// Encoded as two 4 bit values, where the protocol fee of token1 is shifted 4 bits and the protocol fee of token0 + /// is the lower 4 bits. Used as the denominator of a fraction of the swap fee, e.g. 4 means 1/4th of the swap fee. + /// unlocked Whether the pool is currently locked to reentrancy + function slot0() + external + view + returns ( + uint160 sqrtPriceX96, + int24 tick, + uint16 observationIndex, + uint16 observationCardinality, + uint16 observationCardinalityNext, + uint8 feeProtocol, + bool unlocked + ); + + /// @notice The fee growth as a Q128.128 fees of token0 collected per unit of liquidity for the entire life of the pool + /// @dev This value can overflow the uint256 + function feeGrowthGlobal0X128() external view returns (uint256); + + /// @notice The fee growth as a Q128.128 fees of token1 collected per unit of liquidity for the entire life of the pool + /// @dev This value can overflow the uint256 + function feeGrowthGlobal1X128() external view returns (uint256); + + /// @notice The amounts of token0 and token1 that are owed to the protocol + /// @dev Protocol fees will never exceed uint128 max in either token + function protocolFees() external view returns (uint128 token0, uint128 token1); + + /// @notice The currently in range liquidity available to the pool + /// @dev This value has no relationship to the total liquidity across all ticks + /// @return The liquidity at the current price of the pool + function liquidity() external view returns (uint128); + + /// @notice Look up information about a specific tick in the pool + /// @param tick The tick to look up + /// @return liquidityGross the total amount of position liquidity that uses the pool either as tick lower or + /// tick upper + /// @return liquidityNet how much liquidity changes when the pool price crosses the tick, + /// @return feeGrowthOutside0X128 the fee growth on the other side of the tick from the current tick in token0, + /// @return feeGrowthOutside1X128 the fee growth on the other side of the tick from the current tick in token1, + /// @return tickCumulativeOutside the cumulative tick value on the other side of the tick from the current tick + /// @return secondsPerLiquidityOutsideX128 the seconds spent per liquidity on the other side of the tick from the current tick, + /// @return secondsOutside the seconds spent on the other side of the tick from the current tick, + /// @return initialized Set to true if the tick is initialized, i.e. liquidityGross is greater than 0, otherwise equal to false. + /// Outside values can only be used if the tick is initialized, i.e. if liquidityGross is greater than 0. + /// In addition, these values are only relative and must be used only in comparison to previous snapshots for + /// a specific position. + function ticks(int24 tick) + external + view + returns ( + uint128 liquidityGross, + int128 liquidityNet, + uint256 feeGrowthOutside0X128, + uint256 feeGrowthOutside1X128, + int56 tickCumulativeOutside, + uint160 secondsPerLiquidityOutsideX128, + uint32 secondsOutside, + bool initialized + ); + + /// @notice Returns 256 packed tick initialized boolean values. See TickBitmap for more information + function tickBitmap(int16 wordPosition) external view returns (uint256); + + /// @notice Returns the information about a position by the position's key + /// @param key The position's key is a hash of a preimage composed by the owner, tickLower and tickUpper + /// @return liquidity The amount of liquidity in the position, + /// @return feeGrowthInside0LastX128 fee growth of token0 inside the tick range as of the last mint/burn/poke, + /// @return feeGrowthInside1LastX128 fee growth of token1 inside the tick range as of the last mint/burn/poke, + /// @return tokensOwed0 the computed amount of token0 owed to the position as of the last mint/burn/poke, + /// @return tokensOwed1 the computed amount of token1 owed to the position as of the last mint/burn/poke + function positions(bytes32 key) + external + view + returns ( + uint128 liquidity, + uint256 feeGrowthInside0LastX128, + uint256 feeGrowthInside1LastX128, + uint128 tokensOwed0, + uint128 tokensOwed1 + ); + + /// @notice Returns data about a specific observation index + /// @param index The element of the observations array to fetch + /// @dev You most likely want to use #observe() instead of this method to get an observation as of some amount of time + /// ago, rather than at a specific index in the array. + /// @return blockTimestamp The timestamp of the observation, + /// @return tickCumulative the tick multiplied by seconds elapsed for the life of the pool as of the observation timestamp, + /// @return secondsPerLiquidityCumulativeX128 the seconds per in range liquidity for the life of the pool as of the observation timestamp, + /// @return initialized whether the observation has been initialized and the values are safe to use + function observations(uint256 index) + external + view + returns ( + uint32 blockTimestamp, + int56 tickCumulative, + uint160 secondsPerLiquidityCumulativeX128, + bool initialized + ); +} + +// File: Math.sol + +// OpenZeppelin Contracts v4.4.1 (utils/math/Math.sol) + +/** + * @dev Standard math utilities missing in the Solidity language. + */ +library Math { + /** + * @dev Returns the largest of two numbers. + */ + function max(uint256 a, uint256 b) internal pure returns (uint256) { + return a >= b ? a : b; + } + + /** + * @dev Returns the smallest of two numbers. + */ + function min(uint256 a, uint256 b) internal pure returns (uint256) { + return a < b ? a : b; + } + + /** + * @dev Returns the average of two numbers. The result is rounded towards + * zero. + */ + function average(uint256 a, uint256 b) internal pure returns (uint256) { + // (a + b) / 2 can overflow. + return (a & b) + (a ^ b) / 2; + } + + /** + * @dev Returns the ceiling of the division of two numbers. + * + * This differs from standard division with `/` in that it rounds up instead + * of rounding down. + */ + function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) { + // (a + b - 1) / b can overflow on addition, so we distribute. + return a / b + (a % b == 0 ? 0 : 1); + } +} + +// File: SafeCast.sol + +/// @title Safe casting methods +/// @notice Contains methods for safely casting between types +library SafeCast { + /// @notice Cast a uint256 to a uint160, revert on overflow + /// @param y The uint256 to be downcasted + /// @return z The downcasted integer, now type uint160 + function toUint160(uint256 y) internal pure returns (uint160 z) { + require((z = uint160(y)) == y); + } + + /// @notice Cast a int256 to a int128, revert on overflow or underflow + /// @param y The int256 to be downcasted + /// @return z The downcasted integer, now type int128 + function toInt128(int256 y) internal pure returns (int128 z) { + require((z = int128(y)) == y); + } + + /// @notice Cast a uint256 to a int256, revert on overflow + /// @param y The uint256 to be casted + /// @return z The casted integer, now type int256 + function toInt256(uint256 y) internal pure returns (int256 z) { + require(y < 2**255); + z = int256(y); + } +} + +// File: TickMath.sol + +/// @title Math library for computing sqrt prices from ticks and vice versa +/// @notice Computes sqrt price for ticks of size 1.0001, i.e. sqrt(1.0001^tick) as fixed point Q64.96 numbers. Supports +/// prices between 2**-128 and 2**128 +library TickMath { + error T(); + error R(); + + /// @dev The minimum tick that may be passed to #getSqrtRatioAtTick computed from log base 1.0001 of 2**-128 + int24 internal constant MIN_TICK = -887272; + /// @dev The maximum tick that may be passed to #getSqrtRatioAtTick computed from log base 1.0001 of 2**128 + int24 internal constant MAX_TICK = -MIN_TICK; + + /// @dev The minimum value that can be returned from #getSqrtRatioAtTick. Equivalent to getSqrtRatioAtTick(MIN_TICK) + uint160 internal constant MIN_SQRT_RATIO = 4295128739; + /// @dev The maximum value that can be returned from #getSqrtRatioAtTick. Equivalent to getSqrtRatioAtTick(MAX_TICK) + uint160 internal constant MAX_SQRT_RATIO = + 1461446703485210103287273052203988822378723970342; + + /// @notice Calculates sqrt(1.0001^tick) * 2^96 + /// @dev Throws if |tick| > max tick + /// @param tick The input tick for the above formula + /// @return sqrtPriceX96 A Fixed point Q64.96 number representing the sqrt of the ratio of the two assets (token1/token0) + /// at the given tick + function getSqrtRatioAtTick(int24 tick) + internal + pure + returns (uint160 sqrtPriceX96) + { + unchecked { + uint256 absTick = tick < 0 + ? uint256(-int256(tick)) + : uint256(int256(tick)); + if (absTick > uint256(int256(MAX_TICK))) revert T(); + + uint256 ratio = absTick & 0x1 != 0 + ? 0xfffcb933bd6fad37aa2d162d1a594001 + : 0x100000000000000000000000000000000; + if (absTick & 0x2 != 0) + ratio = (ratio * 0xfff97272373d413259a46990580e213a) >> 128; + if (absTick & 0x4 != 0) + ratio = (ratio * 0xfff2e50f5f656932ef12357cf3c7fdcc) >> 128; + if (absTick & 0x8 != 0) + ratio = (ratio * 0xffe5caca7e10e4e61c3624eaa0941cd0) >> 128; + if (absTick & 0x10 != 0) + ratio = (ratio * 0xffcb9843d60f6159c9db58835c926644) >> 128; + if (absTick & 0x20 != 0) + ratio = (ratio * 0xff973b41fa98c081472e6896dfb254c0) >> 128; + if (absTick & 0x40 != 0) + ratio = (ratio * 0xff2ea16466c96a3843ec78b326b52861) >> 128; + if (absTick & 0x80 != 0) + ratio = (ratio * 0xfe5dee046a99a2a811c461f1969c3053) >> 128; + if (absTick & 0x100 != 0) + ratio = (ratio * 0xfcbe86c7900a88aedcffc83b479aa3a4) >> 128; + if (absTick & 0x200 != 0) + ratio = (ratio * 0xf987a7253ac413176f2b074cf7815e54) >> 128; + if (absTick & 0x400 != 0) + ratio = (ratio * 0xf3392b0822b70005940c7a398e4b70f3) >> 128; + if (absTick & 0x800 != 0) + ratio = (ratio * 0xe7159475a2c29b7443b29c7fa6e889d9) >> 128; + if (absTick & 0x1000 != 0) + ratio = (ratio * 0xd097f3bdfd2022b8845ad8f792aa5825) >> 128; + if (absTick & 0x2000 != 0) + ratio = (ratio * 0xa9f746462d870fdf8a65dc1f90e061e5) >> 128; + if (absTick & 0x4000 != 0) + ratio = (ratio * 0x70d869a156d2a1b890bb3df62baf32f7) >> 128; + if (absTick & 0x8000 != 0) + ratio = (ratio * 0x31be135f97d08fd981231505542fcfa6) >> 128; + if (absTick & 0x10000 != 0) + ratio = (ratio * 0x9aa508b5b7a84e1c677de54f3e99bc9) >> 128; + if (absTick & 0x20000 != 0) + ratio = (ratio * 0x5d6af8dedb81196699c329225ee604) >> 128; + if (absTick & 0x40000 != 0) + ratio = (ratio * 0x2216e584f5fa1ea926041bedfe98) >> 128; + if (absTick & 0x80000 != 0) + ratio = (ratio * 0x48a170391f7dc42444e8fa2) >> 128; + + if (tick > 0) ratio = type(uint256).max / ratio; + + // this divides by 1<<32 rounding up to go from a Q128.128 to a Q128.96. + // we then downcast because we know the result always fits within 160 bits due to our tick input constraint + // we round up in the division so getTickAtSqrtRatio of the output price is always consistent + sqrtPriceX96 = uint160( + (ratio >> 32) + (ratio % (1 << 32) == 0 ? 0 : 1) + ); + } + } + + /// @notice Calculates the greatest tick value such that getRatioAtTick(tick) <= ratio + /// @dev Throws in case sqrtPriceX96 < MIN_SQRT_RATIO, as MIN_SQRT_RATIO is the lowest value getRatioAtTick may + /// ever return. + /// @param sqrtPriceX96 The sqrt ratio for which to compute the tick as a Q64.96 + /// @return tick The greatest tick for which the ratio is less than or equal to the input ratio + function getTickAtSqrtRatio(uint160 sqrtPriceX96) + internal + pure + returns (int24 tick) + { + unchecked { + // second inequality must be < because the price can never reach the price at the max tick + if ( + !(sqrtPriceX96 >= MIN_SQRT_RATIO && + sqrtPriceX96 < MAX_SQRT_RATIO) + ) revert R(); + uint256 ratio = uint256(sqrtPriceX96) << 32; + + uint256 r = ratio; + uint256 msb = 0; + + assembly { + let f := shl(7, gt(r, 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF)) + msb := or(msb, f) + r := shr(f, r) + } + assembly { + let f := shl(6, gt(r, 0xFFFFFFFFFFFFFFFF)) + msb := or(msb, f) + r := shr(f, r) + } + assembly { + let f := shl(5, gt(r, 0xFFFFFFFF)) + msb := or(msb, f) + r := shr(f, r) + } + assembly { + let f := shl(4, gt(r, 0xFFFF)) + msb := or(msb, f) + r := shr(f, r) + } + assembly { + let f := shl(3, gt(r, 0xFF)) + msb := or(msb, f) + r := shr(f, r) + } + assembly { + let f := shl(2, gt(r, 0xF)) + msb := or(msb, f) + r := shr(f, r) + } + assembly { + let f := shl(1, gt(r, 0x3)) + msb := or(msb, f) + r := shr(f, r) + } + assembly { + let f := gt(r, 0x1) + msb := or(msb, f) + } + + if (msb >= 128) r = ratio >> (msb - 127); + else r = ratio << (127 - msb); + + int256 log_2 = (int256(msb) - 128) << 64; + + assembly { + r := shr(127, mul(r, r)) + let f := shr(128, r) + log_2 := or(log_2, shl(63, f)) + r := shr(f, r) + } + assembly { + r := shr(127, mul(r, r)) + let f := shr(128, r) + log_2 := or(log_2, shl(62, f)) + r := shr(f, r) + } + assembly { + r := shr(127, mul(r, r)) + let f := shr(128, r) + log_2 := or(log_2, shl(61, f)) + r := shr(f, r) + } + assembly { + r := shr(127, mul(r, r)) + let f := shr(128, r) + log_2 := or(log_2, shl(60, f)) + r := shr(f, r) + } + assembly { + r := shr(127, mul(r, r)) + let f := shr(128, r) + log_2 := or(log_2, shl(59, f)) + r := shr(f, r) + } + assembly { + r := shr(127, mul(r, r)) + let f := shr(128, r) + log_2 := or(log_2, shl(58, f)) + r := shr(f, r) + } + assembly { + r := shr(127, mul(r, r)) + let f := shr(128, r) + log_2 := or(log_2, shl(57, f)) + r := shr(f, r) + } + assembly { + r := shr(127, mul(r, r)) + let f := shr(128, r) + log_2 := or(log_2, shl(56, f)) + r := shr(f, r) + } + assembly { + r := shr(127, mul(r, r)) + let f := shr(128, r) + log_2 := or(log_2, shl(55, f)) + r := shr(f, r) + } + assembly { + r := shr(127, mul(r, r)) + let f := shr(128, r) + log_2 := or(log_2, shl(54, f)) + r := shr(f, r) + } + assembly { + r := shr(127, mul(r, r)) + let f := shr(128, r) + log_2 := or(log_2, shl(53, f)) + r := shr(f, r) + } + assembly { + r := shr(127, mul(r, r)) + let f := shr(128, r) + log_2 := or(log_2, shl(52, f)) + r := shr(f, r) + } + assembly { + r := shr(127, mul(r, r)) + let f := shr(128, r) + log_2 := or(log_2, shl(51, f)) + r := shr(f, r) + } + assembly { + r := shr(127, mul(r, r)) + let f := shr(128, r) + log_2 := or(log_2, shl(50, f)) + } + + int256 log_sqrt10001 = log_2 * 255738958999603826347141; // 128.128 number + + int24 tickLow = int24( + (log_sqrt10001 - 3402992956809132418596140100660247210) >> 128 + ); + int24 tickHi = int24( + (log_sqrt10001 + 291339464771989622907027621153398088495) >> 128 + ); + + tick = tickLow == tickHi + ? tickLow + : getSqrtRatioAtTick(tickHi) <= sqrtPriceX96 + ? tickHi + : tickLow; + } + } +} + +// File: UnsafeMath.sol + +/// @title Math functions that do not check inputs or outputs +/// @notice Contains methods that perform common math functions but do not do any overflow or underflow checks +library UnsafeMath { + /// @notice Returns ceil(x / y) + /// @dev division by 0 has unspecified behavior, and must be checked externally + /// @param x The dividend + /// @param y The divisor + /// @return z The quotient, ceil(x / y) + function divRoundingUp(uint256 x, uint256 y) + internal + pure + returns (uint256 z) + { + assembly { + z := add(div(x, y), gt(mod(x, y), 0)) + } + } +} + +// File: IERC20Extended.sol + +interface IERC20Extended is IERC20 { + function decimals() external view returns (uint8); + + function name() external view returns (string memory); + + function symbol() external view returns (string memory); +} + +// File: IERC20Metadata.sol + +// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/IERC20Metadata.sol) + +/** + * @dev Interface for the optional metadata functions from the ERC20 standard. + * + * _Available since v4.1._ + */ +interface IERC20Metadata is IERC20 { + /** + * @dev Returns the name of the token. + */ + function name() external view returns (string memory); + + /** + * @dev Returns the symbol of the token. + */ + function symbol() external view returns (string memory); + + /** + * @dev Returns the decimals places of the token. + */ + function decimals() external view returns (uint8); +} + +// File: IUniswapV3Pool.sol + +/// @title The interface for a Uniswap V3 Pool +/// @notice A Uniswap pool facilitates swapping and automated market making between any two assets that strictly conform +/// to the ERC20 specification +/// @dev The pool interface is broken up into many smaller pieces +interface IUniswapV3Pool is + IUniswapV3PoolImmutables, + IUniswapV3PoolState, + IUniswapV3PoolDerivedState, + IUniswapV3PoolActions, + IUniswapV3PoolOwnerActions, + IUniswapV3PoolErrors, + IUniswapV3PoolEvents +{ + +} + +// File: LiquidityAmounts.sol + +/// @title Liquidity amount functions +/// @notice Provides functions for computing liquidity amounts from token amounts and prices +library LiquidityAmounts { + /// @notice Downcasts uint256 to uint128 + /// @param x The uint258 to be downcasted + /// @return y The passed value, downcasted to uint128 + function toUint128(uint256 x) private pure returns (uint128 y) { + require((y = uint128(x)) == x); + } + + /// @notice Computes the amount of liquidity received for a given amount of token0 and price range + /// @dev Calculates amount0 * (sqrt(upper) * sqrt(lower)) / (sqrt(upper) - sqrt(lower)) + /// @param sqrtRatioAX96 A sqrt price representing the first tick boundary + /// @param sqrtRatioBX96 A sqrt price representing the second tick boundary + /// @param amount0 The amount0 being sent in + /// @return liquidity The amount of returned liquidity + function getLiquidityForAmount0( + uint160 sqrtRatioAX96, + uint160 sqrtRatioBX96, + uint256 amount0 + ) internal pure returns (uint128 liquidity) { + if (sqrtRatioAX96 > sqrtRatioBX96) + (sqrtRatioAX96, sqrtRatioBX96) = (sqrtRatioBX96, sqrtRatioAX96); + uint256 intermediate = FullMath.mulDiv( + sqrtRatioAX96, + sqrtRatioBX96, + FixedPoint96.Q96 + ); + return + toUint128( + FullMath.mulDiv( + amount0, + intermediate, + sqrtRatioBX96 - sqrtRatioAX96 + ) + ); + } + + /// @notice Computes the amount of liquidity received for a given amount of token1 and price range + /// @dev Calculates amount1 / (sqrt(upper) - sqrt(lower)). + /// @param sqrtRatioAX96 A sqrt price representing the first tick boundary + /// @param sqrtRatioBX96 A sqrt price representing the second tick boundary + /// @param amount1 The amount1 being sent in + /// @return liquidity The amount of returned liquidity + function getLiquidityForAmount1( + uint160 sqrtRatioAX96, + uint160 sqrtRatioBX96, + uint256 amount1 + ) internal pure returns (uint128 liquidity) { + if (sqrtRatioAX96 > sqrtRatioBX96) + (sqrtRatioAX96, sqrtRatioBX96) = (sqrtRatioBX96, sqrtRatioAX96); + return + toUint128( + FullMath.mulDiv( + amount1, + FixedPoint96.Q96, + sqrtRatioBX96 - sqrtRatioAX96 + ) + ); + } + + /// @notice Computes the maximum amount of liquidity received for a given amount of token0, token1, the current + /// pool prices and the prices at the tick boundaries + /// @param sqrtRatioX96 A sqrt price representing the current pool prices + /// @param sqrtRatioAX96 A sqrt price representing the first tick boundary + /// @param sqrtRatioBX96 A sqrt price representing the second tick boundary + /// @param amount0 The amount of token0 being sent in + /// @param amount1 The amount of token1 being sent in + /// @return liquidity The maximum amount of liquidity received + function getLiquidityForAmounts( + uint160 sqrtRatioX96, + uint160 sqrtRatioAX96, + uint160 sqrtRatioBX96, + uint256 amount0, + uint256 amount1 + ) internal pure returns (uint128 liquidity) { + if (sqrtRatioAX96 > sqrtRatioBX96) + (sqrtRatioAX96, sqrtRatioBX96) = (sqrtRatioBX96, sqrtRatioAX96); + + if (sqrtRatioX96 <= sqrtRatioAX96) { + liquidity = getLiquidityForAmount0( + sqrtRatioAX96, + sqrtRatioBX96, + amount0 + ); + } else if (sqrtRatioX96 < sqrtRatioBX96) { + uint128 liquidity0 = getLiquidityForAmount0( + sqrtRatioX96, + sqrtRatioBX96, + amount0 + ); + uint128 liquidity1 = getLiquidityForAmount1( + sqrtRatioAX96, + sqrtRatioX96, + amount1 + ); + + liquidity = liquidity0 < liquidity1 ? liquidity0 : liquidity1; + } else { + liquidity = getLiquidityForAmount1( + sqrtRatioAX96, + sqrtRatioBX96, + amount1 + ); + } + } + + /// @notice Computes the amount of token0 for a given amount of liquidity and a price range + /// @param sqrtRatioAX96 A sqrt price representing the first tick boundary + /// @param sqrtRatioBX96 A sqrt price representing the second tick boundary + /// @param liquidity The liquidity being valued + /// @return amount0 The amount of token0 + function getAmount0ForLiquidity( + uint160 sqrtRatioAX96, + uint160 sqrtRatioBX96, + uint128 liquidity + ) internal pure returns (uint256 amount0) { + if (sqrtRatioAX96 > sqrtRatioBX96) + (sqrtRatioAX96, sqrtRatioBX96) = (sqrtRatioBX96, sqrtRatioAX96); + + return + FullMath.mulDiv( + uint256(liquidity) << FixedPoint96.RESOLUTION, + sqrtRatioBX96 - sqrtRatioAX96, + sqrtRatioBX96 + ) / sqrtRatioAX96; + } + + /// @notice Computes the amount of token1 for a given amount of liquidity and a price range + /// @param sqrtRatioAX96 A sqrt price representing the first tick boundary + /// @param sqrtRatioBX96 A sqrt price representing the second tick boundary + /// @param liquidity The liquidity being valued + /// @return amount1 The amount of token1 + function getAmount1ForLiquidity( + uint160 sqrtRatioAX96, + uint160 sqrtRatioBX96, + uint128 liquidity + ) internal pure returns (uint256 amount1) { + if (sqrtRatioAX96 > sqrtRatioBX96) + (sqrtRatioAX96, sqrtRatioBX96) = (sqrtRatioBX96, sqrtRatioAX96); + + return + FullMath.mulDiv( + liquidity, + sqrtRatioBX96 - sqrtRatioAX96, + FixedPoint96.Q96 + ); + } + + /// @notice Computes the token0 and token1 value for a given amount of liquidity, the current + /// pool prices and the prices at the tick boundaries + /// @param sqrtRatioX96 A sqrt price representing the current pool prices + /// @param sqrtRatioAX96 A sqrt price representing the first tick boundary + /// @param sqrtRatioBX96 A sqrt price representing the second tick boundary + /// @param liquidity The liquidity being valued + /// @return amount0 The amount of token0 + /// @return amount1 The amount of token1 + function getAmountsForLiquidity( + uint160 sqrtRatioX96, + uint160 sqrtRatioAX96, + uint160 sqrtRatioBX96, + uint128 liquidity + ) internal pure returns (uint256 amount0, uint256 amount1) { + if (sqrtRatioAX96 > sqrtRatioBX96) + (sqrtRatioAX96, sqrtRatioBX96) = (sqrtRatioBX96, sqrtRatioAX96); + + if (sqrtRatioX96 <= sqrtRatioAX96) { + amount0 = getAmount0ForLiquidity( + sqrtRatioAX96, + sqrtRatioBX96, + liquidity + ); + } else if (sqrtRatioX96 < sqrtRatioBX96) { + amount0 = getAmount0ForLiquidity( + sqrtRatioX96, + sqrtRatioBX96, + liquidity + ); + amount1 = getAmount1ForLiquidity( + sqrtRatioAX96, + sqrtRatioX96, + liquidity + ); + } else { + amount1 = getAmount1ForLiquidity( + sqrtRatioAX96, + sqrtRatioBX96, + liquidity + ); + } + } +} + +// File: SafeERC20.sol + +// OpenZeppelin Contracts v4.4.1 (token/ERC20/utils/SafeERC20.sol) + +/** + * @title SafeERC20 + * @dev Wrappers around ERC20 operations that throw on failure (when the token + * contract returns false). Tokens that return no value (and instead revert or + * throw on failure) are also supported, non-reverting calls are assumed to be + * successful. + * To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract, + * which allows you to call the safe operations as `token.safeTransfer(...)`, etc. + */ +library SafeERC20 { + using Address for address; + + function safeTransfer( + IERC20 token, + address to, + uint256 value + ) internal { + _callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value)); + } + + function safeTransferFrom( + IERC20 token, + address from, + address to, + uint256 value + ) internal { + _callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value)); + } + + /** + * @dev Deprecated. This function has issues similar to the ones found in + * {IERC20-approve}, and its usage is discouraged. + * + * Whenever possible, use {safeIncreaseAllowance} and + * {safeDecreaseAllowance} instead. + */ + function safeApprove( + IERC20 token, + address spender, + uint256 value + ) internal { + // safeApprove should only be called when setting an initial allowance, + // or when resetting it to zero. To increase and decrease it, use + // 'safeIncreaseAllowance' and 'safeDecreaseAllowance' + require( + (value == 0) || (token.allowance(address(this), spender) == 0), + "SafeERC20: approve from non-zero to non-zero allowance" + ); + _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value)); + } + + function safeIncreaseAllowance( + IERC20 token, + address spender, + uint256 value + ) internal { + uint256 newAllowance = token.allowance(address(this), spender) + value; + _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance)); + } + + function safeDecreaseAllowance( + IERC20 token, + address spender, + uint256 value + ) internal { + unchecked { + uint256 oldAllowance = token.allowance(address(this), spender); + require(oldAllowance >= value, "SafeERC20: decreased allowance below zero"); + uint256 newAllowance = oldAllowance - value; + _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance)); + } + } + + /** + * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement + * on the return value: the return value is optional (but if data is returned, it must not be false). + * @param token The token targeted by the call. + * @param data The call data (encoded using abi.encode or one of its variants). + */ + function _callOptionalReturn(IERC20 token, bytes memory data) private { + // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since + // we're implementing it ourselves. We use {Address.functionCall} to perform this call, which verifies that + // the target address contains contract code and also asserts for success in the low-level call. + + bytes memory returndata = address(token).functionCall(data, "SafeERC20: low-level call failed"); + if (returndata.length > 0) { + // Return data is optional + require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed"); + } + } +} + +// File: SqrtPriceMath.sol + +/// @title Functions based on Q64.96 sqrt price and liquidity +/// @notice Contains the math that uses square root of price as a Q64.96 and liquidity to compute deltas +library SqrtPriceMath { + using SafeCast for uint256; + + /// @notice Gets the next sqrt price given a delta of token0 + /// @dev Always rounds up, because in the exact output case (increasing price) we need to move the price at least + /// far enough to get the desired output amount, and in the exact input case (decreasing price) we need to move the + /// price less in order to not send too much output. + /// The most precise formula for this is liquidity * sqrtPX96 / (liquidity +- amount * sqrtPX96), + /// if this is impossible because of overflow, we calculate liquidity / (liquidity / sqrtPX96 +- amount). + /// @param sqrtPX96 The starting price, i.e. before accounting for the token0 delta + /// @param liquidity The amount of usable liquidity + /// @param amount How much of token0 to add or remove from virtual reserves + /// @param add Whether to add or remove the amount of token0 + /// @return The price after adding or removing amount, depending on add + function getNextSqrtPriceFromAmount0RoundingUp( + uint160 sqrtPX96, + uint128 liquidity, + uint256 amount, + bool add + ) internal pure returns (uint160) { + // we short circuit amount == 0 because the result is otherwise not guaranteed to equal the input price + if (amount == 0) return sqrtPX96; + uint256 numerator1 = uint256(liquidity) << FixedPoint96.RESOLUTION; + + if (add) { + unchecked { + uint256 product; + if ((product = amount * sqrtPX96) / amount == sqrtPX96) { + uint256 denominator = numerator1 + product; + if (denominator >= numerator1) + // always fits in 160 bits + return + uint160( + FullMath.mulDivRoundingUp( + numerator1, + sqrtPX96, + denominator + ) + ); + } + } + // denominator is checked for overflow + return + uint160( + UnsafeMath.divRoundingUp( + numerator1, + (numerator1 / sqrtPX96) + amount + ) + ); + } else { + unchecked { + uint256 product; + // if the product overflows, we know the denominator underflows + // in addition, we must check that the denominator does not underflow + require( + (product = amount * sqrtPX96) / amount == sqrtPX96 && + numerator1 > product + ); + uint256 denominator = numerator1 - product; + return + FullMath + .mulDivRoundingUp(numerator1, sqrtPX96, denominator) + .toUint160(); + } + } + } + + /// @notice Gets the next sqrt price given a delta of token1 + /// @dev Always rounds down, because in the exact output case (decreasing price) we need to move the price at least + /// far enough to get the desired output amount, and in the exact input case (increasing price) we need to move the + /// price less in order to not send too much output. + /// The formula we compute is within <1 wei of the lossless version: sqrtPX96 +- amount / liquidity + /// @param sqrtPX96 The starting price, i.e., before accounting for the token1 delta + /// @param liquidity The amount of usable liquidity + /// @param amount How much of token1 to add, or remove, from virtual reserves + /// @param add Whether to add, or remove, the amount of token1 + /// @return The price after adding or removing `amount` + function getNextSqrtPriceFromAmount1RoundingDown( + uint160 sqrtPX96, + uint128 liquidity, + uint256 amount, + bool add + ) internal pure returns (uint160) { + // if we're adding (subtracting), rounding down requires rounding the quotient down (up) + // in both cases, avoid a mulDiv for most inputs + if (add) { + uint256 quotient = ( + amount <= type(uint160).max + ? (amount << FixedPoint96.RESOLUTION) / liquidity + : FullMath.mulDiv(amount, FixedPoint96.Q96, liquidity) + ); + + return (uint256(sqrtPX96) + quotient).toUint160(); + } else { + uint256 quotient = ( + amount <= type(uint160).max + ? UnsafeMath.divRoundingUp( + amount << FixedPoint96.RESOLUTION, + liquidity + ) + : FullMath.mulDivRoundingUp( + amount, + FixedPoint96.Q96, + liquidity + ) + ); + + require(sqrtPX96 > quotient); + // always fits 160 bits + unchecked { + return uint160(sqrtPX96 - quotient); + } + } + } + + /// @notice Gets the next sqrt price given an input amount of token0 or token1 + /// @dev Throws if price or liquidity are 0, or if the next price is out of bounds + /// @param sqrtPX96 The starting price, i.e., before accounting for the input amount + /// @param liquidity The amount of usable liquidity + /// @param amountIn How much of token0, or token1, is being swapped in + /// @param zeroForOne Whether the amount in is token0 or token1 + /// @return sqrtQX96 The price after adding the input amount to token0 or token1 + function getNextSqrtPriceFromInput( + uint160 sqrtPX96, + uint128 liquidity, + uint256 amountIn, + bool zeroForOne + ) internal pure returns (uint160 sqrtQX96) { + require(sqrtPX96 > 0); + require(liquidity > 0); + + // round to make sure that we don't pass the target price + return + zeroForOne + ? getNextSqrtPriceFromAmount0RoundingUp( + sqrtPX96, + liquidity, + amountIn, + true + ) + : getNextSqrtPriceFromAmount1RoundingDown( + sqrtPX96, + liquidity, + amountIn, + true + ); + } + + /// @notice Gets the next sqrt price given an output amount of token0 or token1 + /// @dev Throws if price or liquidity are 0 or the next price is out of bounds + /// @param sqrtPX96 The starting price before accounting for the output amount + /// @param liquidity The amount of usable liquidity + /// @param amountOut How much of token0, or token1, is being swapped out + /// @param zeroForOne Whether the amount out is token0 or token1 + /// @return sqrtQX96 The price after removing the output amount of token0 or token1 + function getNextSqrtPriceFromOutput( + uint160 sqrtPX96, + uint128 liquidity, + uint256 amountOut, + bool zeroForOne + ) internal pure returns (uint160 sqrtQX96) { + require(sqrtPX96 > 0); + require(liquidity > 0); + + // round to make sure that we pass the target price + return + zeroForOne + ? getNextSqrtPriceFromAmount1RoundingDown( + sqrtPX96, + liquidity, + amountOut, + false + ) + : getNextSqrtPriceFromAmount0RoundingUp( + sqrtPX96, + liquidity, + amountOut, + false + ); + } + + /// @notice Gets the amount0 delta between two prices + /// @dev Calculates liquidity / sqrt(lower) - liquidity / sqrt(upper), + /// i.e. liquidity * (sqrt(upper) - sqrt(lower)) / (sqrt(upper) * sqrt(lower)) + /// @param sqrtRatioAX96 A sqrt price + /// @param sqrtRatioBX96 Another sqrt price + /// @param liquidity The amount of usable liquidity + /// @param roundUp Whether to round the amount up or down + /// @return amount0 Amount of token0 required to cover a position of size liquidity between the two passed prices + function getAmount0Delta( + uint160 sqrtRatioAX96, + uint160 sqrtRatioBX96, + uint128 liquidity, + bool roundUp + ) internal pure returns (uint256 amount0) { + unchecked { + if (sqrtRatioAX96 > sqrtRatioBX96) + (sqrtRatioAX96, sqrtRatioBX96) = (sqrtRatioBX96, sqrtRatioAX96); + + uint256 numerator1 = uint256(liquidity) << FixedPoint96.RESOLUTION; + uint256 numerator2 = sqrtRatioBX96 - sqrtRatioAX96; + + require(sqrtRatioAX96 > 0); + + return + roundUp + ? UnsafeMath.divRoundingUp( + FullMath.mulDivRoundingUp( + numerator1, + numerator2, + sqrtRatioBX96 + ), + sqrtRatioAX96 + ) + : FullMath.mulDiv(numerator1, numerator2, sqrtRatioBX96) / + sqrtRatioAX96; + } + } + + /// @notice Gets the amount1 delta between two prices + /// @dev Calculates liquidity * (sqrt(upper) - sqrt(lower)) + /// @param sqrtRatioAX96 A sqrt price + /// @param sqrtRatioBX96 Another sqrt price + /// @param liquidity The amount of usable liquidity + /// @param roundUp Whether to round the amount up, or down + /// @return amount1 Amount of token1 required to cover a position of size liquidity between the two passed prices + function getAmount1Delta( + uint160 sqrtRatioAX96, + uint160 sqrtRatioBX96, + uint128 liquidity, + bool roundUp + ) internal pure returns (uint256 amount1) { + unchecked { + if (sqrtRatioAX96 > sqrtRatioBX96) + (sqrtRatioAX96, sqrtRatioBX96) = (sqrtRatioBX96, sqrtRatioAX96); + + return + roundUp + ? FullMath.mulDivRoundingUp( + liquidity, + sqrtRatioBX96 - sqrtRatioAX96, + FixedPoint96.Q96 + ) + : FullMath.mulDiv( + liquidity, + sqrtRatioBX96 - sqrtRatioAX96, + FixedPoint96.Q96 + ); + } + } + + /// @notice Helper that gets signed token0 delta + /// @param sqrtRatioAX96 A sqrt price + /// @param sqrtRatioBX96 Another sqrt price + /// @param liquidity The change in liquidity for which to compute the amount0 delta + /// @return amount0 Amount of token0 corresponding to the passed liquidityDelta between the two prices + function getAmount0Delta( + uint160 sqrtRatioAX96, + uint160 sqrtRatioBX96, + int128 liquidity + ) internal pure returns (int256 amount0) { + unchecked { + return + liquidity < 0 + ? -getAmount0Delta( + sqrtRatioAX96, + sqrtRatioBX96, + uint128(-liquidity), + false + ).toInt256() + : getAmount0Delta( + sqrtRatioAX96, + sqrtRatioBX96, + uint128(liquidity), + true + ).toInt256(); + } + } + + /// @notice Helper that gets signed token1 delta + /// @param sqrtRatioAX96 A sqrt price + /// @param sqrtRatioBX96 Another sqrt price + /// @param liquidity The change in liquidity for which to compute the amount1 delta + /// @return amount1 Amount of token1 corresponding to the passed liquidityDelta between the two prices + function getAmount1Delta( + uint160 sqrtRatioAX96, + uint160 sqrtRatioBX96, + int128 liquidity + ) internal pure returns (int256 amount1) { + unchecked { + return + liquidity < 0 + ? -getAmount1Delta( + sqrtRatioAX96, + sqrtRatioBX96, + uint128(-liquidity), + false + ).toInt256() + : getAmount1Delta( + sqrtRatioAX96, + sqrtRatioBX96, + uint128(liquidity), + true + ).toInt256(); + } + } +} + +// File: TickBitmap.sol + +/// @title Packed tick initialized state library +/// @notice Stores a packed mapping of tick index to its initialized state +/// @dev The mapping uses int16 for keys since ticks are represented as int24 and there are 256 (2^8) values per word. +library TickBitmap { + /// @notice Computes the position in the mapping where the initialized bit for a tick lives + /// @param tick The tick for which to compute the position + /// @return wordPos The key in the mapping containing the word in which the bit is stored + /// @return bitPos The bit position in the word where the flag is stored + function position(int24 tick) internal pure returns (int16 wordPos, uint8 bitPos) { + unchecked { + wordPos = int16(tick >> 8); + bitPos = uint8(int8(tick % 256)); + } + } + + /// @notice Flips the initialized state for a given tick from false to true, or vice versa + /// @param self The mapping in which to flip the tick + /// @param tick The tick to flip + /// @param tickSpacing The spacing between usable ticks + function flipTick( + mapping(int16 => uint256) storage self, + int24 tick, + int24 tickSpacing + ) internal { + unchecked { + require(tick % tickSpacing == 0); // ensure that the tick is spaced + (int16 wordPos, uint8 bitPos) = position(tick / tickSpacing); + uint256 mask = 1 << bitPos; + self[wordPos] ^= mask; + } + } + + /// @notice Returns the next initialized tick contained in the same word (or adjacent word) as the tick that is either + /// to the left (less than or equal to) or right (greater than) of the given tick + /// @param self The mapping in which to compute the next initialized tick + /// @param tick The starting tick + /// @param tickSpacing The spacing between usable ticks + /// @param lte Whether to search for the next initialized tick to the left (less than or equal to the starting tick) + /// @return next The next initialized or uninitialized tick up to 256 ticks away from the current tick + /// @return initialized Whether the next tick is initialized, as the function only searches within up to 256 ticks + function nextInitializedTickWithinOneWord( + mapping(int16 => uint256) storage self, + int24 tick, + int24 tickSpacing, + bool lte + ) internal view returns (int24 next, bool initialized) { + unchecked { + int24 compressed = tick / tickSpacing; + if (tick < 0 && tick % tickSpacing != 0) compressed--; // round towards negative infinity + + if (lte) { + (int16 wordPos, uint8 bitPos) = position(compressed); + // all the 1s at or to the right of the current bitPos + uint256 mask = (1 << bitPos) - 1 + (1 << bitPos); + uint256 masked = self[wordPos] & mask; + + // if there are no initialized ticks to the right of or at the current tick, return rightmost in the word + initialized = masked != 0; + // overflow/underflow is possible, but prevented externally by limiting both tickSpacing and tick + next = initialized + ? (compressed - int24(uint24(bitPos - BitMath.mostSignificantBit(masked)))) * tickSpacing + : (compressed - int24(uint24(bitPos))) * tickSpacing; + } else { + // start from the word of the next tick, since the current tick state doesn't matter + (int16 wordPos, uint8 bitPos) = position(compressed + 1); + // all the 1s at or to the left of the bitPos + uint256 mask = ~((1 << bitPos) - 1); + uint256 masked = self[wordPos] & mask; + + // if there are no initialized ticks to the left of the current tick, return leftmost in the word + initialized = masked != 0; + // overflow/underflow is possible, but prevented externally by limiting both tickSpacing and tick + next = initialized + ? (compressed + 1 + int24(uint24(BitMath.leastSignificantBit(masked) - bitPos))) * tickSpacing + : (compressed + 1 + int24(uint24(type(uint8).max - bitPos))) * tickSpacing; + } + } + } +} + +// File: TickBitmapExtended.sol + +/// @title Tick bitmap extended functions +/// @dev Uses the bitmap from UniswapV3Pool +library TickBitmapExtended { + /// @notice Computes the position in the mapping where the initialized bit for a tick lives + /// @param tick The tick for which to compute the position + /// @return wordPos The key in the mapping containing the word in which the bit is stored + /// @return bitPos The bit position in the word where the flag is stored + function position(int24 tick) + private + pure + returns (int16 wordPos, uint8 bitPos) + { + wordPos = int16(tick >> 8); + bitPos = uint8(uint24(tick % 256)); + } + + /// @notice Returns the next initialized tick contained in the same word (or adjacent word) as the tick that is either + /// to the left (less than or equal to) or right (greater than) of the given tick + /// @param self The mapping in which to compute the next initialized tick + /// @param tick The starting tick + /// @param tickSpacing The spacing between usable ticks + /// @param lte Whether to search for the next initialized tick to the left (less than or equal to the starting tick) + /// @return next The next initialized or uninitialized tick up to 256 ticks away from the current tick + /// @return initialized Whether the next tick is initialized, as the function only searches within up to 256 ticks + function nextInitializedTickWithinOneWord( + function(int16) external view returns (uint256) self, + int24 tick, + int24 tickSpacing, + bool lte + ) internal view returns (int24 next, bool initialized) { + int24 compressed = tick / tickSpacing; + if (tick < 0 && tick % tickSpacing != 0) compressed--; // round towards negative infinity + + if (lte) { + (int16 wordPos, uint8 bitPos) = position(compressed); + // all the 1s at or to the right of the current bitPos + uint256 mask = (1 << bitPos) - 1 + (1 << bitPos); + uint256 masked = self(wordPos) & mask; + + // if there are no initialized ticks to the right of or at the current tick, return rightmost in the word + initialized = masked != 0; + // overflow/underflow is possible, but prevented externally by limiting both tickSpacing and tick + next = initialized + ? (compressed - + int24( + uint24(bitPos - BitMath.mostSignificantBit(masked)) + )) * tickSpacing + : (compressed - int24(uint24(bitPos))) * tickSpacing; + } else { + // start from the word of the next tick, since the current tick state doesn't matter + (int16 wordPos, uint8 bitPos) = position(compressed + 1); + // all the 1s at or to the left of the bitPos + uint256 mask = ~((1 << bitPos) - 1); + uint256 masked = self(wordPos) & mask; + + // if there are no initialized ticks to the left of the current tick, return leftmost in the word + initialized = masked != 0; + // overflow/underflow is possible, but prevented externally by limiting both tickSpacing and tick + next = initialized + ? (compressed + + 1 + + int24( + uint24(BitMath.leastSignificantBit(masked) - bitPos) + )) * tickSpacing + : (compressed + 1 + int24(uint24(type(uint8).max - bitPos))) * + tickSpacing; + } + } +} + +// File: ERC20.sol + +// OpenZeppelin Contracts v4.4.1 (token/ERC20/ERC20.sol) + +/** + * @dev Implementation of the {IERC20} interface. + * + * This implementation is agnostic to the way tokens are created. This means + * that a supply mechanism has to be added in a derived contract using {_mint}. + * For a generic mechanism see {ERC20PresetMinterPauser}. + * + * TIP: For a detailed writeup see our guide + * https://forum.zeppelin.solutions/t/how-to-implement-erc20-supply-mechanisms/226[How + * to implement supply mechanisms]. + * + * We have followed general OpenZeppelin Contracts guidelines: functions revert + * instead returning `false` on failure. This behavior is nonetheless + * conventional and does not conflict with the expectations of ERC20 + * applications. + * + * Additionally, an {Approval} event is emitted on calls to {transferFrom}. + * This allows applications to reconstruct the allowance for all accounts just + * by listening to said events. Other implementations of the EIP may not emit + * these events, as it isn't required by the specification. + * + * Finally, the non-standard {decreaseAllowance} and {increaseAllowance} + * functions have been added to mitigate the well-known issues around setting + * allowances. See {IERC20-approve}. + */ +contract ERC20 is Context, IERC20, IERC20Metadata { + mapping(address => uint256) private _balances; + + mapping(address => mapping(address => uint256)) private _allowances; + + uint256 private _totalSupply; + + string private _name; + string private _symbol; + + /** + * @dev Sets the values for {name} and {symbol}. + * + * The default value of {decimals} is 18. To select a different value for + * {decimals} you should overload it. + * + * All two of these values are immutable: they can only be set once during + * construction. + */ + constructor(string memory name_, string memory symbol_) { + _name = name_; + _symbol = symbol_; + } + + /** + * @dev Returns the name of the token. + */ + function name() public view virtual override returns (string memory) { + return _name; + } + + /** + * @dev Returns the symbol of the token, usually a shorter version of the + * name. + */ + function symbol() public view virtual override returns (string memory) { + return _symbol; + } + + /** + * @dev Returns the number of decimals used to get its user representation. + * For example, if `decimals` equals `2`, a balance of `505` tokens should + * be displayed to a user as `5.05` (`505 / 10 ** 2`). + * + * Tokens usually opt for a value of 18, imitating the relationship between + * Ether and Wei. This is the value {ERC20} uses, unless this function is + * overridden; + * + * NOTE: This information is only used for _display_ purposes: it in + * no way affects any of the arithmetic of the contract, including + * {IERC20-balanceOf} and {IERC20-transfer}. + */ + function decimals() public view virtual override returns (uint8) { + return 18; + } + + /** + * @dev See {IERC20-totalSupply}. + */ + function totalSupply() public view virtual override returns (uint256) { + return _totalSupply; + } + + /** + * @dev See {IERC20-balanceOf}. + */ + function balanceOf(address account) public view virtual override returns (uint256) { + return _balances[account]; + } + + /** + * @dev See {IERC20-transfer}. + * + * Requirements: + * + * - `recipient` cannot be the zero address. + * - the caller must have a balance of at least `amount`. + */ + function transfer(address recipient, uint256 amount) public virtual override returns (bool) { + _transfer(_msgSender(), recipient, amount); + return true; + } + + /** + * @dev See {IERC20-allowance}. + */ + function allowance(address owner, address spender) public view virtual override returns (uint256) { + return _allowances[owner][spender]; + } + + /** + * @dev See {IERC20-approve}. + * + * Requirements: + * + * - `spender` cannot be the zero address. + */ + function approve(address spender, uint256 amount) public virtual override returns (bool) { + _approve(_msgSender(), spender, amount); + return true; + } + + /** + * @dev See {IERC20-transferFrom}. + * + * Emits an {Approval} event indicating the updated allowance. This is not + * required by the EIP. See the note at the beginning of {ERC20}. + * + * Requirements: + * + * - `sender` and `recipient` cannot be the zero address. + * - `sender` must have a balance of at least `amount`. + * - the caller must have allowance for ``sender``'s tokens of at least + * `amount`. + */ + function transferFrom( + address sender, + address recipient, + uint256 amount + ) public virtual override returns (bool) { + _transfer(sender, recipient, amount); + + uint256 currentAllowance = _allowances[sender][_msgSender()]; + require(currentAllowance >= amount, "ERC20: transfer amount exceeds allowance"); + unchecked { + _approve(sender, _msgSender(), currentAllowance - amount); + } + + return true; + } + + /** + * @dev Atomically increases the allowance granted to `spender` by the caller. + * + * This is an alternative to {approve} that can be used as a mitigation for + * problems described in {IERC20-approve}. + * + * Emits an {Approval} event indicating the updated allowance. + * + * Requirements: + * + * - `spender` cannot be the zero address. + */ + function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) { + _approve(_msgSender(), spender, _allowances[_msgSender()][spender] + addedValue); + return true; + } + + /** + * @dev Atomically decreases the allowance granted to `spender` by the caller. + * + * This is an alternative to {approve} that can be used as a mitigation for + * problems described in {IERC20-approve}. + * + * Emits an {Approval} event indicating the updated allowance. + * + * Requirements: + * + * - `spender` cannot be the zero address. + * - `spender` must have allowance for the caller of at least + * `subtractedValue`. + */ + function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) { + uint256 currentAllowance = _allowances[_msgSender()][spender]; + require(currentAllowance >= subtractedValue, "ERC20: decreased allowance below zero"); + unchecked { + _approve(_msgSender(), spender, currentAllowance - subtractedValue); + } + + return true; + } + + /** + * @dev Moves `amount` of tokens from `sender` to `recipient`. + * + * This internal function is equivalent to {transfer}, and can be used to + * e.g. implement automatic token fees, slashing mechanisms, etc. + * + * Emits a {Transfer} event. + * + * Requirements: + * + * - `sender` cannot be the zero address. + * - `recipient` cannot be the zero address. + * - `sender` must have a balance of at least `amount`. + */ + function _transfer( + address sender, + address recipient, + uint256 amount + ) internal virtual { + require(sender != address(0), "ERC20: transfer from the zero address"); + require(recipient != address(0), "ERC20: transfer to the zero address"); + + _beforeTokenTransfer(sender, recipient, amount); + + uint256 senderBalance = _balances[sender]; + require(senderBalance >= amount, "ERC20: transfer amount exceeds balance"); + unchecked { + _balances[sender] = senderBalance - amount; + } + _balances[recipient] += amount; + + emit Transfer(sender, recipient, amount); + + _afterTokenTransfer(sender, recipient, amount); + } + + /** @dev Creates `amount` tokens and assigns them to `account`, increasing + * the total supply. + * + * Emits a {Transfer} event with `from` set to the zero address. + * + * Requirements: + * + * - `account` cannot be the zero address. + */ + function _mint(address account, uint256 amount) internal virtual { + require(account != address(0), "ERC20: mint to the zero address"); + + _beforeTokenTransfer(address(0), account, amount); + + _totalSupply += amount; + _balances[account] += amount; + emit Transfer(address(0), account, amount); + + _afterTokenTransfer(address(0), account, amount); + } + + /** + * @dev Destroys `amount` tokens from `account`, reducing the + * total supply. + * + * Emits a {Transfer} event with `to` set to the zero address. + * + * Requirements: + * + * - `account` cannot be the zero address. + * - `account` must have at least `amount` tokens. + */ + function _burn(address account, uint256 amount) internal virtual { + require(account != address(0), "ERC20: burn from the zero address"); + + _beforeTokenTransfer(account, address(0), amount); + + uint256 accountBalance = _balances[account]; + require(accountBalance >= amount, "ERC20: burn amount exceeds balance"); + unchecked { + _balances[account] = accountBalance - amount; + } + _totalSupply -= amount; + + emit Transfer(account, address(0), amount); + + _afterTokenTransfer(account, address(0), amount); + } + + /** + * @dev Sets `amount` as the allowance of `spender` over the `owner` s tokens. + * + * This internal function is equivalent to `approve`, and can be used to + * e.g. set automatic allowances for certain subsystems, etc. + * + * Emits an {Approval} event. + * + * Requirements: + * + * - `owner` cannot be the zero address. + * - `spender` cannot be the zero address. + */ + function _approve( + address owner, + address spender, + uint256 amount + ) internal virtual { + require(owner != address(0), "ERC20: approve from the zero address"); + require(spender != address(0), "ERC20: approve to the zero address"); + + _allowances[owner][spender] = amount; + emit Approval(owner, spender, amount); + } + + /** + * @dev Hook that is called before any transfer of tokens. This includes + * minting and burning. + * + * Calling conditions: + * + * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens + * will be transferred to `to`. + * - when `from` is zero, `amount` tokens will be minted for `to`. + * - when `to` is zero, `amount` of ``from``'s tokens will be burned. + * - `from` and `to` are never both zero. + * + * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks]. + */ + function _beforeTokenTransfer( + address from, + address to, + uint256 amount + ) internal virtual {} + + /** + * @dev Hook that is called after any transfer of tokens. This includes + * minting and burning. + * + * Calling conditions: + * + * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens + * has been transferred to `to`. + * - when `from` is zero, `amount` tokens have been minted for `to`. + * - when `to` is zero, `amount` of ``from``'s tokens have been burned. + * - `from` and `to` are never both zero. + * + * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks]. + */ + function _afterTokenTransfer( + address from, + address to, + uint256 amount + ) internal virtual {} +} + +// File: SwapMath.sol + +/// @title Computes the result of a swap within ticks +/// @notice Contains methods for computing the result of a swap within a single tick price range, i.e., a single tick. +library SwapMath { + /// @notice Computes the result of swapping some amount in, or amount out, given the parameters of the swap + /// @dev The fee, plus the amount in, will never exceed the amount remaining if the swap's `amountSpecified` is positive + /// @param sqrtRatioCurrentX96 The current sqrt price of the pool + /// @param sqrtRatioTargetX96 The price that cannot be exceeded, from which the direction of the swap is inferred + /// @param liquidity The usable liquidity + /// @param amountRemaining How much input or output amount is remaining to be swapped in/out + /// @param feePips The fee taken from the input amount, expressed in hundredths of a bip + /// @return sqrtRatioNextX96 The price after swapping the amount in/out, not to exceed the price target + /// @return amountIn The amount to be swapped in, of either token0 or token1, based on the direction of the swap + /// @return amountOut The amount to be received, of either token0 or token1, based on the direction of the swap + /// @return feeAmount The amount of input that will be taken as a fee + function computeSwapStep( + uint160 sqrtRatioCurrentX96, + uint160 sqrtRatioTargetX96, + uint128 liquidity, + int256 amountRemaining, + uint24 feePips + ) + internal + pure + returns ( + uint160 sqrtRatioNextX96, + uint256 amountIn, + uint256 amountOut, + uint256 feeAmount + ) + { + unchecked { + bool zeroForOne = sqrtRatioCurrentX96 >= sqrtRatioTargetX96; + bool exactIn = amountRemaining >= 0; + + if (exactIn) { + uint256 amountRemainingLessFee = FullMath.mulDiv( + uint256(amountRemaining), + 1e6 - feePips, + 1e6 + ); + amountIn = zeroForOne + ? SqrtPriceMath.getAmount0Delta( + sqrtRatioTargetX96, + sqrtRatioCurrentX96, + liquidity, + true + ) + : SqrtPriceMath.getAmount1Delta( + sqrtRatioCurrentX96, + sqrtRatioTargetX96, + liquidity, + true + ); + if (amountRemainingLessFee >= amountIn) + sqrtRatioNextX96 = sqrtRatioTargetX96; + else + sqrtRatioNextX96 = SqrtPriceMath.getNextSqrtPriceFromInput( + sqrtRatioCurrentX96, + liquidity, + amountRemainingLessFee, + zeroForOne + ); + } else { + amountOut = zeroForOne + ? SqrtPriceMath.getAmount1Delta( + sqrtRatioTargetX96, + sqrtRatioCurrentX96, + liquidity, + false + ) + : SqrtPriceMath.getAmount0Delta( + sqrtRatioCurrentX96, + sqrtRatioTargetX96, + liquidity, + false + ); + if (uint256(-amountRemaining) >= amountOut) + sqrtRatioNextX96 = sqrtRatioTargetX96; + else + sqrtRatioNextX96 = SqrtPriceMath.getNextSqrtPriceFromOutput( + sqrtRatioCurrentX96, + liquidity, + uint256(-amountRemaining), + zeroForOne + ); + } + + bool max = sqrtRatioTargetX96 == sqrtRatioNextX96; + + // get the input/output amounts + if (zeroForOne) { + amountIn = max && exactIn + ? amountIn + : SqrtPriceMath.getAmount0Delta( + sqrtRatioNextX96, + sqrtRatioCurrentX96, + liquidity, + true + ); + amountOut = max && !exactIn + ? amountOut + : SqrtPriceMath.getAmount1Delta( + sqrtRatioNextX96, + sqrtRatioCurrentX96, + liquidity, + false + ); + } else { + amountIn = max && exactIn + ? amountIn + : SqrtPriceMath.getAmount1Delta( + sqrtRatioCurrentX96, + sqrtRatioNextX96, + liquidity, + true + ); + amountOut = max && !exactIn + ? amountOut + : SqrtPriceMath.getAmount0Delta( + sqrtRatioCurrentX96, + sqrtRatioNextX96, + liquidity, + false + ); + } + + // cap the output amount to not exceed the remaining output amount + if (!exactIn && amountOut > uint256(-amountRemaining)) { + amountOut = uint256(-amountRemaining); + } + + if (exactIn && sqrtRatioNextX96 != sqrtRatioTargetX96) { + // we didn't reach the target, so take the remainder of the maximum input as fee + feeAmount = uint256(amountRemaining) - amountIn; + } else { + feeAmount = FullMath.mulDivRoundingUp( + amountIn, + feePips, + 1e6 - feePips + ); + } + } + } +} + +// File: ySwapper.sol + +interface ITradeFactory { + function enable(address, address) external; +} + +abstract contract ySwapper { + using SafeERC20 for IERC20; + // TODO: not working for clonables ! + address public tradeFactory = + address(0xD3f89C21719Ec5961a3E6B0f9bBf9F9b4180E9e9); + + bool public tradesEnabled; + + // Implement in contract using ySwaps. + // should return the list of tokens to be swapped and a list of tokens to be swapped to + function getYSwapTokens() + internal + view + virtual + returns (address[] memory, address[] memory); + + // WARNING this is a manual permissioned function + // should call internalFunction and use onlyROLEs + // if you don't want this function, just override with empty function + function removeTradeFactoryPermissions() external virtual; + + // WARNING this is a manual permissioned function + // should call internalFunction and use onlyROLEs + // if you don't want this function, just override with empty function + function updateTradeFactoryPermissions(address _tradeFactory) + external + virtual; + + function _setUpTradeFactory() internal { + //approve and set up trade factory + tradesEnabled = true; + ( + address[] memory tokensToEnable, + address[] memory toTokens + ) = getYSwapTokens(); + + for (uint256 i; i < tokensToEnable.length; i++) { + _enableTradeFactoryForToken(tokensToEnable[i], toTokens[i]); + } + } + + function _enableTradeFactoryForToken(address fromToken, address toToken) + internal + { + ITradeFactory tf = ITradeFactory(tradeFactory); + IERC20(fromToken).safeApprove(address(tf), type(uint256).max); + tf.enable(fromToken, toToken); + } + + function _updateTradeFactory(address _newTradeFactory) internal { + if (tradeFactory != address(0)) { + _removeTradeFactory(); + } + + tradeFactory = _newTradeFactory; + _setUpTradeFactory(); + } + + function _removeTradeFactory() internal { + address _tradeFactory = tradeFactory; + + (address[] memory tokens, ) = getYSwapTokens(); + + for (uint256 i = 0; i < tokens.length; i++) { + IERC20(tokens[i]).safeApprove(_tradeFactory, 0); + } + + tradeFactory = address(0); + tradesEnabled = false; + } +} + +// File: BaseStrategy.sol + +struct StrategyParams { + uint256 performanceFee; + uint256 activation; + uint256 debtRatio; + uint256 minDebtPerHarvest; + uint256 maxDebtPerHarvest; + uint256 lastReport; + uint256 totalDebt; + uint256 totalGain; + uint256 totalLoss; +} + +interface VaultAPI is IERC20 { + function name() external view returns (string calldata); + + function symbol() external view returns (string calldata); + + function decimals() external view returns (uint256); + + function apiVersion() external pure returns (string memory); + + function permit( + address owner, + address spender, + uint256 amount, + uint256 expiry, + bytes calldata signature + ) external returns (bool); + + // NOTE: Vyper produces multiple signatures for a given function with "default" args + function deposit() external returns (uint256); + + function deposit(uint256 amount) external returns (uint256); + + function deposit(uint256 amount, address recipient) external returns (uint256); + + // NOTE: Vyper produces multiple signatures for a given function with "default" args + function withdraw() external returns (uint256); + + function withdraw(uint256 maxShares) external returns (uint256); + + function withdraw(uint256 maxShares, address recipient) external returns (uint256); + + function token() external view returns (address); + + function strategies(address _strategy) external view returns (StrategyParams memory); + + function pricePerShare() external view returns (uint256); + + function totalAssets() external view returns (uint256); + + function depositLimit() external view returns (uint256); + + function maxAvailableShares() external view returns (uint256); + + /** + * View how much the Vault would increase this Strategy's borrow limit, + * based on its present performance (since its last report). Can be used to + * determine expectedReturn in your Strategy. + */ + function creditAvailable() external view returns (uint256); + + /** + * View how much the Vault would like to pull back from the Strategy, + * based on its present performance (since its last report). Can be used to + * determine expectedReturn in your Strategy. + */ + function debtOutstanding() external view returns (uint256); + + /** + * View how much the Vault expect this Strategy to return at the current + * block, based on its present performance (since its last report). Can be + * used to determine expectedReturn in your Strategy. + */ + function expectedReturn() external view returns (uint256); + + /** + * This is the main contact point where the Strategy interacts with the + * Vault. It is critical that this call is handled as intended by the + * Strategy. Therefore, this function will be called by BaseStrategy to + * make sure the integration is correct. + */ + function report( + uint256 _gain, + uint256 _loss, + uint256 _debtPayment + ) external returns (uint256); + + /** + * This function should only be used in the scenario where the Strategy is + * being retired but no migration of the positions are possible, or in the + * extreme scenario that the Strategy needs to be put into "Emergency Exit" + * mode in order for it to exit as quickly as possible. The latter scenario + * could be for any reason that is considered "critical" that the Strategy + * exits its position as fast as possible, such as a sudden change in + * market conditions leading to losses, or an imminent failure in an + * external dependency. + */ + function revokeStrategy() external; + + /** + * View the governance address of the Vault to assert privileged functions + * can only be called by governance. The Strategy serves the Vault, so it + * is subject to governance defined by the Vault. + */ + function governance() external view returns (address); + + /** + * View the management address of the Vault to assert privileged functions + * can only be called by management. The Strategy serves the Vault, so it + * is subject to management defined by the Vault. + */ + function management() external view returns (address); + + /** + * View the guardian address of the Vault to assert privileged functions + * can only be called by guardian. The Strategy serves the Vault, so it + * is subject to guardian defined by the Vault. + */ + function guardian() external view returns (address); +} + +/** + * This interface is here for the keeper bot to use. + */ +interface StrategyAPI { + function name() external view returns (string memory); + + function vault() external view returns (address); + + function want() external view returns (address); + + function apiVersion() external pure returns (string memory); + + function keeper() external view returns (address); + + function isActive() external view returns (bool); + + function delegatedAssets() external view returns (uint256); + + function estimatedTotalAssets() external view returns (uint256); + + function tendTrigger(uint256 callCost) external view returns (bool); + + function tend() external; + + function harvestTrigger(uint256 callCost) external view returns (bool); + + function harvest() external; + + event Harvested(uint256 profit, uint256 loss, uint256 debtPayment, uint256 debtOutstanding); +} + +interface HealthCheck { + function check( + uint256 profit, + uint256 loss, + uint256 debtPayment, + uint256 debtOutstanding, + uint256 totalDebt + ) external view returns (bool); +} + +/** + * @title Yearn Base Strategy + * @author yearn.finance + * @notice + * BaseStrategy implements all of the required functionality to interoperate + * closely with the Vault contract. This contract should be inherited and the + * abstract methods implemented to adapt the Strategy to the particular needs + * it has to create a return. + * + * Of special interest is the relationship between `harvest()` and + * `vault.report()'. `harvest()` may be called simply because enough time has + * elapsed since the last report, and not because any funds need to be moved + * or positions adjusted. This is critical so that the Vault may maintain an + * accurate picture of the Strategy's performance. See `vault.report()`, + * `harvest()`, and `harvestTrigger()` for further details. + */ + +abstract contract BaseStrategy { + using SafeERC20 for IERC20; + string public metadataURI; + + // health checks + bool public doHealthCheck; + address public healthCheck; + + /** + * @notice + * Used to track which version of `StrategyAPI` this Strategy + * implements. + * @dev The Strategy's version must match the Vault's `API_VERSION`. + * @return A string which holds the current API version of this contract. + */ + function apiVersion() public pure returns (string memory) { + return "0.4.3"; + } + + /** + * @notice This Strategy's name. + * @dev + * You can use this field to manage the "version" of this Strategy, e.g. + * `StrategySomethingOrOtherV1`. However, "API Version" is managed by + * `apiVersion()` function above. + * @return This Strategy's name. + */ + function name() external view virtual returns (string memory); + + /** + * @notice + * The amount (priced in want) of the total assets managed by this strategy should not count + * towards Yearn's TVL calculations. + * @dev + * You can override this field to set it to a non-zero value if some of the assets of this + * Strategy is somehow delegated inside another part of of Yearn's ecosystem e.g. another Vault. + * Note that this value must be strictly less than or equal to the amount provided by + * `estimatedTotalAssets()` below, as the TVL calc will be total assets minus delegated assets. + * Also note that this value is used to determine the total assets under management by this + * strategy, for the purposes of computing the management fee in `Vault` + * @return + * The amount of assets this strategy manages that should not be included in Yearn's Total Value + * Locked (TVL) calculation across it's ecosystem. + */ + function delegatedAssets() external view virtual returns (uint256) { + return 0; + } + + VaultAPI public vault; + address public strategist; + address public rewards; + address public keeper; + + IERC20 public want; + + // So indexers can keep track of this + event Harvested(uint256 profit, uint256 loss, uint256 debtPayment, uint256 debtOutstanding); + + event UpdatedStrategist(address newStrategist); + + event UpdatedKeeper(address newKeeper); + + event UpdatedRewards(address rewards); + + event UpdatedMinReportDelay(uint256 delay); + + event UpdatedMaxReportDelay(uint256 delay); + + event UpdatedProfitFactor(uint256 profitFactor); + + event UpdatedDebtThreshold(uint256 debtThreshold); + + event EmergencyExitEnabled(); + + event UpdatedMetadataURI(string metadataURI); + + event SetHealthCheck(address); + event SetDoHealthCheck(bool); + + // The minimum number of seconds between harvest calls. See + // `setMinReportDelay()` for more details. + uint256 public minReportDelay; + + // The maximum number of seconds between harvest calls. See + // `setMaxReportDelay()` for more details. + uint256 public maxReportDelay; + + // The minimum multiple that `callCost` must be above the credit/profit to + // be "justifiable". See `setProfitFactor()` for more details. + uint256 public profitFactor; + + // Use this to adjust the threshold at which running a debt causes a + // harvest trigger. See `setDebtThreshold()` for more details. + uint256 public debtThreshold; + + // See note on `setEmergencyExit()`. + bool public emergencyExit; + + // modifiers + modifier onlyAuthorized() { + require(msg.sender == strategist || msg.sender == governance(), "!authorized"); + _; + } + + modifier onlyEmergencyAuthorized() { + require( + msg.sender == strategist || msg.sender == governance() || msg.sender == vault.guardian() || msg.sender == vault.management(), + "!authorized" + ); + _; + } + + modifier onlyStrategist() { + require(msg.sender == strategist, "!strategist"); + _; + } + + modifier onlyGovernance() { + require(msg.sender == governance(), "!authorized"); + _; + } + + modifier onlyKeepers() { + require( + msg.sender == keeper || + msg.sender == strategist || + msg.sender == governance() || + msg.sender == vault.guardian() || + msg.sender == vault.management(), + "!authorized" + ); + _; + } + + modifier onlyVaultManagers() { + require(msg.sender == vault.management() || msg.sender == governance(), "!authorized"); + _; + } + + constructor(address _vault) { + _initialize(_vault, msg.sender, msg.sender, msg.sender); + } + + /** + * @notice + * Initializes the Strategy, this is called only once, when the + * contract is deployed. + * @dev `_vault` should implement `VaultAPI`. + * @param _vault The address of the Vault responsible for this Strategy. + * @param _strategist The address to assign as `strategist`. + * The strategist is able to change the reward address + * @param _rewards The address to use for pulling rewards. + * @param _keeper The adddress of the _keeper. _keeper + * can harvest and tend a strategy. + */ + function _initialize( + address _vault, + address _strategist, + address _rewards, + address _keeper + ) internal { + require(address(want) == address(0), "Strategy already initialized"); + + vault = VaultAPI(_vault); + want = IERC20(vault.token()); + want.safeApprove(_vault, type(uint256).max); // Give Vault unlimited access (might save gas) + strategist = _strategist; + rewards = _rewards; + keeper = _keeper; + + // initialize variables + minReportDelay = 0; + maxReportDelay = 86400; + profitFactor = 100; + debtThreshold = 0; + + vault.approve(rewards, type(uint256).max); // Allow rewards to be pulled + } + + function setHealthCheck(address _healthCheck) external onlyVaultManagers { + emit SetHealthCheck(_healthCheck); + healthCheck = _healthCheck; + } + + function setDoHealthCheck(bool _doHealthCheck) external onlyVaultManagers { + emit SetDoHealthCheck(_doHealthCheck); + doHealthCheck = _doHealthCheck; + } + + /** + * @notice + * Used to change `strategist`. + * + * This may only be called by governance or the existing strategist. + * @param _strategist The new address to assign as `strategist`. + */ + function setStrategist(address _strategist) external onlyAuthorized { + require(_strategist != address(0)); + strategist = _strategist; + emit UpdatedStrategist(_strategist); + } + + /** + * @notice + * Used to change `keeper`. + * + * `keeper` is the only address that may call `tend()` or `harvest()`, + * other than `governance()` or `strategist`. However, unlike + * `governance()` or `strategist`, `keeper` may *only* call `tend()` + * and `harvest()`, and no other authorized functions, following the + * principle of least privilege. + * + * This may only be called by governance or the strategist. + * @param _keeper The new address to assign as `keeper`. + */ + function setKeeper(address _keeper) external onlyAuthorized { + require(_keeper != address(0)); + keeper = _keeper; + emit UpdatedKeeper(_keeper); + } + + /** + * @notice + * Used to change `rewards`. EOA or smart contract which has the permission + * to pull rewards from the vault. + * + * This may only be called by the strategist. + * @param _rewards The address to use for pulling rewards. + */ + function setRewards(address _rewards) external onlyStrategist { + require(_rewards != address(0)); + vault.approve(rewards, 0); + rewards = _rewards; + vault.approve(rewards, type(uint256).max); + emit UpdatedRewards(_rewards); + } + + /** + * @notice + * Used to change `minReportDelay`. `minReportDelay` is the minimum number + * of blocks that should pass for `harvest()` to be called. + * + * For external keepers (such as the Keep3r network), this is the minimum + * time between jobs to wait. (see `harvestTrigger()` + * for more details.) + * + * This may only be called by governance or the strategist. + * @param _delay The minimum number of seconds to wait between harvests. + */ + function setMinReportDelay(uint256 _delay) external onlyAuthorized { + minReportDelay = _delay; + emit UpdatedMinReportDelay(_delay); + } + + /** + * @notice + * Used to change `maxReportDelay`. `maxReportDelay` is the maximum number + * of blocks that should pass for `harvest()` to be called. + * + * For external keepers (such as the Keep3r network), this is the maximum + * time between jobs to wait. (see `harvestTrigger()` + * for more details.) + * + * This may only be called by governance or the strategist. + * @param _delay The maximum number of seconds to wait between harvests. + */ + function setMaxReportDelay(uint256 _delay) external onlyAuthorized { + maxReportDelay = _delay; + emit UpdatedMaxReportDelay(_delay); + } + + /** + * @notice + * Used to change `profitFactor`. `profitFactor` is used to determine + * if it's worthwhile to harvest, given gas costs. (See `harvestTrigger()` + * for more details.) + * + * This may only be called by governance or the strategist. + * @param _profitFactor A ratio to multiply anticipated + * `harvest()` gas cost against. + */ + function setProfitFactor(uint256 _profitFactor) external onlyAuthorized { + profitFactor = _profitFactor; + emit UpdatedProfitFactor(_profitFactor); + } + + /** + * @notice + * Sets how far the Strategy can go into loss without a harvest and report + * being required. + * + * By default this is 0, meaning any losses would cause a harvest which + * will subsequently report the loss to the Vault for tracking. (See + * `harvestTrigger()` for more details.) + * + * This may only be called by governance or the strategist. + * @param _debtThreshold How big of a loss this Strategy may carry without + * being required to report to the Vault. + */ + function setDebtThreshold(uint256 _debtThreshold) external onlyAuthorized { + debtThreshold = _debtThreshold; + emit UpdatedDebtThreshold(_debtThreshold); + } + + /** + * @notice + * Used to change `metadataURI`. `metadataURI` is used to store the URI + * of the file describing the strategy. + * + * This may only be called by governance or the strategist. + * @param _metadataURI The URI that describe the strategy. + */ + function setMetadataURI(string calldata _metadataURI) external onlyAuthorized { + metadataURI = _metadataURI; + emit UpdatedMetadataURI(_metadataURI); + } + + /** + * Resolve governance address from Vault contract, used to make assertions + * on protected functions in the Strategy. + */ + function governance() internal view returns (address) { + return vault.governance(); + } + + /** + * @notice + * Provide an accurate conversion from `_amtInWei` (denominated in wei) + * to `want` (using the native decimal characteristics of `want`). + * @dev + * Care must be taken when working with decimals to assure that the conversion + * is compatible. As an example: + * + * given 1e17 wei (0.1 ETH) as input, and want is USDC (6 decimals), + * with USDC/ETH = 1800, this should give back 1800000000 (180 USDC) + * + * @param _amtInWei The amount (in wei/1e-18 ETH) to convert to `want` + * @return The amount in `want` of `_amtInEth` converted to `want` + **/ + function ethToWant(uint256 _amtInWei) public view virtual returns (uint256); + + /** + * @notice + * Provide an accurate estimate for the total amount of assets + * (principle + return) that this Strategy is currently managing, + * denominated in terms of `want` tokens. + * + * This total should be "realizable" e.g. the total value that could + * *actually* be obtained from this Strategy if it were to divest its + * entire position based on current on-chain conditions. + * @dev + * Care must be taken in using this function, since it relies on external + * systems, which could be manipulated by the attacker to give an inflated + * (or reduced) value produced by this function, based on current on-chain + * conditions (e.g. this function is possible to influence through + * flashloan attacks, oracle manipulations, or other DeFi attack + * mechanisms). + * + * It is up to governance to use this function to correctly order this + * Strategy relative to its peers in the withdrawal queue to minimize + * losses for the Vault based on sudden withdrawals. This value should be + * higher than the total debt of the Strategy and higher than its expected + * value to be "safe". + * @return The estimated total assets in this Strategy. + */ + function estimatedTotalAssets() public view virtual returns (uint256); + + /* + * @notice + * Provide an indication of whether this strategy is currently "active" + * in that it is managing an active position, or will manage a position in + * the future. This should correlate to `harvest()` activity, so that Harvest + * events can be tracked externally by indexing agents. + * @return True if the strategy is actively managing a position. + */ + function isActive() public view returns (bool) { + return vault.strategies(address(this)).debtRatio > 0 || estimatedTotalAssets() > 0; + } + + /** + * Perform any Strategy unwinding or other calls necessary to capture the + * "free return" this Strategy has generated since the last time its core + * position(s) were adjusted. Examples include unwrapping extra rewards. + * This call is only used during "normal operation" of a Strategy, and + * should be optimized to minimize losses as much as possible. + * + * This method returns any realized profits and/or realized losses + * incurred, and should return the total amounts of profits/losses/debt + * payments (in `want` tokens) for the Vault's accounting (e.g. + * `want.balanceOf(this) >= _debtPayment + _profit`). + * + * `_debtOutstanding` will be 0 if the Strategy is not past the configured + * debt limit, otherwise its value will be how far past the debt limit + * the Strategy is. The Strategy's debt limit is configured in the Vault. + * + * NOTE: `_debtPayment` should be less than or equal to `_debtOutstanding`. + * It is okay for it to be less than `_debtOutstanding`, as that + * should only used as a guide for how much is left to pay back. + * Payments should be made to minimize loss from slippage, debt, + * withdrawal fees, etc. + * + * See `vault.debtOutstanding()`. + */ + function prepareReturn(uint256 _debtOutstanding) + internal + virtual + returns ( + uint256 _profit, + uint256 _loss, + uint256 _debtPayment + ); + + /** + * Perform any adjustments to the core position(s) of this Strategy given + * what change the Vault made in the "investable capital" available to the + * Strategy. Note that all "free capital" in the Strategy after the report + * was made is available for reinvestment. Also note that this number + * could be 0, and you should handle that scenario accordingly. + * + * See comments regarding `_debtOutstanding` on `prepareReturn()`. + */ + function adjustPosition(uint256 _debtOutstanding) internal virtual; + + /** + * Liquidate up to `_amountNeeded` of `want` of this strategy's positions, + * irregardless of slippage. Any excess will be re-invested with `adjustPosition()`. + * This function should return the amount of `want` tokens made available by the + * liquidation. If there is a difference between them, `_loss` indicates whether the + * difference is due to a realized loss, or if there is some other sitution at play + * (e.g. locked funds) where the amount made available is less than what is needed. + * + * NOTE: The invariant `_liquidatedAmount + _loss <= _amountNeeded` should always be maintained + */ + function liquidatePosition(uint256 _amountNeeded) internal virtual returns (uint256 _liquidatedAmount, uint256 _loss); + + /** + * Liquidate everything and returns the amount that got freed. + * This function is used during emergency exit instead of `prepareReturn()` to + * liquidate all of the Strategy's positions back to the Vault. + */ + + function liquidateAllPositions() internal virtual returns (uint256 _amountFreed); + + /** + * @notice + * Provide a signal to the keeper that `tend()` should be called. The + * keeper will provide the estimated gas cost that they would pay to call + * `tend()`, and this function should use that estimate to make a + * determination if calling it is "worth it" for the keeper. This is not + * the only consideration into issuing this trigger, for example if the + * position would be negatively affected if `tend()` is not called + * shortly, then this can return `true` even if the keeper might be + * "at a loss" (keepers are always reimbursed by Yearn). + * @dev + * `callCostInWei` must be priced in terms of `wei` (1e-18 ETH). + * + * This call and `harvestTrigger()` should never return `true` at the same + * time. + * @param callCostInWei The keeper's estimated gas cost to call `tend()` (in wei). + * @return `true` if `tend()` should be called, `false` otherwise. + */ + function tendTrigger(uint256 callCostInWei) public view virtual returns (bool) { + // We usually don't need tend, but if there are positions that need + // active maintainence, overriding this function is how you would + // signal for that. + // If your implementation uses the cost of the call in want, you can + // use uint256 callCost = ethToWant(callCostInWei); + + return false; + } + + /** + * @notice + * Adjust the Strategy's position. The purpose of tending isn't to + * realize gains, but to maximize yield by reinvesting any returns. + * + * See comments on `adjustPosition()`. + * + * This may only be called by governance, the strategist, or the keeper. + */ + function tend() external onlyKeepers { + // Don't take profits with this call, but adjust for better gains + adjustPosition(vault.debtOutstanding()); + } + + /** + * @notice + * Provide a signal to the keeper that `harvest()` should be called. The + * keeper will provide the estimated gas cost that they would pay to call + * `harvest()`, and this function should use that estimate to make a + * determination if calling it is "worth it" for the keeper. This is not + * the only consideration into issuing this trigger, for example if the + * position would be negatively affected if `harvest()` is not called + * shortly, then this can return `true` even if the keeper might be "at a + * loss" (keepers are always reimbursed by Yearn). + * @dev + * `callCostInWei` must be priced in terms of `wei` (1e-18 ETH). + * + * This call and `tendTrigger` should never return `true` at the + * same time. + * + * See `min/maxReportDelay`, `profitFactor`, `debtThreshold` to adjust the + * strategist-controlled parameters that will influence whether this call + * returns `true` or not. These parameters will be used in conjunction + * with the parameters reported to the Vault (see `params`) to determine + * if calling `harvest()` is merited. + * + * It is expected that an external system will check `harvestTrigger()`. + * This could be a script run off a desktop or cloud bot (e.g. + * https://github.com/iearn-finance/yearn-vaults/blob/main/scripts/keep.py), + * or via an integration with the Keep3r network (e.g. + * https://github.com/Macarse/GenericKeep3rV2/blob/master/contracts/keep3r/GenericKeep3rV2.sol). + * @param callCostInWei The keeper's estimated gas cost to call `harvest()` (in wei). + * @return `true` if `harvest()` should be called, `false` otherwise. + */ + function harvestTrigger(uint256 callCostInWei) public view virtual returns (bool) { + uint256 callCost = ethToWant(callCostInWei); + StrategyParams memory params = vault.strategies(address(this)); + + // Should not trigger if Strategy is not activated + if (params.activation == 0) return false; + + // Should not trigger if we haven't waited long enough since previous harvest + if (block.timestamp - params.lastReport < minReportDelay) return false; + + // Should trigger if hasn't been called in a while + if (block.timestamp - params.lastReport >= maxReportDelay) return true; + + // If some amount is owed, pay it back + // NOTE: Since debt is based on deposits, it makes sense to guard against large + // changes to the value from triggering a harvest directly through user + // behavior. This should ensure reasonable resistance to manipulation + // from user-initiated withdrawals as the outstanding debt fluctuates. + uint256 outstanding = vault.debtOutstanding(); + if (outstanding > debtThreshold) return true; + + // Check for profits and losses + uint256 total = estimatedTotalAssets(); + // Trigger if we have a loss to report + if (total + debtThreshold < params.totalDebt) return true; + + uint256 profit = 0; + if (total > params.totalDebt) profit = total - params.totalDebt; // We've earned a profit! + + // Otherwise, only trigger if it "makes sense" economically (gas cost + // is debtOutstanding) { + profit = amountFreed - debtOutstanding; + } + debtPayment = debtOutstanding - loss; + } else { + // Free up returns for Vault to pull + (profit, loss, debtPayment) = prepareReturn(debtOutstanding); + } + + // Allow Vault to take up to the "harvested" balance of this contract, + // which is the amount it has earned since the last time it reported to + // the Vault. + uint256 totalDebt = vault.strategies(address(this)).totalDebt; + debtOutstanding = vault.report(profit, loss, debtPayment); + + // Check if free returns are left, and re-invest them + adjustPosition(debtOutstanding); + + // call healthCheck contract + if (doHealthCheck && healthCheck != address(0)) { + require(HealthCheck(healthCheck).check(profit, loss, debtPayment, debtOutstanding, totalDebt), "!healthcheck"); + } else { + doHealthCheck = true; + } + + emit Harvested(profit, loss, debtPayment, debtOutstanding); + } + + /** + * @notice + * Withdraws `_amountNeeded` to `vault`. + * + * This may only be called by the Vault. + * @param _amountNeeded How much `want` to withdraw. + * @return _loss Any realized losses + */ + function withdraw(uint256 _amountNeeded) external returns (uint256 _loss) { + require(msg.sender == address(vault), "!vault"); + // Liquidate as much as possible to `want`, up to `_amountNeeded` + uint256 amountFreed; + (amountFreed, _loss) = liquidatePosition(_amountNeeded); + // Send it directly back (NOTE: Using `msg.sender` saves some gas here) + want.safeTransfer(msg.sender, amountFreed); + // NOTE: Reinvest anything leftover on next `tend`/`harvest` + } + + /** + * Do anything necessary to prepare this Strategy for migration, such as + * transferring any reserve or LP tokens, CDPs, or other tokens or stores of + * value. + */ + function prepareMigration(address _newStrategy) internal virtual; + + /** + * @notice + * Transfers all `want` from this Strategy to `_newStrategy`. + * + * This may only be called by the Vault. + * @dev + * The new Strategy's Vault must be the same as this Strategy's Vault. + * The migration process should be carefully performed to make sure all + * the assets are migrated to the new address, which should have never + * interacted with the vault before. + * @param _newStrategy The Strategy to migrate to. + */ + function migrate(address _newStrategy) external { + require(msg.sender == address(vault)); + require(BaseStrategy(_newStrategy).vault() == vault); + prepareMigration(_newStrategy); + want.safeTransfer(_newStrategy, want.balanceOf(address(this))); + } + + /** + * @notice + * Activates emergency exit. Once activated, the Strategy will exit its + * position upon the next harvest, depositing all funds into the Vault as + * quickly as is reasonable given on-chain conditions. + * + * This may only be called by governance or the strategist. + * @dev + * See `vault.setEmergencyShutdown()` and `harvest()` for further details. + */ + function setEmergencyExit() external onlyEmergencyAuthorized { + emergencyExit = true; + vault.revokeStrategy(); + + emit EmergencyExitEnabled(); + } + + /** + * Override this to add all tokens/tokenized positions this contract + * manages on a *persistent* basis (e.g. not just for swapping back to + * want ephemerally). + * + * NOTE: Do *not* include `want`, already included in `sweep` below. + * + * Example: + * ``` + * function protectedTokens() internal override view returns (address[] memory) { + * address[] memory protected = new address[](3); + * protected[0] = tokenA; + * protected[1] = tokenB; + * protected[2] = tokenC; + * return protected; + * } + * ``` + */ + function protectedTokens() internal view virtual returns (address[] memory); + + /** + * @notice + * Removes tokens from this Strategy that are not the type of tokens + * managed by this Strategy. This may be used in case of accidentally + * sending the wrong kind of token to this Strategy. + * + * Tokens will be sent to `governance()`. + * + * This will fail if an attempt is made to sweep `want`, or any tokens + * that are protected by this Strategy. + * + * This may only be called by governance. + * @dev + * Implement `protectedTokens()` to specify any additional tokens that + * should be protected from sweeping in addition to `want`. + * @param _token The token to transfer out of this vault. + */ + function sweep(address _token) external onlyGovernance { + require(_token != address(want), "!want"); + require(_token != address(vault), "!shares"); + + address[] memory _protectedTokens = protectedTokens(); + for (uint256 i; i < _protectedTokens.length; i++) require(_token != _protectedTokens[i], "!protected"); + + IERC20(_token).safeTransfer(governance(), IERC20(_token).balanceOf(address(this))); + } +} + +abstract contract BaseStrategyInitializable is BaseStrategy { + bool public isOriginal = true; + event Cloned(address indexed clone); + + constructor(address _vault) BaseStrategy(_vault) {} + + function initialize( + address _vault, + address _strategist, + address _rewards, + address _keeper + ) external virtual { + _initialize(_vault, _strategist, _rewards, _keeper); + } + + function clone(address _vault) external returns (address) { + require(isOriginal, "!clone"); + return this.clone(_vault, msg.sender, msg.sender, msg.sender); + } + + function clone( + address _vault, + address _strategist, + address _rewards, + address _keeper + ) external returns (address newStrategy) { + // Copied from https://github.com/optionality/clone-factory/blob/master/contracts/CloneFactory.sol + bytes20 addressBytes = bytes20(address(this)); + + assembly { + // EIP-1167 bytecode + let clone_code := mload(0x40) + mstore(clone_code, 0x3d602d80600a3d3981f3363d3d373d3d3d363d73000000000000000000000000) + mstore(add(clone_code, 0x14), addressBytes) + mstore(add(clone_code, 0x28), 0x5af43d82803e903d91602b57fd5bf30000000000000000000000000000000000) + newStrategy := create(0, clone_code, 0x37) + } + + BaseStrategyInitializable(newStrategy).initialize(_vault, _strategist, _rewards, _keeper); + + emit Cloned(newStrategy); + } +} + +// File: Simulate.sol + +/// @title Library for simulating swaps. +/// @notice By fully replicating the swap logic, we can make a static call to get a quote. +library Simulate { + using SafeCast for uint256; + + struct Cache { + // price at the beginning of the swap + uint160 sqrtPriceX96Start; + // tick at the beginning of the swap + int24 tickStart; + // liquidity at the beginning of the swap + uint128 liquidityStart; + // the lp fee of the pool + uint24 fee; + // the tick spacing of the pool + int24 tickSpacing; + } + + struct State { + // the amount remaining to be swapped in/out of the input/output asset + int256 amountSpecifiedRemaining; + // the amount already swapped out/in of the output/input asset + int256 amountCalculated; + // current sqrt(price) + uint160 sqrtPriceX96; + // the tick associated with the current price + int24 tick; + // the current liquidity in range + uint128 liquidity; + } + + // copied from UniswapV3Pool to avoid pragma issues associated with importing it + struct StepComputations { + // the price at the beginning of the step + uint160 sqrtPriceStartX96; + // the next tick to swap to from the current tick in the swap direction + int24 tickNext; + // whether tickNext is initialized or not + bool initialized; + // sqrt(price) for the next tick (1/0) + uint160 sqrtPriceNextX96; + // how much is being swapped in in this step + uint256 amountIn; + // how much is being swapped out + uint256 amountOut; + // how much fee is being paid in + uint256 feeAmount; + } + + function simulateSwap( + IUniswapV3Pool pool, + bool zeroForOne, + int256 amountSpecified, + uint160 sqrtPriceLimitX96 + ) internal view returns (int256 amount0, int256 amount1) { + require(amountSpecified != 0, 'AS'); + + (uint160 sqrtPriceX96, int24 tick, , , , , ) = pool.slot0(); + + require( + zeroForOne + ? sqrtPriceLimitX96 < sqrtPriceX96 && sqrtPriceLimitX96 > TickMath.MIN_SQRT_RATIO + : sqrtPriceLimitX96 > sqrtPriceX96 && sqrtPriceLimitX96 < TickMath.MAX_SQRT_RATIO, + 'SPL' + ); + + Cache memory cache = Cache({ + sqrtPriceX96Start: sqrtPriceX96, + tickStart: tick, + liquidityStart: pool.liquidity(), + fee: pool.fee(), + tickSpacing: pool.tickSpacing() + }); + + bool exactInput = amountSpecified > 0; + + State memory state = State({ + amountSpecifiedRemaining: amountSpecified, + amountCalculated: 0, + sqrtPriceX96: cache.sqrtPriceX96Start, + tick: cache.tickStart, + liquidity: cache.liquidityStart + }); + + while (state.amountSpecifiedRemaining != 0 && state.sqrtPriceX96 != sqrtPriceLimitX96) { + StepComputations memory step; + + step.sqrtPriceStartX96 = state.sqrtPriceX96; + + (step.tickNext, step.initialized) = nextInitializedTickWithinOneWord( + pool.tickBitmap, + state.tick, + cache.tickSpacing, + zeroForOne + ); + + if (step.tickNext < TickMath.MIN_TICK) { + step.tickNext = TickMath.MIN_TICK; + } else if (step.tickNext > TickMath.MAX_TICK) { + step.tickNext = TickMath.MAX_TICK; + } + + step.sqrtPriceNextX96 = TickMath.getSqrtRatioAtTick(step.tickNext); + + (state.sqrtPriceX96, step.amountIn, step.amountOut, step.feeAmount) = SwapMath.computeSwapStep( + state.sqrtPriceX96, + (zeroForOne ? step.sqrtPriceNextX96 < sqrtPriceLimitX96 : step.sqrtPriceNextX96 > sqrtPriceLimitX96) + ? sqrtPriceLimitX96 + : step.sqrtPriceNextX96, + state.liquidity, + state.amountSpecifiedRemaining, + cache.fee + ); + + if (exactInput) { + unchecked { + state.amountSpecifiedRemaining -= (step.amountIn + step.feeAmount).toInt256(); + } + state.amountCalculated -= step.amountOut.toInt256(); + } else { + unchecked { + state.amountSpecifiedRemaining += step.amountOut.toInt256(); + } + state.amountCalculated += (step.amountIn + step.feeAmount).toInt256(); + } + + if (state.sqrtPriceX96 == step.sqrtPriceNextX96) { + if (step.initialized) { + (, int128 liquidityNet, , , , , , ) = pool.ticks(step.tickNext); + unchecked { + if (zeroForOne) liquidityNet = -liquidityNet; + } + + state.liquidity = liquidityNet < 0 + ? state.liquidity - uint128(-liquidityNet) + : state.liquidity + uint128(liquidityNet); + } + + unchecked { + state.tick = zeroForOne ? step.tickNext - 1 : step.tickNext; + } + } else if (state.sqrtPriceX96 != step.sqrtPriceStartX96) { + // recompute unless we're on a lower tick boundary (i.e. already transitioned ticks), and haven't moved + state.tick = TickMath.getTickAtSqrtRatio(state.sqrtPriceX96); + } + } + + (amount0, amount1) = zeroForOne == exactInput + ? (amountSpecified - state.amountSpecifiedRemaining, state.amountCalculated) + : (state.amountCalculated, amountSpecified - state.amountSpecifiedRemaining); + } + + // This function replicates TickBitmap, but accepts a function pointer argument. + // It's private because it's messy, and shouldn't be re-used. + function nextInitializedTickWithinOneWord( + function(int16) external view returns (uint256) self, + int24 tick, + int24 tickSpacing, + bool lte + ) private view returns (int24 next, bool initialized) { + unchecked { + int24 compressed = tick / tickSpacing; + if (tick < 0 && tick % tickSpacing != 0) compressed--; // round towards negative infinity + + if (lte) { + (int16 wordPos, uint8 bitPos) = TickBitmap.position(compressed); + // all the 1s at or to the right of the current bitPos + uint256 mask = (1 << bitPos) - 1 + (1 << bitPos); + uint256 masked = self(wordPos) & mask; + + // if there are no initialized ticks to the right of or at the current tick, return rightmost in the word + initialized = masked != 0; + // overflow/underflow is possible, but prevented externally by limiting both tickSpacing and tick + next = initialized + ? (compressed - int24(uint24(bitPos - BitMath.mostSignificantBit(masked)))) * tickSpacing + : (compressed - int24(uint24(bitPos))) * tickSpacing; + } else { + // start from the word of the next tick, since the current tick state doesn't matter + (int16 wordPos, uint8 bitPos) = TickBitmap.position(compressed + 1); + // all the 1s at or to the left of the bitPos + uint256 mask = ~((1 << bitPos) - 1); + uint256 masked = self(wordPos) & mask; + + // if there are no initialized ticks to the left of the current tick, return leftmost in the word + initialized = masked != 0; + // overflow/underflow is possible, but prevented externally by limiting both tickSpacing and tick + next = initialized + ? (compressed + 1 + int24(uint24(BitMath.leastSignificantBit(masked) - bitPos))) * tickSpacing + : (compressed + 1 + int24(uint24(type(uint8).max - bitPos))) * tickSpacing; + } + } + } +} + +// File: Joint.sol + +interface ProviderStrategy { + function vault() external view returns (VaultAPI); + + function strategist() external view returns (address); + + function keeper() external view returns (address); + + function want() external view returns (address); + + function totalDebt() external view returns (uint256); +} + +abstract contract Joint { + using SafeERC20 for IERC20; + using Address for address; + // Constant to use in ratio calculations + uint256 internal constant RATIO_PRECISION = 1e18; + // Provider strategy of tokenA + ProviderStrategy public providerA; + // Provider strategy of tokenB + ProviderStrategy public providerB; + + // Address of tokenA + address public tokenA; + // Address of tokenB + address public tokenB; + + // Reference token to use in swaps: WETH, WFTM... + address public referenceToken; + // Array containing reward tokens + address[] public rewardTokens; + + // Address of the pool to LP + address public pool; + + // Amounts that actually go into the LP position + uint256 public investedA; + uint256 public investedB; + + // Boolean values protecting against re-investing into the pool + bool public dontInvestWant; + bool public autoProtectionDisabled; + + // Thresholds to operate the strat + uint256 public minAmountToSell; + uint256 public maxPercentageLoss; + uint256 public minRewardToHarvest; + + // Modifiers needed for access control normally inherited from BaseStrategy + modifier onlyGovernance() { + checkGovernance(); + _; + } + + modifier onlyVaultManagers() { + checkVaultManagers(); + _; + } + + modifier onlyProviders() { + checkProvider(); + _; + } + + modifier onlyKeepers() { + checkKeepers(); + _; + } + + function checkKeepers() internal { + require(isKeeper() || isGovernance() || isVaultManager()); + } + + function checkGovernance() internal { + require(isGovernance()); + } + + function checkVaultManagers() internal { + require(isGovernance() || isVaultManager()); + } + + function checkProvider() internal { + require(isProvider()); + } + + function isGovernance() internal view returns (bool) { + return + msg.sender == providerA.vault().governance() || + msg.sender == providerB.vault().governance(); + } + + function isVaultManager() internal view returns (bool) { + return + msg.sender == providerA.vault().management() || + msg.sender == providerB.vault().management(); + } + + function isKeeper() internal view returns (bool) { + return + (msg.sender == providerA.keeper()) || + (msg.sender == providerB.keeper()); + } + + function isProvider() internal view returns (bool) { + return + msg.sender == address(providerA) || + msg.sender == address(providerB); + } + + /* + * @notice + * Constructor, only called during original deploy + * @param _providerA, provider strategy of tokenA + * @param _providerB, provider strategy of tokenB + * @param _referenceToken, token to use as reference, for pricing oracles and paying hedging costs (if any) + * @param _pool, Pool to LP + */ + constructor( + address _providerA, + address _providerB, + address _referenceToken, + address _pool + ) { + _initialize(_providerA, _providerB, _referenceToken, _pool); + } + + /* + * @notice + * Constructor equivalent for clones, initializing the joint and the specifics of UniV3Joint + * @param _providerA, provider strategy of tokenA + * @param _providerB, provider strategy of tokenB + * @param _referenceToken, token to use as reference, for pricing oracles and paying hedging costs (if any) + * @param _pool, Pool to LP + */ + function _initialize( + address _providerA, + address _providerB, + address _referenceToken, + address _pool + ) internal virtual { + require(address(providerA) == address(0), "Joint already initialized"); + providerA = ProviderStrategy(_providerA); + providerB = ProviderStrategy(_providerB); + referenceToken = _referenceToken; + pool = _pool; + + // NOTE: we let some loss to avoid getting locked in the position if something goes slightly wrong + maxPercentageLoss = RATIO_PRECISION / 1_000; // 0.10% + + tokenA = address(providerA.want()); + tokenB = address(providerB.want()); + require(tokenA != tokenB, "!same-want"); + } + + function name() external view virtual returns (string memory); + + function shouldEndEpoch() external view virtual returns (bool); + + function _autoProtect() internal view virtual returns (bool); + + /* + * @notice + * Check wether a token address is part of rewards or not + * @param token, token address to check + * @return wether the provided token address is a reward for the strar or not + */ + function _isReward(address token) internal view returns (bool) { + for (uint256 i = 0; i < rewardTokens.length; i++) { + if (rewardTokens[i] == token) { + return true; + } + } + + return false; + } + + /* + * @notice + * Function used in harvestTrigger in providers to decide wether an epoch can be started or not: + * - if there is balance of tokens but no position open, return true + * @return wether to start a new epoch or not + */ + function shouldStartEpoch() external view returns (bool) { + // return true if we have balance of A or balance of B while the position is closed + return + (balanceOfA() > 0 || balanceOfB() > 0) && + investedA == 0 && + investedB == 0; + } + + /* + * @notice + * Function available for vault managers to set the boolean value deciding wether + * to re-invest into the LP or not + * @param _dontInvestWant, new booelan value to use + */ + function setDontInvestWant(bool _dontInvestWant) + external + onlyVaultManagers + { + dontInvestWant = _dontInvestWant; + } + + /* + * @notice + * Function available for vault managers to set the minimum reward to harvest + * @param _minRewardToHarvest, new value to use + */ + function setMinRewardToHarvest(uint256 _minRewardToHarvest) + external + onlyVaultManagers + { + minRewardToHarvest = _minRewardToHarvest; + } + + /* + * @notice + * Function available for vault managers to set the minimum amount to sell + * @param _minAmountToSell, new value to use + */ + function setMinAmountToSell(uint256 _minAmountToSell) + external + onlyVaultManagers + { + minAmountToSell = _minAmountToSell; + } + + /* + * @notice + * Function available for vault managers to set the auto protection + * @param _autoProtectionDisabled, new value to use + */ + function setAutoProtectionDisabled(bool _autoProtectionDisabled) + external + onlyVaultManagers + { + autoProtectionDisabled = _autoProtectionDisabled; + } + + /* + * @notice + * Function available for vault managers to set the maximum allowed loss + * @param _maxPercentageLoss, new value to use + */ + function setMaxPercentageLoss(uint256 _maxPercentageLoss) + external + onlyVaultManagers + { + require(_maxPercentageLoss <= RATIO_PRECISION); + maxPercentageLoss = _maxPercentageLoss; + } + + /* + * @notice + * Function available for providers to close the joint position and return the funds to each + * provider strategy + */ + function closePositionReturnFunds() external onlyProviders { + // Check if it needs to stop starting new epochs after finishing this one. + // _autoProtect is implemented in children + if (_autoProtect() && !autoProtectionDisabled) { + dontInvestWant = true; + } + + // Check that we have a position to close + if (investedA == 0 || investedB == 0) { + return; + } + + // 1. CLOSE LIQUIDITY POSITION + // Closing the position will: + // - Remove liquidity from DEX + // - Claim pending rewards + // - Close Hedge and receive payoff + // and returns current balance of tokenA and tokenB + (uint256 currentBalanceA, uint256 currentBalanceB) = _closePosition(); + + // 2. SELL REWARDS FOR WANT + (uint256 rewardsSwappedToA, uint256 rewardsSwappedToB) = swapRewardTokens(); + currentBalanceA += rewardsSwappedToA; + currentBalanceB += rewardsSwappedToB; + + // 3. REBALANCE PORTFOLIO + // Calculate rebalance operation + // It will return which of the tokens (A or B) we need to sell and how much of it + // to leave the position with the initial proportions + (address sellToken, uint256 sellAmount) = calculateSellToBalance( + currentBalanceA, + currentBalanceB, + investedA, + investedB + ); + // Perform the swap to balance the tokens + if (sellToken != address(0) && sellAmount > minAmountToSell) { + uint256 buyAmount = swap( + sellToken, + sellToken == tokenA ? tokenB : tokenA, + sellAmount, + 0 + ); + } + + // reset invested balances + investedA = investedB = 0; + + _returnLooseToProviders(); + // Check that we have returned with no losses + + require( + IERC20(tokenA).balanceOf(address(providerA)) >= + (providerA.totalDebt() * + (RATIO_PRECISION - maxPercentageLoss)) / + RATIO_PRECISION, + "!wrong-balanceA" + ); + require( + IERC20(tokenB).balanceOf(address(providerB)) >= + (providerB.totalDebt() * + (RATIO_PRECISION - maxPercentageLoss)) / + RATIO_PRECISION, + "!wrong-balanceB" + ); + } + + /* + * @notice + * Function available for providers to open the joint position: + * - open the LP position + * - open the hedginf position if necessary + * - deposit the LPs if necessary + */ + function openPosition() external onlyProviders { + // No capital, nothing to do + if (balanceOfA() == 0 || balanceOfB() == 0) { + return; + } + + require( + balanceOfStake() == 0 && + balanceOfPool() == 0 && + investedA == 0 && + investedB == 0 + ); // don't create LP if we are already invested + + // Open the LP position + (uint256 amountA, uint256 amountB) = createLP(); + // Open hedge + (uint256 costHedgeA, uint256 costHedgeB) = hedgeLP(); + + // Set invested amounts + investedA = amountA + costHedgeA; + investedB = amountB + costHedgeB; + + // Deposit LPs (if any) + depositLP(); + + // If there is loose balance, return it + if (balanceOfStake() != 0 || balanceOfPool() != 0) { + _returnLooseToProviders(); + } + } + + // Keepers will claim and sell rewards mid-epoch (otherwise we sell only in the end) + function harvest() external virtual onlyKeepers { + getReward(); + } + + function harvestTrigger(uint256 callCost) external view virtual returns (bool) { + return balanceOfRewardToken()[0] > minRewardToHarvest; + } + + function getHedgeProfit() public view virtual returns (uint256, uint256); + + /* + * @notice + * Function estimating the current assets in the joint, taking into account: + * - current balance of tokens in the LP + * - pending rewards from the LP (if any) + * - hedge profit (if any) + * - rebalancing of tokens to maintain token ratios + * @return _aBalance, _bBalance, estimated tokenA and tokenB balances + */ + function estimatedTotalAssetsAfterBalance() + public + view + returns (uint256 _aBalance, uint256 _bBalance) + { + // Current status of tokens in LP (includes potential IL) + (_aBalance, _bBalance) = balanceOfTokensInLP(); + + // Add remaining balance in joint (if any) + _aBalance = _aBalance + balanceOfA(); + _bBalance = _bBalance + balanceOfB(); + + // Include hedge payoffs + (uint256 callProfit, uint256 putProfit) = getHedgeProfit(); + _aBalance = _aBalance + callProfit; + _bBalance = _bBalance + putProfit; + + // Include rewards (swapping them if not tokenA or tokenB) + uint256[] memory _rewardsPending = pendingRewards(); + for (uint256 i = 0; i < rewardTokens.length; i++) { + address reward = rewardTokens[i]; + if (reward == tokenA) { + _aBalance = _aBalance + _rewardsPending[i]; + } else if (reward == tokenB) { + _bBalance = _bBalance + _rewardsPending[i]; + } else if (_rewardsPending[i] != 0) { + address swapTo = findSwapTo(reward); + uint256 outAmount = quote( + reward, + swapTo, + _rewardsPending[i] + IERC20(reward).balanceOf(address(this)) + ); + if (swapTo == tokenA) { + _aBalance = _aBalance + outAmount; + } else if (swapTo == tokenB) { + _bBalance = _bBalance + outAmount; + } + } + } + + // Calculate rebalancing operation needed + (address sellToken, uint256 sellAmount) = calculateSellToBalance( + _aBalance, + _bBalance, + investedA, + investedB + ); + + // Update amounts with rebalancing operation + if (sellToken == tokenA) { + uint256 buyAmount = quote(sellToken, tokenB, sellAmount); + _aBalance = _aBalance - sellAmount; + _bBalance = _bBalance + buyAmount; + } else if (sellToken == tokenB) { + uint256 buyAmount = quote(sellToken, tokenA, sellAmount); + _bBalance = _bBalance - sellAmount; + _aBalance = _aBalance + buyAmount; + } + } + + /* + * @notice + * Function available internally calculating the necessary operation to rebalance + * the tokenA and tokenB balances to initial ratios + * @param currentA, current balance of tokenA + * @param currentB, current balance of tokenB + * @param startingA, initial balance of tokenA + * @param startingB, initial balance of tokenB + * @return _sellToken, address of the token needed to sell + * @return _sellAmount, amount needed to sell + */ + function calculateSellToBalance( + uint256 currentA, + uint256 currentB, + uint256 startingA, + uint256 startingB + ) internal view returns (address _sellToken, uint256 _sellAmount) { + // If no position, no calculation needed + if (startingA == 0 || startingB == 0) return (address(0), 0); + + // Get the current ratio between current and starting balance for each token + (uint256 ratioA, uint256 ratioB) = getRatios( + currentA, + currentB, + startingA, + startingB + ); + + // if already balanced, no action needed + if (ratioA == ratioB) return (address(0), 0); + + // If ratioA is higher, there is excess of tokenA + if (ratioA > ratioB) { + _sellToken = tokenA; + // Simulate the swap and assess the received amount + _sellAmount = _calculateSellToBalance( + _sellToken, + currentA, + currentB, + startingA, + startingB, + 10**uint256(IERC20Extended(tokenA).decimals()) + ); + } else { + // ratioB is higher, excess of tokenB + _sellToken = tokenB; + // Simulate the swap and assess the received amount + _sellAmount = _calculateSellToBalance( + _sellToken, + currentB, + currentA, + startingB, + startingA, + 10**uint256(IERC20Extended(tokenB).decimals()) + ); + } + } + + /* + * @notice + * Function available internally calculating and simulating the necessary swap to + * rebalance the tokens + * @param sellToken, address of the token to sell + * @param current0, current balance of token + * @param current1, current balance of other token + * @param starting0, initial balance of token + * @param starting1, initial balance of other token + * @param precision, constant value ensuring precision is preserved + * @return _sellAmount, amount needed to sell + */ + function _calculateSellToBalance( + address sellToken, + uint256 current0, + uint256 current1, + uint256 starting0, + uint256 starting1, + uint256 precision + ) internal view returns (uint256 _sellAmount) { + uint256 numerator = (current0 - ((starting0 * current1) / starting1)) * + precision; + uint256 exchangeRate = quote( + sellToken, + sellToken == tokenA ? tokenB : tokenA, + precision + ); + + // First time to approximate + _sellAmount = + numerator / + (precision + ((starting0 * exchangeRate) / starting1)); + // Shortcut to avoid Uniswap amountIn == 0 revert + if (_sellAmount == 0) { + return 0; + } + + // Second time to account for price impact + exchangeRate = + (quote( + sellToken, + sellToken == tokenA ? tokenB : tokenA, + _sellAmount + ) * precision) / + _sellAmount; + _sellAmount = + numerator / + (precision + ((starting0 * exchangeRate) / starting1)); + } + + /* + * @notice + * Function available publicly estimating the balance of one of the providers + * (one of the tokens). Re-uses the estimatedTotalAssetsAfterBalance function but oonly uses + * one the 2 returned values + * @param _provider, address of the provider of interest + * @return _balance, balance of the requested provider + */ + function estimatedTotalProviderAssets(address _provider) + public + view + returns (uint256 _balance) + { + if (_provider == address(providerA)) { + (_balance, ) = estimatedTotalAssetsAfterBalance(); + } else if (_provider == address(providerB)) { + (, _balance) = estimatedTotalAssetsAfterBalance(); + } + } + + function getHedgeBudget(address token) + public + view + virtual + returns (uint256); + + function hedgeLP() internal virtual returns (uint256, uint256); + + function closeHedge() internal virtual; + + /* + * @notice + * Function available publicly estimating the balancing ratios for the 2 tokens in the form: + * ratio = currentBalance / investedBalance + * @param currentA, current balance of tokenA + * @param currentB, current balance of tokenB + * @param startingA, initial balance of tokenA + * @param startingB, initial balance of tokenB + * @return _a, _b, ratios for tokenA and tokenB + */ + function getRatios( + uint256 currentA, + uint256 currentB, + uint256 startingA, + uint256 startingB + ) public pure returns (uint256 _a, uint256 _b) { + _a = (currentA * RATIO_PRECISION) / startingA; + _b = (currentB * RATIO_PRECISION) / startingB; + } + + function createLP() internal virtual returns (uint256, uint256); + + function burnLP(uint256 amount) internal virtual; + + /* + * @notice + * Function available internally deciding what to swap agaisnt the requested token: + * - if token is either tokenA or B, swap to the other + * - if token is not A or B but is a reward, swap to the reference token if it's + * either A or B, if not, swap to tokenA + * @param token, address of the token to swap from + * @return address of the token to swap to + */ + function findSwapTo(address from_token) internal view returns (address) { + if (tokenA == from_token) { + return tokenB; + } else if (tokenB == from_token) { + return tokenA; + } + if (tokenA == referenceToken || tokenB == referenceToken) { + return referenceToken; + } + return tokenA; + } + + /* + * @notice + * Function available internally deciding the swapping path to follow + * @param _token_in, address of the token to swap from + * @param _token_to, address of the token to swap to + * @return address array of the swap path to follow + */ + function getTokenOutPath(address _token_in, address _token_out) + internal + view + returns (address[] memory _path) + { + address _tokenA = tokenA; + address _tokenB = tokenB; + bool isReferenceToken = _token_in == address(referenceToken) || + _token_out == address(referenceToken); + bool is_internal = (_token_in == _tokenA && _token_out == _tokenB) || + (_token_in == _tokenB && _token_out == _tokenA); + _path = new address[](isReferenceToken || is_internal ? 2 : 3); + _path[0] = _token_in; + if (isReferenceToken || is_internal) { + _path[1] = _token_out; + } else { + _path[1] = address(referenceToken); + _path[2] = _token_out; + } + } + + function getReward() internal virtual; + + function depositLP() internal virtual {} + + function withdrawLP() internal virtual {} + + /* + * @notice + * Function available internally swapping amounts necessary to swap rewards + * @return amounts exchanged to tokenA and tokenB + */ + function swapRewardTokens() + internal + virtual + returns (uint256 swappedToA, uint256 swappedToB) + { + address _tokenA = tokenA; + address _tokenB = tokenB; + for (uint256 i = 0; i < rewardTokens.length; i++) { + address reward = rewardTokens[i]; + uint256 _rewardBal = IERC20(reward).balanceOf(address(this)); + // If the reward token is either A or B, don't swap + if (reward == _tokenA || reward == _tokenB || _rewardBal == 0) { + continue; + // If the referenceToken is either A or B, swap rewards against it + } else if (_tokenA == referenceToken) { + swappedToA += swap(reward, referenceToken, _rewardBal, 0); + } else if (_tokenB == referenceToken) { + swappedToB += swap(reward, referenceToken, _rewardBal, 0); + } else { + // Assume that position has already been liquidated + (uint256 ratioA, uint256 ratioB) = getRatios( + balanceOfA(), + balanceOfB(), + investedA, + investedB + ); + + if (ratioA >= ratioB) { + swappedToB += swap(reward, _tokenB, _rewardBal, 0); + } else { + swappedToA += swap(reward, _tokenA, _rewardBal, 0); + } + } + } + return (swappedToA, swappedToB); + } + + function swap( + address _tokenFrom, + address _tokenTo, + uint256 _amountIn, + uint256 _minOutAmount + ) internal virtual returns (uint256 _amountOut); + + function quote( + address _tokenFrom, + address _tokenTo, + uint256 _amountIn + ) internal view virtual returns (uint256 _amountOut); + + /* + * @notice + * Function available internally closing the joint postion: + * - withdraw LPs (if any) + * - close hedging position (if any) + * - close LP position + * @return balance of tokenA and tokenB + */ + function _closePosition() internal returns (uint256, uint256) { + // Unstake LP from staking contract + withdrawLP(); + + // Close the hedge + closeHedge(); + + if (balanceOfPool() == 0) { + return (0, 0); + } + + // **WARNING**: This call is sandwichable, care should be taken + // to always execute with a private relay + burnLP(balanceOfPool()); + + return (balanceOfA(), balanceOfB()); + } + + /* + * @notice + * Function available internally sending back all funds to provuder strategies + * @return balance of tokenA and tokenB + */ + function _returnLooseToProviders() + internal + returns (uint256 balanceA, uint256 balanceB) + { + balanceA = balanceOfA(); + if (balanceA > 0) { + IERC20(tokenA).safeTransfer(address(providerA), balanceA); + } + + balanceB = balanceOfB(); + if (balanceB > 0) { + IERC20(tokenB).safeTransfer(address(providerB), balanceB); + } + } + + /* + * @notice + * Function available publicly returning the joint's balance of tokenA + * @return balance of tokenA + */ + function balanceOfA() public view returns (uint256) { + return IERC20(tokenA).balanceOf(address(this)); + } + + /* + * @notice + * Function available publicly returning the joint's balance of tokenB + * @return balance of tokenB + */ + function balanceOfB() public view returns (uint256) { + return IERC20(tokenB).balanceOf(address(this)); + } + + function balanceOfPool() public view virtual returns (uint256); + + /* + * @notice + * Function available publicly returning the joint's balance of rewards + * @return array of balances + */ + function balanceOfRewardToken() public view returns (uint256[] memory) { + uint256[] memory _balances = new uint256[](rewardTokens.length); + for (uint8 i = 0; i < rewardTokens.length; i++) { + _balances[i] = IERC20(rewardTokens[i]).balanceOf(address(this)); + } + return _balances; + } + + function balanceOfStake() public view virtual returns (uint256 _balance) {} + + function balanceOfTokensInLP() + public + view + virtual + returns (uint256 _balanceA, uint256 _balanceB); + + function pendingRewards() public view virtual returns (uint256[] memory); + + // --- MANAGEMENT FUNCTIONS --- + /* + * @notice + * Function available to vault managers closing the joint position manually + * @param expectedBalanceA, expected balance of tokenA to receive + * @param expectedBalanceB, expected balance of tokenB to receive + */ + function liquidatePositionManually( + uint256 expectedBalanceA, + uint256 expectedBalanceB + ) external onlyVaultManagers { + (uint256 balanceA, uint256 balanceB) = _closePosition(); + require(expectedBalanceA <= balanceA, "!sandwidched"); + require(expectedBalanceB <= balanceB, "!sandwidched"); + } + + /* + * @notice + * Function available to vault managers returning the funds to the providers manually + */ + function returnLooseToProvidersManually() external onlyVaultManagers { + _returnLooseToProviders(); + } + + /* + * @notice + * Function available to vault managers closing the LP position manually + * @param expectedBalanceA, expected balance of tokenA to receive + * @param expectedBalanceB, expected balance of tokenB to receive + */ + function removeLiquidityManually( + uint256 amount, + uint256 expectedBalanceA, + uint256 expectedBalanceB + ) external virtual onlyVaultManagers { + burnLP(amount); + require(expectedBalanceA <= balanceOfA(), "!sandwidched"); + require(expectedBalanceB <= balanceOfB(), "!sandwidched"); + } + + function swapTokenForTokenManually( + bool sellA, + uint256 swapInAmount, + uint256 minOutAmount + ) external virtual returns (uint256); + + /* + * @notice + * Function available to governance sweeping a specified token but tokenA and B + * @param _token, address of the token to sweep + */ + function sweep(address _token) external onlyGovernance { + require(_token != address(tokenA)); + require(_token != address(tokenB)); + + SafeERC20.safeTransfer( + IERC20(_token), + providerA.vault().governance(), + IERC20(_token).balanceOf(address(this)) + ); + } + + /* + * @notice + * Function available to providers to change the provider addresses + * @param _newProvider, new address of provider + */ + function migrateProvider(address _newProvider) external onlyProviders { + ProviderStrategy newProvider = ProviderStrategy(_newProvider); + if (address(newProvider.want()) == tokenA) { + providerA = newProvider; + } else if (address(newProvider.want()) == tokenB) { + providerB = newProvider; + } else { + revert("Unsupported token"); + } + } + + /* + * @notice + * Internal function checking if allowance is already enough for the contract + * and if not, safely sets it to max + * @param _contract, spender contract + * @param _token, token to approve spend + * @param _amount, _amoun to approve + */ + function _checkAllowance( + address _contract, + IERC20 _token, + uint256 _amount + ) internal { + if (_token.allowance(address(this), _contract) < _amount) { + _token.safeApprove(_contract, 0); + _token.safeApprove(_contract, _amount); + } + } +} + +// File: UniswapHelperViews.sol + +/// @title Uniswap V3 necessary views for the strategy +library UniswapHelperViews { + using SafeCast for uint256; + using TickBitmapExtended for function(int16) + external + view + returns (uint256); + + error ZeroAmount(); + error InvalidSqrtPriceLimit(uint160 sqrtPriceLimitX96); + + IUniswapV3Factory public constant uniV3factory = IUniswapV3Factory(0x1F98431c8aD98523631AE4a59f267346ea31F984); + + uint256 public constant PRECISION = 1e18; + + function checkExistingPool( + address tokenA, + address tokenB, + uint24 feeTier, + address poolToCheck + ) external view returns(bool) { + if (uniV3factory.getPool(tokenA, tokenB, feeTier) == poolToCheck) { + return true; + } + return false; + } + + /// @notice Simulates a swap over an Uniswap V3 Pool, allowing to handle tick crosses. + /// @param v3Pool uniswap v3 pool address + /// @param zeroForOne direction of swap, true means swap zero for one + /// @param amountSpecified amount to swap in/out + /// @param sqrtPriceLimitX96 the maximum price to swap to, if this price is reached, then the swap is stopped partially + /// @return amount0 token0 amount + /// @return amount1 token1 amount + function simulateSwap( + address v3Pool, + bool zeroForOne, + int256 amountSpecified, + uint160 sqrtPriceLimitX96 + ) + external + view + returns ( + int256, int256 + ) + { + return Simulate.simulateSwap(IUniswapV3Pool(v3Pool), zeroForOne, amountSpecified, sqrtPriceLimitX96); + } + + struct feesEarnedParams { + address v3Pool; + uint128 liquidity; + int24 tickCurrent; + int24 tickLower; + int24 tickUpper; + uint256 feeGrowthGlobal0X128; + uint256 feeGrowthGlobal1X128; + uint256 feeGrowthInside0LastX128; + uint256 feeGrowthInside1LastX128; + } + + /// @notice Retrieves owed fee data for a specific position + /// @param _feesEarnedParams Custom struct containing: + /// - liquidity Position's liquidity + /// - tickCurrent The current tick + /// - tickLower The lower tick boundary of the position + /// - tickUpper The upper tick boundary of the position + /// - feeGrowthGlobal0X128 The all-time global fee growth, per unit of liquidity, in token0 + /// - feeGrowthGlobal1X128 The all-time global fee growth, per unit of liquidity, in token1 + /// - feeGrowthInside0X128 The all-time fee growth in token0, per unit of liquidity, inside the position's tick boundaries + /// - feeGrowthInside1X128 The all-time fee growth in token1, per unit of liquidity, inside the position's tick boundaries + function getFeesEarned( + feesEarnedParams memory _feesEarnedParams + ) internal view returns (uint128 tokensOwed0, uint128 tokensOwed1) { + uint256 feeGrowthBelow0X128; + uint256 feeGrowthBelow1X128; + IUniswapV3Pool _pool = IUniswapV3Pool(_feesEarnedParams.v3Pool); + (,,uint256 lower_feeGrowthOutside0X128, uint256 lower_feeGrowthOutside1X128,,,,) = _pool.ticks(_feesEarnedParams.tickLower); + (,,uint256 upper_feeGrowthOutside0X128, uint256 upper_feeGrowthOutside1X128,,,,) = _pool.ticks(_feesEarnedParams.tickUpper); + + if (_feesEarnedParams.tickCurrent >= _feesEarnedParams.tickLower) { + feeGrowthBelow0X128 = lower_feeGrowthOutside0X128; + feeGrowthBelow1X128 = lower_feeGrowthOutside1X128; + } else { + feeGrowthBelow0X128 = + _feesEarnedParams.feeGrowthGlobal0X128 - + lower_feeGrowthOutside0X128; + feeGrowthBelow1X128 = + _feesEarnedParams.feeGrowthGlobal1X128 - + lower_feeGrowthOutside1X128; + } + + // calculate fee growth above + uint256 feeGrowthAbove0X128; + uint256 feeGrowthAbove1X128; + if (_feesEarnedParams.tickCurrent < _feesEarnedParams.tickUpper) { + feeGrowthAbove0X128 = upper_feeGrowthOutside0X128; + feeGrowthAbove1X128 = upper_feeGrowthOutside1X128; + } else { + feeGrowthAbove0X128 = + _feesEarnedParams.feeGrowthGlobal0X128 - + upper_feeGrowthOutside0X128; + feeGrowthAbove1X128 = + _feesEarnedParams.feeGrowthGlobal1X128 - + upper_feeGrowthOutside1X128; + } + + uint256 feeGrowthInside0X128 = _feesEarnedParams.feeGrowthGlobal0X128 - + feeGrowthBelow0X128 - + feeGrowthAbove0X128; + uint256 feeGrowthInside1X128 = _feesEarnedParams.feeGrowthGlobal1X128 - + feeGrowthBelow1X128 - + feeGrowthAbove1X128; + + // calculate accumulated fees + tokensOwed0 = uint128( + FullMath.mulDiv( + feeGrowthInside0X128 - + _feesEarnedParams.feeGrowthInside0LastX128, + _feesEarnedParams.liquidity, + FixedPoint128.Q128 + ) + ); + tokensOwed1 = uint128( + FullMath.mulDiv( + feeGrowthInside1X128 - + _feesEarnedParams.feeGrowthInside1LastX128, + _feesEarnedParams.liquidity, + FixedPoint128.Q128 + ) + ); + } +} + +// File: NoHedgeJoint.sol + +abstract contract NoHedgeJoint is Joint { + constructor( + address _providerA, + address _providerB, + address _weth, + address _pool + ) Joint(_providerA, _providerB, _weth, _pool) {} + + function getHedgeBudget(address token) + public + view + override + returns (uint256) + { + return 0; + } + + function getTimeToMaturity() public view returns (uint256) { + return 0; + } + + function getHedgeProfit() public view override returns (uint256, uint256) { + return (0, 0); + } + + function hedgeLP() + internal + override + returns (uint256 costA, uint256 costB) + { + // NO HEDGE + return (0, 0); + } + + function closeHedge() internal override { + // NO HEDGE + return; + } + + // this function is called by Joint to see if it needs to stop initiating new epochs due to too high volatility + function _autoProtect() internal view override returns (bool) { + return false; + } +} + +// File: UniV3StablesJoint.sol + +// Import necessary libraries and interfaces: +// NoHedgeJoint to inherit from + +// Uni V3 pool functionality + +// CRV pool functionalities for swaps and quotes + +// Helper functions from Uni v3 + +// Liquidity calculations + +// Pool tick calculations + +// Safe casting and math + +interface IBaseFee { + function isCurrentBaseFeeAcceptable() external view returns (bool); +} + +contract UniV3StablesJoint is NoHedgeJoint { + using SafeERC20 for IERC20; + using SafeCast for uint256; + using SafeCast for int256; + + // Used for cloning, will automatically be set to false for other clones + bool public isOriginal = true; + // lower tick of the current LP position + int24 public minTick; + // upper tick of the current LP position + int24 public maxTick; + // # of ticks to go up&down from current price to open LP position + uint24 public ticksFromCurrent; + // fee tier of the pool + uint24 public feeTier; + // boolean variable deciding wether to swap in the uni v3 pool or using CRV + // this can make sense if the pool is unbalanced and price is far from CRV or if the + // liquidity remaining in the pool is not enough for the rebalancing swap the strategy needs + // to perform as the swap function from the uniV3 pool uses a while loop that would get stuck + // until we reach gas limit + bool public useCRVPool; + // CRV pool to use in case of useCRVPool = true + address public crvPool; + + /// @dev The minimum value that can be returned from #getSqrtRatioAtTick. Equivalent to getSqrtRatioAtTick(MIN_TICK) + uint160 internal constant MIN_SQRT_RATIO = 4295128739; + /// @dev The maximum value that can be returned from #getSqrtRatioAtTick. Equivalent to getSqrtRatioAtTick(MAX_TICK) + uint160 internal constant MAX_SQRT_RATIO = + 1461446703485210103287273052203988822378723970342; + + /* + * @notice + * Constructor, only called during original deploy + * @param _providerA, provider strategy of tokenA + * @param _providerB, provider strategy of tokenB + * @param _referenceToken, token to use as reference, for pricing oracles and paying hedging costs (if any) + * @param _pool, Uni V3 pool to LP + * @param _ticksFromCurrent, # of ticks up & down to provide liquidity into + */ + constructor( + address _providerA, + address _providerB, + address _referenceToken, + address _pool, + uint24 _ticksFromCurrent + ) NoHedgeJoint(_providerA, _providerB, _referenceToken, _pool) { + _initializeUniV3StablesJoint(_ticksFromCurrent); + } + + /* + * @notice + * Constructor equivalent for clones, initializing the joint and the specifics of UniV3StablesJoint + * @param _providerA, provider strategy of tokenA + * @param _providerB, provider strategy of tokenB + * @param _referenceToken, token to use as reference, for pricing oracles and paying hedging costs (if any) + * @param _pool, Uni V3 pool to LP + * @param _ticksFromCurrent, # of ticks up & down to provide liquidity into + */ + function initialize( + address _providerA, + address _providerB, + address _referenceToken, + address _pool, + uint24 _ticksFromCurrent + ) external { + _initialize(_providerA, _providerB, _referenceToken, _pool); + _initializeUniV3StablesJoint(_ticksFromCurrent); + } + + /* + * @notice + * Initialize UniV3StablesJoint specifics + * @param _ticksFromCurrent, # of ticks up & down to provide liquidity into + */ + function _initializeUniV3StablesJoint(uint24 _ticksFromCurrent) internal { + ticksFromCurrent = _ticksFromCurrent; + // The reward tokens are the tokens provided to the pool + rewardTokens = new address[](2); + rewardTokens[0] = tokenA; + rewardTokens[1] = tokenB; + // by default use uni pool to swap as it has lower fees + useCRVPool = false; + // Initialize CRV pool to 3pool + crvPool = address(0xbEbc44782C7dB0a1A60Cb6fe97d0b483032FF1C7); + // Set up the fee tier + feeTier = IUniswapV3Pool(pool).fee(); + } + + event Cloned(address indexed clone); + + /* + * @notice + * Cloning function to migrate/ deploy to other pools + * @param _providerA, provider strategy of tokenA + * @param _providerB, provider strategy of tokenB + * @param _referenceToken, token to use as reference, for pricing oracles and paying hedging costs (if any) + * @param _pool, Uni V3 pool to LP + * @param _ticksFromCurrent, # of ticks up & down to provide liquidity into + * @return newJoint, address of newly deployed joint + */ + function cloneUniV3StablesJoint( + address _providerA, + address _providerB, + address _referenceToken, + address _pool, + uint24 _ticksFromCurrent + ) external returns (address newJoint) { + require(isOriginal, "!original"); + bytes20 addressBytes = bytes20(address(this)); + + assembly { + // EIP-1167 bytecode + let clone_code := mload(0x40) + mstore( + clone_code, + 0x3d602d80600a3d3981f3363d3d373d3d3d363d73000000000000000000000000 + ) + mstore(add(clone_code, 0x14), addressBytes) + mstore( + add(clone_code, 0x28), + 0x5af43d82803e903d91602b57fd5bf30000000000000000000000000000000000 + ) + newJoint := create(0, clone_code, 0x37) + } + + UniV3StablesJoint(newJoint).initialize( + _providerA, + _providerB, + _referenceToken, + _pool, + _ticksFromCurrent + ); + + emit Cloned(newJoint); + } + + /* + * @notice + * Function returning the name of the joint in the format "NoHedgeUniV3StablesJoint(USDC-DAI)" + * @return name of the strategy + */ + function name() external view override returns (string memory) { + string memory ab = string( + abi.encodePacked( + IERC20Extended(address(tokenA)).symbol(), + "-", + IERC20Extended(address(tokenB)).symbol() + ) + ); + + return string(abi.encodePacked("NoHedgeUniV3StablesJoint(", ab, ")")); + } + + /* + * @notice + * Function returning the liquidity amount of the LP position + * @return liquidity from positionInfo + */ + function balanceOfPool() public view override returns (uint256 liquidity) { + (liquidity,,,,) = _positionInfo(); + } + + /* + * @notice + * Function available for vault managers to set the boolean value deciding wether + * to use the uni v3 pool for swaps or a CRV pool + * @param newUseCRVPool, new boolean value to use + */ + function setUseCRVPool(bool _useCRVPool) external onlyVaultManagers { + useCRVPool = _useCRVPool; + } + + /* + * @notice + * Function available for vault managers to set the Uni v3 pool to invest into + * @param pool, new pool value to use + */ + function setUniPool(address _pool, uint24 _feeTier) external onlyVaultManagers { + require(investedA == 0 && investedB == 0 && UniswapHelperViews.checkExistingPool(tokenA, tokenB, _feeTier, _pool)); + pool = _pool; + feeTier = _feeTier; + } + + /* + * @notice + * Function available for vault managers to set the number of ticks on each side of + * current tick to provide liquidity to + * @param newTicksFromCurrent, new value to use + */ + function setTicksFromCurrent(uint24 _ticksFromCurrent) external onlyVaultManagers { + ticksFromCurrent = _ticksFromCurrent; + } + + /* + * @notice + * Function available for vault managers to set min & max values of the position. If, + * for any reason the ticks are not the value they should be, we always have the option + * to re-set them back to the necessary value using the force parameter + * @param _minTick, lower limit of position + * @param _minTick, lower limit of position + * @param forceChange, force parameter to ensure this function is not called randomly + */ + function setTicksManually(int24 _minTick, int24 _maxTick, bool forceChange) external onlyVaultManagers { + if ((investedA > 0 || investedB > 0) && !forceChange) { + revert(); + } + minTick = _minTick; + maxTick = _maxTick; + } + + /* + * @notice + * Function returning the current balance of each token in the LP position taking + * the new level of reserves into account + * @return _balanceA, balance of tokenA in the LP position + * @return _balanceB, balance of tokenB in the LP position + */ + function balanceOfTokensInLP() + public + view + override + returns (uint256 _balanceA, uint256 _balanceB) + { + // Get the current pool status + (uint160 sqrtPriceX96,,,,,,) = IUniswapV3Pool(pool).slot0(); + // Get the current position status + (uint128 liquidity,,,,) = _positionInfo(); + + // Use Uniswap libraries to calculate the token0 and token1 balances for the + // provided ticks and liquidity amount + (uint256 amount0, uint256 amount1) = LiquidityAmounts + .getAmountsForLiquidity( + sqrtPriceX96, + TickMath.getSqrtRatioAtTick(minTick), + TickMath.getSqrtRatioAtTick(maxTick), + liquidity + ); + // uniswap orders token0 and token1 based on alphabetical order + return tokenA < tokenB ? (amount0, amount1) : (amount1, amount0); + } + + /* + * @notice + * Function returning the amount of rewards earned until now - unclaimed + * @return uint256 array of tokenA and tokenB earned as rewards + */ + function pendingRewards() public view override returns (uint256[] memory) { + // Initialize the array to same length as reward tokens + uint256[] memory _amountPending = new uint256[](rewardTokens.length); + + // Get LP position info + (uint128 liquidity, + uint256 feeGrowthInside0LastX128, + uint256 feeGrowthInside1LastX128, + uint128 tokensOwed0, + uint128 tokensOwed1) = _positionInfo(); + + // Initialize to the current status of owed tokens + (_amountPending[0], _amountPending[1]) = tokenA < tokenB + ? (tokensOwed0, tokensOwed1) + : (tokensOwed1, tokensOwed0); + + // Gas savings + IUniswapV3Pool _pool = IUniswapV3Pool(pool); + int24 _minTick = minTick; + int24 _maxTick = maxTick; + + // Use Uniswap views library to calculate the fees earned in tokenA and tokenB based + // on current status of the pool and provided position + (,int24 tick,,,,,) = _pool.slot0(); + (tokensOwed0, tokensOwed1) = UniswapHelperViews.getFeesEarned( + UniswapHelperViews.feesEarnedParams( + pool, + liquidity, + tick, + _minTick, + _maxTick, + _pool.feeGrowthGlobal0X128(), + _pool.feeGrowthGlobal1X128(), + feeGrowthInside0LastX128, + feeGrowthInside1LastX128 + ) + ); + + // Reorder to make sure amounts are added correctly + if (tokenA < tokenB) { + _amountPending[0] += tokensOwed0; + _amountPending[1] += tokensOwed1; + } else { + _amountPending[1] += tokensOwed0; + _amountPending[0] += tokensOwed1; + } + + return _amountPending; + } + + /* + * @notice + * Function called by the uniswap pool when minting the LP position (providing liquidity), + * instead of approving and sending the tokens, uniV3 calls the callback imoplementation + * on the caller contract + * @param amount0Owed, amount of token0 to send + * @param amount1Owed, amount of token1 to send + * @param data, additional calldata + */ + function uniswapV3MintCallback( + uint256 amount0Owed, + uint256 amount1Owed, + bytes calldata data + ) external { + IUniswapV3Pool _pool = IUniswapV3Pool(pool); + // Only the pool can use this function + require(msg.sender == address(_pool)); // dev: callback only called by pool + // Send the required funds to the pool + IERC20(_pool.token0()).safeTransfer(address(_pool), amount0Owed); + IERC20(_pool.token1()).safeTransfer(address(_pool), amount1Owed); + } + + /* + * @notice + * Function called by the uniswap pool when swapping, + * instead of approving and sending the tokens, uniV3 calls the callback imoplementation + * on the caller contract + * @param amount0Delta, amount of token0 to send (if any) + * @param amount1Delta, amount of token1 to send (if any) + * @param data, additional calldata + */ + function uniswapV3SwapCallback( + int256 amount0Delta, + int256 amount1Delta, + bytes calldata data + ) external { + IUniswapV3Pool _pool = IUniswapV3Pool(pool); + // Only the pool can use this function + require(msg.sender == address(_pool)); // dev: callback only called by pool + + uint256 amountIn; + address tokenIn; + + // Send the required funds to the pool + if (amount0Delta > 0) { + amountIn = uint256(amount0Delta); + tokenIn = _pool.token0(); + } else { + amountIn = uint256(amount1Delta); + tokenIn = _pool.token1(); + } + + IERC20(tokenIn).safeTransfer(address(_pool), amountIn); + } + + /* + * @notice + * Function used internally to collect the accrued fees by burn 0 of the LP position + * and collecting the owed tokens (only fees as no LP has been burnt) + * @return balance of tokens in the LP (invested amounts) + */ + function getReward() internal override { + _burnAndCollect(0, minTick, maxTick); + } + + /* + * @notice + * Function used internally to open the LP position in the uni v3 pool: + * - calculates the ticks to provide liquidity into + * - calculates the liquidity amount to provide based on the ticks + * and amounts to invest + * - calls the mint function in the uni v3 pool + * @return balance of tokens in the LP (invested amounts) + */ + function createLP() internal override returns (uint256, uint256) { + IUniswapV3Pool _pool = IUniswapV3Pool(pool); + // Get the current state of the pool + (uint160 sqrtPriceX96, int24 tick,,,,,) = _pool.slot0(); + // Space between ticks for this pool + int24 _tickSpacing = _pool.tickSpacing(); + // Current tick must be referenced as a multiple of tickSpacing + int24 _currentTick = (tick / _tickSpacing) * _tickSpacing; + // Gas savings for # of ticks to LP + int24 _ticksFromCurrent = int24(ticksFromCurrent); + // Minimum tick to enter + int24 _minTick = _currentTick - (_tickSpacing * _ticksFromCurrent); + // Maximum tick to enter + int24 _maxTick = _currentTick + (_tickSpacing * (_ticksFromCurrent + 1)); + + // Set the state variables + minTick = _minTick; + maxTick = _maxTick; + + uint256 amount0; + uint256 amount1; + + // MAke sure tokens are in order + if (tokenA < tokenB) { + amount0 = balanceOfA(); + amount1 = balanceOfB(); + } else { + amount0 = balanceOfB(); + amount1 = balanceOfA(); + } + + // Calculate the amount of liquidity the joint can provided based on current situation + // and amount of tokens available + uint128 liquidityAmount = LiquidityAmounts.getLiquidityForAmounts( + sqrtPriceX96, + TickMath.getSqrtRatioAtTick(_minTick), + TickMath.getSqrtRatioAtTick(_maxTick), + amount0, + amount1 + ); + + // Mint the LP position - we are not yet in the LP, needs to go through the mint + // callback first + _pool.mint(address(this), _minTick, _maxTick, liquidityAmount, ""); + + // After executing the mint callback, calculate the invested amounts + return balanceOfTokensInLP(); + } + + /* + * @notice + * Function used internally to close the LP position in the uni v3 pool: + * - burns the LP liquidity specified amount + * - collects all pending rewards + * - re-sets the active position min and max tick to 0 + * @param amount, amount of liquidity to burn + */ + function burnLP(uint256 _amount) internal override { + _burnAndCollect(_amount, minTick, maxTick); + // If entire position is closed, re-set the min and max ticks + (uint128 liquidity,,,,) = _positionInfo(); + if (liquidity == 0){ + minTick = 0; + maxTick = 0; + } + } + + /* + * @notice + * Function available to vault managers to burn the LP manually, if for any reason + * the ticks have been set to 0 (or any different value from the original LP), we make + * sure we can always get out of the position + * This function can be used to only collect fees by passing a 0 amount to burn + * @param _amount, amount of liquidity to burn + * @param _minTick, lower limit of position + * @param _maxTick, upper limit of position + */ + function burnLPManually( + uint256 _amount, + int24 _minTick, + int24 _maxTick, + uint256 _minOutTokenA, + uint256 _minOutTokenB + ) external onlyVaultManagers { + _burnAndCollect(_amount, _minTick, _maxTick); + require(IERC20(tokenA).balanceOf(address(this)) >= _minOutTokenA && + IERC20(tokenB).balanceOf(address(this)) >= _minOutTokenB); + } + + /* + * @notice + * Function available internally to burn the LP amount specified, for position + * defined by minTick and maxTick specified and collect the owed tokens + * @param _amount, amount of liquidity to burn + * @param _minTick, lower limit of position + * @param _maxTick, upper limit of position + */ + function _burnAndCollect( + uint256 _amount, + int24 _minTick, + int24 _maxTick + ) internal { + IUniswapV3Pool _pool = IUniswapV3Pool(pool); + _pool.burn(_minTick, _maxTick, uint128(_amount)); + _pool.collect( + address(this), + _minTick, + _maxTick, + type(uint128).max, + type(uint128).max + ); + } + + /* + * @notice + * Function used internally to swap tokens during rebalancing. Depending on the useCRVPool + * state variable it will either use the uni v3 pool to swap or a CRV pool specified in + * crvPool state variable + * @param _tokenFrom, adress of token to swap from + * @param _tokenTo, address of token to swap to + * @param _amountIn, amount of _tokenIn to swap for _tokenTo + * @return swapped amount + */ + function swap( + address _tokenFrom, + address _tokenTo, + uint256 _amountIn, + uint256 _minOutAmount + ) internal override returns (uint256) { + require(_tokenTo == tokenA || _tokenTo == tokenB); // dev: must be a or b + require(_tokenFrom == tokenA || _tokenFrom == tokenB); // dev: must be a or b + uint256 prevBalance = IERC20(_tokenTo).balanceOf(address(this)); + if (useCRVPool) { + // Do NOT use uni pool use CRV pool + ICRVPool _pool = ICRVPool(crvPool); + + // Allow necessary amount for CRV pool + _checkAllowance(address(_pool), IERC20(_tokenFrom), _amountIn); + // Perform swap + _pool.exchange( + _getCRVPoolIndex(_tokenFrom, _pool), + _getCRVPoolIndex(_tokenTo, _pool), + _amountIn, + 0 + ); + uint256 result = IERC20(_tokenTo).balanceOf(address(this)) - prevBalance; + require(result >= _minOutAmount); + return (result); + } else { + // Use uni v3 pool to swap + // Order of swap + bool zeroForOne = _tokenFrom < _tokenTo; + + // Use swap function of uni v3 pool, will use the implemented swap callback to + // receive the corresponding tokens + (int256 _amount0, int256 _amount1) = IUniswapV3Pool(pool).swap( + // recipient + address(this), + // Order of swap + zeroForOne, + // amountSpecified + _amountIn.toInt256(), + // Price limit + zeroForOne ? MIN_SQRT_RATIO + 1 : MAX_SQRT_RATIO - 1, + // additonal calldata + "" + ); + uint256 result = zeroForOne ? uint256(-_amount1) : uint256(-_amount0); + require(result >= _minOutAmount); + // Ensure amounts are returned in right order and sign (uni returns negative numbers) + return result; + } + + } + + /* + * @notice + * Function used internally to quote a potential rebalancing swap without actually + * executing it. Same as the swap function, will simulate the trade either on the uni v3 + * pool or CRV pool based on useCRVPool + * @param _tokenFrom, adress of token to swap from + * @param _tokenTo, address of token to swap to + * @param _amountIn, amount of _tokenIn to swap for _tokenTo + * @return simulated swapped amount + */ + function quote( + address _tokenFrom, + address _tokenTo, + uint256 _amountIn + ) internal view override returns (uint256) { + require(_tokenTo == tokenA || _tokenTo == tokenB); // dev: must be a or b + require(_tokenFrom == tokenA || _tokenFrom == tokenB); // dev: must be a or b + if(useCRVPool){ + // Do NOT use uni pool use CRV pool + + ICRVPool _pool = ICRVPool(crvPool); + + // Call the quote function in CRV pool + return _pool.get_dy( + _getCRVPoolIndex(_tokenFrom, _pool), + _getCRVPoolIndex(_tokenTo, _pool), + _amountIn + ); + } else { + // Use uni v3 pool to swap + // Order of swap + bool zeroForOne = _tokenFrom < _tokenTo; + + // Use the uniswap helper view to simulate the swap in the uni v3 pool + (int256 _amount0, int256 _amount1) = UniswapHelperViews.simulateSwap( + // pool to use + pool, + // order of swap + zeroForOne, + // amountSpecified + _amountIn.toInt256(), + // price limit + zeroForOne ? MIN_SQRT_RATIO + 1 : MAX_SQRT_RATIO - 1 + ); + + // Ensure amounts are returned in right order and sign (uni returns negative numbers) + return zeroForOne ? uint256(-_amount1) : uint256(-_amount0); + } + + } + + /* + * @notice + * Function used internally to retrieve the CRV index for a token in a CRV pool, for example + * 3Pool uses: + * - 0 is DAI + * - 1 is USDC + * - 2 is USDT + * @return in128 containing the token's pool index + */ + function _getCRVPoolIndex(address _token, ICRVPool _pool) internal view returns(int128) { + uint8 i = 0; + int128 poolIndex = 0; + while (i < 5) { + if (_pool.coins(i) == _token) { + return poolIndex; + } + i++; + poolIndex++; + } + } + + /* + * @notice + * Function used internally to retrieve the details of the joint's LP position: + * - the amount of liquidity owned by this position + * - fee growth per unit of liquidity as of the last update to liquidity or fees owed + * - the fees owed to the position owner in token0/token1 + * @return PositionInfo struct containing the position details + */ + function _positionInfo() + private + view + returns ( + uint128 liquidity, + uint256 feeGrowthInside0LastX128, + uint256 feeGrowthInside1LastX128, + uint128 tokensOwed0, + uint128 tokensOwed1 + ) + { + bytes32 key = keccak256( + abi.encodePacked(address(this), minTick, maxTick) + ); + return IUniswapV3Pool(pool).positions(key); + } + + /* + * @notice + * Function used by governance to swap tokens manually if needed, can be used when closing + * the LP position manually and need some re-balancing before sending funds back to the + * providers + * @param swapPath, path of addresses to swap, should be 2 and always tokenA <> tokenB + * @param swapInAmount, amount of swapPath[0] to swap for swapPath[1] + * @param minOutAmount, minimum amount of want out + * @return swapped amount + */ + function swapTokenForTokenManually( + bool sellA, + uint256 swapInAmount, + uint256 minOutAmount + ) external onlyGovernance override returns (uint256) { + + if(sellA) { + return swap( + tokenA, + tokenB, + swapInAmount, + minOutAmount + ); + } else { + return swap( + tokenB, + tokenA, + swapInAmount, + minOutAmount + ); + } + + + } + + // check if the current baseFee is below our external target + function isBaseFeeAcceptable() internal view returns (bool) { + return + IBaseFee(0xb5e1CAcB567d98faaDB60a1fD4820720141f064F) + .isCurrentBaseFeeAcceptable(); + } + + /* + * @notice + * Function used by keepers to assess whether to harvest the joint and compound generated + * fees into the existing position, checks whether both pending fee amounts (tokenA and B) + * are greater than minRewardToHarvest + * @param callCost, call cost parameter + * @return bool amount assessing whether to harvest or not + */ + function harvestTrigger(uint256 callCost) external view override returns (bool) { + + uint256 _minRewardToHarvest = minRewardToHarvest; + if (_minRewardToHarvest == 0) { + return false; + } + + // check if the base fee gas price is higher than we allow. if it is, block harvests. + if (!isBaseFeeAcceptable()) { + return false; + } + + uint256[] memory _pendingRewards = pendingRewards(); + + if (_pendingRewards[0] >= _minRewardToHarvest * (10**IERC20Extended(rewardTokens[0]).decimals()) / RATIO_PRECISION && + _pendingRewards[1] >= _minRewardToHarvest * (10**IERC20Extended(rewardTokens[1]).decimals()) / RATIO_PRECISION + ) { + return true; + } + + } + + /* + * @notice + * Function used by harvest trigger in the providers to assess whether to harvest it as + * the joint may have gone out of bounds. If debt ratio is kept in the vaults, the joint + * re-centers, if debt ratio is 0, the joint is simpley closed and funds are sent back + * to each provider + * @return bool amount assessing whether to end the epoch or not + */ + function shouldEndEpoch() external view override returns (bool) { + (,int24 _tick,,,,,) = IUniswapV3Pool(pool).slot0(); + (uint128 liquidity,,,,) = _positionInfo(); + if((_tick < minTick || _tick >= maxTick) && (liquidity > 0)) { + return true; + } + } + + /* + * @notice + * Function used by keepers to compound the generated feed into the existing position + * in the joint. There may be some funds not used in the position and left idle in the + * joint + */ + function harvest() external override onlyKeepers { + getReward(); + + uint256 amount0; + uint256 amount1; + + // Make sure tokens are in order + if (tokenA < tokenB) { + amount0 = balanceOfA(); + amount1 = balanceOfB(); + } else { + amount0 = balanceOfB(); + amount1 = balanceOfA(); + } + + // Minimum tick to enter + int24 _minTick = minTick; + // Maximum tick to enter + int24 _maxTick = maxTick; + + // Calculate the amount of liquidity the joint can provided based on current situation + // and amount of tokens available + IUniswapV3Pool _pool = IUniswapV3Pool(pool); + (uint160 sqrtPriceX96,,,,,,) = _pool.slot0(); + uint128 liquidityAmount = LiquidityAmounts.getLiquidityForAmounts( + sqrtPriceX96, + TickMath.getSqrtRatioAtTick(_minTick), + TickMath.getSqrtRatioAtTick(_maxTick), + amount0, + amount1 + ); + + // Mint the LP position - we are not yet in the LP, needs to go through the mint + // callback first + _pool.mint(address(this), _minTick, _maxTick, liquidityAmount, ""); + + } +} diff --git a/hardhat.config.js b/hardhat.config.js index fd3c6f1..8ff8278 100644 --- a/hardhat.config.js +++ b/hardhat.config.js @@ -1,15 +1,14 @@ - // autogenerated by brownie // do not modify the existing settings module.exports = { - networks: { - hardhat: { - hardfork: "london", - // base fee of 0 allows use of 0 gas price when testing - initialBaseFeePerGas: 0, - // brownie expects calls and transactions to throw on revert - throwOnTransactionFailures: true, - throwOnCallFailures: true - } - } -} \ No newline at end of file + networks: { + hardhat: { + hardfork: "london", + // base fee of 0 allows use of 0 gas price when testing + initialBaseFeePerGas: 0, + // brownie expects calls and transactions to throw on revert + throwOnTransactionFailures: true, + throwOnCallFailures: true, + }, + }, +}; diff --git a/interfaces/CRV/ICRVPool.sol b/interfaces/CRV/ICRVPool.sol new file mode 100644 index 0000000..6759371 --- /dev/null +++ b/interfaces/CRV/ICRVPool.sol @@ -0,0 +1,10 @@ +// SPDX-License-Identifier: AGPL-3.0 +pragma solidity 0.8.12; + +interface ICRVPool { + function get_dy(int128 i, int128 j, uint256 dx) external view returns (uint256); + + function exchange(int128 i, int128 j, uint256 dx, uint256 min_dy) external; + + function coins(uint256 arg0) external view returns (address); +} diff --git a/interfaces/IERC20Extended.sol b/interfaces/IERC20Extended.sol index 267fb1a..3eae49e 100644 --- a/interfaces/IERC20Extended.sol +++ b/interfaces/IERC20Extended.sol @@ -1,5 +1,7 @@ -pragma solidity 0.6.12; -import {IERC20} from "@openzeppelin/contracts/token/ERC20/SafeERC20.sol"; +// SPDX-License-Identifier: AGPL-3.0 +pragma solidity 0.8.12; + +import {IERC20} from "@openzeppelin/contracts/token/ERC20/IERC20.sol"; interface IERC20Extended is IERC20 { function decimals() external view returns (uint8); diff --git a/interfaces/IMasterChef.sol b/interfaces/IMasterChef.sol index d1c2b67..fb6be5d 100644 --- a/interfaces/IMasterChef.sol +++ b/interfaces/IMasterChef.sol @@ -1,4 +1,4 @@ -pragma solidity 0.6.12; +pragma solidity 0.8.12; pragma experimental ABIEncoderV2; interface IMasterchef { diff --git a/interfaces/IRewarder.sol b/interfaces/IRewarder.sol index 6ca353d..8e2185c 100644 --- a/interfaces/IRewarder.sol +++ b/interfaces/IRewarder.sol @@ -1,7 +1,7 @@ // SPDX-License-Identifier: MIT -pragma solidity 0.6.12; -import {IERC20} from "@openzeppelin/contracts/token/ERC20/SafeERC20.sol"; +pragma solidity 0.8.12; +import {IERC20} from "@openzeppelin/contracts/token/ERC20/IERC20.sol"; interface IRewarder { function onSushiReward( diff --git a/interfaces/ISolidRouter.sol b/interfaces/ISolidRouter.sol index 5ac93d8..4c8dd6a 100644 --- a/interfaces/ISolidRouter.sol +++ b/interfaces/ISolidRouter.sol @@ -1,9 +1,13 @@ // SPDX-License-Identifier: AGPL-3.0 -pragma solidity 0.6.12; +pragma solidity 0.8.12; pragma experimental ABIEncoderV2; interface ISolidFactory { - function getPair(address token0, address token1, bool stable) external view returns (address); + function getPair( + address token0, + address token1, + bool stable + ) external view returns (address); } interface ISolidRouter { @@ -14,6 +18,7 @@ interface ISolidRouter { } function factory() external view returns (address); + function addLiquidity( address tokenA, address tokenB, @@ -32,7 +37,6 @@ interface ISolidRouter { uint256 liquidity ); - function removeLiquidity( address tokenA, address tokenB, @@ -44,7 +48,6 @@ interface ISolidRouter { uint256 deadline ) external returns (uint256 amountA, uint256 amountB); - function swapExactTokensForTokens( uint256 amountIn, uint256 amountOutMin, @@ -53,8 +56,8 @@ interface ISolidRouter { uint256 deadline ) external returns (uint256[] memory amounts); - function getAmountsOut(uint amountIn, route[] memory routes) external view returns (uint[] memory amounts); - + function getAmountsOut(uint256 amountIn, route[] memory routes) + external + view + returns (uint256[] memory amounts); } - - diff --git a/interfaces/ISolidex.sol b/interfaces/ISolidex.sol index c50c83f..f5a385f 100644 --- a/interfaces/ISolidex.sol +++ b/interfaces/ISolidex.sol @@ -1,19 +1,26 @@ // SPDX-License-Identifier: AGPL-3.0 -pragma solidity 0.6.12; +pragma solidity 0.8.12; pragma experimental ABIEncoderV2; - interface ISolidex { struct Amounts { uint256 solid; uint256 sex; } - function deposit(address _pair, uint256 _amount) external; - function withdraw(address _pair, uint256 _amount) external; - function getReward(address[] calldata _pairs) external; - function pendingRewards(address _account, address[] calldata pairs) external view returns (Amounts[] memory); - function userBalances(address _account, address _pair) external view returns (uint256); -} + function deposit(address _pair, uint256 _amount) external; + + function withdraw(address _pair, uint256 _amount) external; + function getReward(address[] calldata _pairs) external; + function pendingRewards(address _account, address[] calldata pairs) + external + view + returns (Amounts[] memory); + + function userBalances(address _account, address _pair) + external + view + returns (uint256); +} diff --git a/interfaces/hegic/IHegicOptions.sol b/interfaces/hegic/IHegicOptions.sol index cb1377d..5f518c1 100644 --- a/interfaces/hegic/IHegicOptions.sol +++ b/interfaces/hegic/IHegicOptions.sol @@ -1,4 +1,4 @@ -pragma solidity 0.6.12; +pragma solidity 0.8.12; /** * Hegic @@ -55,8 +55,17 @@ interface IPriceCalculator { * unlocks the expired options and distributes the premiums among the liquidity providers. **/ interface IHegicPool is IERC721, IPriceCalculator { - enum OptionState {Invalid, Active, Exercised, Expired} - enum TrancheState {Invalid, Open, Closed} + enum OptionState { + Invalid, + Active, + Exercised, + Expired + } + enum TrancheState { + Invalid, + Open, + Closed + } /** * @param state The state of the option: Invalid, Active, Exercised, Expired diff --git a/interfaces/uni/V1/IUniswapV1Exchange.sol b/interfaces/uniswap/V1/IUniswapV1Exchange.sol similarity index 96% rename from interfaces/uni/V1/IUniswapV1Exchange.sol rename to interfaces/uniswap/V1/IUniswapV1Exchange.sol index f53dfd1..c435ba9 100644 --- a/interfaces/uni/V1/IUniswapV1Exchange.sol +++ b/interfaces/uniswap/V1/IUniswapV1Exchange.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: AGPL-3.0 -pragma solidity 0.6.12; +pragma solidity 0.8.12; interface IUniswapV1Exchange { function balanceOf(address owner) external view returns (uint256); diff --git a/interfaces/uni/V1/IUniswapV1Factory.sol b/interfaces/uniswap/V1/IUniswapV1Factory.sol similarity index 85% rename from interfaces/uni/V1/IUniswapV1Factory.sol rename to interfaces/uniswap/V1/IUniswapV1Factory.sol index bf79359..670752c 100644 --- a/interfaces/uni/V1/IUniswapV1Factory.sol +++ b/interfaces/uniswap/V1/IUniswapV1Factory.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: AGPL-3.0 -pragma solidity 0.6.12; +pragma solidity 0.8.12; interface IUniswapV1Factory { function getExchange(address) external view returns (address); diff --git a/interfaces/uni/IUniSimple.sol b/interfaces/uniswap/V2/IUniSimple.sol similarity index 89% rename from interfaces/uni/IUniSimple.sol rename to interfaces/uniswap/V2/IUniSimple.sol index 36e142b..a5e55d3 100644 --- a/interfaces/uni/IUniSimple.sol +++ b/interfaces/uniswap/V2/IUniSimple.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: AGPL-3.0 -pragma solidity 0.6.12; +pragma solidity 0.8.12; interface IUniSimple { function getAmountsOut(uint256 amountIn, address[] calldata path) diff --git a/interfaces/uni/IUniswapV2Factory.sol b/interfaces/uniswap/V2/IUniswapV2Factory.sol similarity index 96% rename from interfaces/uni/IUniswapV2Factory.sol rename to interfaces/uniswap/V2/IUniswapV2Factory.sol index 5332100..15a8f7c 100644 --- a/interfaces/uni/IUniswapV2Factory.sol +++ b/interfaces/uniswap/V2/IUniswapV2Factory.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: AGPL-3.0 -pragma solidity 0.6.12; +pragma solidity 0.8.12; interface IUniswapV2Factory { event PairCreated( diff --git a/interfaces/uni/IUniswapV2Migrator.sol b/interfaces/uniswap/V2/IUniswapV2Migrator.sol similarity index 90% rename from interfaces/uni/IUniswapV2Migrator.sol rename to interfaces/uniswap/V2/IUniswapV2Migrator.sol index 5b40489..09c18fd 100644 --- a/interfaces/uni/IUniswapV2Migrator.sol +++ b/interfaces/uniswap/V2/IUniswapV2Migrator.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: AGPL-3.0 -pragma solidity 0.6.12; +pragma solidity 0.8.12; interface IUniswapV2Migrator { function migrate( diff --git a/interfaces/uni/IUniswapV2Pair.sol b/interfaces/uniswap/V2/IUniswapV2Pair.sol similarity index 100% rename from interfaces/uni/IUniswapV2Pair.sol rename to interfaces/uniswap/V2/IUniswapV2Pair.sol diff --git a/interfaces/uni/IUniswapV2Router01.sol b/interfaces/uniswap/V2/IUniswapV2Router01.sol similarity index 99% rename from interfaces/uni/IUniswapV2Router01.sol rename to interfaces/uniswap/V2/IUniswapV2Router01.sol index 05b2ddf..ad9d47f 100644 --- a/interfaces/uni/IUniswapV2Router01.sol +++ b/interfaces/uniswap/V2/IUniswapV2Router01.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: AGPL-3.0 -pragma solidity 0.6.12; +pragma solidity 0.8.12; interface IUniswapV2Router01 { function factory() external pure returns (address); diff --git a/interfaces/uni/IUniswapV2Router02.sol b/interfaces/uniswap/V2/IUniswapV2Router02.sol similarity index 98% rename from interfaces/uni/IUniswapV2Router02.sol rename to interfaces/uniswap/V2/IUniswapV2Router02.sol index 70b5934..f7a0d5f 100644 --- a/interfaces/uni/IUniswapV2Router02.sol +++ b/interfaces/uniswap/V2/IUniswapV2Router02.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: AGPL-3.0 -pragma solidity 0.6.12; +pragma solidity 0.8.12; import "./IUniswapV2Router01.sol"; diff --git a/interfaces/uni/IWETH.sol b/interfaces/uniswap/V2/IWETH.sol similarity index 91% rename from interfaces/uni/IWETH.sol rename to interfaces/uniswap/V2/IWETH.sol index dc3dfac..2b5bd5c 100644 --- a/interfaces/uni/IWETH.sol +++ b/interfaces/uniswap/V2/IWETH.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: AGPL-3.0 -pragma solidity 0.6.12; +pragma solidity 0.8.12; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; diff --git a/interfaces/uniswap/V3/IUniswapV3Factory.sol b/interfaces/uniswap/V3/IUniswapV3Factory.sol new file mode 100644 index 0000000..de9e244 --- /dev/null +++ b/interfaces/uniswap/V3/IUniswapV3Factory.sol @@ -0,0 +1,78 @@ +// SPDX-License-Identifier: GPL-2.0-or-later +pragma solidity >=0.5.0; + +/// @title The interface for the Uniswap V3 Factory +/// @notice The Uniswap V3 Factory facilitates creation of Uniswap V3 pools and control over the protocol fees +interface IUniswapV3Factory { + /// @notice Emitted when the owner of the factory is changed + /// @param oldOwner The owner before the owner was changed + /// @param newOwner The owner after the owner was changed + event OwnerChanged(address indexed oldOwner, address indexed newOwner); + + /// @notice Emitted when a pool is created + /// @param token0 The first token of the pool by address sort order + /// @param token1 The second token of the pool by address sort order + /// @param fee The fee collected upon every swap in the pool, denominated in hundredths of a bip + /// @param tickSpacing The minimum number of ticks between initialized ticks + /// @param pool The address of the created pool + event PoolCreated( + address indexed token0, + address indexed token1, + uint24 indexed fee, + int24 tickSpacing, + address pool + ); + + /// @notice Emitted when a new fee amount is enabled for pool creation via the factory + /// @param fee The enabled fee, denominated in hundredths of a bip + /// @param tickSpacing The minimum number of ticks between initialized ticks for pools created with the given fee + event FeeAmountEnabled(uint24 indexed fee, int24 indexed tickSpacing); + + /// @notice Returns the current owner of the factory + /// @dev Can be changed by the current owner via setOwner + /// @return The address of the factory owner + function owner() external view returns (address); + + /// @notice Returns the tick spacing for a given fee amount, if enabled, or 0 if not enabled + /// @dev A fee amount can never be removed, so this value should be hard coded or cached in the calling context + /// @param fee The enabled fee, denominated in hundredths of a bip. Returns 0 in case of unenabled fee + /// @return The tick spacing + function feeAmountTickSpacing(uint24 fee) external view returns (int24); + + /// @notice Returns the pool address for a given pair of tokens and a fee, or address 0 if it does not exist + /// @dev tokenA and tokenB may be passed in either token0/token1 or token1/token0 order + /// @param tokenA The contract address of either token0 or token1 + /// @param tokenB The contract address of the other token + /// @param fee The fee collected upon every swap in the pool, denominated in hundredths of a bip + /// @return pool The pool address + function getPool( + address tokenA, + address tokenB, + uint24 fee + ) external view returns (address pool); + + /// @notice Creates a pool for the given two tokens and fee + /// @param tokenA One of the two tokens in the desired pool + /// @param tokenB The other of the two tokens in the desired pool + /// @param fee The desired fee for the pool + /// @dev tokenA and tokenB may be passed in either order: token0/token1 or token1/token0. tickSpacing is retrieved + /// from the fee. The call will revert if the pool already exists, the fee is invalid, or the token arguments + /// are invalid. + /// @return pool The address of the newly created pool + function createPool( + address tokenA, + address tokenB, + uint24 fee + ) external returns (address pool); + + /// @notice Updates the owner of the factory + /// @dev Must be called by the current owner + /// @param _owner The new owner of the factory + function setOwner(address _owner) external; + + /// @notice Enables a fee amount with the given tickSpacing + /// @dev Fee amounts may never be removed once enabled + /// @param fee The fee amount to enable, denominated in hundredths of a bip (i.e. 1e-6) + /// @param tickSpacing The spacing between ticks to be enforced for all pools created with the given fee amount + function enableFeeAmount(uint24 fee, int24 tickSpacing) external; +} \ No newline at end of file diff --git a/interfaces/uniswap/V3/IUniswapV3Pool.sol b/interfaces/uniswap/V3/IUniswapV3Pool.sol new file mode 100644 index 0000000..2800ccf --- /dev/null +++ b/interfaces/uniswap/V3/IUniswapV3Pool.sol @@ -0,0 +1,26 @@ +// SPDX-License-Identifier: GPL-2.0-or-later +pragma solidity >=0.5.0; + +import {IUniswapV3PoolImmutables} from "./pool/IUniswapV3PoolImmutables.sol"; +import {IUniswapV3PoolState} from "./pool/IUniswapV3PoolState.sol"; +import {IUniswapV3PoolDerivedState} from "./pool/IUniswapV3PoolDerivedState.sol"; +import {IUniswapV3PoolActions} from "./pool/IUniswapV3PoolActions.sol"; +import {IUniswapV3PoolOwnerActions} from "./pool/IUniswapV3PoolOwnerActions.sol"; +import {IUniswapV3PoolErrors} from "./pool/IUniswapV3PoolErrors.sol"; +import {IUniswapV3PoolEvents} from "./pool/IUniswapV3PoolEvents.sol"; + +/// @title The interface for a Uniswap V3 Pool +/// @notice A Uniswap pool facilitates swapping and automated market making between any two assets that strictly conform +/// to the ERC20 specification +/// @dev The pool interface is broken up into many smaller pieces +interface IUniswapV3Pool is + IUniswapV3PoolImmutables, + IUniswapV3PoolState, + IUniswapV3PoolDerivedState, + IUniswapV3PoolActions, + IUniswapV3PoolOwnerActions, + IUniswapV3PoolErrors, + IUniswapV3PoolEvents +{ + +} diff --git a/interfaces/uniswap/V3/pool/IUniswapV3PoolActions.sol b/interfaces/uniswap/V3/pool/IUniswapV3PoolActions.sol new file mode 100644 index 0000000..3c10a21 --- /dev/null +++ b/interfaces/uniswap/V3/pool/IUniswapV3PoolActions.sol @@ -0,0 +1,105 @@ +// SPDX-License-Identifier: GPL-2.0-or-later +pragma solidity >=0.5.0; + +/// @title Permissionless pool actions +/// @notice Contains pool methods that can be called by anyone +interface IUniswapV3PoolActions { + /// @notice Sets the initial price for the pool + /// @dev Price is represented as a sqrt(amountToken1/amountToken0) Q64.96 value + /// @param sqrtPriceX96 the initial sqrt price of the pool as a Q64.96 + function initialize(uint160 sqrtPriceX96) external; + + /// @notice Adds liquidity for the given recipient/tickLower/tickUpper position + /// @dev The caller of this method receives a callback in the form of IUniswapV3MintCallback#uniswapV3MintCallback + /// in which they must pay any token0 or token1 owed for the liquidity. The amount of token0/token1 due depends + /// on tickLower, tickUpper, the amount of liquidity, and the current price. + /// @param recipient The address for which the liquidity will be created + /// @param tickLower The lower tick of the position in which to add liquidity + /// @param tickUpper The upper tick of the position in which to add liquidity + /// @param amount The amount of liquidity to mint + /// @param data Any data that should be passed through to the callback + /// @return amount0 The amount of token0 that was paid to mint the given amount of liquidity. Matches the value in the callback + /// @return amount1 The amount of token1 that was paid to mint the given amount of liquidity. Matches the value in the callback + function mint( + address recipient, + int24 tickLower, + int24 tickUpper, + uint128 amount, + bytes calldata data + ) external returns (uint256 amount0, uint256 amount1); + + /// @notice Collects tokens owed to a position + /// @dev Does not recompute fees earned, which must be done either via mint or burn of any amount of liquidity. + /// Collect must be called by the position owner. To withdraw only token0 or only token1, amount0Requested or + /// amount1Requested may be set to zero. To withdraw all tokens owed, caller may pass any value greater than the + /// actual tokens owed, e.g. type(uint128).max. Tokens owed may be from accumulated swap fees or burned liquidity. + /// @param recipient The address which should receive the fees collected + /// @param tickLower The lower tick of the position for which to collect fees + /// @param tickUpper The upper tick of the position for which to collect fees + /// @param amount0Requested How much token0 should be withdrawn from the fees owed + /// @param amount1Requested How much token1 should be withdrawn from the fees owed + /// @return amount0 The amount of fees collected in token0 + /// @return amount1 The amount of fees collected in token1 + function collect( + address recipient, + int24 tickLower, + int24 tickUpper, + uint128 amount0Requested, + uint128 amount1Requested + ) external returns (uint128 amount0, uint128 amount1); + + /// @notice Burn liquidity from the sender and account tokens owed for the liquidity to the position + /// @dev Can be used to trigger a recalculation of fees owed to a position by calling with an amount of 0 + /// @dev Fees must be collected separately via a call to #collect + /// @param tickLower The lower tick of the position for which to burn liquidity + /// @param tickUpper The upper tick of the position for which to burn liquidity + /// @param amount How much liquidity to burn + /// @return amount0 The amount of token0 sent to the recipient + /// @return amount1 The amount of token1 sent to the recipient + function burn( + int24 tickLower, + int24 tickUpper, + uint128 amount + ) external returns (uint256 amount0, uint256 amount1); + + /// @notice Swap token0 for token1, or token1 for token0 + /// @dev The caller of this method receives a callback in the form of IUniswapV3SwapCallback#uniswapV3SwapCallback + /// @param recipient The address to receive the output of the swap + /// @param zeroForOne The direction of the swap, true for token0 to token1, false for token1 to token0 + /// @param amountSpecified The amount of the swap, which implicitly configures the swap as exact input (positive), or exact output (negative) + /// @param sqrtPriceLimitX96 The Q64.96 sqrt price limit. If zero for one, the price cannot be less than this + /// value after the swap. If one for zero, the price cannot be greater than this value after the swap + /// @param data Any data to be passed through to the callback + /// @return amount0 The delta of the balance of token0 of the pool, exact when negative, minimum when positive + /// @return amount1 The delta of the balance of token1 of the pool, exact when negative, minimum when positive + function swap( + address recipient, + bool zeroForOne, + int256 amountSpecified, + uint160 sqrtPriceLimitX96, + bytes calldata data + ) external returns (int256 amount0, int256 amount1); + + /// @notice Receive token0 and/or token1 and pay it back, plus a fee, in the callback + /// @dev The caller of this method receives a callback in the form of IUniswapV3FlashCallback#uniswapV3FlashCallback + /// @dev Can be used to donate underlying tokens pro-rata to currently in-range liquidity providers by calling + /// with 0 amount{0,1} and sending the donation amount(s) from the callback + /// @param recipient The address which will receive the token0 and token1 amounts + /// @param amount0 The amount of token0 to send + /// @param amount1 The amount of token1 to send + /// @param data Any data to be passed through to the callback + function flash( + address recipient, + uint256 amount0, + uint256 amount1, + bytes calldata data + ) external; + + /// @notice Increase the maximum number of price and liquidity observations that this pool will store + /// @dev This method is no-op if the pool already has an observationCardinalityNext greater than or equal to + /// the input observationCardinalityNext. + /// @param observationCardinalityNext The desired minimum number of observations for the pool to store + function increaseObservationCardinalityNext( + uint16 observationCardinalityNext + ) external; +} diff --git a/interfaces/uniswap/V3/pool/IUniswapV3PoolDerivedState.sol b/interfaces/uniswap/V3/pool/IUniswapV3PoolDerivedState.sol new file mode 100644 index 0000000..c851ec9 --- /dev/null +++ b/interfaces/uniswap/V3/pool/IUniswapV3PoolDerivedState.sol @@ -0,0 +1,43 @@ +// SPDX-License-Identifier: GPL-2.0-or-later +pragma solidity >=0.5.0; + +/// @title Pool state that is not stored +/// @notice Contains view functions to provide information about the pool that is computed rather than stored on the +/// blockchain. The functions here may have variable gas costs. +interface IUniswapV3PoolDerivedState { + /// @notice Returns the cumulative tick and liquidity as of each timestamp `secondsAgo` from the current block timestamp + /// @dev To get a time weighted average tick or liquidity-in-range, you must call this with two values, one representing + /// the beginning of the period and another for the end of the period. E.g., to get the last hour time-weighted average tick, + /// you must call it with secondsAgos = [3600, 0]. + /// @dev The time weighted average tick represents the geometric time weighted average price of the pool, in + /// log base sqrt(1.0001) of token1 / token0. The TickMath library can be used to go from a tick value to a ratio. + /// @param secondsAgos From how long ago each cumulative tick and liquidity value should be returned + /// @return tickCumulatives Cumulative tick values as of each `secondsAgos` from the current block timestamp + /// @return secondsPerLiquidityCumulativeX128s Cumulative seconds per liquidity-in-range value as of each `secondsAgos` from the current block + /// timestamp + function observe(uint32[] calldata secondsAgos) + external + view + returns ( + int56[] memory tickCumulatives, + uint160[] memory secondsPerLiquidityCumulativeX128s + ); + + /// @notice Returns a snapshot of the tick cumulative, seconds per liquidity and seconds inside a tick range + /// @dev Snapshots must only be compared to other snapshots, taken over a period for which a position existed. + /// I.e., snapshots cannot be compared if a position is not held for the entire period between when the first + /// snapshot is taken and the second snapshot is taken. + /// @param tickLower The lower tick of the range + /// @param tickUpper The upper tick of the range + /// @return tickCumulativeInside The snapshot of the tick accumulator for the range + /// @return secondsPerLiquidityInsideX128 The snapshot of seconds per liquidity for the range + /// @return secondsInside The snapshot of seconds per liquidity for the range + function snapshotCumulativesInside(int24 tickLower, int24 tickUpper) + external + view + returns ( + int56 tickCumulativeInside, + uint160 secondsPerLiquidityInsideX128, + uint32 secondsInside + ); +} diff --git a/interfaces/uniswap/V3/pool/IUniswapV3PoolErrors.sol b/interfaces/uniswap/V3/pool/IUniswapV3PoolErrors.sol new file mode 100644 index 0000000..e4413d0 --- /dev/null +++ b/interfaces/uniswap/V3/pool/IUniswapV3PoolErrors.sol @@ -0,0 +1,19 @@ +// SPDX-License-Identifier: GPL-2.0-or-later +pragma solidity >=0.5.0; + +/// @title Errors emitted by a pool +/// @notice Contains all events emitted by the pool +interface IUniswapV3PoolErrors { + error LOK(); + error TLU(); + error TLM(); + error TUM(); + error AI(); + error M0(); + error M1(); + error AS(); + error IIA(); + error L(); + error F0(); + error F1(); +} diff --git a/interfaces/uniswap/V3/pool/IUniswapV3PoolEvents.sol b/interfaces/uniswap/V3/pool/IUniswapV3PoolEvents.sol new file mode 100644 index 0000000..97b26fb --- /dev/null +++ b/interfaces/uniswap/V3/pool/IUniswapV3PoolEvents.sol @@ -0,0 +1,131 @@ +// SPDX-License-Identifier: GPL-2.0-or-later +pragma solidity >=0.5.0; + +/// @title Events emitted by a pool +/// @notice Contains all events emitted by the pool +interface IUniswapV3PoolEvents { + /// @notice Emitted exactly once by a pool when #initialize is first called on the pool + /// @dev Mint/Burn/Swap cannot be emitted by the pool before Initialize + /// @param sqrtPriceX96 The initial sqrt price of the pool, as a Q64.96 + /// @param tick The initial tick of the pool, i.e. log base 1.0001 of the starting price of the pool + event Initialize(uint160 sqrtPriceX96, int24 tick); + + /// @notice Emitted when liquidity is minted for a given position + /// @param sender The address that minted the liquidity + /// @param owner The owner of the position and recipient of any minted liquidity + /// @param tickLower The lower tick of the position + /// @param tickUpper The upper tick of the position + /// @param amount The amount of liquidity minted to the position range + /// @param amount0 How much token0 was required for the minted liquidity + /// @param amount1 How much token1 was required for the minted liquidity + event Mint( + address sender, + address indexed owner, + int24 indexed tickLower, + int24 indexed tickUpper, + uint128 amount, + uint256 amount0, + uint256 amount1 + ); + + /// @notice Emitted when fees are collected by the owner of a position + /// @dev Collect events may be emitted with zero amount0 and amount1 when the caller chooses not to collect fees + /// @param owner The owner of the position for which fees are collected + /// @param tickLower The lower tick of the position + /// @param tickUpper The upper tick of the position + /// @param amount0 The amount of token0 fees collected + /// @param amount1 The amount of token1 fees collected + event Collect( + address indexed owner, + address recipient, + int24 indexed tickLower, + int24 indexed tickUpper, + uint128 amount0, + uint128 amount1 + ); + + /// @notice Emitted when a position's liquidity is removed + /// @dev Does not withdraw any fees earned by the liquidity position, which must be withdrawn via #collect + /// @param owner The owner of the position for which liquidity is removed + /// @param tickLower The lower tick of the position + /// @param tickUpper The upper tick of the position + /// @param amount The amount of liquidity to remove + /// @param amount0 The amount of token0 withdrawn + /// @param amount1 The amount of token1 withdrawn + event Burn( + address indexed owner, + int24 indexed tickLower, + int24 indexed tickUpper, + uint128 amount, + uint256 amount0, + uint256 amount1 + ); + + /// @notice Emitted by the pool for any swaps between token0 and token1 + /// @param sender The address that initiated the swap call, and that received the callback + /// @param recipient The address that received the output of the swap + /// @param amount0 The delta of the token0 balance of the pool + /// @param amount1 The delta of the token1 balance of the pool + /// @param sqrtPriceX96 The sqrt(price) of the pool after the swap, as a Q64.96 + /// @param liquidity The liquidity of the pool after the swap + /// @param tick The log base 1.0001 of price of the pool after the swap + event Swap( + address indexed sender, + address indexed recipient, + int256 amount0, + int256 amount1, + uint160 sqrtPriceX96, + uint128 liquidity, + int24 tick + ); + + /// @notice Emitted by the pool for any flashes of token0/token1 + /// @param sender The address that initiated the swap call, and that received the callback + /// @param recipient The address that received the tokens from flash + /// @param amount0 The amount of token0 that was flashed + /// @param amount1 The amount of token1 that was flashed + /// @param paid0 The amount of token0 paid for the flash, which can exceed the amount0 plus the fee + /// @param paid1 The amount of token1 paid for the flash, which can exceed the amount1 plus the fee + event Flash( + address indexed sender, + address indexed recipient, + uint256 amount0, + uint256 amount1, + uint256 paid0, + uint256 paid1 + ); + + /// @notice Emitted by the pool for increases to the number of observations that can be stored + /// @dev observationCardinalityNext is not the observation cardinality until an observation is written at the index + /// just before a mint/swap/burn. + /// @param observationCardinalityNextOld The previous value of the next observation cardinality + /// @param observationCardinalityNextNew The updated value of the next observation cardinality + event IncreaseObservationCardinalityNext( + uint16 observationCardinalityNextOld, + uint16 observationCardinalityNextNew + ); + + /// @notice Emitted when the protocol fee is changed by the pool + /// @param feeProtocol0Old The previous value of the token0 protocol fee + /// @param feeProtocol1Old The previous value of the token1 protocol fee + /// @param feeProtocol0New The updated value of the token0 protocol fee + /// @param feeProtocol1New The updated value of the token1 protocol fee + event SetFeeProtocol( + uint8 feeProtocol0Old, + uint8 feeProtocol1Old, + uint8 feeProtocol0New, + uint8 feeProtocol1New + ); + + /// @notice Emitted when the collected protocol fees are withdrawn by the factory owner + /// @param sender The address that collects the protocol fees + /// @param recipient The address that receives the collected protocol fees + /// @param amount0 The amount of token0 protocol fees that is withdrawn + /// @param amount0 The amount of token1 protocol fees that is withdrawn + event CollectProtocol( + address indexed sender, + address indexed recipient, + uint128 amount0, + uint128 amount1 + ); +} diff --git a/interfaces/uniswap/V3/pool/IUniswapV3PoolImmutables.sol b/interfaces/uniswap/V3/pool/IUniswapV3PoolImmutables.sol new file mode 100644 index 0000000..c9beb15 --- /dev/null +++ b/interfaces/uniswap/V3/pool/IUniswapV3PoolImmutables.sol @@ -0,0 +1,35 @@ +// SPDX-License-Identifier: GPL-2.0-or-later +pragma solidity >=0.5.0; + +/// @title Pool state that never changes +/// @notice These parameters are fixed for a pool forever, i.e., the methods will always return the same values +interface IUniswapV3PoolImmutables { + /// @notice The contract that deployed the pool, which must adhere to the IUniswapV3Factory interface + /// @return The contract address + function factory() external view returns (address); + + /// @notice The first of the two tokens of the pool, sorted by address + /// @return The token contract address + function token0() external view returns (address); + + /// @notice The second of the two tokens of the pool, sorted by address + /// @return The token contract address + function token1() external view returns (address); + + /// @notice The pool's fee in hundredths of a bip, i.e. 1e-6 + /// @return The fee + function fee() external view returns (uint24); + + /// @notice The pool tick spacing + /// @dev Ticks can only be used at multiples of this value, minimum of 1 and always positive + /// e.g.: a tickSpacing of 3 means ticks can be initialized every 3rd tick, i.e., ..., -6, -3, 0, 3, 6, ... + /// This value is an int24 to avoid casting even though it is always positive. + /// @return The tick spacing + function tickSpacing() external view returns (int24); + + /// @notice The maximum amount of position liquidity that can use any tick in the range + /// @dev This parameter is enforced per tick to prevent liquidity from overflowing a uint128 at any point, and + /// also prevents out-of-range liquidity from being used to prevent adding in-range liquidity to a pool + /// @return The max amount of liquidity per tick + function maxLiquidityPerTick() external view returns (uint128); +} diff --git a/interfaces/uniswap/V3/pool/IUniswapV3PoolOwnerActions.sol b/interfaces/uniswap/V3/pool/IUniswapV3PoolOwnerActions.sol new file mode 100644 index 0000000..2395ed3 --- /dev/null +++ b/interfaces/uniswap/V3/pool/IUniswapV3PoolOwnerActions.sol @@ -0,0 +1,23 @@ +// SPDX-License-Identifier: GPL-2.0-or-later +pragma solidity >=0.5.0; + +/// @title Permissioned pool actions +/// @notice Contains pool methods that may only be called by the factory owner +interface IUniswapV3PoolOwnerActions { + /// @notice Set the denominator of the protocol's % share of the fees + /// @param feeProtocol0 new protocol fee for token0 of the pool + /// @param feeProtocol1 new protocol fee for token1 of the pool + function setFeeProtocol(uint8 feeProtocol0, uint8 feeProtocol1) external; + + /// @notice Collect the protocol fee accrued to the pool + /// @param recipient The address to which collected protocol fees should be sent + /// @param amount0Requested The maximum amount of token0 to send, can be 0 to collect fees in only token1 + /// @param amount1Requested The maximum amount of token1 to send, can be 0 to collect fees in only token0 + /// @return amount0 The protocol fee collected in token0 + /// @return amount1 The protocol fee collected in token1 + function collectProtocol( + address recipient, + uint128 amount0Requested, + uint128 amount1Requested + ) external returns (uint128 amount0, uint128 amount1); +} diff --git a/interfaces/uniswap/V3/pool/IUniswapV3PoolState.sol b/interfaces/uniswap/V3/pool/IUniswapV3PoolState.sol new file mode 100644 index 0000000..4beecc0 --- /dev/null +++ b/interfaces/uniswap/V3/pool/IUniswapV3PoolState.sol @@ -0,0 +1,112 @@ +// SPDX-License-Identifier: GPL-2.0-or-later +pragma solidity >=0.5.0; + +/// @title Pool state that can change +/// @notice These methods compose the pool's state, and can change with any frequency including multiple times +/// per transaction +interface IUniswapV3PoolState { + struct Slot0 { + // the current price + uint160 sqrtPriceX96; + // the current tick + int24 tick; + // the most-recently updated index of the observations array + uint16 observationIndex; + // the current maximum number of observations that are being stored + uint16 observationCardinality; + // the next maximum number of observations to store, triggered in observations.write + uint16 observationCardinalityNext; + // the current protocol fee as a percentage of the swap fee taken on withdrawal + // represented as an integer denominator (1/x)% + uint8 feeProtocol; + // whether the pool is locked + bool unlocked; + } + + /// @notice The 0th storage slot in the pool stores many values, and is exposed as a single method to save gas + /// when accessed externally. + /// Encoded as two 4 bit values, where the protocol fee of token1 is shifted 4 bits and the protocol fee of token0 + /// is the lower 4 bits. Used as the denominator of a fraction of the swap fee, e.g. 4 means 1/4th of the swap fee. + /// unlocked Whether the pool is currently locked to reentrancy + function slot0() external view returns (Slot0 memory); + + /// @notice The fee growth as a Q128.128 fees of token0 collected per unit of liquidity for the entire life of the pool + /// @dev This value can overflow the uint256 + function feeGrowthGlobal0X128() external view returns (uint256); + + /// @notice The fee growth as a Q128.128 fees of token1 collected per unit of liquidity for the entire life of the pool + /// @dev This value can overflow the uint256 + function feeGrowthGlobal1X128() external view returns (uint256); + + /// @notice The amounts of token0 and token1 that are owed to the protocol + /// @dev Protocol fees will never exceed uint128 max in either token + function protocolFees() + external + view + returns (uint128 token0, uint128 token1); + + /// @notice The currently in range liquidity available to the pool + /// @dev This value has no relationship to the total liquidity across all ticks + /// @return The liquidity at the current price of the pool + function liquidity() external view returns (uint128); + + struct TickInfo { + // the total position liquidity that references this tick + uint128 liquidityGross; + // amount of net liquidity added (subtracted) when tick is crossed from left to right (right to left), + int128 liquidityNet; + // fee growth per unit of liquidity 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 + uint256 feeGrowthOutside0X128; + uint256 feeGrowthOutside1X128; + // the cumulative tick value on the other side of the tick + int56 tickCumulativeOutside; + // the seconds per unit of liquidity 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 + uint160 secondsPerLiquidityOutsideX128; + // the seconds spent on the other side of the tick (relative to the current tick) + // only has relative meaning, not absolute — the value depends on when the tick is initialized + uint32 secondsOutside; + // true iff the tick is initialized, i.e. the value is exactly equivalent to the expression liquidityGross != 0 + // these 8 bits are set to prevent fresh sstores when crossing newly initialized ticks + bool initialized; + } + + /// @notice Look up information about a specific tick in the pool + function ticks(int24 tick) external view returns (TickInfo memory); + + struct PositionInfo { + // the amount of liquidity owned by this position + uint128 liquidity; + // fee growth per unit of liquidity as of the last update to liquidity or fees owed + uint256 feeGrowthInside0LastX128; + uint256 feeGrowthInside1LastX128; + // the fees owed to the position owner in token0/token1 + uint128 tokensOwed0; + uint128 tokensOwed1; + } + + /// @notice Returns 256 packed tick initialized boolean values. See TickBitmap for more information + function tickBitmap(int16 wordPosition) external view returns (uint256); + + /// @notice Returns the information about a position by the position's key + function positions(bytes32 key) external view returns (PositionInfo memory); + + /// @notice Returns data about a specific observation index + /// @param index The element of the observations array to fetch + /// @dev You most likely want to use #observe() instead of this method to get an observation as of some amount of time + /// ago, rather than at a specific index in the array. + /// @return blockTimestamp The timestamp of the observation, + /// @return tickCumulative the tick multiplied by seconds elapsed for the life of the pool as of the observation timestamp, + /// @return secondsPerLiquidityCumulativeX128 the seconds per in range liquidity for the life of the pool as of the observation timestamp, + /// @return initialized whether the observation has been initialized and the values are safe to use + function observations(uint256 index) + external + view + returns ( + uint32 blockTimestamp, + int56 tickCumulative, + uint160 secondsPerLiquidityCumulativeX128, + bool initialized + ); +} diff --git a/package-lock.json b/package-lock.json index 6dd4dd2..06dccf5 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,10 +9,10 @@ "@commitlint/cli": "^11.0.0", "@commitlint/config-conventional": "^11.0.0", "ethlint": "^1.2.5", - "hardhat": "^2.6.7", + "hardhat": "^2.9.3", "husky": "^4.3.0", "prettier": "^2.1.2", - "prettier-plugin-solidity": "^1.0.0-alpha.57", + "prettier-plugin-solidity": "^1.0.0-beta.19", "pretty-quick": "^3.0.2" } }, @@ -433,34 +433,50 @@ } }, "node_modules/@ethereumjs/block": { - "version": "3.5.1", - "resolved": "https://registry.npmjs.org/@ethereumjs/block/-/block-3.5.1.tgz", - "integrity": "sha512-MoY9bHKABOBK6BW0v1N1Oc0Cve4x/giX67M3TtrVBUsKQTj2eznLGKpydoitxWSZ+WgKKSVhfRMzbCGRwk7T5w==", + "version": "3.6.2", + "resolved": "https://registry.npmjs.org/@ethereumjs/block/-/block-3.6.2.tgz", + "integrity": "sha512-mOqYWwMlAZpYUEOEqt7EfMFuVL2eyLqWWIzcf4odn6QgXY8jBI2NhVuJncrMCKeMZrsJAe7/auaRRB6YcdH+Qw==", "dev": true, "dependencies": { - "@ethereumjs/common": "^2.5.0", - "@ethereumjs/tx": "^3.3.1", - "ethereumjs-util": "^7.1.1", - "merkle-patricia-tree": "^4.2.1" + "@ethereumjs/common": "^2.6.3", + "@ethereumjs/tx": "^3.5.1", + "ethereumjs-util": "^7.1.4", + "merkle-patricia-tree": "^4.2.4" } }, "node_modules/@ethereumjs/blockchain": { - "version": "5.4.2", - "resolved": "https://registry.npmjs.org/@ethereumjs/blockchain/-/blockchain-5.4.2.tgz", - "integrity": "sha512-AOAAwz/lw2lciG9gf5wHi7M/qknraXXnLR66lYgbQ04qfyFC3ZE5x/5rLVm1Vu+kfJLlKrYZTmA0IbOkc7kvgw==", + "version": "5.5.2", + "resolved": "https://registry.npmjs.org/@ethereumjs/blockchain/-/blockchain-5.5.2.tgz", + "integrity": "sha512-Jz26iJmmsQtngerW6r5BDFaew/f2mObLrRZo3rskLOx1lmtMZ8+TX/vJexmivrnWgmAsTdNWhlKUYY4thPhPig==", "dev": true, "dependencies": { - "@ethereumjs/block": "^3.5.1", - "@ethereumjs/common": "^2.5.0", + "@ethereumjs/block": "^3.6.2", + "@ethereumjs/common": "^2.6.3", "@ethereumjs/ethash": "^1.1.0", - "debug": "^2.2.0", - "ethereumjs-util": "^7.1.1", + "debug": "^4.3.3", + "ethereumjs-util": "^7.1.4", "level-mem": "^5.0.1", "lru-cache": "^5.1.1", - "rlp": "^2.2.4", "semaphore-async-await": "^1.5.1" } }, + "node_modules/@ethereumjs/blockchain/node_modules/debug": { + "version": "4.3.4", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", + "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", + "dev": true, + "dependencies": { + "ms": "2.1.2" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, "node_modules/@ethereumjs/blockchain/node_modules/lru-cache": { "version": "5.1.1", "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-5.1.1.tgz", @@ -470,6 +486,12 @@ "yallist": "^3.0.2" } }, + "node_modules/@ethereumjs/blockchain/node_modules/ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "dev": true + }, "node_modules/@ethereumjs/blockchain/node_modules/yallist": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.1.1.tgz", @@ -477,13 +499,13 @@ "dev": true }, "node_modules/@ethereumjs/common": { - "version": "2.5.0", - "resolved": "https://registry.npmjs.org/@ethereumjs/common/-/common-2.5.0.tgz", - "integrity": "sha512-DEHjW6e38o+JmB/NO3GZBpW4lpaiBpkFgXF6jLcJ6gETBYpEyaA5nTimsWBUJR3Vmtm/didUEbNjajskugZORg==", + "version": "2.6.4", + "resolved": "https://registry.npmjs.org/@ethereumjs/common/-/common-2.6.4.tgz", + "integrity": "sha512-RDJh/R/EAr+B7ZRg5LfJ0BIpf/1LydFgYdvZEuTraojCbVypO2sQ+QnpP5u2wJf9DASyooKqu8O4FJEWUV6NXw==", "dev": true, "dependencies": { "crc-32": "^1.2.0", - "ethereumjs-util": "^7.1.1" + "ethereumjs-util": "^7.1.4" } }, "node_modules/@ethereumjs/ethash": { @@ -500,36 +522,58 @@ } }, "node_modules/@ethereumjs/tx": { - "version": "3.3.2", - "resolved": "https://registry.npmjs.org/@ethereumjs/tx/-/tx-3.3.2.tgz", - "integrity": "sha512-6AaJhwg4ucmwTvw/1qLaZUX5miWrwZ4nLOUsKyb/HtzS3BMw/CasKhdi1ims9mBKeK9sOJCH4qGKOBGyJCeeog==", + "version": "3.5.1", + "resolved": "https://registry.npmjs.org/@ethereumjs/tx/-/tx-3.5.1.tgz", + "integrity": "sha512-xzDrTiu4sqZXUcaBxJ4n4W5FrppwxLxZB4ZDGVLtxSQR4lVuOnFR6RcUHdg1mpUhAPVrmnzLJpxaeXnPxIyhWA==", "dev": true, "dependencies": { - "@ethereumjs/common": "^2.5.0", - "ethereumjs-util": "^7.1.2" + "@ethereumjs/common": "^2.6.3", + "ethereumjs-util": "^7.1.4" } }, "node_modules/@ethereumjs/vm": { - "version": "5.5.3", - "resolved": "https://registry.npmjs.org/@ethereumjs/vm/-/vm-5.5.3.tgz", - "integrity": "sha512-0k5OreWnlgXYs54wohgO11jtGI05GDasj2EYxzuaStxTi15CS3vow5wGYELC1pG9xngE1F/mFmKi/f14XRuDow==", + "version": "5.9.0", + "resolved": "https://registry.npmjs.org/@ethereumjs/vm/-/vm-5.9.0.tgz", + "integrity": "sha512-0IRsj4IuF8lFDWVVLc4mFOImaSX8VWF8CGm3mXHG/LLlQ/Tryy/kKXMw/bU9D+Zw03CdteW+wCGqNFS6+mPjpg==", "dev": true, "dependencies": { - "@ethereumjs/block": "^3.5.0", - "@ethereumjs/blockchain": "^5.4.1", - "@ethereumjs/common": "^2.5.0", - "@ethereumjs/tx": "^3.3.1", + "@ethereumjs/block": "^3.6.2", + "@ethereumjs/blockchain": "^5.5.2", + "@ethereumjs/common": "^2.6.4", + "@ethereumjs/tx": "^3.5.1", "async-eventemitter": "^0.2.4", "core-js-pure": "^3.0.1", - "debug": "^2.2.0", - "ethereumjs-util": "^7.1.1", + "debug": "^4.3.3", + "ethereumjs-util": "^7.1.4", "functional-red-black-tree": "^1.0.1", "mcl-wasm": "^0.7.1", - "merkle-patricia-tree": "^4.2.1", - "rustbn.js": "~0.2.0", - "util.promisify": "^1.0.1" + "merkle-patricia-tree": "^4.2.4", + "rustbn.js": "~0.2.0" + } + }, + "node_modules/@ethereumjs/vm/node_modules/debug": { + "version": "4.3.4", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", + "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", + "dev": true, + "dependencies": { + "ms": "2.1.2" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } } }, + "node_modules/@ethereumjs/vm/node_modules/ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "dev": true + }, "node_modules/@ethersproject/abi": { "version": "5.5.0", "resolved": "https://registry.npmjs.org/@ethersproject/abi/-/abi-5.5.0.tgz", @@ -921,6 +965,46 @@ "@ethersproject/strings": "^5.5.0" } }, + "node_modules/@metamask/eth-sig-util": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/@metamask/eth-sig-util/-/eth-sig-util-4.0.1.tgz", + "integrity": "sha512-tghyZKLHZjcdlDqCA3gNZmLeR0XvOE9U1qoQO9ohyAZT6Pya+H9vkBPcsyXytmYLNgVoin7CKCmweo/R43V+tQ==", + "dev": true, + "dependencies": { + "ethereumjs-abi": "^0.6.8", + "ethereumjs-util": "^6.2.1", + "ethjs-util": "^0.1.6", + "tweetnacl": "^1.0.3", + "tweetnacl-util": "^0.15.1" + }, + "engines": { + "node": ">=12.0.0" + } + }, + "node_modules/@metamask/eth-sig-util/node_modules/@types/bn.js": { + "version": "4.11.6", + "resolved": "https://registry.npmjs.org/@types/bn.js/-/bn.js-4.11.6.tgz", + "integrity": "sha512-pqr857jrp2kPuO9uRjZ3PwnJTjoQy+fcdxvBTvHm6dkmEL9q+hDD/2j/0ELOBPtPnS8LjCX0gI9nbl8lVkadpg==", + "dev": true, + "dependencies": { + "@types/node": "*" + } + }, + "node_modules/@metamask/eth-sig-util/node_modules/ethereumjs-util": { + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/ethereumjs-util/-/ethereumjs-util-6.2.1.tgz", + "integrity": "sha512-W2Ktez4L01Vexijrm5EB6w7dg4n/TgpoYU4avuT5T3Vmnw/eCRtiBrJfQYS/DCSvDIOLn2k57GcHdeBcgVxAqw==", + "dev": true, + "dependencies": { + "@types/bn.js": "^4.11.3", + "bn.js": "^4.11.0", + "create-hash": "^1.1.2", + "elliptic": "^6.5.2", + "ethereum-cryptography": "^0.1.3", + "ethjs-util": "0.1.6", + "rlp": "^2.2.3" + } + }, "node_modules/@sentry/core": { "version": "5.30.0", "resolved": "https://registry.npmjs.org/@sentry/core/-/core-5.30.0.tgz", @@ -1024,16 +1108,18 @@ } }, "node_modules/@solidity-parser/parser": { - "version": "0.11.1", - "resolved": "https://registry.npmjs.org/@solidity-parser/parser/-/parser-0.11.1.tgz", - "integrity": "sha512-H8BSBoKE8EubJa0ONqecA2TviT3TnHeC4NpgnAHSUiuhZoQBfPB4L2P9bs8R6AoTW10Endvh3vc+fomVMIDIYQ==", + "version": "0.14.1", + "resolved": "https://registry.npmjs.org/@solidity-parser/parser/-/parser-0.14.1.tgz", + "integrity": "sha512-eLjj2L6AuQjBB6s/ibwCAc0DwrR5Ge+ys+wgWo+bviU7fV2nTMQhU63CGaDKXg9iTmMxwhkyoggdIR7ZGRfMgw==", "dev": true, - "license": "MIT" + "dependencies": { + "antlr4ts": "^0.5.0-alpha.4" + } }, "node_modules/@types/abstract-leveldown": { - "version": "5.0.2", - "resolved": "https://registry.npmjs.org/@types/abstract-leveldown/-/abstract-leveldown-5.0.2.tgz", - "integrity": "sha512-+jA1XXF3jsz+Z7FcuiNqgK53hTa/luglT2TyTpKPqoYbxVY+mCPF22Rm+q3KPBrMHJwNXFrTViHszBOfU4vftQ==", + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/@types/abstract-leveldown/-/abstract-leveldown-7.2.0.tgz", + "integrity": "sha512-q5veSX6zjUy/DlDhR4Y4cU0k2Ar+DT2LUraP00T19WLmTO6Se1djepCCaqU6nQrwcJ5Hyo/CWqxTzrrFg8eqbQ==", "dev": true }, "node_modules/@types/bn.js": { @@ -1083,9 +1169,9 @@ "license": "MIT" }, "node_modules/@types/node": { - "version": "16.11.6", - "resolved": "https://registry.npmjs.org/@types/node/-/node-16.11.6.tgz", - "integrity": "sha512-ua7PgUoeQFjmWPcoo9khiPum3Pd60k4/2ZGXt18sm2Slk0W0xZTqt5Y0Ny1NyBiN1EVQ/+FaF9NcY4Qe6rwk5w==", + "version": "17.0.28", + "resolved": "https://registry.npmjs.org/@types/node/-/node-17.0.28.tgz", + "integrity": "sha512-UYmIeBnB0On70dN1iGCinsL1qH5JmIEJwa+3KX0Xw4HQJ8KA16ULlyTCNmnzfyzj/BlxZKmZLqp4TYdssnov1w==", "dev": true }, "node_modules/@types/normalize-package-data": { @@ -1120,6 +1206,12 @@ "@types/node": "*" } }, + "node_modules/@ungap/promise-all-settled": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@ungap/promise-all-settled/-/promise-all-settled-1.1.2.tgz", + "integrity": "sha512-sL/cEvJWAnClXw0wHk85/2L0G6Sj8UB0Ctc1TEMbKSsmpRosqhwj9gWgFRZSrBr2f9tiXISwNhCPmlfqUqyb9Q==", + "dev": true + }, "node_modules/abort-controller": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/abort-controller/-/abort-controller-3.0.0.tgz", @@ -1192,6 +1284,19 @@ "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", "dev": true }, + "node_modules/aggregate-error": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/aggregate-error/-/aggregate-error-3.1.0.tgz", + "integrity": "sha512-4I7Td01quW/RpocfNayFdFVk1qSuoh0E7JrbRJ16nH01HhKFQ88INq9Sd+nd72zqRySlr9BmDA8xlEJ6vJMrYA==", + "dev": true, + "dependencies": { + "clean-stack": "^2.0.0", + "indent-string": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, "node_modules/ajv": { "version": "5.5.2", "resolved": "https://registry.npmjs.org/ajv/-/ajv-5.5.2.tgz", @@ -1242,11 +1347,10 @@ } }, "node_modules/ansi-regex": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.0.tgz", - "integrity": "sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg==", + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", "dev": true, - "license": "MIT", "engines": { "node": ">=8" } @@ -1285,13 +1389,10 @@ } }, "node_modules/argparse": { - "version": "1.0.10", - "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", - "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", - "dev": true, - "dependencies": { - "sprintf-js": "~1.0.2" - } + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", + "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", + "dev": true }, "node_modules/arr-diff": { "version": "4.0.0", @@ -1381,9 +1482,9 @@ } }, "node_modules/async": { - "version": "2.6.3", - "resolved": "https://registry.npmjs.org/async/-/async-2.6.3.tgz", - "integrity": "sha512-zflvls11DCy+dQWzTW2dzuilv8Z5X/pjfmZOWba6TNIVDm+2UDaJmXSOXlasHKfNBs8oo3M0aT50fDEWfKZjXg==", + "version": "2.6.4", + "resolved": "https://registry.npmjs.org/async/-/async-2.6.4.tgz", + "integrity": "sha512-mzo5dfJYwAn29PeiJ0zvwTo04zj8HDJj0Mn8TD7sno7q12prdbnasKJHhkm2c1LgrhlJ0teaea8860oxi51mGA==", "dev": true, "dependencies": { "lodash": "^4.17.14" @@ -1518,9 +1619,9 @@ } }, "node_modules/blakejs": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/blakejs/-/blakejs-1.1.1.tgz", - "integrity": "sha512-bLG6PHOCZJKNshTjGRBvET0vTciwQE6zFKOKKXPDJfwFBd4Ac0yBfPZqcGvGJap50l7ktvlpFqc2jGVaUgbJgg==", + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/blakejs/-/blakejs-1.2.1.tgz", + "integrity": "sha512-QXUSXI3QVc/gJME0dBpXrag1kbzOqCjCX8/b54ntNyW6sjtoqxqRk3LTmXzaJoh71zMsDCjM+47jS7XiwN/+fQ==", "dev": true }, "node_modules/bn.js": { @@ -1808,6 +1909,15 @@ "node": ">=0.10.0" } }, + "node_modules/clean-stack": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/clean-stack/-/clean-stack-2.2.0.tgz", + "integrity": "sha512-4diC9HaTE+KRAMWhDhrGOECgWZxoevMc5TlkObMqNSsVU62PYzXZ/SMTjzyGAFF1YusgxGcSWTEXBhp0CPwQ1A==", + "dev": true, + "engines": { + "node": ">=6" + } + }, "node_modules/cliui": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/cliui/-/cliui-6.0.0.tgz", @@ -2034,9 +2144,9 @@ } }, "node_modules/core-js-pure": { - "version": "3.19.0", - "resolved": "https://registry.npmjs.org/core-js-pure/-/core-js-pure-3.19.0.tgz", - "integrity": "sha512-UEQk8AxyCYvNAs6baNoPqDADv7BX0AmBLGxVsrAifPPx/C8EAzV4Q+2ZUJqVzfI2TQQEZITnwUkWcHpgc/IubQ==", + "version": "3.22.2", + "resolved": "https://registry.npmjs.org/core-js-pure/-/core-js-pure-3.22.2.tgz", + "integrity": "sha512-Lb+/XT4WC4PaCWWtZpNPaXmjiNDUe5CJuUtbkMrIM1kb1T/jJoAIp+bkVP/r5lHzMr+ZAAF8XHp7+my6Ol0ysQ==", "dev": true, "hasInstallScript": true, "funding": { @@ -2069,14 +2179,10 @@ } }, "node_modules/crc-32": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/crc-32/-/crc-32-1.2.0.tgz", - "integrity": "sha512-1uBwHxF+Y/4yF5G48fwnKq6QsIXheor3ZLPT80yGBV1oEUwpPojlEhQbWKVw1VwcTQyMGHK1/XMmTjmlsmTTGA==", + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/crc-32/-/crc-32-1.2.2.tgz", + "integrity": "sha512-ROmzCKrTnOwybPcJApAA6WBWij23HVfGVNKqqrZpuyZOHqK2CwHSvpGuyt/UNNvaIjEd8X5IFGp4Mh+Ie1IHJQ==", "dev": true, - "dependencies": { - "exit-on-epipe": "~1.0.1", - "printj": "~1.1.0" - }, "bin": { "crc32": "bin/crc32.njs" }, @@ -2209,18 +2315,6 @@ "node": ">=6" } }, - "node_modules/define-properties": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.1.3.tgz", - "integrity": "sha512-3MqfYKj2lLzdMSf8ZIZE/V+Zuy+BgD6f164e8K2w7dgnpKArBDerGYpM46IYYcjnkdPNMjPk9A6VFB8+3SKlXQ==", - "dev": true, - "dependencies": { - "object-keys": "^1.0.12" - }, - "engines": { - "node": ">= 0.4" - } - }, "node_modules/define-property": { "version": "0.2.5", "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", @@ -2330,13 +2424,6 @@ "node": ">=0.3.1" } }, - "node_modules/dir-to-object": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/dir-to-object/-/dir-to-object-2.0.0.tgz", - "integrity": "sha512-sXs0JKIhymON7T1UZuO2Ud6VTNAx/VTBXIl4+3mjb2RgfOpt+hectX0x04YqPOPdkeOAKoJuKqwqnXXURNPNEA==", - "dev": true, - "license": "MIT" - }, "node_modules/dot-prop": { "version": "5.3.0", "resolved": "https://registry.npmjs.org/dot-prop/-/dot-prop-5.3.0.tgz", @@ -2447,55 +2534,13 @@ "is-arrayish": "^0.2.1" } }, - "node_modules/es-abstract": { - "version": "1.19.1", - "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.19.1.tgz", - "integrity": "sha512-2vJ6tjA/UfqLm2MPs7jxVybLoB8i1t1Jd9R3kISld20sIxPcTbLuggQOUxeWeAvIUkduv/CfMjuh4WmiXr2v9w==", - "dev": true, - "dependencies": { - "call-bind": "^1.0.2", - "es-to-primitive": "^1.2.1", - "function-bind": "^1.1.1", - "get-intrinsic": "^1.1.1", - "get-symbol-description": "^1.0.0", - "has": "^1.0.3", - "has-symbols": "^1.0.2", - "internal-slot": "^1.0.3", - "is-callable": "^1.2.4", - "is-negative-zero": "^2.0.1", - "is-regex": "^1.1.4", - "is-shared-array-buffer": "^1.0.1", - "is-string": "^1.0.7", - "is-weakref": "^1.0.1", - "object-inspect": "^1.11.0", - "object-keys": "^1.1.1", - "object.assign": "^4.1.2", - "string.prototype.trimend": "^1.0.4", - "string.prototype.trimstart": "^1.0.4", - "unbox-primitive": "^1.0.1" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/es-to-primitive": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/es-to-primitive/-/es-to-primitive-1.2.1.tgz", - "integrity": "sha512-QCOllgZJtaUo9miYBcLChTUaHNjJF3PYs1VidD7AwiEj1kYxKeQTctLAezAOH5ZKRH0g2IgPn6KwB4IT8iRpvA==", + "node_modules/escalade": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.1.tgz", + "integrity": "sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw==", "dev": true, - "dependencies": { - "is-callable": "^1.1.4", - "is-date-object": "^1.0.1", - "is-symbol": "^1.0.2" - }, "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" + "node": ">=6" } }, "node_modules/escape-string-regexp": { @@ -2508,46 +2553,6 @@ "node": ">=0.8.0" } }, - "node_modules/esprima": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", - "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", - "dev": true, - "bin": { - "esparse": "bin/esparse.js", - "esvalidate": "bin/esvalidate.js" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/eth-sig-util": { - "version": "2.5.4", - "resolved": "https://registry.npmjs.org/eth-sig-util/-/eth-sig-util-2.5.4.tgz", - "integrity": "sha512-aCMBwp8q/4wrW4QLsF/HYBOSA7TpLKmkVwP3pYQNkEEseW2Rr8Z5Uxc9/h6HX+OG3tuHo+2bINVSihIeBfym6A==", - "dev": true, - "dependencies": { - "ethereumjs-abi": "0.6.8", - "ethereumjs-util": "^5.1.1", - "tweetnacl": "^1.0.3", - "tweetnacl-util": "^0.15.0" - } - }, - "node_modules/eth-sig-util/node_modules/ethereumjs-util": { - "version": "5.2.1", - "resolved": "https://registry.npmjs.org/ethereumjs-util/-/ethereumjs-util-5.2.1.tgz", - "integrity": "sha512-v3kT+7zdyCm1HIqWlLNrHGqHGLpGYIhjeHxQjnDXjLT2FyGJDsd3LWMYUo7pAFRrk86CR3nUJfhC81CCoJNNGQ==", - "dev": true, - "dependencies": { - "bn.js": "^4.11.0", - "create-hash": "^1.1.2", - "elliptic": "^6.5.2", - "ethereum-cryptography": "^0.1.3", - "ethjs-util": "^0.1.3", - "rlp": "^2.0.0", - "safe-buffer": "^5.1.1" - } - }, "node_modules/ethereum-cryptography": { "version": "0.1.3", "resolved": "https://registry.npmjs.org/ethereum-cryptography/-/ethereum-cryptography-0.1.3.tgz", @@ -2606,9 +2611,9 @@ } }, "node_modules/ethereumjs-util": { - "version": "7.1.3", - "resolved": "https://registry.npmjs.org/ethereumjs-util/-/ethereumjs-util-7.1.3.tgz", - "integrity": "sha512-y+82tEbyASO0K0X1/SRhbJJoAlfcvq8JbrG4a5cjrOks7HS/36efU/0j2flxCPOUM++HFahk33kr/ZxyC4vNuw==", + "version": "7.1.4", + "resolved": "https://registry.npmjs.org/ethereumjs-util/-/ethereumjs-util-7.1.4.tgz", + "integrity": "sha512-p6KmuPCX4mZIqsQzXfmSx9Y0l2hqf+VkAiwSisW3UKUFdk8ZkAt+AYaor83z2nSi6CU2zSsXMlD80hAbNEGM0A==", "dev": true, "dependencies": { "@types/bn.js": "^5.1.0", @@ -2709,15 +2714,6 @@ "url": "https://github.com/sindresorhus/execa?sponsor=1" } }, - "node_modules/exit-on-epipe": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/exit-on-epipe/-/exit-on-epipe-1.0.1.tgz", - "integrity": "sha512-h2z5mrROTxce56S+pnvAV890uu7ls7f1kEvVGJbw1OlFH3/mlJ5bkXu0KRyW94v37zzHPiUd55iLn3DA7TjWpw==", - "dev": true, - "engines": { - "node": ">=0.8" - } - }, "node_modules/expand-brackets": { "version": "0.1.5", "resolved": "https://registry.npmjs.org/expand-brackets/-/expand-brackets-0.1.5.tgz", @@ -2892,40 +2888,14 @@ } }, "node_modules/flat": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/flat/-/flat-4.1.1.tgz", - "integrity": "sha512-FmTtBsHskrU6FJ2VxCnsDb84wu9zhmO3cUX2kGFb5tuwhfXxGciiT0oRY+cck35QmG+NmGh5eLz6lLCpWTqwpA==", + "version": "5.0.2", + "resolved": "https://registry.npmjs.org/flat/-/flat-5.0.2.tgz", + "integrity": "sha512-b6suED+5/3rTpUBdG1gupIl8MPFCAMA0QXwmljLhvCUKcUvdE4gWky9zpuGCcXHOsz4J9wPGNWq6OKpmIzz3hQ==", "dev": true, - "dependencies": { - "is-buffer": "~2.0.3" - }, "bin": { "flat": "cli.js" } }, - "node_modules/flat/node_modules/is-buffer": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-2.0.5.tgz", - "integrity": "sha512-i2R6zNFDwgEHJyQUtJEk0XFi1i0dPFn/oqjK3/vPCcDeJvW5NQ83V8QbicfF1SupOaB0h8ntgBC2YiE7dfyctQ==", - "dev": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ], - "engines": { - "node": ">=4" - } - }, "node_modules/follow-redirects": { "version": "1.14.4", "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.14.4.tgz", @@ -2946,15 +2916,6 @@ } } }, - "node_modules/for-each": { - "version": "0.3.3", - "resolved": "https://registry.npmjs.org/for-each/-/for-each-0.3.3.tgz", - "integrity": "sha512-jqYfLp7mo9vIyQf8ykW2v7A+2N4QjeCeI5+Dz9XraiO1ign81wjiH7Fb9vSOWvQfNtmSa4H2RoQTrrXivdUZmw==", - "dev": true, - "dependencies": { - "is-callable": "^1.1.3" - } - }, "node_modules/for-in": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/for-in/-/for-in-1.0.2.tgz", @@ -3105,22 +3066,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/get-symbol-description": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/get-symbol-description/-/get-symbol-description-1.0.0.tgz", - "integrity": "sha512-2EmdH1YvIQiZpltCNgkuiUnyukzxM/R6NDJX31Ke3BG1Nq5b0S2PhX59UKi9vZpPDQVdqn+1IcaAwnzTT5vCjw==", - "dev": true, - "dependencies": { - "call-bind": "^1.0.2", - "get-intrinsic": "^1.1.1" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/get-value": { "version": "2.0.6", "resolved": "https://registry.npmjs.org/get-value/-/get-value-2.0.6.tgz", @@ -3234,23 +3179,25 @@ } }, "node_modules/hardhat": { - "version": "2.6.7", - "resolved": "https://registry.npmjs.org/hardhat/-/hardhat-2.6.7.tgz", - "integrity": "sha512-Mua01f6ZN1feQLktHSH2p5A5LCdA+Wf7+O2lJDH6wClvWPtI2eqKNNY2gxBwYXoQ28GZrT3K6mqQOZeRWAca6Q==", + "version": "2.9.3", + "resolved": "https://registry.npmjs.org/hardhat/-/hardhat-2.9.3.tgz", + "integrity": "sha512-7Vw99RbYbMZ15UzegOR/nqIYIqddZXvLwJGaX5sX4G5bydILnbjmDU6g3jMKJSiArEixS3vHAEaOs5CW1JQ3hg==", "dev": true, "dependencies": { - "@ethereumjs/block": "^3.4.0", - "@ethereumjs/blockchain": "^5.4.0", - "@ethereumjs/common": "^2.4.0", - "@ethereumjs/tx": "^3.3.0", - "@ethereumjs/vm": "^5.5.2", + "@ethereumjs/block": "^3.6.0", + "@ethereumjs/blockchain": "^5.5.0", + "@ethereumjs/common": "^2.6.0", + "@ethereumjs/tx": "^3.4.0", + "@ethereumjs/vm": "^5.6.0", "@ethersproject/abi": "^5.1.2", + "@metamask/eth-sig-util": "^4.0.0", "@sentry/node": "^5.18.1", - "@solidity-parser/parser": "^0.14.0", + "@solidity-parser/parser": "^0.14.1", "@types/bn.js": "^5.1.0", "@types/lru-cache": "^5.1.0", "abort-controller": "^3.0.0", "adm-zip": "^0.4.16", + "aggregate-error": "^3.0.0", "ansi-escapes": "^4.3.0", "chalk": "^2.4.2", "chokidar": "^3.4.0", @@ -3258,22 +3205,20 @@ "debug": "^4.1.1", "enquirer": "^2.3.0", "env-paths": "^2.2.0", - "eth-sig-util": "^2.5.2", "ethereum-cryptography": "^0.1.2", "ethereumjs-abi": "^0.6.8", - "ethereumjs-util": "^7.1.0", + "ethereumjs-util": "^7.1.3", "find-up": "^2.1.0", "fp-ts": "1.19.3", "fs-extra": "^7.0.1", "glob": "^7.1.3", - "https-proxy-agent": "^5.0.0", "immutable": "^4.0.0-rc.12", "io-ts": "1.10.4", "lodash": "^4.17.11", - "merkle-patricia-tree": "^4.2.0", + "merkle-patricia-tree": "^4.2.2", "mnemonist": "^0.38.0", - "mocha": "^7.1.2", - "node-fetch": "^2.6.0", + "mocha": "^9.2.0", + "p-map": "^4.0.0", "qs": "^6.7.0", "raw-body": "^2.4.1", "resolve": "1.17.0", @@ -3284,41 +3229,15 @@ "stacktrace-parser": "^0.1.10", "true-case-path": "^2.2.1", "tsort": "0.0.1", - "uuid": "^3.3.2", + "undici": "^4.14.1", + "uuid": "^8.3.2", "ws": "^7.4.6" }, "bin": { "hardhat": "internal/cli/cli.js" }, "engines": { - "node": "^12.0.0 || ^14.0.0 || >=16.0.0" - } - }, - "node_modules/hardhat/node_modules/@solidity-parser/parser": { - "version": "0.14.0", - "resolved": "https://registry.npmjs.org/@solidity-parser/parser/-/parser-0.14.0.tgz", - "integrity": "sha512-cX0JJRcmPtNUJpzD2K7FdA7qQsTOk1UZnFx2k7qAg9ZRvuaH5NBe5IEdBMXGlmf2+FmjhqbygJ26H8l2SV7aKQ==", - "dev": true, - "dependencies": { - "antlr4ts": "^0.5.0-alpha.4" - } - }, - "node_modules/hardhat/node_modules/ansi-colors": { - "version": "3.2.3", - "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-3.2.3.tgz", - "integrity": "sha512-LEHHyuhlPY3TmuUYMh2oz89lTShfvgbmzaBcxve9t/9Wuy7Dwf4yoAKcND7KFT1HAQfqZ12qtc+DUrBMeKF9nw==", - "dev": true, - "engines": { - "node": ">=6" - } - }, - "node_modules/hardhat/node_modules/ansi-regex": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", - "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==", - "dev": true, - "engines": { - "node": ">=6" + "node": "^12.0.0 || ^14.0.0 || ^16.0.0" } }, "node_modules/hardhat/node_modules/ansi-styles": { @@ -3388,10 +3307,16 @@ } }, "node_modules/hardhat/node_modules/chokidar": { - "version": "3.5.2", - "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.5.2.tgz", - "integrity": "sha512-ekGhOnNVPgT77r4K/U3GDhu+FQ2S8TnK/s2KbIGXi0SZWuwkZ2QNyfWdZW+TVfn84DpEP7rLeCt2UI6bJ8GwbQ==", + "version": "3.5.3", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.5.3.tgz", + "integrity": "sha512-Dr3sfKRP6oTcjf2JmUmFJfeVMvXBdegxB0iVQ5eb2V10uFJUCAS8OByZdVAyVb8xXNz3GjjTgj9kLWsZTqE6kw==", "dev": true, + "funding": [ + { + "type": "individual", + "url": "https://paulmillr.com/funding/" + } + ], "dependencies": { "anymatch": "~3.1.2", "braces": "~3.0.2", @@ -3409,14 +3334,14 @@ } }, "node_modules/hardhat/node_modules/cliui": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/cliui/-/cliui-5.0.0.tgz", - "integrity": "sha512-PYeGSEmmHM6zvoef2w8TPzlrnNpXIjTipYK780YswmIP9vjxmd6Y2a3CB2Ks6/AU8NHjZugXvo8w3oWM2qnwXA==", + "version": "7.0.4", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-7.0.4.tgz", + "integrity": "sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ==", "dev": true, "dependencies": { - "string-width": "^3.1.0", - "strip-ansi": "^5.2.0", - "wrap-ansi": "^5.1.0" + "string-width": "^4.2.0", + "strip-ansi": "^6.0.0", + "wrap-ansi": "^7.0.0" } }, "node_modules/hardhat/node_modules/color-convert": { @@ -3435,9 +3360,9 @@ "dev": true }, "node_modules/hardhat/node_modules/debug": { - "version": "4.3.2", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.2.tgz", - "integrity": "sha512-mOp8wKcvj7XxC78zLgw/ZA+6TSgkoE2C/ienthhRD298T7UNwAg9diBpLRxC0mOezLl4B0xV7M0cCO6P/O0Xhw==", + "version": "4.3.3", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.3.tgz", + "integrity": "sha512-/zxw5+vh1Tfv+4Qn7a5nsbcJKPaSvCDhojn6FEl9vupwK2VCSDtEiEtqr8DFtzYFOdz63LBkxec7DYuc2jon6Q==", "dev": true, "dependencies": { "ms": "2.1.2" @@ -3451,11 +3376,14 @@ } } }, - "node_modules/hardhat/node_modules/emoji-regex": { - "version": "7.0.3", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-7.0.3.tgz", - "integrity": "sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA==", - "dev": true + "node_modules/hardhat/node_modules/diff": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/diff/-/diff-5.0.0.tgz", + "integrity": "sha512-/VTCrvm5Z0JGty/BWHljh+BAiw3IK+2j87NGMu8Nwc/f48WoDAC395uomO9ZD117ZOBaHmkX1oyLvkVM/aIT3w==", + "dev": true, + "engines": { + "node": ">=0.3.1" + } }, "node_modules/hardhat/node_modules/fill-range": { "version": "7.0.1", @@ -3589,15 +3517,6 @@ "node": ">=0.10.0" } }, - "node_modules/hardhat/node_modules/is-fullwidth-code-point": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", - "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", - "dev": true, - "engines": { - "node": ">=4" - } - }, "node_modules/hardhat/node_modules/is-glob": { "version": "4.0.3", "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", @@ -3641,219 +3560,171 @@ "node": ">=4" } }, - "node_modules/hardhat/node_modules/minimist": { - "version": "1.2.5", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz", - "integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==", - "dev": true - }, - "node_modules/hardhat/node_modules/mkdirp": { - "version": "0.5.5", - "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.5.tgz", - "integrity": "sha512-NKmAlESf6jMGym1++R0Ra7wvhV+wFW63FaSOFPwRahvea0gMUcGUhVeAg/0BC0wiv9ih5NYPB1Wn1UEI1/L+xQ==", - "dev": true, - "dependencies": { - "minimist": "^1.2.5" - }, - "bin": { - "mkdirp": "bin/cmd.js" - } - }, "node_modules/hardhat/node_modules/mocha": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/mocha/-/mocha-7.2.0.tgz", - "integrity": "sha512-O9CIypScywTVpNaRrCAgoUnJgozpIofjKUYmJhiCIJMiuYnLI6otcb1/kpW9/n/tJODHGZ7i8aLQoDVsMtOKQQ==", + "version": "9.2.2", + "resolved": "https://registry.npmjs.org/mocha/-/mocha-9.2.2.tgz", + "integrity": "sha512-L6XC3EdwT6YrIk0yXpavvLkn8h+EU+Y5UcCHKECyMbdUIxyMuZj4bX4U9e1nvnvUUvQVsV2VHQr5zLdcUkhW/g==", "dev": true, "dependencies": { - "ansi-colors": "3.2.3", + "@ungap/promise-all-settled": "1.1.2", + "ansi-colors": "4.1.1", "browser-stdout": "1.3.1", - "chokidar": "3.3.0", - "debug": "3.2.6", - "diff": "3.5.0", - "escape-string-regexp": "1.0.5", - "find-up": "3.0.0", - "glob": "7.1.3", + "chokidar": "3.5.3", + "debug": "4.3.3", + "diff": "5.0.0", + "escape-string-regexp": "4.0.0", + "find-up": "5.0.0", + "glob": "7.2.0", "growl": "1.10.5", "he": "1.2.0", - "js-yaml": "3.13.1", - "log-symbols": "3.0.0", - "minimatch": "3.0.4", - "mkdirp": "0.5.5", - "ms": "2.1.1", - "node-environment-flags": "1.0.6", - "object.assign": "4.1.0", - "strip-json-comments": "2.0.1", - "supports-color": "6.0.0", - "which": "1.3.1", - "wide-align": "1.1.3", - "yargs": "13.3.2", - "yargs-parser": "13.1.2", - "yargs-unparser": "1.6.0" + "js-yaml": "4.1.0", + "log-symbols": "4.1.0", + "minimatch": "4.2.1", + "ms": "2.1.3", + "nanoid": "3.3.1", + "serialize-javascript": "6.0.0", + "strip-json-comments": "3.1.1", + "supports-color": "8.1.1", + "which": "2.0.2", + "workerpool": "6.2.0", + "yargs": "16.2.0", + "yargs-parser": "20.2.4", + "yargs-unparser": "2.0.0" }, "bin": { "_mocha": "bin/_mocha", "mocha": "bin/mocha" }, "engines": { - "node": ">= 8.10.0" + "node": ">= 12.0.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/mochajs" } }, - "node_modules/hardhat/node_modules/mocha/node_modules/chokidar": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.3.0.tgz", - "integrity": "sha512-dGmKLDdT3Gdl7fBUe8XK+gAtGmzy5Fn0XkkWQuYxGIgWVPPse2CxFA5mtrlD0TOHaHjEUqkWNyP1XdHoJES/4A==", + "node_modules/hardhat/node_modules/mocha/node_modules/escape-string-regexp": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", + "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", "dev": true, - "dependencies": { - "anymatch": "~3.1.1", - "braces": "~3.0.2", - "glob-parent": "~5.1.0", - "is-binary-path": "~2.1.0", - "is-glob": "~4.0.1", - "normalize-path": "~3.0.0", - "readdirp": "~3.2.0" - }, "engines": { - "node": ">= 8.10.0" + "node": ">=10" }, - "optionalDependencies": { - "fsevents": "~2.1.1" - } - }, - "node_modules/hardhat/node_modules/mocha/node_modules/debug": { - "version": "3.2.6", - "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.6.tgz", - "integrity": "sha512-mel+jf7nrtEl5Pn1Qx46zARXKDpBbvzezse7p7LqINmdoIk8PYP5SySaxEmYv6TZ0JyEKA1hsCId6DIhgITtWQ==", - "deprecated": "Debug versions >=3.2.0 <3.2.7 || >=4 <4.3.1 have a low-severity ReDos regression when used in a Node.js environment. It is recommended you upgrade to 3.2.7 or 4.3.1. (https://github.com/visionmedia/debug/issues/797)", - "dev": true, - "dependencies": { - "ms": "^2.1.1" + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/hardhat/node_modules/mocha/node_modules/find-up": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-3.0.0.tgz", - "integrity": "sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg==", + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz", + "integrity": "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==", "dev": true, "dependencies": { - "locate-path": "^3.0.0" + "locate-path": "^6.0.0", + "path-exists": "^4.0.0" }, "engines": { - "node": ">=6" + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/hardhat/node_modules/mocha/node_modules/fsevents": { - "version": "2.1.3", - "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.1.3.tgz", - "integrity": "sha512-Auw9a4AxqWpa9GUfj370BMPzzyncfBABW8Mab7BGWBYDj4Isgq+cDKtx0i6u9jcX9pQDnswsaaOTgTmA5pEjuQ==", - "deprecated": "\"Please update to latest v2.3 or v2.2\"", + "node_modules/hardhat/node_modules/mocha/node_modules/has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", "dev": true, - "hasInstallScript": true, - "optional": true, - "os": [ - "darwin" - ], "engines": { - "node": "^8.16.0 || ^10.6.0 || >=11.0.0" + "node": ">=8" } }, - "node_modules/hardhat/node_modules/mocha/node_modules/glob": { - "version": "7.1.3", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.3.tgz", - "integrity": "sha512-vcfuiIxogLV4DlGBHIUOwI0IbrJ8HWPc4MU7HzviGeNho/UJDfi6B5p3sHeWIQ0KGIU0Jpxi5ZHxemQfLkkAwQ==", + "node_modules/hardhat/node_modules/mocha/node_modules/locate-path": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz", + "integrity": "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==", "dev": true, "dependencies": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^3.0.4", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" + "p-locate": "^5.0.0" }, "engines": { - "node": "*" + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/hardhat/node_modules/mocha/node_modules/locate-path": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-3.0.0.tgz", - "integrity": "sha512-7AO748wWnIhNqAuaty2ZWHkQHRSNfPVIsPIfwEOWO22AmaoVrWavlOcMR5nzTLNYvp36X220/maaRsrec1G65A==", + "node_modules/hardhat/node_modules/mocha/node_modules/minimatch": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-4.2.1.tgz", + "integrity": "sha512-9Uq1ChtSZO+Mxa/CL1eGizn2vRn3MlLgzhT0Iz8zaY8NdvxvB0d5QdPFmCKf7JKA9Lerx5vRrnwO03jsSfGG9g==", "dev": true, "dependencies": { - "p-locate": "^3.0.0", - "path-exists": "^3.0.0" + "brace-expansion": "^1.1.7" }, "engines": { - "node": ">=6" + "node": ">=10" } }, "node_modules/hardhat/node_modules/mocha/node_modules/ms": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.1.tgz", - "integrity": "sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg==", + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", "dev": true }, "node_modules/hardhat/node_modules/mocha/node_modules/p-limit": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", - "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", + "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", "dev": true, "dependencies": { - "p-try": "^2.0.0" + "yocto-queue": "^0.1.0" }, "engines": { - "node": ">=6" + "node": ">=10" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/hardhat/node_modules/mocha/node_modules/p-locate": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-3.0.0.tgz", - "integrity": "sha512-x+12w/To+4GFfgJhBEpiDcLozRJGegY+Ei7/z0tSLkMmxGZNybVMSfWj9aJn8Z5Fc7dBUNJOOVgPv2H7IwulSQ==", + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-5.0.0.tgz", + "integrity": "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==", "dev": true, "dependencies": { - "p-limit": "^2.0.0" + "p-limit": "^3.0.2" }, "engines": { - "node": ">=6" - } - }, - "node_modules/hardhat/node_modules/mocha/node_modules/p-try": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", - "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", - "dev": true, - "engines": { - "node": ">=6" + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/hardhat/node_modules/mocha/node_modules/readdirp": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.2.0.tgz", - "integrity": "sha512-crk4Qu3pmXwgxdSgGhgA/eXiJAPQiX4GMOZZMXnqKxHX7TaoL+3gQVo/WeuAiogr07DpnfjIMpXXa+PAIvwPGQ==", + "node_modules/hardhat/node_modules/mocha/node_modules/path-exists": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", + "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", "dev": true, - "dependencies": { - "picomatch": "^2.0.4" - }, "engines": { - "node": ">= 8" + "node": ">=8" } }, "node_modules/hardhat/node_modules/mocha/node_modules/supports-color": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-6.0.0.tgz", - "integrity": "sha512-on9Kwidc1IUQo+bQdhi8+Tijpo0e1SS6RoGo2guUwn5vdaxw8RXOF9Vb2ws+ihWOmh4JnCJOvaziZWP1VABaLg==", + "version": "8.1.1", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-8.1.1.tgz", + "integrity": "sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==", "dev": true, "dependencies": { - "has-flag": "^3.0.0" + "has-flag": "^4.0.0" }, "engines": { - "node": ">=6" + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/supports-color?sponsor=1" } }, "node_modules/hardhat/node_modules/ms": { @@ -3871,21 +3742,6 @@ "node": ">=0.10.0" } }, - "node_modules/hardhat/node_modules/object.assign": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.1.0.tgz", - "integrity": "sha512-exHJeq6kBKj58mqGyTQ9DFvrZC/eR6OwxzoM9YRoGBqrXYonaFyGiFMuc9VZrXf7DarreEwMpurG3dd+CNyW5w==", - "dev": true, - "dependencies": { - "define-properties": "^1.1.2", - "function-bind": "^1.1.1", - "has-symbols": "^1.0.0", - "object-keys": "^1.0.11" - }, - "engines": { - "node": ">= 0.4" - } - }, "node_modules/hardhat/node_modules/p-limit": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-1.3.0.tgz", @@ -3961,32 +3817,6 @@ "semver": "bin/semver.js" } }, - "node_modules/hardhat/node_modules/string-width": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-3.1.0.tgz", - "integrity": "sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w==", - "dev": true, - "dependencies": { - "emoji-regex": "^7.0.1", - "is-fullwidth-code-point": "^2.0.0", - "strip-ansi": "^5.1.0" - }, - "engines": { - "node": ">=6" - } - }, - "node_modules/hardhat/node_modules/strip-ansi": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", - "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", - "dev": true, - "dependencies": { - "ansi-regex": "^4.1.0" - }, - "engines": { - "node": ">=6" - } - }, "node_modules/hardhat/node_modules/supports-color": { "version": "5.5.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", @@ -4020,119 +3850,90 @@ "node": ">= 4.0.0" } }, - "node_modules/hardhat/node_modules/which": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", - "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", - "dev": true, - "dependencies": { - "isexe": "^2.0.0" - }, - "bin": { - "which": "bin/which" - } - }, "node_modules/hardhat/node_modules/wrap-ansi": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-5.1.0.tgz", - "integrity": "sha512-QC1/iN/2/RPVJ5jYK8BGttj5z83LmSKmvbvrXPNCLZSEb32KKVDJDl/MOt2N01qU2H/FkzEa9PKto1BqDjtd7Q==", + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", + "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", "dev": true, "dependencies": { - "ansi-styles": "^3.2.0", - "string-width": "^3.0.0", - "strip-ansi": "^5.0.0" + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" }, "engines": { - "node": ">=6" - } - }, - "node_modules/hardhat/node_modules/yargs": { - "version": "13.3.2", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-13.3.2.tgz", - "integrity": "sha512-AX3Zw5iPruN5ie6xGRIDgqkT+ZhnRlZMLMHAs8tg7nRruy2Nb+i5o9bwghAogtM08q1dpr2LVoS8KSTMYpWXUw==", - "dev": true, - "dependencies": { - "cliui": "^5.0.0", - "find-up": "^3.0.0", - "get-caller-file": "^2.0.1", - "require-directory": "^2.1.1", - "require-main-filename": "^2.0.0", - "set-blocking": "^2.0.0", - "string-width": "^3.0.0", - "which-module": "^2.0.0", - "y18n": "^4.0.0", - "yargs-parser": "^13.1.2" - } - }, - "node_modules/hardhat/node_modules/yargs-parser": { - "version": "13.1.2", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-13.1.2.tgz", - "integrity": "sha512-3lbsNRf/j+A4QuSZfDRA7HRSfWrzO0YjqTJd5kjAq37Zep1CEgaYmrH9Q3GwPiB9cHyd1Y1UwggGhJGoxipbzg==", - "dev": true, - "dependencies": { - "camelcase": "^5.0.0", - "decamelize": "^1.2.0" + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/wrap-ansi?sponsor=1" } }, - "node_modules/hardhat/node_modules/yargs/node_modules/find-up": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-3.0.0.tgz", - "integrity": "sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg==", + "node_modules/hardhat/node_modules/wrap-ansi/node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", "dev": true, "dependencies": { - "locate-path": "^3.0.0" + "color-convert": "^2.0.1" }, "engines": { - "node": ">=6" + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" } }, - "node_modules/hardhat/node_modules/yargs/node_modules/locate-path": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-3.0.0.tgz", - "integrity": "sha512-7AO748wWnIhNqAuaty2ZWHkQHRSNfPVIsPIfwEOWO22AmaoVrWavlOcMR5nzTLNYvp36X220/maaRsrec1G65A==", + "node_modules/hardhat/node_modules/wrap-ansi/node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", "dev": true, "dependencies": { - "p-locate": "^3.0.0", - "path-exists": "^3.0.0" + "color-name": "~1.1.4" }, "engines": { - "node": ">=6" + "node": ">=7.0.0" } }, - "node_modules/hardhat/node_modules/yargs/node_modules/p-limit": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", - "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", + "node_modules/hardhat/node_modules/wrap-ansi/node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, + "node_modules/hardhat/node_modules/y18n": { + "version": "5.0.8", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz", + "integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==", "dev": true, - "dependencies": { - "p-try": "^2.0.0" - }, "engines": { - "node": ">=6" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "node": ">=10" } }, - "node_modules/hardhat/node_modules/yargs/node_modules/p-locate": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-3.0.0.tgz", - "integrity": "sha512-x+12w/To+4GFfgJhBEpiDcLozRJGegY+Ei7/z0tSLkMmxGZNybVMSfWj9aJn8Z5Fc7dBUNJOOVgPv2H7IwulSQ==", + "node_modules/hardhat/node_modules/yargs": { + "version": "16.2.0", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-16.2.0.tgz", + "integrity": "sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw==", "dev": true, "dependencies": { - "p-limit": "^2.0.0" + "cliui": "^7.0.2", + "escalade": "^3.1.1", + "get-caller-file": "^2.0.5", + "require-directory": "^2.1.1", + "string-width": "^4.2.0", + "y18n": "^5.0.5", + "yargs-parser": "^20.2.2" }, "engines": { - "node": ">=6" + "node": ">=10" } }, - "node_modules/hardhat/node_modules/yargs/node_modules/p-try": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", - "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", + "node_modules/hardhat/node_modules/yargs-parser": { + "version": "20.2.4", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.4.tgz", + "integrity": "sha512-WOkpgNhPTlE73h4VFAFsOnomJVaovO8VqLDzy5saChRBFQFBoMYirowyW+Q9HB4HFF4Z7VZTiG3iSzJJA29yRA==", "dev": true, "engines": { - "node": ">=6" + "node": ">=10" } }, "node_modules/has": { @@ -4148,15 +3949,6 @@ "node": ">= 0.4.0" } }, - "node_modules/has-bigints": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/has-bigints/-/has-bigints-1.0.1.tgz", - "integrity": "sha512-LSBS2LjbNBTf6287JEbEzvJgftkF5qFkmCo9hDRpAzKhUOlJ+hx8dd4USs00SgsUNwc4617J9ki5YtEClM2ffA==", - "dev": true, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/has-flag": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", @@ -4179,21 +3971,6 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/has-tostringtag": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/has-tostringtag/-/has-tostringtag-1.0.0.tgz", - "integrity": "sha512-kFjcSNhnlGV1kyoGk7OXKSawH5JOb/LzUc5w9B02hOTO0dfFRjbHQKvg1d6cf3HbeUmtU9VbbV3qzZ2Teh97WQ==", - "dev": true, - "dependencies": { - "has-symbols": "^1.0.2" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/has-value": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/has-value/-/has-value-1.0.0.tgz", @@ -4537,20 +4314,6 @@ "dev": true, "license": "ISC" }, - "node_modules/internal-slot": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/internal-slot/-/internal-slot-1.0.3.tgz", - "integrity": "sha512-O0DB1JC/sPyZl7cIo78n5dR7eUSwwpYPiXRhTzNxZVAMUuB8vlnRFyLxdrVToks6XPLVnFfbzaVd5WLjhgg+vA==", - "dev": true, - "dependencies": { - "get-intrinsic": "^1.1.0", - "has": "^1.0.3", - "side-channel": "^1.0.4" - }, - "engines": { - "node": ">= 0.4" - } - }, "node_modules/invert-kv": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/invert-kv/-/invert-kv-1.0.0.tgz", @@ -4600,18 +4363,6 @@ "dev": true, "license": "MIT" }, - "node_modules/is-bigint": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/is-bigint/-/is-bigint-1.0.4.tgz", - "integrity": "sha512-zB9CruMamjym81i2JZ3UMn54PKGsQzsJeo6xvN3HJJ4CAsQNB6iRutp2To77OfCNuoxspsIhzaPoO1zyCEhFOg==", - "dev": true, - "dependencies": { - "has-bigints": "^1.0.1" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/is-binary-path": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-1.0.1.tgz", @@ -4625,22 +4376,6 @@ "node": ">=0.10.0" } }, - "node_modules/is-boolean-object": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/is-boolean-object/-/is-boolean-object-1.1.2.tgz", - "integrity": "sha512-gDYaKHJmnj4aWxyj6YHyXVpdQawtVLHU5cb+eztPGczf6cjuTdwve5ZIEfgXqH4e57An1D1AKf8CZ3kYrQRqYA==", - "dev": true, - "dependencies": { - "call-bind": "^1.0.2", - "has-tostringtag": "^1.0.0" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/is-buffer": { "version": "1.1.6", "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz", @@ -4648,18 +4383,6 @@ "dev": true, "license": "MIT" }, - "node_modules/is-callable": { - "version": "1.2.4", - "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.2.4.tgz", - "integrity": "sha512-nsuwtxZfMX67Oryl9LCQ+upnC0Z0BgpwntpS89m1H/TLF0zNfzfLMV/9Wa/6MZsj0acpEjAO0KF1xT6ZdLl95w==", - "dev": true, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/is-core-module": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.2.0.tgz", @@ -4696,21 +4419,6 @@ "node": ">=0.10.0" } }, - "node_modules/is-date-object": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/is-date-object/-/is-date-object-1.0.5.tgz", - "integrity": "sha512-9YQaSxsAiSwcvS33MBk3wTCVnWK+HhF8VZR2jRxehM16QcVOdHqPn4VPHmRK4lSr38n9JriurInLcP90xsYNfQ==", - "dev": true, - "dependencies": { - "has-tostringtag": "^1.0.0" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/is-descriptor": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", @@ -4812,18 +4520,6 @@ "npm": ">=3" } }, - "node_modules/is-negative-zero": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/is-negative-zero/-/is-negative-zero-2.0.1.tgz", - "integrity": "sha512-2z6JzQvZRa9A2Y7xC6dQQm4FSTSTNWjKIYYTt4246eMTJmIo0Q+ZyOsU66X8lxK1AbB92dFeglPLrhwpeRKO6w==", - "dev": true, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/is-number": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/is-number/-/is-number-3.0.0.tgz", @@ -4837,21 +4533,6 @@ "node": ">=0.10.0" } }, - "node_modules/is-number-object": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/is-number-object/-/is-number-object-1.0.6.tgz", - "integrity": "sha512-bEVOqiRcvo3zO1+G2lVMy+gkkEm9Yh7cDMRusKKu5ZJKPUYSJwICTKZrNKHA2EbSP0Tu0+6B/emsYNHZyn6K8g==", - "dev": true, - "dependencies": { - "has-tostringtag": "^1.0.0" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/is-obj": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/is-obj/-/is-obj-2.0.0.tgz", @@ -4905,31 +4586,6 @@ "node": ">=0.10.0" } }, - "node_modules/is-regex": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.1.4.tgz", - "integrity": "sha512-kvRdxDsxZjhzUX07ZnLydzS1TU/TJlTUHHY4YLL87e37oUA49DfkLqgy+VjFocowy29cKvcSiu+kIv728jTTVg==", - "dev": true, - "dependencies": { - "call-bind": "^1.0.2", - "has-tostringtag": "^1.0.0" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/is-shared-array-buffer": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/is-shared-array-buffer/-/is-shared-array-buffer-1.0.1.tgz", - "integrity": "sha512-IU0NmyknYZN0rChcKhRO1X8LYz5Isj/Fsqh8NJOSf+N/hCOTwy29F32Ik7a+QszE63IdvmwdTPDd6cZ5pg4cwA==", - "dev": true, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/is-stream": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.0.tgz", @@ -4940,36 +4596,6 @@ "node": ">=8" } }, - "node_modules/is-string": { - "version": "1.0.7", - "resolved": "https://registry.npmjs.org/is-string/-/is-string-1.0.7.tgz", - "integrity": "sha512-tE2UXzivje6ofPW7l23cjDOMa09gb7xlAqG6jG5ej6uPV32TlWP3NKPigtaGeHNu9fohccRYvIiZMfOOnOYUtg==", - "dev": true, - "dependencies": { - "has-tostringtag": "^1.0.0" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/is-symbol": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/is-symbol/-/is-symbol-1.0.4.tgz", - "integrity": "sha512-C/CPBqKWnvdcxqIARxyOh4v1UUEOCHpgDa0WYgpKDFMszcrPcffg5uhwSgPCLD2WWxmq6isisz87tzT01tuGhg==", - "dev": true, - "dependencies": { - "has-symbols": "^1.0.2" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/is-text-path": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/is-text-path/-/is-text-path-1.0.1.tgz", @@ -4983,16 +4609,16 @@ "node": ">=0.10.0" } }, - "node_modules/is-weakref": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/is-weakref/-/is-weakref-1.0.1.tgz", - "integrity": "sha512-b2jKc2pQZjaeFYWEf7ScFj+Be1I+PXmlu572Q8coTXZ+LD/QQZ7ShPMst8h16riVgyXTQwUsFEl74mDvc/3MHQ==", + "node_modules/is-unicode-supported": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/is-unicode-supported/-/is-unicode-supported-0.1.0.tgz", + "integrity": "sha512-knxG2q4UC3u8stRGyAVJCOdxFmv5DZiRcdlIaAQXAbSfJya+OhopNotLQrstBhququ4ZpuKbDc/8S6mgXgPFPw==", "dev": true, - "dependencies": { - "call-bind": "^1.0.0" + "engines": { + "node": ">=10" }, "funding": { - "url": "https://github.com/sponsors/ljharb" + "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/is-windows": { @@ -5053,13 +4679,12 @@ "license": "MIT" }, "node_modules/js-yaml": { - "version": "3.13.1", - "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.13.1.tgz", - "integrity": "sha512-YfbcO7jXDdyj0DGxYVSlSeQNHbD7XPWvrVWeVUujrQEoZzWJIRrCPoyk6kL6IAjAG2IolMK4T0hNUe0HOUs5Jw==", + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", + "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==", "dev": true, "dependencies": { - "argparse": "^1.0.7", - "esprima": "^4.0.0" + "argparse": "^2.0.1" }, "bin": { "js-yaml": "bin/js-yaml.js" @@ -5354,77 +4979,19 @@ "license": "MIT" }, "node_modules/log-symbols": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-3.0.0.tgz", - "integrity": "sha512-dSkNGuI7iG3mfvDzUuYZyvk5dD9ocYCYzNU6CYDE6+Xqd+gwme6Z00NS3dUh8mq/73HaEtT7m6W+yUPtU6BZnQ==", - "dev": true, - "dependencies": { - "chalk": "^2.4.2" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/log-symbols/node_modules/ansi-styles": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", - "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", - "dev": true, - "dependencies": { - "color-convert": "^1.9.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/log-symbols/node_modules/chalk": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", - "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-4.1.0.tgz", + "integrity": "sha512-8XPvpAA8uyhfteu8pIvQxpJZ7SYYdpUivZpGy6sFsBuKRY/7rQGavedeB8aK+Zkyq6upMFVL/9AW6vOYzfRyLg==", "dev": true, "dependencies": { - "ansi-styles": "^3.2.1", - "escape-string-regexp": "^1.0.5", - "supports-color": "^5.3.0" + "chalk": "^4.1.0", + "is-unicode-supported": "^0.1.0" }, "engines": { - "node": ">=4" - } - }, - "node_modules/log-symbols/node_modules/color-convert": { - "version": "1.9.3", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", - "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", - "dev": true, - "dependencies": { - "color-name": "1.1.3" - } - }, - "node_modules/log-symbols/node_modules/color-name": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", - "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", - "dev": true - }, - "node_modules/log-symbols/node_modules/has-flag": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", - "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", - "dev": true, - "engines": { - "node": ">=4" - } - }, - "node_modules/log-symbols/node_modules/supports-color": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", - "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", - "dev": true, - "dependencies": { - "has-flag": "^3.0.0" + "node": ">=10" }, - "engines": { - "node": ">=4" + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/lru_map": { @@ -5647,17 +5214,16 @@ "license": "MIT" }, "node_modules/merkle-patricia-tree": { - "version": "4.2.2", - "resolved": "https://registry.npmjs.org/merkle-patricia-tree/-/merkle-patricia-tree-4.2.2.tgz", - "integrity": "sha512-eqZYNTshcYx9aESkSPr71EqwsR/QmpnObDEV4iLxkt/x/IoLYZYjJvKY72voP/27Vy61iMOrfOG6jrn7ttXD+Q==", + "version": "4.2.4", + "resolved": "https://registry.npmjs.org/merkle-patricia-tree/-/merkle-patricia-tree-4.2.4.tgz", + "integrity": "sha512-eHbf/BG6eGNsqqfbLED9rIqbsF4+sykEaBn6OLNs71tjclbMcMOk1tEPmJKcNcNCLkvbpY/lwyOlizWsqPNo8w==", "dev": true, "dependencies": { "@types/levelup": "^4.3.0", - "ethereumjs-util": "^7.1.2", + "ethereumjs-util": "^7.1.4", "level-mem": "^5.0.1", "level-ws": "^2.0.0", "readable-stream": "^3.6.0", - "rlp": "^2.2.4", "semaphore-async-await": "^1.5.1" } }, @@ -5990,6 +5556,18 @@ "license": "MIT", "optional": true }, + "node_modules/nanoid": { + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.1.tgz", + "integrity": "sha512-n6Vs/3KGyxPQd6uO0eH4Bv0ojGSUvuLlIHtC3Y0kEO23YRge8H9x1GCzLn28YX0H66pMkxuaeESFq4tKISKwdw==", + "dev": true, + "bin": { + "nanoid": "bin/nanoid.cjs" + }, + "engines": { + "node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1" + } + }, "node_modules/nanomatch": { "version": "1.2.13", "resolved": "https://registry.npmjs.org/nanomatch/-/nanomatch-1.2.13.tgz", @@ -6070,41 +5648,10 @@ "integrity": "sha512-Ntyt4AIXyaLIuMHF6IOoTakB3K+RWxwtsHNRxllEoA6vPwP9o4866g6YWDLUdnucilZhmkxiHwHr11gAENw+QA==", "dev": true }, - "node_modules/node-environment-flags": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/node-environment-flags/-/node-environment-flags-1.0.6.tgz", - "integrity": "sha512-5Evy2epuL+6TM0lCQGpFIj6KwiEsGh1SrHUhTbNX+sLbBtjidPZFAnVK9y5yU1+h//RitLbRHTIMyxQPtxMdHw==", - "dev": true, - "dependencies": { - "object.getownpropertydescriptors": "^2.0.3", - "semver": "^5.7.0" - } - }, - "node_modules/node-environment-flags/node_modules/semver": { - "version": "5.7.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", - "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", - "dev": true, - "bin": { - "semver": "bin/semver" - } - }, - "node_modules/node-fetch": { - "version": "2.6.5", - "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.5.tgz", - "integrity": "sha512-mmlIVHJEu5rnIxgEgez6b9GgWXbkZj5YZ7fx+2r94a2E+Uirsp6HsPTPlomfdHtpt/B0cdKviwkoaM6pyvUOpQ==", - "dev": true, - "dependencies": { - "whatwg-url": "^5.0.0" - }, - "engines": { - "node": "4.x || >=6.0.0" - } - }, "node_modules/node-gyp-build": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/node-gyp-build/-/node-gyp-build-4.3.0.tgz", - "integrity": "sha512-iWjXZvmboq0ja1pUGULQBexmxq8CV4xBhX7VDOTbL7ZR4FOowwY/VOtRxBN/yKxmdGoIp4j5ysNT4u3S2pDQ3Q==", + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/node-gyp-build/-/node-gyp-build-4.4.0.tgz", + "integrity": "sha512-amJnQCcgtRVw9SvoebO3BKGESClrfXGCUTX9hSn1OuGQTQBOZmVd0Z0OlecpuRksKvbsUqALE8jls/ErClAPuQ==", "dev": true, "bin": { "node-gyp-build": "bin.js", @@ -6188,15 +5735,6 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/object-keys": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz", - "integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==", - "dev": true, - "engines": { - "node": ">= 0.4" - } - }, "node_modules/object-visit": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/object-visit/-/object-visit-1.0.1.tgz", @@ -6210,41 +5748,6 @@ "node": ">=0.10.0" } }, - "node_modules/object.assign": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.1.2.tgz", - "integrity": "sha512-ixT2L5THXsApyiUPYKmW+2EHpXXe5Ii3M+f4e+aJFAHao5amFRW6J0OO6c/LU8Be47utCx2GL89hxGB6XSmKuQ==", - "dev": true, - "dependencies": { - "call-bind": "^1.0.0", - "define-properties": "^1.1.3", - "has-symbols": "^1.0.1", - "object-keys": "^1.1.1" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/object.getownpropertydescriptors": { - "version": "2.1.3", - "resolved": "https://registry.npmjs.org/object.getownpropertydescriptors/-/object.getownpropertydescriptors-2.1.3.tgz", - "integrity": "sha512-VdDoCwvJI4QdC6ndjpqFmoL3/+HxffFBbcJzKi5hwLLqqx3mdbedRpfZDdK0SrOSauj8X4GzBvnDZl4vTN7dOw==", - "dev": true, - "dependencies": { - "call-bind": "^1.0.2", - "define-properties": "^1.1.3", - "es-abstract": "^1.19.1" - }, - "engines": { - "node": ">= 0.8" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/object.omit": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/object.omit/-/object.omit-2.0.1.tgz", @@ -6505,6 +6008,21 @@ "node": ">=8" } }, + "node_modules/p-map": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/p-map/-/p-map-4.0.0.tgz", + "integrity": "sha512-/bjOqmgETBYB5BoEeGVea8dmvHb2m9GLy1E9W43yeyfP6QQCZGFNa+XRceJEuDB6zqr+gKpIAmlLebMpykw/MQ==", + "dev": true, + "dependencies": { + "aggregate-error": "^3.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/p-try": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", @@ -6770,44 +6288,45 @@ } }, "node_modules/prettier": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.2.1.tgz", - "integrity": "sha512-PqyhM2yCjg/oKkFPtTGUojv7gnZAoG80ttl45O6x2Ug/rMJw4wcc9k6aaf2hibP7BGVCCM33gZoGjyvt9mm16Q==", + "version": "2.6.2", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.6.2.tgz", + "integrity": "sha512-PkUpF+qoXTqhOeWL9fu7As8LXsIUZ1WYaJiY/a7McAQzxjk82OF0tibkFXVCDImZtWxbvojFjerkiLb0/q8mew==", "dev": true, - "license": "MIT", "bin": { "prettier": "bin-prettier.js" }, "engines": { "node": ">=10.13.0" + }, + "funding": { + "url": "https://github.com/prettier/prettier?sponsor=1" } }, "node_modules/prettier-plugin-solidity": { - "version": "1.0.0-beta.3", - "resolved": "https://registry.npmjs.org/prettier-plugin-solidity/-/prettier-plugin-solidity-1.0.0-beta.3.tgz", - "integrity": "sha512-iLbf5ZqwSUqi/BQuRGh+fHy0y3VLX9WayI7qB3wqakSUHItbiKsUKyXbTeho4pfTJVr0D3M4c8BNuEr2OMAOVg==", + "version": "1.0.0-beta.19", + "resolved": "https://registry.npmjs.org/prettier-plugin-solidity/-/prettier-plugin-solidity-1.0.0-beta.19.tgz", + "integrity": "sha512-xxRQ5ZiiZyUoMFLE9h7HnUDXI/daf1tnmL1msEdcKmyh7ZGQ4YklkYLC71bfBpYU2WruTb5/SFLUaEb3RApg5g==", "dev": true, - "license": "MIT", "dependencies": { - "@solidity-parser/parser": "^0.11.0", - "dir-to-object": "^2.0.0", - "emoji-regex": "^9.0.0", + "@solidity-parser/parser": "^0.14.0", + "emoji-regex": "^10.0.0", "escape-string-regexp": "^4.0.0", - "prettier": "^2.0.5", - "semver": "^7.3.2", - "solidity-comments-extractor": "^0.0.4", - "string-width": "^4.2.0" + "semver": "^7.3.5", + "solidity-comments-extractor": "^0.0.7", + "string-width": "^4.2.3" }, "engines": { - "node": ">=10" + "node": ">=12" + }, + "peerDependencies": { + "prettier": "^2.3.0" } }, "node_modules/prettier-plugin-solidity/node_modules/emoji-regex": { - "version": "9.2.1", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-9.2.1.tgz", - "integrity": "sha512-117l1H6U4X3Krn+MrzYrL57d5H7siRHWraBs7s+LjRuFK7Fe7hJqnJ0skWlinqsycVLU5YAo6L8CsEYQ0V5prg==", - "dev": true, - "license": "MIT" + "version": "10.1.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-10.1.0.tgz", + "integrity": "sha512-xAEnNCT3w2Tg6MA7ly6QqYJvEoY1tm9iIjJ3yMKK9JPlWuRHAMoe5iETwQnx3M9TVbFMfsrBgWKR+IsmswwNjg==", + "dev": true }, "node_modules/prettier-plugin-solidity/node_modules/escape-string-regexp": { "version": "4.0.0", @@ -6860,18 +6379,6 @@ "node": ">=8" } }, - "node_modules/printj": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/printj/-/printj-1.1.2.tgz", - "integrity": "sha512-zA2SmoLaxZyArQTOPj5LXecR+RagfPSU5Kw1qP+jkWeNlrq+eJZyY2oS68SU1Z/7/myXM4lo9716laOFAVStCQ==", - "dev": true, - "bin": { - "printj": "bin/printj.njs" - }, - "engines": { - "node": ">=0.8" - } - }, "node_modules/process-nextick-args": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz", @@ -7700,13 +7207,13 @@ "dev": true }, "node_modules/secp256k1": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/secp256k1/-/secp256k1-4.0.2.tgz", - "integrity": "sha512-UDar4sKvWAksIlfX3xIaQReADn+WFnHvbVujpcbr+9Sf/69odMwy2MUsz5CKLQgX9nsIyrjuxL2imVyoNHa3fg==", + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/secp256k1/-/secp256k1-4.0.3.tgz", + "integrity": "sha512-NLZVf+ROMxwtEj3Xa562qgv2BK5e2WNmXPiOdVIPLgs6lyTzMvBq0aWTYMI5XCP9jZMVKOcqZLw/Wc4vDkuxhA==", "dev": true, "hasInstallScript": true, "dependencies": { - "elliptic": "^6.5.2", + "elliptic": "^6.5.4", "node-addon-api": "^2.0.0", "node-gyp-build": "^4.2.0" }, @@ -7724,11 +7231,10 @@ } }, "node_modules/semver": { - "version": "7.3.4", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.4.tgz", - "integrity": "sha512-tCfb2WLjqFAtXn4KEdxIhalnRtoKFN7nAwj0B3ZXCbQloV2tq5eDbcTmT68JJD3nRJq24/XgxtQKFIpQdtvmVw==", + "version": "7.3.7", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.7.tgz", + "integrity": "sha512-QlYTucUYOews+WeEujDoEGziz4K6c47V/Bd+LjSSYcA94p+DmINdf7ncaUinThfvZyu13lN9OY1XDxt8C0Tw0g==", "dev": true, - "license": "ISC", "dependencies": { "lru-cache": "^6.0.0" }, @@ -7759,6 +7265,15 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/serialize-javascript": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-6.0.0.tgz", + "integrity": "sha512-Qr3TosvguFt8ePWqsvRfrKyQXIiW+nGbYpy8XK24NQHE83caxWt+mIymTT19DGFbNWNLfEwsrkSmN64lVWB9ag==", + "dev": true, + "dependencies": { + "randombytes": "^2.1.0" + } + }, "node_modules/set-blocking": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz", @@ -7997,11 +7512,10 @@ } }, "node_modules/solidity-comments-extractor": { - "version": "0.0.4", - "resolved": "https://registry.npmjs.org/solidity-comments-extractor/-/solidity-comments-extractor-0.0.4.tgz", - "integrity": "sha512-58glBODwXIKMaQ7rfcJOrWtFQMMOK28tJ0/LcB5Xhu7WtAxk4UX2fpgKPuaL41XjMp/y0gAa1MTLqk018wuSzA==", - "dev": true, - "license": "MIT" + "version": "0.0.7", + "resolved": "https://registry.npmjs.org/solidity-comments-extractor/-/solidity-comments-extractor-0.0.7.tgz", + "integrity": "sha512-wciNMLg/Irp8OKGrh3S2tfvZiZ0NEyILfcRCXCD4mp7SgK/i9gzLfhY2hY7VMCQJ3kH9UB9BzNdibIVMchzyYw==", + "dev": true }, "node_modules/solium-plugin-security": { "version": "0.1.1", @@ -8469,12 +7983,6 @@ "safe-buffer": "~5.2.0" } }, - "node_modules/sprintf-js": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", - "integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=", - "dev": true - }, "node_modules/stacktrace-parser": { "version": "0.1.10", "resolved": "https://registry.npmjs.org/stacktrace-parser/-/stacktrace-parser-0.1.10.tgz", @@ -8530,54 +8038,26 @@ } }, "node_modules/string-width": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.0.tgz", - "integrity": "sha512-zUz5JD+tgqtuDjMhwIg5uFVV3dtqZ9yQJlZVfq4I01/K5Paj5UHj7VyrQOJvzawSVlKpObApbfD0Ed6yJc+1eg==", + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", "dev": true, - "license": "MIT", "dependencies": { "emoji-regex": "^8.0.0", "is-fullwidth-code-point": "^3.0.0", - "strip-ansi": "^6.0.0" + "strip-ansi": "^6.0.1" }, "engines": { "node": ">=8" } }, - "node_modules/string.prototype.trimend": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/string.prototype.trimend/-/string.prototype.trimend-1.0.4.tgz", - "integrity": "sha512-y9xCjw1P23Awk8EvTpcyL2NIr1j7wJ39f+k6lvRnSMz+mz9CGz9NYPelDk42kOz6+ql8xjfK8oYzy3jAP5QU5A==", - "dev": true, - "dependencies": { - "call-bind": "^1.0.2", - "define-properties": "^1.1.3" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/string.prototype.trimstart": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/string.prototype.trimstart/-/string.prototype.trimstart-1.0.4.tgz", - "integrity": "sha512-jh6e984OBfvxS50tdY2nRZnoC5/mLFKOREQfw8t5yytkoUsJRNxvI/E39qu1sD0OtWI3OC0XgKSmcWwziwYuZw==", - "dev": true, - "dependencies": { - "call-bind": "^1.0.2", - "define-properties": "^1.1.3" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/strip-ansi": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.0.tgz", - "integrity": "sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w==", + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", "dev": true, - "license": "MIT", "dependencies": { - "ansi-regex": "^5.0.0" + "ansi-regex": "^5.0.1" }, "engines": { "node": ">=8" @@ -8630,12 +8110,15 @@ } }, "node_modules/strip-json-comments": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz", - "integrity": "sha1-PFMZQukIwml8DsNEhYwobHygpgo=", + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", + "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==", "dev": true, "engines": { - "node": ">=0.10.0" + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/supports-color": { @@ -8836,12 +8319,6 @@ "node": ">=0.6" } }, - "node_modules/tr46": { - "version": "0.0.3", - "resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz", - "integrity": "sha1-gYT9NH2snNwYWZLzpmIuFLnZq2o=", - "dev": true - }, "node_modules/trim-newlines": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/trim-newlines/-/trim-newlines-3.0.0.tgz", @@ -8905,19 +8382,13 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/unbox-primitive": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/unbox-primitive/-/unbox-primitive-1.0.1.tgz", - "integrity": "sha512-tZU/3NqK3dA5gpE1KtyiJUrEB0lxnGkMFHptJ7q6ewdZ8s12QrODwNbhIJStmJkd1QDXa1NRA8aF2A1zk/Ypyw==", + "node_modules/undici": { + "version": "4.16.0", + "resolved": "https://registry.npmjs.org/undici/-/undici-4.16.0.tgz", + "integrity": "sha512-tkZSECUYi+/T1i4u+4+lwZmQgLXd4BLGlrc7KZPcLIW7Jpq99+Xpc30ONv7nS6F5UNOxp/HBZSSL9MafUrvJbw==", "dev": true, - "dependencies": { - "function-bind": "^1.1.1", - "has-bigints": "^1.0.1", - "has-symbols": "^1.0.2", - "which-boxed-primitive": "^1.0.2" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" + "engines": { + "node": ">=12.18" } }, "node_modules/union-value": { @@ -9031,30 +8502,13 @@ "dev": true, "license": "MIT" }, - "node_modules/util.promisify": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/util.promisify/-/util.promisify-1.1.1.tgz", - "integrity": "sha512-/s3UsZUrIfa6xDhr7zZhnE9SLQ5RIXyYfiVnMMyMDzOc8WhWN4Nbh36H842OyurKbCDAesZOJaVyvmSl6fhGQw==", - "dev": true, - "dependencies": { - "call-bind": "^1.0.0", - "define-properties": "^1.1.3", - "for-each": "^0.3.3", - "has-symbols": "^1.0.1", - "object.getownpropertydescriptors": "^2.1.1" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/uuid": { - "version": "3.4.0", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.4.0.tgz", - "integrity": "sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A==", - "deprecated": "Please upgrade to version 7 or higher. Older versions may use Math.random() in certain circumstances, which is known to be problematic. See https://v8.dev/blog/math-random for details.", + "version": "8.3.2", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz", + "integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==", "dev": true, "bin": { - "uuid": "bin/uuid" + "uuid": "dist/bin/uuid" } }, "node_modules/validate-npm-package-license": { @@ -9068,22 +8522,6 @@ "spdx-expression-parse": "^3.0.0" } }, - "node_modules/webidl-conversions": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz", - "integrity": "sha1-JFNCdeKnvGvnvIZhHMFq4KVlSHE=", - "dev": true - }, - "node_modules/whatwg-url": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz", - "integrity": "sha1-lmRU6HZUYuN2RNNib2dCzotwll0=", - "dev": true, - "dependencies": { - "tr46": "~0.0.3", - "webidl-conversions": "^3.0.0" - } - }, "node_modules/which": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", @@ -9100,22 +8538,6 @@ "node": ">= 8" } }, - "node_modules/which-boxed-primitive": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/which-boxed-primitive/-/which-boxed-primitive-1.0.2.tgz", - "integrity": "sha512-bwZdv0AKLpplFY2KZRX6TvyuN7ojjr7lwkg6ml0roIy9YeuSr7JS372qlNW18UQYzgYK9ziGcerWqZOmEn9VNg==", - "dev": true, - "dependencies": { - "is-bigint": "^1.0.1", - "is-boolean-object": "^1.1.0", - "is-number-object": "^1.0.4", - "is-string": "^1.0.5", - "is-symbol": "^1.0.3" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/which-module": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/which-module/-/which-module-2.0.0.tgz", @@ -9130,57 +8552,11 @@ "dev": true, "license": "MIT" }, - "node_modules/wide-align": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/wide-align/-/wide-align-1.1.3.tgz", - "integrity": "sha512-QGkOQc8XL6Bt5PwnsExKBPuMKBxnGxWWW3fU55Xt4feHozMUhdUMaBCk290qpm/wG5u/RSKzwdAC4i51YigihA==", - "dev": true, - "dependencies": { - "string-width": "^1.0.2 || 2" - } - }, - "node_modules/wide-align/node_modules/ansi-regex": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", - "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=", - "dev": true, - "engines": { - "node": ">=4" - } - }, - "node_modules/wide-align/node_modules/is-fullwidth-code-point": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", - "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", - "dev": true, - "engines": { - "node": ">=4" - } - }, - "node_modules/wide-align/node_modules/string-width": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", - "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==", - "dev": true, - "dependencies": { - "is-fullwidth-code-point": "^2.0.0", - "strip-ansi": "^4.0.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/wide-align/node_modules/strip-ansi": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", - "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", - "dev": true, - "dependencies": { - "ansi-regex": "^3.0.0" - }, - "engines": { - "node": ">=4" - } + "node_modules/workerpool": { + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/workerpool/-/workerpool-6.2.0.tgz", + "integrity": "sha512-Rsk5qQHJ9eowMH28Jwhe8HEbmdYDX4lwoMWshiCXugjtHqMD9ZbiqSDLxcsfdqsETPzVUtX5s1Z5kStiIM6l4A==", + "dev": true }, "node_modules/wrap-ansi": { "version": "6.2.0", @@ -9228,262 +8604,120 @@ "node_modules/xtend": { "version": "4.0.2", "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz", - "integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=0.4" - } - }, - "node_modules/y18n": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/y18n/-/y18n-4.0.1.tgz", - "integrity": "sha512-wNcy4NvjMYL8gogWWYAO7ZFWFfHcbdbE57tZO8e4cbpj8tfUcwrwqSl3ad8HxpYWCdXcJUCeKKZS62Av1affwQ==", - "dev": true, - "license": "ISC" - }, - "node_modules/yallist": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", - "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", - "dev": true, - "license": "ISC" - }, - "node_modules/yaml": { - "version": "1.10.0", - "resolved": "https://registry.npmjs.org/yaml/-/yaml-1.10.0.tgz", - "integrity": "sha512-yr2icI4glYaNG+KWONODapy2/jDdMSDnrONSjblABjD9B4Z5LgiircSt8m8sRZFNi08kG9Sm0uSHtEmP3zaEGg==", - "dev": true, - "license": "ISC", - "engines": { - "node": ">= 6" - } - }, - "node_modules/yargs": { - "version": "15.4.1", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-15.4.1.tgz", - "integrity": "sha512-aePbxDmcYW++PaqBsJ+HYUFwCdv4LVvdnhBy78E57PIor8/OVvhMrADFFEDh8DHDFRv/O9i3lPhsENjO7QX0+A==", - "dev": true, - "license": "MIT", - "dependencies": { - "cliui": "^6.0.0", - "decamelize": "^1.2.0", - "find-up": "^4.1.0", - "get-caller-file": "^2.0.1", - "require-directory": "^2.1.1", - "require-main-filename": "^2.0.0", - "set-blocking": "^2.0.0", - "string-width": "^4.2.0", - "which-module": "^2.0.0", - "y18n": "^4.0.0", - "yargs-parser": "^18.1.2" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/yargs-parser": { - "version": "18.1.3", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-18.1.3.tgz", - "integrity": "sha512-o50j0JeToy/4K6OZcaQmW6lyXXKhq7csREXcDwk2omFPJEwUNOVtJKvmDr9EI1fAJZUyZcRF7kxGBWmRXudrCQ==", - "dev": true, - "license": "ISC", - "dependencies": { - "camelcase": "^5.0.0", - "decamelize": "^1.2.0" - }, - "engines": { - "node": ">=6" - } - }, - "node_modules/yargs-unparser": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/yargs-unparser/-/yargs-unparser-1.6.0.tgz", - "integrity": "sha512-W9tKgmSn0DpSatfri0nx52Joq5hVXgeLiqR/5G0sZNDoLZFOr/xjBUDcShCOGNsBnEMNo1KAMBkTej1Hm62HTw==", - "dev": true, - "dependencies": { - "flat": "^4.1.0", - "lodash": "^4.17.15", - "yargs": "^13.3.0" - }, - "engines": { - "node": ">=6" - } - }, - "node_modules/yargs-unparser/node_modules/ansi-regex": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", - "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==", - "dev": true, - "engines": { - "node": ">=6" - } - }, - "node_modules/yargs-unparser/node_modules/ansi-styles": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", - "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", - "dev": true, - "dependencies": { - "color-convert": "^1.9.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/yargs-unparser/node_modules/cliui": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/cliui/-/cliui-5.0.0.tgz", - "integrity": "sha512-PYeGSEmmHM6zvoef2w8TPzlrnNpXIjTipYK780YswmIP9vjxmd6Y2a3CB2Ks6/AU8NHjZugXvo8w3oWM2qnwXA==", - "dev": true, - "dependencies": { - "string-width": "^3.1.0", - "strip-ansi": "^5.2.0", - "wrap-ansi": "^5.1.0" - } - }, - "node_modules/yargs-unparser/node_modules/color-convert": { - "version": "1.9.3", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", - "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", - "dev": true, - "dependencies": { - "color-name": "1.1.3" - } - }, - "node_modules/yargs-unparser/node_modules/color-name": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", - "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", - "dev": true - }, - "node_modules/yargs-unparser/node_modules/emoji-regex": { - "version": "7.0.3", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-7.0.3.tgz", - "integrity": "sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA==", - "dev": true - }, - "node_modules/yargs-unparser/node_modules/find-up": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-3.0.0.tgz", - "integrity": "sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg==", - "dev": true, - "dependencies": { - "locate-path": "^3.0.0" - }, - "engines": { - "node": ">=6" - } - }, - "node_modules/yargs-unparser/node_modules/is-fullwidth-code-point": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", - "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", + "integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==", "dev": true, + "license": "MIT", "engines": { - "node": ">=4" + "node": ">=0.4" } }, - "node_modules/yargs-unparser/node_modules/locate-path": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-3.0.0.tgz", - "integrity": "sha512-7AO748wWnIhNqAuaty2ZWHkQHRSNfPVIsPIfwEOWO22AmaoVrWavlOcMR5nzTLNYvp36X220/maaRsrec1G65A==", + "node_modules/y18n": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-4.0.1.tgz", + "integrity": "sha512-wNcy4NvjMYL8gogWWYAO7ZFWFfHcbdbE57tZO8e4cbpj8tfUcwrwqSl3ad8HxpYWCdXcJUCeKKZS62Av1affwQ==", "dev": true, - "dependencies": { - "p-locate": "^3.0.0", - "path-exists": "^3.0.0" - }, - "engines": { - "node": ">=6" - } + "license": "ISC" }, - "node_modules/yargs-unparser/node_modules/p-locate": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-3.0.0.tgz", - "integrity": "sha512-x+12w/To+4GFfgJhBEpiDcLozRJGegY+Ei7/z0tSLkMmxGZNybVMSfWj9aJn8Z5Fc7dBUNJOOVgPv2H7IwulSQ==", + "node_modules/yallist": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", "dev": true, - "dependencies": { - "p-limit": "^2.0.0" - }, - "engines": { - "node": ">=6" - } + "license": "ISC" }, - "node_modules/yargs-unparser/node_modules/path-exists": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz", - "integrity": "sha1-zg6+ql94yxiSXqfYENe1mwEP1RU=", + "node_modules/yaml": { + "version": "1.10.0", + "resolved": "https://registry.npmjs.org/yaml/-/yaml-1.10.0.tgz", + "integrity": "sha512-yr2icI4glYaNG+KWONODapy2/jDdMSDnrONSjblABjD9B4Z5LgiircSt8m8sRZFNi08kG9Sm0uSHtEmP3zaEGg==", "dev": true, + "license": "ISC", "engines": { - "node": ">=4" + "node": ">= 6" } }, - "node_modules/yargs-unparser/node_modules/string-width": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-3.1.0.tgz", - "integrity": "sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w==", + "node_modules/yargs": { + "version": "15.4.1", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-15.4.1.tgz", + "integrity": "sha512-aePbxDmcYW++PaqBsJ+HYUFwCdv4LVvdnhBy78E57PIor8/OVvhMrADFFEDh8DHDFRv/O9i3lPhsENjO7QX0+A==", "dev": true, + "license": "MIT", "dependencies": { - "emoji-regex": "^7.0.1", - "is-fullwidth-code-point": "^2.0.0", - "strip-ansi": "^5.1.0" + "cliui": "^6.0.0", + "decamelize": "^1.2.0", + "find-up": "^4.1.0", + "get-caller-file": "^2.0.1", + "require-directory": "^2.1.1", + "require-main-filename": "^2.0.0", + "set-blocking": "^2.0.0", + "string-width": "^4.2.0", + "which-module": "^2.0.0", + "y18n": "^4.0.0", + "yargs-parser": "^18.1.2" }, "engines": { - "node": ">=6" + "node": ">=8" } }, - "node_modules/yargs-unparser/node_modules/strip-ansi": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", - "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", + "node_modules/yargs-parser": { + "version": "18.1.3", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-18.1.3.tgz", + "integrity": "sha512-o50j0JeToy/4K6OZcaQmW6lyXXKhq7csREXcDwk2omFPJEwUNOVtJKvmDr9EI1fAJZUyZcRF7kxGBWmRXudrCQ==", "dev": true, + "license": "ISC", "dependencies": { - "ansi-regex": "^4.1.0" + "camelcase": "^5.0.0", + "decamelize": "^1.2.0" }, "engines": { "node": ">=6" } }, - "node_modules/yargs-unparser/node_modules/wrap-ansi": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-5.1.0.tgz", - "integrity": "sha512-QC1/iN/2/RPVJ5jYK8BGttj5z83LmSKmvbvrXPNCLZSEb32KKVDJDl/MOt2N01qU2H/FkzEa9PKto1BqDjtd7Q==", + "node_modules/yargs-unparser": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/yargs-unparser/-/yargs-unparser-2.0.0.tgz", + "integrity": "sha512-7pRTIA9Qc1caZ0bZ6RYRGbHJthJWuakf+WmHK0rVeLkNrrGhfoabBNdue6kdINI6r4if7ocq9aD/n7xwKOdzOA==", "dev": true, "dependencies": { - "ansi-styles": "^3.2.0", - "string-width": "^3.0.0", - "strip-ansi": "^5.0.0" + "camelcase": "^6.0.0", + "decamelize": "^4.0.0", + "flat": "^5.0.2", + "is-plain-obj": "^2.1.0" }, "engines": { - "node": ">=6" + "node": ">=10" } }, - "node_modules/yargs-unparser/node_modules/yargs": { - "version": "13.3.2", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-13.3.2.tgz", - "integrity": "sha512-AX3Zw5iPruN5ie6xGRIDgqkT+ZhnRlZMLMHAs8tg7nRruy2Nb+i5o9bwghAogtM08q1dpr2LVoS8KSTMYpWXUw==", + "node_modules/yargs-unparser/node_modules/camelcase": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-6.3.0.tgz", + "integrity": "sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA==", "dev": true, - "dependencies": { - "cliui": "^5.0.0", - "find-up": "^3.0.0", - "get-caller-file": "^2.0.1", - "require-directory": "^2.1.1", - "require-main-filename": "^2.0.0", - "set-blocking": "^2.0.0", - "string-width": "^3.0.0", - "which-module": "^2.0.0", - "y18n": "^4.0.0", - "yargs-parser": "^13.1.2" + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/yargs-unparser/node_modules/yargs-parser": { - "version": "13.1.2", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-13.1.2.tgz", - "integrity": "sha512-3lbsNRf/j+A4QuSZfDRA7HRSfWrzO0YjqTJd5kjAq37Zep1CEgaYmrH9Q3GwPiB9cHyd1Y1UwggGhJGoxipbzg==", + "node_modules/yargs-unparser/node_modules/decamelize": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-4.0.0.tgz", + "integrity": "sha512-9iE1PgSik9HeIIw2JO94IidnE3eBoQrFJ3w7sFuzSX4DpmZ3v5sZpUiV5Swcf6mQEF+Y0ru8Neo+p+nyh2J+hQ==", "dev": true, - "dependencies": { - "camelcase": "^5.0.0", - "decamelize": "^1.2.0" + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/yargs-unparser/node_modules/is-plain-obj": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-2.1.0.tgz", + "integrity": "sha512-YWnfyRwxL/+SsrWYfOpUtz5b3YD+nyfkHvjbcanzk8zgyO4ASD67uVMRt8k5bM4lLMDnXfriRhOpemw+NfT1eA==", + "dev": true, + "engines": { + "node": ">=8" } }, "node_modules/yocto-queue": { @@ -9800,34 +9034,42 @@ "dev": true }, "@ethereumjs/block": { - "version": "3.5.1", - "resolved": "https://registry.npmjs.org/@ethereumjs/block/-/block-3.5.1.tgz", - "integrity": "sha512-MoY9bHKABOBK6BW0v1N1Oc0Cve4x/giX67M3TtrVBUsKQTj2eznLGKpydoitxWSZ+WgKKSVhfRMzbCGRwk7T5w==", + "version": "3.6.2", + "resolved": "https://registry.npmjs.org/@ethereumjs/block/-/block-3.6.2.tgz", + "integrity": "sha512-mOqYWwMlAZpYUEOEqt7EfMFuVL2eyLqWWIzcf4odn6QgXY8jBI2NhVuJncrMCKeMZrsJAe7/auaRRB6YcdH+Qw==", "dev": true, "requires": { - "@ethereumjs/common": "^2.5.0", - "@ethereumjs/tx": "^3.3.1", - "ethereumjs-util": "^7.1.1", - "merkle-patricia-tree": "^4.2.1" + "@ethereumjs/common": "^2.6.3", + "@ethereumjs/tx": "^3.5.1", + "ethereumjs-util": "^7.1.4", + "merkle-patricia-tree": "^4.2.4" } }, "@ethereumjs/blockchain": { - "version": "5.4.2", - "resolved": "https://registry.npmjs.org/@ethereumjs/blockchain/-/blockchain-5.4.2.tgz", - "integrity": "sha512-AOAAwz/lw2lciG9gf5wHi7M/qknraXXnLR66lYgbQ04qfyFC3ZE5x/5rLVm1Vu+kfJLlKrYZTmA0IbOkc7kvgw==", + "version": "5.5.2", + "resolved": "https://registry.npmjs.org/@ethereumjs/blockchain/-/blockchain-5.5.2.tgz", + "integrity": "sha512-Jz26iJmmsQtngerW6r5BDFaew/f2mObLrRZo3rskLOx1lmtMZ8+TX/vJexmivrnWgmAsTdNWhlKUYY4thPhPig==", "dev": true, "requires": { - "@ethereumjs/block": "^3.5.1", - "@ethereumjs/common": "^2.5.0", + "@ethereumjs/block": "^3.6.2", + "@ethereumjs/common": "^2.6.3", "@ethereumjs/ethash": "^1.1.0", - "debug": "^2.2.0", - "ethereumjs-util": "^7.1.1", + "debug": "^4.3.3", + "ethereumjs-util": "^7.1.4", "level-mem": "^5.0.1", "lru-cache": "^5.1.1", - "rlp": "^2.2.4", "semaphore-async-await": "^1.5.1" }, "dependencies": { + "debug": { + "version": "4.3.4", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", + "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", + "dev": true, + "requires": { + "ms": "2.1.2" + } + }, "lru-cache": { "version": "5.1.1", "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-5.1.1.tgz", @@ -9837,6 +9079,12 @@ "yallist": "^3.0.2" } }, + "ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "dev": true + }, "yallist": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.1.1.tgz", @@ -9846,13 +9094,13 @@ } }, "@ethereumjs/common": { - "version": "2.5.0", - "resolved": "https://registry.npmjs.org/@ethereumjs/common/-/common-2.5.0.tgz", - "integrity": "sha512-DEHjW6e38o+JmB/NO3GZBpW4lpaiBpkFgXF6jLcJ6gETBYpEyaA5nTimsWBUJR3Vmtm/didUEbNjajskugZORg==", + "version": "2.6.4", + "resolved": "https://registry.npmjs.org/@ethereumjs/common/-/common-2.6.4.tgz", + "integrity": "sha512-RDJh/R/EAr+B7ZRg5LfJ0BIpf/1LydFgYdvZEuTraojCbVypO2sQ+QnpP5u2wJf9DASyooKqu8O4FJEWUV6NXw==", "dev": true, "requires": { "crc-32": "^1.2.0", - "ethereumjs-util": "^7.1.1" + "ethereumjs-util": "^7.1.4" } }, "@ethereumjs/ethash": { @@ -9869,34 +9117,50 @@ } }, "@ethereumjs/tx": { - "version": "3.3.2", - "resolved": "https://registry.npmjs.org/@ethereumjs/tx/-/tx-3.3.2.tgz", - "integrity": "sha512-6AaJhwg4ucmwTvw/1qLaZUX5miWrwZ4nLOUsKyb/HtzS3BMw/CasKhdi1ims9mBKeK9sOJCH4qGKOBGyJCeeog==", + "version": "3.5.1", + "resolved": "https://registry.npmjs.org/@ethereumjs/tx/-/tx-3.5.1.tgz", + "integrity": "sha512-xzDrTiu4sqZXUcaBxJ4n4W5FrppwxLxZB4ZDGVLtxSQR4lVuOnFR6RcUHdg1mpUhAPVrmnzLJpxaeXnPxIyhWA==", "dev": true, "requires": { - "@ethereumjs/common": "^2.5.0", - "ethereumjs-util": "^7.1.2" + "@ethereumjs/common": "^2.6.3", + "ethereumjs-util": "^7.1.4" } }, "@ethereumjs/vm": { - "version": "5.5.3", - "resolved": "https://registry.npmjs.org/@ethereumjs/vm/-/vm-5.5.3.tgz", - "integrity": "sha512-0k5OreWnlgXYs54wohgO11jtGI05GDasj2EYxzuaStxTi15CS3vow5wGYELC1pG9xngE1F/mFmKi/f14XRuDow==", + "version": "5.9.0", + "resolved": "https://registry.npmjs.org/@ethereumjs/vm/-/vm-5.9.0.tgz", + "integrity": "sha512-0IRsj4IuF8lFDWVVLc4mFOImaSX8VWF8CGm3mXHG/LLlQ/Tryy/kKXMw/bU9D+Zw03CdteW+wCGqNFS6+mPjpg==", "dev": true, "requires": { - "@ethereumjs/block": "^3.5.0", - "@ethereumjs/blockchain": "^5.4.1", - "@ethereumjs/common": "^2.5.0", - "@ethereumjs/tx": "^3.3.1", + "@ethereumjs/block": "^3.6.2", + "@ethereumjs/blockchain": "^5.5.2", + "@ethereumjs/common": "^2.6.4", + "@ethereumjs/tx": "^3.5.1", "async-eventemitter": "^0.2.4", "core-js-pure": "^3.0.1", - "debug": "^2.2.0", - "ethereumjs-util": "^7.1.1", + "debug": "^4.3.3", + "ethereumjs-util": "^7.1.4", "functional-red-black-tree": "^1.0.1", "mcl-wasm": "^0.7.1", - "merkle-patricia-tree": "^4.2.1", - "rustbn.js": "~0.2.0", - "util.promisify": "^1.0.1" + "merkle-patricia-tree": "^4.2.4", + "rustbn.js": "~0.2.0" + }, + "dependencies": { + "debug": { + "version": "4.3.4", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", + "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", + "dev": true, + "requires": { + "ms": "2.1.2" + } + }, + "ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "dev": true + } } }, "@ethersproject/abi": { @@ -10110,6 +9374,45 @@ "@ethersproject/strings": "^5.5.0" } }, + "@metamask/eth-sig-util": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/@metamask/eth-sig-util/-/eth-sig-util-4.0.1.tgz", + "integrity": "sha512-tghyZKLHZjcdlDqCA3gNZmLeR0XvOE9U1qoQO9ohyAZT6Pya+H9vkBPcsyXytmYLNgVoin7CKCmweo/R43V+tQ==", + "dev": true, + "requires": { + "ethereumjs-abi": "^0.6.8", + "ethereumjs-util": "^6.2.1", + "ethjs-util": "^0.1.6", + "tweetnacl": "^1.0.3", + "tweetnacl-util": "^0.15.1" + }, + "dependencies": { + "@types/bn.js": { + "version": "4.11.6", + "resolved": "https://registry.npmjs.org/@types/bn.js/-/bn.js-4.11.6.tgz", + "integrity": "sha512-pqr857jrp2kPuO9uRjZ3PwnJTjoQy+fcdxvBTvHm6dkmEL9q+hDD/2j/0ELOBPtPnS8LjCX0gI9nbl8lVkadpg==", + "dev": true, + "requires": { + "@types/node": "*" + } + }, + "ethereumjs-util": { + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/ethereumjs-util/-/ethereumjs-util-6.2.1.tgz", + "integrity": "sha512-W2Ktez4L01Vexijrm5EB6w7dg4n/TgpoYU4avuT5T3Vmnw/eCRtiBrJfQYS/DCSvDIOLn2k57GcHdeBcgVxAqw==", + "dev": true, + "requires": { + "@types/bn.js": "^4.11.3", + "bn.js": "^4.11.0", + "create-hash": "^1.1.2", + "elliptic": "^6.5.2", + "ethereum-cryptography": "^0.1.3", + "ethjs-util": "0.1.6", + "rlp": "^2.2.3" + } + } + } + }, "@sentry/core": { "version": "5.30.0", "resolved": "https://registry.npmjs.org/@sentry/core/-/core-5.30.0.tgz", @@ -10192,15 +9495,18 @@ } }, "@solidity-parser/parser": { - "version": "0.11.1", - "resolved": "https://registry.npmjs.org/@solidity-parser/parser/-/parser-0.11.1.tgz", - "integrity": "sha512-H8BSBoKE8EubJa0ONqecA2TviT3TnHeC4NpgnAHSUiuhZoQBfPB4L2P9bs8R6AoTW10Endvh3vc+fomVMIDIYQ==", - "dev": true + "version": "0.14.1", + "resolved": "https://registry.npmjs.org/@solidity-parser/parser/-/parser-0.14.1.tgz", + "integrity": "sha512-eLjj2L6AuQjBB6s/ibwCAc0DwrR5Ge+ys+wgWo+bviU7fV2nTMQhU63CGaDKXg9iTmMxwhkyoggdIR7ZGRfMgw==", + "dev": true, + "requires": { + "antlr4ts": "^0.5.0-alpha.4" + } }, "@types/abstract-leveldown": { - "version": "5.0.2", - "resolved": "https://registry.npmjs.org/@types/abstract-leveldown/-/abstract-leveldown-5.0.2.tgz", - "integrity": "sha512-+jA1XXF3jsz+Z7FcuiNqgK53hTa/luglT2TyTpKPqoYbxVY+mCPF22Rm+q3KPBrMHJwNXFrTViHszBOfU4vftQ==", + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/@types/abstract-leveldown/-/abstract-leveldown-7.2.0.tgz", + "integrity": "sha512-q5veSX6zjUy/DlDhR4Y4cU0k2Ar+DT2LUraP00T19WLmTO6Se1djepCCaqU6nQrwcJ5Hyo/CWqxTzrrFg8eqbQ==", "dev": true }, "@types/bn.js": { @@ -10248,9 +9554,9 @@ "dev": true }, "@types/node": { - "version": "16.11.6", - "resolved": "https://registry.npmjs.org/@types/node/-/node-16.11.6.tgz", - "integrity": "sha512-ua7PgUoeQFjmWPcoo9khiPum3Pd60k4/2ZGXt18sm2Slk0W0xZTqt5Y0Ny1NyBiN1EVQ/+FaF9NcY4Qe6rwk5w==", + "version": "17.0.28", + "resolved": "https://registry.npmjs.org/@types/node/-/node-17.0.28.tgz", + "integrity": "sha512-UYmIeBnB0On70dN1iGCinsL1qH5JmIEJwa+3KX0Xw4HQJ8KA16ULlyTCNmnzfyzj/BlxZKmZLqp4TYdssnov1w==", "dev": true }, "@types/normalize-package-data": { @@ -10283,6 +9589,12 @@ "@types/node": "*" } }, + "@ungap/promise-all-settled": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@ungap/promise-all-settled/-/promise-all-settled-1.1.2.tgz", + "integrity": "sha512-sL/cEvJWAnClXw0wHk85/2L0G6Sj8UB0Ctc1TEMbKSsmpRosqhwj9gWgFRZSrBr2f9tiXISwNhCPmlfqUqyb9Q==", + "dev": true + }, "abort-controller": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/abort-controller/-/abort-controller-3.0.0.tgz", @@ -10337,6 +9649,16 @@ } } }, + "aggregate-error": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/aggregate-error/-/aggregate-error-3.1.0.tgz", + "integrity": "sha512-4I7Td01quW/RpocfNayFdFVk1qSuoh0E7JrbRJ16nH01HhKFQ88INq9Sd+nd72zqRySlr9BmDA8xlEJ6vJMrYA==", + "dev": true, + "requires": { + "clean-stack": "^2.0.0", + "indent-string": "^4.0.0" + } + }, "ajv": { "version": "5.5.2", "resolved": "https://registry.npmjs.org/ajv/-/ajv-5.5.2.tgz", @@ -10373,9 +9695,9 @@ } }, "ansi-regex": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.0.tgz", - "integrity": "sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg==", + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", "dev": true }, "ansi-styles": { @@ -10404,13 +9726,10 @@ } }, "argparse": { - "version": "1.0.10", - "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", - "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", - "dev": true, - "requires": { - "sprintf-js": "~1.0.2" - } + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", + "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", + "dev": true }, "arr-diff": { "version": "4.0.0", @@ -10467,9 +9786,9 @@ "dev": true }, "async": { - "version": "2.6.3", - "resolved": "https://registry.npmjs.org/async/-/async-2.6.3.tgz", - "integrity": "sha512-zflvls11DCy+dQWzTW2dzuilv8Z5X/pjfmZOWba6TNIVDm+2UDaJmXSOXlasHKfNBs8oo3M0aT50fDEWfKZjXg==", + "version": "2.6.4", + "resolved": "https://registry.npmjs.org/async/-/async-2.6.4.tgz", + "integrity": "sha512-mzo5dfJYwAn29PeiJ0zvwTo04zj8HDJj0Mn8TD7sno7q12prdbnasKJHhkm2c1LgrhlJ0teaea8860oxi51mGA==", "dev": true, "requires": { "lodash": "^4.17.14" @@ -10566,9 +9885,9 @@ } }, "blakejs": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/blakejs/-/blakejs-1.1.1.tgz", - "integrity": "sha512-bLG6PHOCZJKNshTjGRBvET0vTciwQE6zFKOKKXPDJfwFBd4Ac0yBfPZqcGvGJap50l7ktvlpFqc2jGVaUgbJgg==", + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/blakejs/-/blakejs-1.2.1.tgz", + "integrity": "sha512-QXUSXI3QVc/gJME0dBpXrag1kbzOqCjCX8/b54ntNyW6sjtoqxqRk3LTmXzaJoh71zMsDCjM+47jS7XiwN/+fQ==", "dev": true }, "bn.js": { @@ -10796,6 +10115,12 @@ "static-extend": "^0.1.1" } }, + "clean-stack": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/clean-stack/-/clean-stack-2.2.0.tgz", + "integrity": "sha512-4diC9HaTE+KRAMWhDhrGOECgWZxoevMc5TlkObMqNSsVU62PYzXZ/SMTjzyGAFF1YusgxGcSWTEXBhp0CPwQ1A==", + "dev": true + }, "cliui": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/cliui/-/cliui-6.0.0.tgz", @@ -10968,9 +10293,9 @@ "dev": true }, "core-js-pure": { - "version": "3.19.0", - "resolved": "https://registry.npmjs.org/core-js-pure/-/core-js-pure-3.19.0.tgz", - "integrity": "sha512-UEQk8AxyCYvNAs6baNoPqDADv7BX0AmBLGxVsrAifPPx/C8EAzV4Q+2ZUJqVzfI2TQQEZITnwUkWcHpgc/IubQ==", + "version": "3.22.2", + "resolved": "https://registry.npmjs.org/core-js-pure/-/core-js-pure-3.22.2.tgz", + "integrity": "sha512-Lb+/XT4WC4PaCWWtZpNPaXmjiNDUe5CJuUtbkMrIM1kb1T/jJoAIp+bkVP/r5lHzMr+ZAAF8XHp7+my6Ol0ysQ==", "dev": true }, "core-util-is": { @@ -10993,14 +10318,10 @@ } }, "crc-32": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/crc-32/-/crc-32-1.2.0.tgz", - "integrity": "sha512-1uBwHxF+Y/4yF5G48fwnKq6QsIXheor3ZLPT80yGBV1oEUwpPojlEhQbWKVw1VwcTQyMGHK1/XMmTjmlsmTTGA==", - "dev": true, - "requires": { - "exit-on-epipe": "~1.0.1", - "printj": "~1.1.0" - } + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/crc-32/-/crc-32-1.2.2.tgz", + "integrity": "sha512-ROmzCKrTnOwybPcJApAA6WBWij23HVfGVNKqqrZpuyZOHqK2CwHSvpGuyt/UNNvaIjEd8X5IFGp4Mh+Ie1IHJQ==", + "dev": true }, "create-hash": { "version": "1.2.0", @@ -11102,15 +10423,6 @@ } } }, - "define-properties": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.1.3.tgz", - "integrity": "sha512-3MqfYKj2lLzdMSf8ZIZE/V+Zuy+BgD6f164e8K2w7dgnpKArBDerGYpM46IYYcjnkdPNMjPk9A6VFB8+3SKlXQ==", - "dev": true, - "requires": { - "object-keys": "^1.0.12" - } - }, "define-property": { "version": "0.2.5", "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", @@ -11191,12 +10503,6 @@ "integrity": "sha512-A46qtFgd+g7pDZinpnwiRJtxbC1hpgf0uzP3iG89scHk0AUC7A1TGxf5OiiOUv/JMZR8GOt8hL900hV0bOy5xA==", "dev": true }, - "dir-to-object": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/dir-to-object/-/dir-to-object-2.0.0.tgz", - "integrity": "sha512-sXs0JKIhymON7T1UZuO2Ud6VTNAx/VTBXIl4+3mjb2RgfOpt+hectX0x04YqPOPdkeOAKoJuKqwqnXXURNPNEA==", - "dev": true - }, "dot-prop": { "version": "5.3.0", "resolved": "https://registry.npmjs.org/dot-prop/-/dot-prop-5.3.0.tgz", @@ -11287,44 +10593,11 @@ "is-arrayish": "^0.2.1" } }, - "es-abstract": { - "version": "1.19.1", - "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.19.1.tgz", - "integrity": "sha512-2vJ6tjA/UfqLm2MPs7jxVybLoB8i1t1Jd9R3kISld20sIxPcTbLuggQOUxeWeAvIUkduv/CfMjuh4WmiXr2v9w==", - "dev": true, - "requires": { - "call-bind": "^1.0.2", - "es-to-primitive": "^1.2.1", - "function-bind": "^1.1.1", - "get-intrinsic": "^1.1.1", - "get-symbol-description": "^1.0.0", - "has": "^1.0.3", - "has-symbols": "^1.0.2", - "internal-slot": "^1.0.3", - "is-callable": "^1.2.4", - "is-negative-zero": "^2.0.1", - "is-regex": "^1.1.4", - "is-shared-array-buffer": "^1.0.1", - "is-string": "^1.0.7", - "is-weakref": "^1.0.1", - "object-inspect": "^1.11.0", - "object-keys": "^1.1.1", - "object.assign": "^4.1.2", - "string.prototype.trimend": "^1.0.4", - "string.prototype.trimstart": "^1.0.4", - "unbox-primitive": "^1.0.1" - } - }, - "es-to-primitive": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/es-to-primitive/-/es-to-primitive-1.2.1.tgz", - "integrity": "sha512-QCOllgZJtaUo9miYBcLChTUaHNjJF3PYs1VidD7AwiEj1kYxKeQTctLAezAOH5ZKRH0g2IgPn6KwB4IT8iRpvA==", - "dev": true, - "requires": { - "is-callable": "^1.1.4", - "is-date-object": "^1.0.1", - "is-symbol": "^1.0.2" - } + "escalade": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.1.tgz", + "integrity": "sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw==", + "dev": true }, "escape-string-regexp": { "version": "1.0.5", @@ -11332,41 +10605,6 @@ "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=", "dev": true }, - "esprima": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", - "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", - "dev": true - }, - "eth-sig-util": { - "version": "2.5.4", - "resolved": "https://registry.npmjs.org/eth-sig-util/-/eth-sig-util-2.5.4.tgz", - "integrity": "sha512-aCMBwp8q/4wrW4QLsF/HYBOSA7TpLKmkVwP3pYQNkEEseW2Rr8Z5Uxc9/h6HX+OG3tuHo+2bINVSihIeBfym6A==", - "dev": true, - "requires": { - "ethereumjs-abi": "0.6.8", - "ethereumjs-util": "^5.1.1", - "tweetnacl": "^1.0.3", - "tweetnacl-util": "^0.15.0" - }, - "dependencies": { - "ethereumjs-util": { - "version": "5.2.1", - "resolved": "https://registry.npmjs.org/ethereumjs-util/-/ethereumjs-util-5.2.1.tgz", - "integrity": "sha512-v3kT+7zdyCm1HIqWlLNrHGqHGLpGYIhjeHxQjnDXjLT2FyGJDsd3LWMYUo7pAFRrk86CR3nUJfhC81CCoJNNGQ==", - "dev": true, - "requires": { - "bn.js": "^4.11.0", - "create-hash": "^1.1.2", - "elliptic": "^6.5.2", - "ethereum-cryptography": "^0.1.3", - "ethjs-util": "^0.1.3", - "rlp": "^2.0.0", - "safe-buffer": "^5.1.1" - } - } - } - }, "ethereum-cryptography": { "version": "0.1.3", "resolved": "https://registry.npmjs.org/ethereum-cryptography/-/ethereum-cryptography-0.1.3.tgz", @@ -11427,9 +10665,9 @@ } }, "ethereumjs-util": { - "version": "7.1.3", - "resolved": "https://registry.npmjs.org/ethereumjs-util/-/ethereumjs-util-7.1.3.tgz", - "integrity": "sha512-y+82tEbyASO0K0X1/SRhbJJoAlfcvq8JbrG4a5cjrOks7HS/36efU/0j2flxCPOUM++HFahk33kr/ZxyC4vNuw==", + "version": "7.1.4", + "resolved": "https://registry.npmjs.org/ethereumjs-util/-/ethereumjs-util-7.1.4.tgz", + "integrity": "sha512-p6KmuPCX4mZIqsQzXfmSx9Y0l2hqf+VkAiwSisW3UKUFdk8ZkAt+AYaor83z2nSi6CU2zSsXMlD80hAbNEGM0A==", "dev": true, "requires": { "@types/bn.js": "^5.1.0", @@ -11511,12 +10749,6 @@ "strip-final-newline": "^2.0.0" } }, - "exit-on-epipe": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/exit-on-epipe/-/exit-on-epipe-1.0.1.tgz", - "integrity": "sha512-h2z5mrROTxce56S+pnvAV890uu7ls7f1kEvVGJbw1OlFH3/mlJ5bkXu0KRyW94v37zzHPiUd55iLn3DA7TjWpw==", - "dev": true - }, "expand-brackets": { "version": "0.1.5", "resolved": "https://registry.npmjs.org/expand-brackets/-/expand-brackets-0.1.5.tgz", @@ -11643,36 +10875,16 @@ } }, "flat": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/flat/-/flat-4.1.1.tgz", - "integrity": "sha512-FmTtBsHskrU6FJ2VxCnsDb84wu9zhmO3cUX2kGFb5tuwhfXxGciiT0oRY+cck35QmG+NmGh5eLz6lLCpWTqwpA==", - "dev": true, - "requires": { - "is-buffer": "~2.0.3" - }, - "dependencies": { - "is-buffer": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-2.0.5.tgz", - "integrity": "sha512-i2R6zNFDwgEHJyQUtJEk0XFi1i0dPFn/oqjK3/vPCcDeJvW5NQ83V8QbicfF1SupOaB0h8ntgBC2YiE7dfyctQ==", - "dev": true - } - } + "version": "5.0.2", + "resolved": "https://registry.npmjs.org/flat/-/flat-5.0.2.tgz", + "integrity": "sha512-b6suED+5/3rTpUBdG1gupIl8MPFCAMA0QXwmljLhvCUKcUvdE4gWky9zpuGCcXHOsz4J9wPGNWq6OKpmIzz3hQ==", + "dev": true }, "follow-redirects": { "version": "1.14.4", "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.14.4.tgz", "integrity": "sha512-zwGkiSXC1MUJG/qmeIFH2HBJx9u0V46QGUe3YR1fXG8bXQxq7fLj0RjLZQ5nubr9qNJUZrH+xUcwXEoXNpfS+g==", - "dev": true - }, - "for-each": { - "version": "0.3.3", - "resolved": "https://registry.npmjs.org/for-each/-/for-each-0.3.3.tgz", - "integrity": "sha512-jqYfLp7mo9vIyQf8ykW2v7A+2N4QjeCeI5+Dz9XraiO1ign81wjiH7Fb9vSOWvQfNtmSa4H2RoQTrrXivdUZmw==", - "dev": true, - "requires": { - "is-callable": "^1.1.3" - } + "dev": true }, "for-in": { "version": "1.0.2", @@ -11777,16 +10989,6 @@ "pump": "^3.0.0" } }, - "get-symbol-description": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/get-symbol-description/-/get-symbol-description-1.0.0.tgz", - "integrity": "sha512-2EmdH1YvIQiZpltCNgkuiUnyukzxM/R6NDJX31Ke3BG1Nq5b0S2PhX59UKi9vZpPDQVdqn+1IcaAwnzTT5vCjw==", - "dev": true, - "requires": { - "call-bind": "^1.0.2", - "get-intrinsic": "^1.1.1" - } - }, "get-value": { "version": "2.0.6", "resolved": "https://registry.npmjs.org/get-value/-/get-value-2.0.6.tgz", @@ -11867,23 +11069,25 @@ "dev": true }, "hardhat": { - "version": "2.6.7", - "resolved": "https://registry.npmjs.org/hardhat/-/hardhat-2.6.7.tgz", - "integrity": "sha512-Mua01f6ZN1feQLktHSH2p5A5LCdA+Wf7+O2lJDH6wClvWPtI2eqKNNY2gxBwYXoQ28GZrT3K6mqQOZeRWAca6Q==", + "version": "2.9.3", + "resolved": "https://registry.npmjs.org/hardhat/-/hardhat-2.9.3.tgz", + "integrity": "sha512-7Vw99RbYbMZ15UzegOR/nqIYIqddZXvLwJGaX5sX4G5bydILnbjmDU6g3jMKJSiArEixS3vHAEaOs5CW1JQ3hg==", "dev": true, "requires": { - "@ethereumjs/block": "^3.4.0", - "@ethereumjs/blockchain": "^5.4.0", - "@ethereumjs/common": "^2.4.0", - "@ethereumjs/tx": "^3.3.0", - "@ethereumjs/vm": "^5.5.2", + "@ethereumjs/block": "^3.6.0", + "@ethereumjs/blockchain": "^5.5.0", + "@ethereumjs/common": "^2.6.0", + "@ethereumjs/tx": "^3.4.0", + "@ethereumjs/vm": "^5.6.0", "@ethersproject/abi": "^5.1.2", + "@metamask/eth-sig-util": "^4.0.0", "@sentry/node": "^5.18.1", - "@solidity-parser/parser": "^0.14.0", + "@solidity-parser/parser": "^0.14.1", "@types/bn.js": "^5.1.0", "@types/lru-cache": "^5.1.0", "abort-controller": "^3.0.0", "adm-zip": "^0.4.16", + "aggregate-error": "^3.0.0", "ansi-escapes": "^4.3.0", "chalk": "^2.4.2", "chokidar": "^3.4.0", @@ -11891,22 +11095,20 @@ "debug": "^4.1.1", "enquirer": "^2.3.0", "env-paths": "^2.2.0", - "eth-sig-util": "^2.5.2", "ethereum-cryptography": "^0.1.2", "ethereumjs-abi": "^0.6.8", - "ethereumjs-util": "^7.1.0", + "ethereumjs-util": "^7.1.3", "find-up": "^2.1.0", "fp-ts": "1.19.3", "fs-extra": "^7.0.1", "glob": "^7.1.3", - "https-proxy-agent": "^5.0.0", "immutable": "^4.0.0-rc.12", "io-ts": "1.10.4", "lodash": "^4.17.11", - "merkle-patricia-tree": "^4.2.0", + "merkle-patricia-tree": "^4.2.2", "mnemonist": "^0.38.0", - "mocha": "^7.1.2", - "node-fetch": "^2.6.0", + "mocha": "^9.2.0", + "p-map": "^4.0.0", "qs": "^6.7.0", "raw-body": "^2.4.1", "resolve": "1.17.0", @@ -11917,31 +11119,11 @@ "stacktrace-parser": "^0.1.10", "true-case-path": "^2.2.1", "tsort": "0.0.1", - "uuid": "^3.3.2", + "undici": "^4.14.1", + "uuid": "^8.3.2", "ws": "^7.4.6" }, "dependencies": { - "@solidity-parser/parser": { - "version": "0.14.0", - "resolved": "https://registry.npmjs.org/@solidity-parser/parser/-/parser-0.14.0.tgz", - "integrity": "sha512-cX0JJRcmPtNUJpzD2K7FdA7qQsTOk1UZnFx2k7qAg9ZRvuaH5NBe5IEdBMXGlmf2+FmjhqbygJ26H8l2SV7aKQ==", - "dev": true, - "requires": { - "antlr4ts": "^0.5.0-alpha.4" - } - }, - "ansi-colors": { - "version": "3.2.3", - "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-3.2.3.tgz", - "integrity": "sha512-LEHHyuhlPY3TmuUYMh2oz89lTShfvgbmzaBcxve9t/9Wuy7Dwf4yoAKcND7KFT1HAQfqZ12qtc+DUrBMeKF9nw==", - "dev": true - }, - "ansi-regex": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", - "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==", - "dev": true - }, "ansi-styles": { "version": "3.2.1", "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", @@ -11994,9 +11176,9 @@ } }, "chokidar": { - "version": "3.5.2", - "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.5.2.tgz", - "integrity": "sha512-ekGhOnNVPgT77r4K/U3GDhu+FQ2S8TnK/s2KbIGXi0SZWuwkZ2QNyfWdZW+TVfn84DpEP7rLeCt2UI6bJ8GwbQ==", + "version": "3.5.3", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.5.3.tgz", + "integrity": "sha512-Dr3sfKRP6oTcjf2JmUmFJfeVMvXBdegxB0iVQ5eb2V10uFJUCAS8OByZdVAyVb8xXNz3GjjTgj9kLWsZTqE6kw==", "dev": true, "requires": { "anymatch": "~3.1.2", @@ -12010,14 +11192,14 @@ } }, "cliui": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/cliui/-/cliui-5.0.0.tgz", - "integrity": "sha512-PYeGSEmmHM6zvoef2w8TPzlrnNpXIjTipYK780YswmIP9vjxmd6Y2a3CB2Ks6/AU8NHjZugXvo8w3oWM2qnwXA==", + "version": "7.0.4", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-7.0.4.tgz", + "integrity": "sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ==", "dev": true, "requires": { - "string-width": "^3.1.0", - "strip-ansi": "^5.2.0", - "wrap-ansi": "^5.1.0" + "string-width": "^4.2.0", + "strip-ansi": "^6.0.0", + "wrap-ansi": "^7.0.0" } }, "color-convert": { @@ -12036,18 +11218,18 @@ "dev": true }, "debug": { - "version": "4.3.2", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.2.tgz", - "integrity": "sha512-mOp8wKcvj7XxC78zLgw/ZA+6TSgkoE2C/ienthhRD298T7UNwAg9diBpLRxC0mOezLl4B0xV7M0cCO6P/O0Xhw==", + "version": "4.3.3", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.3.tgz", + "integrity": "sha512-/zxw5+vh1Tfv+4Qn7a5nsbcJKPaSvCDhojn6FEl9vupwK2VCSDtEiEtqr8DFtzYFOdz63LBkxec7DYuc2jon6Q==", "dev": true, "requires": { "ms": "2.1.2" } }, - "emoji-regex": { - "version": "7.0.3", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-7.0.3.tgz", - "integrity": "sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA==", + "diff": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/diff/-/diff-5.0.0.tgz", + "integrity": "sha512-/VTCrvm5Z0JGty/BWHljh+BAiw3IK+2j87NGMu8Nwc/f48WoDAC395uomO9ZD117ZOBaHmkX1oyLvkVM/aIT3w==", "dev": true }, "fill-range": { @@ -12142,12 +11324,6 @@ "integrity": "sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=", "dev": true }, - "is-fullwidth-code-point": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", - "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", - "dev": true - }, "is-glob": { "version": "4.0.3", "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", @@ -12182,164 +11358,115 @@ "path-exists": "^3.0.0" } }, - "minimist": { - "version": "1.2.5", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz", - "integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==", - "dev": true - }, - "mkdirp": { - "version": "0.5.5", - "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.5.tgz", - "integrity": "sha512-NKmAlESf6jMGym1++R0Ra7wvhV+wFW63FaSOFPwRahvea0gMUcGUhVeAg/0BC0wiv9ih5NYPB1Wn1UEI1/L+xQ==", - "dev": true, - "requires": { - "minimist": "^1.2.5" - } - }, "mocha": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/mocha/-/mocha-7.2.0.tgz", - "integrity": "sha512-O9CIypScywTVpNaRrCAgoUnJgozpIofjKUYmJhiCIJMiuYnLI6otcb1/kpW9/n/tJODHGZ7i8aLQoDVsMtOKQQ==", + "version": "9.2.2", + "resolved": "https://registry.npmjs.org/mocha/-/mocha-9.2.2.tgz", + "integrity": "sha512-L6XC3EdwT6YrIk0yXpavvLkn8h+EU+Y5UcCHKECyMbdUIxyMuZj4bX4U9e1nvnvUUvQVsV2VHQr5zLdcUkhW/g==", "dev": true, "requires": { - "ansi-colors": "3.2.3", + "@ungap/promise-all-settled": "1.1.2", + "ansi-colors": "4.1.1", "browser-stdout": "1.3.1", - "chokidar": "3.3.0", - "debug": "3.2.6", - "diff": "3.5.0", - "escape-string-regexp": "1.0.5", - "find-up": "3.0.0", - "glob": "7.1.3", + "chokidar": "3.5.3", + "debug": "4.3.3", + "diff": "5.0.0", + "escape-string-regexp": "4.0.0", + "find-up": "5.0.0", + "glob": "7.2.0", "growl": "1.10.5", "he": "1.2.0", - "js-yaml": "3.13.1", - "log-symbols": "3.0.0", - "minimatch": "3.0.4", - "mkdirp": "0.5.5", - "ms": "2.1.1", - "node-environment-flags": "1.0.6", - "object.assign": "4.1.0", - "strip-json-comments": "2.0.1", - "supports-color": "6.0.0", - "which": "1.3.1", - "wide-align": "1.1.3", - "yargs": "13.3.2", - "yargs-parser": "13.1.2", - "yargs-unparser": "1.6.0" + "js-yaml": "4.1.0", + "log-symbols": "4.1.0", + "minimatch": "4.2.1", + "ms": "2.1.3", + "nanoid": "3.3.1", + "serialize-javascript": "6.0.0", + "strip-json-comments": "3.1.1", + "supports-color": "8.1.1", + "which": "2.0.2", + "workerpool": "6.2.0", + "yargs": "16.2.0", + "yargs-parser": "20.2.4", + "yargs-unparser": "2.0.0" }, "dependencies": { - "chokidar": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.3.0.tgz", - "integrity": "sha512-dGmKLDdT3Gdl7fBUe8XK+gAtGmzy5Fn0XkkWQuYxGIgWVPPse2CxFA5mtrlD0TOHaHjEUqkWNyP1XdHoJES/4A==", - "dev": true, - "requires": { - "anymatch": "~3.1.1", - "braces": "~3.0.2", - "fsevents": "~2.1.1", - "glob-parent": "~5.1.0", - "is-binary-path": "~2.1.0", - "is-glob": "~4.0.1", - "normalize-path": "~3.0.0", - "readdirp": "~3.2.0" - } - }, - "debug": { - "version": "3.2.6", - "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.6.tgz", - "integrity": "sha512-mel+jf7nrtEl5Pn1Qx46zARXKDpBbvzezse7p7LqINmdoIk8PYP5SySaxEmYv6TZ0JyEKA1hsCId6DIhgITtWQ==", - "dev": true, - "requires": { - "ms": "^2.1.1" - } + "escape-string-regexp": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", + "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", + "dev": true }, "find-up": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-3.0.0.tgz", - "integrity": "sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg==", + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz", + "integrity": "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==", "dev": true, "requires": { - "locate-path": "^3.0.0" + "locate-path": "^6.0.0", + "path-exists": "^4.0.0" } }, - "fsevents": { - "version": "2.1.3", - "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.1.3.tgz", - "integrity": "sha512-Auw9a4AxqWpa9GUfj370BMPzzyncfBABW8Mab7BGWBYDj4Isgq+cDKtx0i6u9jcX9pQDnswsaaOTgTmA5pEjuQ==", - "dev": true, - "optional": true + "has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true }, - "glob": { - "version": "7.1.3", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.3.tgz", - "integrity": "sha512-vcfuiIxogLV4DlGBHIUOwI0IbrJ8HWPc4MU7HzviGeNho/UJDfi6B5p3sHeWIQ0KGIU0Jpxi5ZHxemQfLkkAwQ==", + "locate-path": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz", + "integrity": "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==", "dev": true, "requires": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^3.0.4", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" + "p-locate": "^5.0.0" } }, - "locate-path": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-3.0.0.tgz", - "integrity": "sha512-7AO748wWnIhNqAuaty2ZWHkQHRSNfPVIsPIfwEOWO22AmaoVrWavlOcMR5nzTLNYvp36X220/maaRsrec1G65A==", + "minimatch": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-4.2.1.tgz", + "integrity": "sha512-9Uq1ChtSZO+Mxa/CL1eGizn2vRn3MlLgzhT0Iz8zaY8NdvxvB0d5QdPFmCKf7JKA9Lerx5vRrnwO03jsSfGG9g==", "dev": true, "requires": { - "p-locate": "^3.0.0", - "path-exists": "^3.0.0" + "brace-expansion": "^1.1.7" } }, "ms": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.1.tgz", - "integrity": "sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg==", + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", "dev": true }, "p-limit": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", - "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", + "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", "dev": true, "requires": { - "p-try": "^2.0.0" + "yocto-queue": "^0.1.0" } }, "p-locate": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-3.0.0.tgz", - "integrity": "sha512-x+12w/To+4GFfgJhBEpiDcLozRJGegY+Ei7/z0tSLkMmxGZNybVMSfWj9aJn8Z5Fc7dBUNJOOVgPv2H7IwulSQ==", + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-5.0.0.tgz", + "integrity": "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==", "dev": true, "requires": { - "p-limit": "^2.0.0" + "p-limit": "^3.0.2" } }, - "p-try": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", - "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", + "path-exists": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", + "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", "dev": true }, - "readdirp": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.2.0.tgz", - "integrity": "sha512-crk4Qu3pmXwgxdSgGhgA/eXiJAPQiX4GMOZZMXnqKxHX7TaoL+3gQVo/WeuAiogr07DpnfjIMpXXa+PAIvwPGQ==", - "dev": true, - "requires": { - "picomatch": "^2.0.4" - } - }, "supports-color": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-6.0.0.tgz", - "integrity": "sha512-on9Kwidc1IUQo+bQdhi8+Tijpo0e1SS6RoGo2guUwn5vdaxw8RXOF9Vb2ws+ihWOmh4JnCJOvaziZWP1VABaLg==", + "version": "8.1.1", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-8.1.1.tgz", + "integrity": "sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==", "dev": true, "requires": { - "has-flag": "^3.0.0" + "has-flag": "^4.0.0" } } } @@ -12356,18 +11483,6 @@ "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", "dev": true }, - "object.assign": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.1.0.tgz", - "integrity": "sha512-exHJeq6kBKj58mqGyTQ9DFvrZC/eR6OwxzoM9YRoGBqrXYonaFyGiFMuc9VZrXf7DarreEwMpurG3dd+CNyW5w==", - "dev": true, - "requires": { - "define-properties": "^1.1.2", - "function-bind": "^1.1.1", - "has-symbols": "^1.0.0", - "object-keys": "^1.0.11" - } - }, "p-limit": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-1.3.0.tgz", @@ -12422,26 +11537,6 @@ "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", "dev": true }, - "string-width": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-3.1.0.tgz", - "integrity": "sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w==", - "dev": true, - "requires": { - "emoji-regex": "^7.0.1", - "is-fullwidth-code-point": "^2.0.0", - "strip-ansi": "^5.1.0" - } - }, - "strip-ansi": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", - "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", - "dev": true, - "requires": { - "ansi-regex": "^4.1.0" - } - }, "supports-color": { "version": "5.5.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", @@ -12466,98 +11561,69 @@ "integrity": "sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==", "dev": true }, - "which": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", - "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", - "dev": true, - "requires": { - "isexe": "^2.0.0" - } - }, "wrap-ansi": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-5.1.0.tgz", - "integrity": "sha512-QC1/iN/2/RPVJ5jYK8BGttj5z83LmSKmvbvrXPNCLZSEb32KKVDJDl/MOt2N01qU2H/FkzEa9PKto1BqDjtd7Q==", - "dev": true, - "requires": { - "ansi-styles": "^3.2.0", - "string-width": "^3.0.0", - "strip-ansi": "^5.0.0" - } - }, - "yargs": { - "version": "13.3.2", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-13.3.2.tgz", - "integrity": "sha512-AX3Zw5iPruN5ie6xGRIDgqkT+ZhnRlZMLMHAs8tg7nRruy2Nb+i5o9bwghAogtM08q1dpr2LVoS8KSTMYpWXUw==", + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", + "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", "dev": true, "requires": { - "cliui": "^5.0.0", - "find-up": "^3.0.0", - "get-caller-file": "^2.0.1", - "require-directory": "^2.1.1", - "require-main-filename": "^2.0.0", - "set-blocking": "^2.0.0", - "string-width": "^3.0.0", - "which-module": "^2.0.0", - "y18n": "^4.0.0", - "yargs-parser": "^13.1.2" + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" }, "dependencies": { - "find-up": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-3.0.0.tgz", - "integrity": "sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg==", - "dev": true, - "requires": { - "locate-path": "^3.0.0" - } - }, - "locate-path": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-3.0.0.tgz", - "integrity": "sha512-7AO748wWnIhNqAuaty2ZWHkQHRSNfPVIsPIfwEOWO22AmaoVrWavlOcMR5nzTLNYvp36X220/maaRsrec1G65A==", - "dev": true, - "requires": { - "p-locate": "^3.0.0", - "path-exists": "^3.0.0" - } - }, - "p-limit": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", - "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", + "ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", "dev": true, "requires": { - "p-try": "^2.0.0" + "color-convert": "^2.0.1" } }, - "p-locate": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-3.0.0.tgz", - "integrity": "sha512-x+12w/To+4GFfgJhBEpiDcLozRJGegY+Ei7/z0tSLkMmxGZNybVMSfWj9aJn8Z5Fc7dBUNJOOVgPv2H7IwulSQ==", + "color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", "dev": true, "requires": { - "p-limit": "^2.0.0" + "color-name": "~1.1.4" } }, - "p-try": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", - "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", + "color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", "dev": true } } }, - "yargs-parser": { - "version": "13.1.2", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-13.1.2.tgz", - "integrity": "sha512-3lbsNRf/j+A4QuSZfDRA7HRSfWrzO0YjqTJd5kjAq37Zep1CEgaYmrH9Q3GwPiB9cHyd1Y1UwggGhJGoxipbzg==", + "y18n": { + "version": "5.0.8", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz", + "integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==", + "dev": true + }, + "yargs": { + "version": "16.2.0", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-16.2.0.tgz", + "integrity": "sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw==", "dev": true, "requires": { - "camelcase": "^5.0.0", - "decamelize": "^1.2.0" + "cliui": "^7.0.2", + "escalade": "^3.1.1", + "get-caller-file": "^2.0.5", + "require-directory": "^2.1.1", + "string-width": "^4.2.0", + "y18n": "^5.0.5", + "yargs-parser": "^20.2.2" } + }, + "yargs-parser": { + "version": "20.2.4", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.4.tgz", + "integrity": "sha512-WOkpgNhPTlE73h4VFAFsOnomJVaovO8VqLDzy5saChRBFQFBoMYirowyW+Q9HB4HFF4Z7VZTiG3iSzJJA29yRA==", + "dev": true } } }, @@ -12570,12 +11636,6 @@ "function-bind": "^1.1.1" } }, - "has-bigints": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/has-bigints/-/has-bigints-1.0.1.tgz", - "integrity": "sha512-LSBS2LjbNBTf6287JEbEzvJgftkF5qFkmCo9hDRpAzKhUOlJ+hx8dd4USs00SgsUNwc4617J9ki5YtEClM2ffA==", - "dev": true - }, "has-flag": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", @@ -12588,15 +11648,6 @@ "integrity": "sha512-chXa79rL/UC2KlX17jo3vRGz0azaWEx5tGqZg5pO3NUyEJVB17dMruQlzCCOfUvElghKcm5194+BCRvi2Rv/Gw==", "dev": true }, - "has-tostringtag": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/has-tostringtag/-/has-tostringtag-1.0.0.tgz", - "integrity": "sha512-kFjcSNhnlGV1kyoGk7OXKSawH5JOb/LzUc5w9B02hOTO0dfFRjbHQKvg1d6cf3HbeUmtU9VbbV3qzZ2Teh97WQ==", - "dev": true, - "requires": { - "has-symbols": "^1.0.2" - } - }, "has-value": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/has-value/-/has-value-1.0.0.tgz", @@ -12838,17 +11889,6 @@ "integrity": "sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew==", "dev": true }, - "internal-slot": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/internal-slot/-/internal-slot-1.0.3.tgz", - "integrity": "sha512-O0DB1JC/sPyZl7cIo78n5dR7eUSwwpYPiXRhTzNxZVAMUuB8vlnRFyLxdrVToks6XPLVnFfbzaVd5WLjhgg+vA==", - "dev": true, - "requires": { - "get-intrinsic": "^1.1.0", - "has": "^1.0.3", - "side-channel": "^1.0.4" - } - }, "invert-kv": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/invert-kv/-/invert-kv-1.0.0.tgz", @@ -12887,15 +11927,6 @@ "integrity": "sha1-d8mYQFJ6qOyxqLppe4BkWnqSap0=", "dev": true }, - "is-bigint": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/is-bigint/-/is-bigint-1.0.4.tgz", - "integrity": "sha512-zB9CruMamjym81i2JZ3UMn54PKGsQzsJeo6xvN3HJJ4CAsQNB6iRutp2To77OfCNuoxspsIhzaPoO1zyCEhFOg==", - "dev": true, - "requires": { - "has-bigints": "^1.0.1" - } - }, "is-binary-path": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-1.0.1.tgz", @@ -12905,28 +11936,12 @@ "binary-extensions": "^1.0.0" } }, - "is-boolean-object": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/is-boolean-object/-/is-boolean-object-1.1.2.tgz", - "integrity": "sha512-gDYaKHJmnj4aWxyj6YHyXVpdQawtVLHU5cb+eztPGczf6cjuTdwve5ZIEfgXqH4e57An1D1AKf8CZ3kYrQRqYA==", - "dev": true, - "requires": { - "call-bind": "^1.0.2", - "has-tostringtag": "^1.0.0" - } - }, "is-buffer": { "version": "1.1.6", "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz", "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==", "dev": true }, - "is-callable": { - "version": "1.2.4", - "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.2.4.tgz", - "integrity": "sha512-nsuwtxZfMX67Oryl9LCQ+upnC0Z0BgpwntpS89m1H/TLF0zNfzfLMV/9Wa/6MZsj0acpEjAO0KF1xT6ZdLl95w==", - "dev": true - }, "is-core-module": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.2.0.tgz", @@ -12953,15 +11968,6 @@ } } }, - "is-date-object": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/is-date-object/-/is-date-object-1.0.5.tgz", - "integrity": "sha512-9YQaSxsAiSwcvS33MBk3wTCVnWK+HhF8VZR2jRxehM16QcVOdHqPn4VPHmRK4lSr38n9JriurInLcP90xsYNfQ==", - "dev": true, - "requires": { - "has-tostringtag": "^1.0.0" - } - }, "is-descriptor": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", @@ -13029,12 +12035,6 @@ "integrity": "sha1-fY035q135dEnFIkTxXPggtd39VQ=", "dev": true }, - "is-negative-zero": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/is-negative-zero/-/is-negative-zero-2.0.1.tgz", - "integrity": "sha512-2z6JzQvZRa9A2Y7xC6dQQm4FSTSTNWjKIYYTt4246eMTJmIo0Q+ZyOsU66X8lxK1AbB92dFeglPLrhwpeRKO6w==", - "dev": true - }, "is-number": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/is-number/-/is-number-3.0.0.tgz", @@ -13044,15 +12044,6 @@ "kind-of": "^3.0.2" } }, - "is-number-object": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/is-number-object/-/is-number-object-1.0.6.tgz", - "integrity": "sha512-bEVOqiRcvo3zO1+G2lVMy+gkkEm9Yh7cDMRusKKu5ZJKPUYSJwICTKZrNKHA2EbSP0Tu0+6B/emsYNHZyn6K8g==", - "dev": true, - "requires": { - "has-tostringtag": "^1.0.0" - } - }, "is-obj": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/is-obj/-/is-obj-2.0.0.tgz", @@ -13086,46 +12077,12 @@ "integrity": "sha1-IHurkWOEmcB7Kt8kCkGochADRXU=", "dev": true }, - "is-regex": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.1.4.tgz", - "integrity": "sha512-kvRdxDsxZjhzUX07ZnLydzS1TU/TJlTUHHY4YLL87e37oUA49DfkLqgy+VjFocowy29cKvcSiu+kIv728jTTVg==", - "dev": true, - "requires": { - "call-bind": "^1.0.2", - "has-tostringtag": "^1.0.0" - } - }, - "is-shared-array-buffer": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/is-shared-array-buffer/-/is-shared-array-buffer-1.0.1.tgz", - "integrity": "sha512-IU0NmyknYZN0rChcKhRO1X8LYz5Isj/Fsqh8NJOSf+N/hCOTwy29F32Ik7a+QszE63IdvmwdTPDd6cZ5pg4cwA==", - "dev": true - }, "is-stream": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.0.tgz", "integrity": "sha512-XCoy+WlUr7d1+Z8GgSuXmpuUFC9fOhRXglJMx+dwLKTkL44Cjd4W1Z5P+BQZpr+cR93aGP4S/s7Ftw6Nd/kiEw==", "dev": true }, - "is-string": { - "version": "1.0.7", - "resolved": "https://registry.npmjs.org/is-string/-/is-string-1.0.7.tgz", - "integrity": "sha512-tE2UXzivje6ofPW7l23cjDOMa09gb7xlAqG6jG5ej6uPV32TlWP3NKPigtaGeHNu9fohccRYvIiZMfOOnOYUtg==", - "dev": true, - "requires": { - "has-tostringtag": "^1.0.0" - } - }, - "is-symbol": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/is-symbol/-/is-symbol-1.0.4.tgz", - "integrity": "sha512-C/CPBqKWnvdcxqIARxyOh4v1UUEOCHpgDa0WYgpKDFMszcrPcffg5uhwSgPCLD2WWxmq6isisz87tzT01tuGhg==", - "dev": true, - "requires": { - "has-symbols": "^1.0.2" - } - }, "is-text-path": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/is-text-path/-/is-text-path-1.0.1.tgz", @@ -13135,14 +12092,11 @@ "text-extensions": "^1.0.0" } }, - "is-weakref": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/is-weakref/-/is-weakref-1.0.1.tgz", - "integrity": "sha512-b2jKc2pQZjaeFYWEf7ScFj+Be1I+PXmlu572Q8coTXZ+LD/QQZ7ShPMst8h16riVgyXTQwUsFEl74mDvc/3MHQ==", - "dev": true, - "requires": { - "call-bind": "^1.0.0" - } + "is-unicode-supported": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/is-unicode-supported/-/is-unicode-supported-0.1.0.tgz", + "integrity": "sha512-knxG2q4UC3u8stRGyAVJCOdxFmv5DZiRcdlIaAQXAbSfJya+OhopNotLQrstBhququ4ZpuKbDc/8S6mgXgPFPw==", + "dev": true }, "is-windows": { "version": "1.0.2", @@ -13187,13 +12141,12 @@ "dev": true }, "js-yaml": { - "version": "3.13.1", - "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.13.1.tgz", - "integrity": "sha512-YfbcO7jXDdyj0DGxYVSlSeQNHbD7XPWvrVWeVUujrQEoZzWJIRrCPoyk6kL6IAjAG2IolMK4T0hNUe0HOUs5Jw==", + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", + "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==", "dev": true, "requires": { - "argparse": "^1.0.7", - "esprima": "^4.0.0" + "argparse": "^2.0.1" } }, "json-parse-even-better-errors": { @@ -13406,79 +12359,28 @@ "dev": true }, "locate-path": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", - "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", - "dev": true, - "requires": { - "p-locate": "^4.1.0" - } - }, - "lodash": { - "version": "4.17.20", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.20.tgz", - "integrity": "sha512-PlhdFcillOINfeV7Ni6oF1TAEayyZBoZ8bcshTHqOYJYlrqzRK5hagpagky5o4HfCzzd1TRkXPMFq6cKk9rGmA==", - "dev": true - }, - "log-symbols": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-3.0.0.tgz", - "integrity": "sha512-dSkNGuI7iG3mfvDzUuYZyvk5dD9ocYCYzNU6CYDE6+Xqd+gwme6Z00NS3dUh8mq/73HaEtT7m6W+yUPtU6BZnQ==", - "dev": true, - "requires": { - "chalk": "^2.4.2" - }, - "dependencies": { - "ansi-styles": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", - "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", - "dev": true, - "requires": { - "color-convert": "^1.9.0" - } - }, - "chalk": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", - "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", - "dev": true, - "requires": { - "ansi-styles": "^3.2.1", - "escape-string-regexp": "^1.0.5", - "supports-color": "^5.3.0" - } - }, - "color-convert": { - "version": "1.9.3", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", - "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", - "dev": true, - "requires": { - "color-name": "1.1.3" - } - }, - "color-name": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", - "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", - "dev": true - }, - "has-flag": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", - "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", - "dev": true - }, - "supports-color": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", - "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", - "dev": true, - "requires": { - "has-flag": "^3.0.0" - } - } + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", + "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", + "dev": true, + "requires": { + "p-locate": "^4.1.0" + } + }, + "lodash": { + "version": "4.17.20", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.20.tgz", + "integrity": "sha512-PlhdFcillOINfeV7Ni6oF1TAEayyZBoZ8bcshTHqOYJYlrqzRK5hagpagky5o4HfCzzd1TRkXPMFq6cKk9rGmA==", + "dev": true + }, + "log-symbols": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-4.1.0.tgz", + "integrity": "sha512-8XPvpAA8uyhfteu8pIvQxpJZ7SYYdpUivZpGy6sFsBuKRY/7rQGavedeB8aK+Zkyq6upMFVL/9AW6vOYzfRyLg==", + "dev": true, + "requires": { + "chalk": "^4.1.0", + "is-unicode-supported": "^0.1.0" } }, "lru_map": { @@ -13644,17 +12546,16 @@ "dev": true }, "merkle-patricia-tree": { - "version": "4.2.2", - "resolved": "https://registry.npmjs.org/merkle-patricia-tree/-/merkle-patricia-tree-4.2.2.tgz", - "integrity": "sha512-eqZYNTshcYx9aESkSPr71EqwsR/QmpnObDEV4iLxkt/x/IoLYZYjJvKY72voP/27Vy61iMOrfOG6jrn7ttXD+Q==", + "version": "4.2.4", + "resolved": "https://registry.npmjs.org/merkle-patricia-tree/-/merkle-patricia-tree-4.2.4.tgz", + "integrity": "sha512-eHbf/BG6eGNsqqfbLED9rIqbsF4+sykEaBn6OLNs71tjclbMcMOk1tEPmJKcNcNCLkvbpY/lwyOlizWsqPNo8w==", "dev": true, "requires": { "@types/levelup": "^4.3.0", - "ethereumjs-util": "^7.1.2", + "ethereumjs-util": "^7.1.4", "level-mem": "^5.0.1", "level-ws": "^2.0.0", "readable-stream": "^3.6.0", - "rlp": "^2.2.4", "semaphore-async-await": "^1.5.1" }, "dependencies": { @@ -13910,6 +12811,12 @@ "dev": true, "optional": true }, + "nanoid": { + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.1.tgz", + "integrity": "sha512-n6Vs/3KGyxPQd6uO0eH4Bv0ojGSUvuLlIHtC3Y0kEO23YRge8H9x1GCzLn28YX0H66pMkxuaeESFq4tKISKwdw==", + "dev": true + }, "nanomatch": { "version": "1.2.13", "resolved": "https://registry.npmjs.org/nanomatch/-/nanomatch-1.2.13.tgz", @@ -13972,37 +12879,10 @@ "integrity": "sha512-Ntyt4AIXyaLIuMHF6IOoTakB3K+RWxwtsHNRxllEoA6vPwP9o4866g6YWDLUdnucilZhmkxiHwHr11gAENw+QA==", "dev": true }, - "node-environment-flags": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/node-environment-flags/-/node-environment-flags-1.0.6.tgz", - "integrity": "sha512-5Evy2epuL+6TM0lCQGpFIj6KwiEsGh1SrHUhTbNX+sLbBtjidPZFAnVK9y5yU1+h//RitLbRHTIMyxQPtxMdHw==", - "dev": true, - "requires": { - "object.getownpropertydescriptors": "^2.0.3", - "semver": "^5.7.0" - }, - "dependencies": { - "semver": { - "version": "5.7.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", - "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", - "dev": true - } - } - }, - "node-fetch": { - "version": "2.6.5", - "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.5.tgz", - "integrity": "sha512-mmlIVHJEu5rnIxgEgez6b9GgWXbkZj5YZ7fx+2r94a2E+Uirsp6HsPTPlomfdHtpt/B0cdKviwkoaM6pyvUOpQ==", - "dev": true, - "requires": { - "whatwg-url": "^5.0.0" - } - }, "node-gyp-build": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/node-gyp-build/-/node-gyp-build-4.3.0.tgz", - "integrity": "sha512-iWjXZvmboq0ja1pUGULQBexmxq8CV4xBhX7VDOTbL7ZR4FOowwY/VOtRxBN/yKxmdGoIp4j5ysNT4u3S2pDQ3Q==", + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/node-gyp-build/-/node-gyp-build-4.4.0.tgz", + "integrity": "sha512-amJnQCcgtRVw9SvoebO3BKGESClrfXGCUTX9hSn1OuGQTQBOZmVd0Z0OlecpuRksKvbsUqALE8jls/ErClAPuQ==", "dev": true }, "normalize-package-data": { @@ -14058,12 +12938,6 @@ "integrity": "sha512-jp7ikS6Sd3GxQfZJPyH3cjcbJF6GZPClgdV+EFygjFLQ5FmW/dRUnTd9PQ9k0JhoNDabWFbpF1yCdSWCC6gexg==", "dev": true }, - "object-keys": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz", - "integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==", - "dev": true - }, "object-visit": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/object-visit/-/object-visit-1.0.1.tgz", @@ -14073,29 +12947,6 @@ "isobject": "^3.0.0" } }, - "object.assign": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.1.2.tgz", - "integrity": "sha512-ixT2L5THXsApyiUPYKmW+2EHpXXe5Ii3M+f4e+aJFAHao5amFRW6J0OO6c/LU8Be47utCx2GL89hxGB6XSmKuQ==", - "dev": true, - "requires": { - "call-bind": "^1.0.0", - "define-properties": "^1.1.3", - "has-symbols": "^1.0.1", - "object-keys": "^1.1.1" - } - }, - "object.getownpropertydescriptors": { - "version": "2.1.3", - "resolved": "https://registry.npmjs.org/object.getownpropertydescriptors/-/object.getownpropertydescriptors-2.1.3.tgz", - "integrity": "sha512-VdDoCwvJI4QdC6ndjpqFmoL3/+HxffFBbcJzKi5hwLLqqx3mdbedRpfZDdK0SrOSauj8X4GzBvnDZl4vTN7dOw==", - "dev": true, - "requires": { - "call-bind": "^1.0.2", - "define-properties": "^1.1.3", - "es-abstract": "^1.19.1" - } - }, "object.omit": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/object.omit/-/object.omit-2.0.1.tgz", @@ -14281,6 +13132,15 @@ "p-limit": "^2.2.0" } }, + "p-map": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/p-map/-/p-map-4.0.0.tgz", + "integrity": "sha512-/bjOqmgETBYB5BoEeGVea8dmvHb2m9GLy1E9W43yeyfP6QQCZGFNa+XRceJEuDB6zqr+gKpIAmlLebMpykw/MQ==", + "dev": true, + "requires": { + "aggregate-error": "^3.0.0" + } + }, "p-try": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", @@ -14451,31 +13311,29 @@ "dev": true }, "prettier": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.2.1.tgz", - "integrity": "sha512-PqyhM2yCjg/oKkFPtTGUojv7gnZAoG80ttl45O6x2Ug/rMJw4wcc9k6aaf2hibP7BGVCCM33gZoGjyvt9mm16Q==", + "version": "2.6.2", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.6.2.tgz", + "integrity": "sha512-PkUpF+qoXTqhOeWL9fu7As8LXsIUZ1WYaJiY/a7McAQzxjk82OF0tibkFXVCDImZtWxbvojFjerkiLb0/q8mew==", "dev": true }, "prettier-plugin-solidity": { - "version": "1.0.0-beta.3", - "resolved": "https://registry.npmjs.org/prettier-plugin-solidity/-/prettier-plugin-solidity-1.0.0-beta.3.tgz", - "integrity": "sha512-iLbf5ZqwSUqi/BQuRGh+fHy0y3VLX9WayI7qB3wqakSUHItbiKsUKyXbTeho4pfTJVr0D3M4c8BNuEr2OMAOVg==", + "version": "1.0.0-beta.19", + "resolved": "https://registry.npmjs.org/prettier-plugin-solidity/-/prettier-plugin-solidity-1.0.0-beta.19.tgz", + "integrity": "sha512-xxRQ5ZiiZyUoMFLE9h7HnUDXI/daf1tnmL1msEdcKmyh7ZGQ4YklkYLC71bfBpYU2WruTb5/SFLUaEb3RApg5g==", "dev": true, "requires": { - "@solidity-parser/parser": "^0.11.0", - "dir-to-object": "^2.0.0", - "emoji-regex": "^9.0.0", + "@solidity-parser/parser": "^0.14.0", + "emoji-regex": "^10.0.0", "escape-string-regexp": "^4.0.0", - "prettier": "^2.0.5", - "semver": "^7.3.2", - "solidity-comments-extractor": "^0.0.4", - "string-width": "^4.2.0" + "semver": "^7.3.5", + "solidity-comments-extractor": "^0.0.7", + "string-width": "^4.2.3" }, "dependencies": { "emoji-regex": { - "version": "9.2.1", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-9.2.1.tgz", - "integrity": "sha512-117l1H6U4X3Krn+MrzYrL57d5H7siRHWraBs7s+LjRuFK7Fe7hJqnJ0skWlinqsycVLU5YAo6L8CsEYQ0V5prg==", + "version": "10.1.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-10.1.0.tgz", + "integrity": "sha512-xAEnNCT3w2Tg6MA7ly6QqYJvEoY1tm9iIjJ3yMKK9JPlWuRHAMoe5iETwQnx3M9TVbFMfsrBgWKR+IsmswwNjg==", "dev": true }, "escape-string-regexp": { @@ -14512,12 +13370,6 @@ } } }, - "printj": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/printj/-/printj-1.1.2.tgz", - "integrity": "sha512-zA2SmoLaxZyArQTOPj5LXecR+RagfPSU5Kw1qP+jkWeNlrq+eJZyY2oS68SU1Z/7/myXM4lo9716laOFAVStCQ==", - "dev": true - }, "process-nextick-args": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz", @@ -15150,12 +14002,12 @@ "dev": true }, "secp256k1": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/secp256k1/-/secp256k1-4.0.2.tgz", - "integrity": "sha512-UDar4sKvWAksIlfX3xIaQReADn+WFnHvbVujpcbr+9Sf/69odMwy2MUsz5CKLQgX9nsIyrjuxL2imVyoNHa3fg==", + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/secp256k1/-/secp256k1-4.0.3.tgz", + "integrity": "sha512-NLZVf+ROMxwtEj3Xa562qgv2BK5e2WNmXPiOdVIPLgs6lyTzMvBq0aWTYMI5XCP9jZMVKOcqZLw/Wc4vDkuxhA==", "dev": true, "requires": { - "elliptic": "^6.5.2", + "elliptic": "^6.5.4", "node-addon-api": "^2.0.0", "node-gyp-build": "^4.2.0" } @@ -15167,9 +14019,9 @@ "dev": true }, "semver": { - "version": "7.3.4", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.4.tgz", - "integrity": "sha512-tCfb2WLjqFAtXn4KEdxIhalnRtoKFN7nAwj0B3ZXCbQloV2tq5eDbcTmT68JJD3nRJq24/XgxtQKFIpQdtvmVw==", + "version": "7.3.7", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.7.tgz", + "integrity": "sha512-QlYTucUYOews+WeEujDoEGziz4K6c47V/Bd+LjSSYcA94p+DmINdf7ncaUinThfvZyu13lN9OY1XDxt8C0Tw0g==", "dev": true, "requires": { "lru-cache": "^6.0.0" @@ -15187,6 +14039,15 @@ "integrity": "sha512-bXWyL6EAKOJa81XG1OZ/Yyuq+oT0b2YLlxx7c+mrdYPaPbnj6WgVULXhinMIeZGufuUBu/eVRqXEhiv4imfwxA==", "dev": true }, + "serialize-javascript": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-6.0.0.tgz", + "integrity": "sha512-Qr3TosvguFt8ePWqsvRfrKyQXIiW+nGbYpy8XK24NQHE83caxWt+mIymTT19DGFbNWNLfEwsrkSmN64lVWB9ag==", + "dev": true, + "requires": { + "randombytes": "^2.1.0" + } + }, "set-blocking": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz", @@ -15378,9 +14239,9 @@ } }, "solidity-comments-extractor": { - "version": "0.0.4", - "resolved": "https://registry.npmjs.org/solidity-comments-extractor/-/solidity-comments-extractor-0.0.4.tgz", - "integrity": "sha512-58glBODwXIKMaQ7rfcJOrWtFQMMOK28tJ0/LcB5Xhu7WtAxk4UX2fpgKPuaL41XjMp/y0gAa1MTLqk018wuSzA==", + "version": "0.0.7", + "resolved": "https://registry.npmjs.org/solidity-comments-extractor/-/solidity-comments-extractor-0.0.7.tgz", + "integrity": "sha512-wciNMLg/Irp8OKGrh3S2tfvZiZ0NEyILfcRCXCD4mp7SgK/i9gzLfhY2hY7VMCQJ3kH9UB9BzNdibIVMchzyYw==", "dev": true }, "solium-plugin-security": { @@ -15736,12 +14597,6 @@ } } }, - "sprintf-js": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", - "integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=", - "dev": true - }, "stacktrace-parser": { "version": "0.1.10", "resolved": "https://registry.npmjs.org/stacktrace-parser/-/stacktrace-parser-0.1.10.tgz", @@ -15785,43 +14640,23 @@ } }, "string-width": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.0.tgz", - "integrity": "sha512-zUz5JD+tgqtuDjMhwIg5uFVV3dtqZ9yQJlZVfq4I01/K5Paj5UHj7VyrQOJvzawSVlKpObApbfD0Ed6yJc+1eg==", + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", "dev": true, "requires": { "emoji-regex": "^8.0.0", "is-fullwidth-code-point": "^3.0.0", - "strip-ansi": "^6.0.0" - } - }, - "string.prototype.trimend": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/string.prototype.trimend/-/string.prototype.trimend-1.0.4.tgz", - "integrity": "sha512-y9xCjw1P23Awk8EvTpcyL2NIr1j7wJ39f+k6lvRnSMz+mz9CGz9NYPelDk42kOz6+ql8xjfK8oYzy3jAP5QU5A==", - "dev": true, - "requires": { - "call-bind": "^1.0.2", - "define-properties": "^1.1.3" - } - }, - "string.prototype.trimstart": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/string.prototype.trimstart/-/string.prototype.trimstart-1.0.4.tgz", - "integrity": "sha512-jh6e984OBfvxS50tdY2nRZnoC5/mLFKOREQfw8t5yytkoUsJRNxvI/E39qu1sD0OtWI3OC0XgKSmcWwziwYuZw==", - "dev": true, - "requires": { - "call-bind": "^1.0.2", - "define-properties": "^1.1.3" + "strip-ansi": "^6.0.1" } }, "strip-ansi": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.0.tgz", - "integrity": "sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w==", + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", "dev": true, "requires": { - "ansi-regex": "^5.0.0" + "ansi-regex": "^5.0.1" } }, "strip-eof": { @@ -15855,9 +14690,9 @@ } }, "strip-json-comments": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz", - "integrity": "sha1-PFMZQukIwml8DsNEhYwobHygpgo=", + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", + "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==", "dev": true }, "supports-color": { @@ -16001,12 +14836,6 @@ "integrity": "sha512-yaOH/Pk/VEhBWWTlhI+qXxDFXlejDGcQipMlyxda9nthulaxLZUNcUqFxokp0vcYnvteJln5FNQDRrxj3YcbVw==", "dev": true }, - "tr46": { - "version": "0.0.3", - "resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz", - "integrity": "sha1-gYT9NH2snNwYWZLzpmIuFLnZq2o=", - "dev": true - }, "trim-newlines": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/trim-newlines/-/trim-newlines-3.0.0.tgz", @@ -16055,17 +14884,11 @@ "integrity": "sha512-OIAYXk8+ISY+qTOwkHtKqzAuxchoMiD9Udx+FSGQDuiRR+PJKJHc2NJAXlbhkGwTt/4/nKZxELY1w3ReWOL8mw==", "dev": true }, - "unbox-primitive": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/unbox-primitive/-/unbox-primitive-1.0.1.tgz", - "integrity": "sha512-tZU/3NqK3dA5gpE1KtyiJUrEB0lxnGkMFHptJ7q6ewdZ8s12QrODwNbhIJStmJkd1QDXa1NRA8aF2A1zk/Ypyw==", - "dev": true, - "requires": { - "function-bind": "^1.1.1", - "has-bigints": "^1.0.1", - "has-symbols": "^1.0.2", - "which-boxed-primitive": "^1.0.2" - } + "undici": { + "version": "4.16.0", + "resolved": "https://registry.npmjs.org/undici/-/undici-4.16.0.tgz", + "integrity": "sha512-tkZSECUYi+/T1i4u+4+lwZmQgLXd4BLGlrc7KZPcLIW7Jpq99+Xpc30ONv7nS6F5UNOxp/HBZSSL9MafUrvJbw==", + "dev": true }, "union-value": { "version": "1.0.1", @@ -16149,23 +14972,10 @@ "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=", "dev": true }, - "util.promisify": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/util.promisify/-/util.promisify-1.1.1.tgz", - "integrity": "sha512-/s3UsZUrIfa6xDhr7zZhnE9SLQ5RIXyYfiVnMMyMDzOc8WhWN4Nbh36H842OyurKbCDAesZOJaVyvmSl6fhGQw==", - "dev": true, - "requires": { - "call-bind": "^1.0.0", - "define-properties": "^1.1.3", - "for-each": "^0.3.3", - "has-symbols": "^1.0.1", - "object.getownpropertydescriptors": "^2.1.1" - } - }, "uuid": { - "version": "3.4.0", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.4.0.tgz", - "integrity": "sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A==", + "version": "8.3.2", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz", + "integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==", "dev": true }, "validate-npm-package-license": { @@ -16178,22 +14988,6 @@ "spdx-expression-parse": "^3.0.0" } }, - "webidl-conversions": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz", - "integrity": "sha1-JFNCdeKnvGvnvIZhHMFq4KVlSHE=", - "dev": true - }, - "whatwg-url": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz", - "integrity": "sha1-lmRU6HZUYuN2RNNib2dCzotwll0=", - "dev": true, - "requires": { - "tr46": "~0.0.3", - "webidl-conversions": "^3.0.0" - } - }, "which": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", @@ -16203,19 +14997,6 @@ "isexe": "^2.0.0" } }, - "which-boxed-primitive": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/which-boxed-primitive/-/which-boxed-primitive-1.0.2.tgz", - "integrity": "sha512-bwZdv0AKLpplFY2KZRX6TvyuN7ojjr7lwkg6ml0roIy9YeuSr7JS372qlNW18UQYzgYK9ziGcerWqZOmEn9VNg==", - "dev": true, - "requires": { - "is-bigint": "^1.0.1", - "is-boolean-object": "^1.1.0", - "is-number-object": "^1.0.4", - "is-string": "^1.0.5", - "is-symbol": "^1.0.3" - } - }, "which-module": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/which-module/-/which-module-2.0.0.tgz", @@ -16228,47 +15009,11 @@ "integrity": "sha1-Zws6+8VS4LVd9rd4DKdGFfI60cs=", "dev": true }, - "wide-align": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/wide-align/-/wide-align-1.1.3.tgz", - "integrity": "sha512-QGkOQc8XL6Bt5PwnsExKBPuMKBxnGxWWW3fU55Xt4feHozMUhdUMaBCk290qpm/wG5u/RSKzwdAC4i51YigihA==", - "dev": true, - "requires": { - "string-width": "^1.0.2 || 2" - }, - "dependencies": { - "ansi-regex": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", - "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=", - "dev": true - }, - "is-fullwidth-code-point": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", - "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", - "dev": true - }, - "string-width": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", - "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==", - "dev": true, - "requires": { - "is-fullwidth-code-point": "^2.0.0", - "strip-ansi": "^4.0.0" - } - }, - "strip-ansi": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", - "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", - "dev": true, - "requires": { - "ansi-regex": "^3.0.0" - } - } - } + "workerpool": { + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/workerpool/-/workerpool-6.2.0.tgz", + "integrity": "sha512-Rsk5qQHJ9eowMH28Jwhe8HEbmdYDX4lwoMWshiCXugjtHqMD9ZbiqSDLxcsfdqsETPzVUtX5s1Z5kStiIM6l4A==", + "dev": true }, "wrap-ansi": { "version": "6.2.0", @@ -16348,161 +15093,34 @@ } }, "yargs-unparser": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/yargs-unparser/-/yargs-unparser-1.6.0.tgz", - "integrity": "sha512-W9tKgmSn0DpSatfri0nx52Joq5hVXgeLiqR/5G0sZNDoLZFOr/xjBUDcShCOGNsBnEMNo1KAMBkTej1Hm62HTw==", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/yargs-unparser/-/yargs-unparser-2.0.0.tgz", + "integrity": "sha512-7pRTIA9Qc1caZ0bZ6RYRGbHJthJWuakf+WmHK0rVeLkNrrGhfoabBNdue6kdINI6r4if7ocq9aD/n7xwKOdzOA==", "dev": true, "requires": { - "flat": "^4.1.0", - "lodash": "^4.17.15", - "yargs": "^13.3.0" + "camelcase": "^6.0.0", + "decamelize": "^4.0.0", + "flat": "^5.0.2", + "is-plain-obj": "^2.1.0" }, "dependencies": { - "ansi-regex": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", - "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==", - "dev": true - }, - "ansi-styles": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", - "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", - "dev": true, - "requires": { - "color-convert": "^1.9.0" - } - }, - "cliui": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/cliui/-/cliui-5.0.0.tgz", - "integrity": "sha512-PYeGSEmmHM6zvoef2w8TPzlrnNpXIjTipYK780YswmIP9vjxmd6Y2a3CB2Ks6/AU8NHjZugXvo8w3oWM2qnwXA==", - "dev": true, - "requires": { - "string-width": "^3.1.0", - "strip-ansi": "^5.2.0", - "wrap-ansi": "^5.1.0" - } - }, - "color-convert": { - "version": "1.9.3", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", - "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", - "dev": true, - "requires": { - "color-name": "1.1.3" - } - }, - "color-name": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", - "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", - "dev": true - }, - "emoji-regex": { - "version": "7.0.3", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-7.0.3.tgz", - "integrity": "sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA==", + "camelcase": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-6.3.0.tgz", + "integrity": "sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA==", "dev": true }, - "find-up": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-3.0.0.tgz", - "integrity": "sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg==", - "dev": true, - "requires": { - "locate-path": "^3.0.0" - } - }, - "is-fullwidth-code-point": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", - "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", + "decamelize": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-4.0.0.tgz", + "integrity": "sha512-9iE1PgSik9HeIIw2JO94IidnE3eBoQrFJ3w7sFuzSX4DpmZ3v5sZpUiV5Swcf6mQEF+Y0ru8Neo+p+nyh2J+hQ==", "dev": true }, - "locate-path": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-3.0.0.tgz", - "integrity": "sha512-7AO748wWnIhNqAuaty2ZWHkQHRSNfPVIsPIfwEOWO22AmaoVrWavlOcMR5nzTLNYvp36X220/maaRsrec1G65A==", - "dev": true, - "requires": { - "p-locate": "^3.0.0", - "path-exists": "^3.0.0" - } - }, - "p-locate": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-3.0.0.tgz", - "integrity": "sha512-x+12w/To+4GFfgJhBEpiDcLozRJGegY+Ei7/z0tSLkMmxGZNybVMSfWj9aJn8Z5Fc7dBUNJOOVgPv2H7IwulSQ==", - "dev": true, - "requires": { - "p-limit": "^2.0.0" - } - }, - "path-exists": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz", - "integrity": "sha1-zg6+ql94yxiSXqfYENe1mwEP1RU=", + "is-plain-obj": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-2.1.0.tgz", + "integrity": "sha512-YWnfyRwxL/+SsrWYfOpUtz5b3YD+nyfkHvjbcanzk8zgyO4ASD67uVMRt8k5bM4lLMDnXfriRhOpemw+NfT1eA==", "dev": true - }, - "string-width": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-3.1.0.tgz", - "integrity": "sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w==", - "dev": true, - "requires": { - "emoji-regex": "^7.0.1", - "is-fullwidth-code-point": "^2.0.0", - "strip-ansi": "^5.1.0" - } - }, - "strip-ansi": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", - "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", - "dev": true, - "requires": { - "ansi-regex": "^4.1.0" - } - }, - "wrap-ansi": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-5.1.0.tgz", - "integrity": "sha512-QC1/iN/2/RPVJ5jYK8BGttj5z83LmSKmvbvrXPNCLZSEb32KKVDJDl/MOt2N01qU2H/FkzEa9PKto1BqDjtd7Q==", - "dev": true, - "requires": { - "ansi-styles": "^3.2.0", - "string-width": "^3.0.0", - "strip-ansi": "^5.0.0" - } - }, - "yargs": { - "version": "13.3.2", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-13.3.2.tgz", - "integrity": "sha512-AX3Zw5iPruN5ie6xGRIDgqkT+ZhnRlZMLMHAs8tg7nRruy2Nb+i5o9bwghAogtM08q1dpr2LVoS8KSTMYpWXUw==", - "dev": true, - "requires": { - "cliui": "^5.0.0", - "find-up": "^3.0.0", - "get-caller-file": "^2.0.1", - "require-directory": "^2.1.1", - "require-main-filename": "^2.0.0", - "set-blocking": "^2.0.0", - "string-width": "^3.0.0", - "which-module": "^2.0.0", - "y18n": "^4.0.0", - "yargs-parser": "^13.1.2" - } - }, - "yargs-parser": { - "version": "13.1.2", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-13.1.2.tgz", - "integrity": "sha512-3lbsNRf/j+A4QuSZfDRA7HRSfWrzO0YjqTJd5kjAq37Zep1CEgaYmrH9Q3GwPiB9cHyd1Y1UwggGhJGoxipbzg==", - "dev": true, - "requires": { - "camelcase": "^5.0.0", - "decamelize": "^1.2.0" - } } } }, diff --git a/package.json b/package.json index 8e0bcac..0e71d94 100644 --- a/package.json +++ b/package.json @@ -7,7 +7,7 @@ "hardhat": "^2.6.8", "husky": "^4.3.0", "prettier": "^2.1.2", - "prettier-plugin-solidity": "^1.0.0-alpha.57", + "prettier-plugin-solidity": "^1.0.0-beta.19", "pretty-quick": "^3.0.2" }, "scripts": { diff --git a/tests/conftest.py b/tests/conftest.py index 88fe8e5..f5aed1a 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -1,7 +1,7 @@ import pytest from brownie import accounts, chain, config, Contract, web3, Wei, \ - SpookyJoint, SolidexJoint, SpiritJoint, SushiJoint + UniV3StablesJoint, UniswapHelperViews, TestingLibrary from brownie.network import gas_price, gas_limit import requests @@ -15,7 +15,7 @@ def tenderly_fork(web3): gas_price(1) fork_base_url = "https://simulate.yearn.network/fork" - payload = {"network_id": "250"} + payload = {"network_id": f"{chain.id}"} resp = requests.post(fork_base_url, headers={}, json=payload) fork_id = resp.json()["simulation_fork"]["id"] fork_rpc_url = f"https://rpc.tenderly.co/fork/{fork_id}" @@ -24,15 +24,19 @@ def tenderly_fork(web3): web3.provider = tenderly_provider print(f"https://dashboard.tenderly.co/yearn/yearn-web/fork/{fork_id}") -@pytest.fixture(scope="session", autouse=True) -def donate(wftm, accounts, gov, tokenA_whale, tokenB_whale): - donor = accounts.at(wftm, force=True) +@pytest.fixture(scope="module", autouse=True) +def donate(wftm, weth, accounts, gov, tokenA_whale, tokenB_whale, chain): + donor = accounts.at(wftm, force=True) if chain.id == 250 else accounts.at(weth, force=True) for i in range(10): + print(f"Donating account {i}") donor.transfer(accounts[i], 100e18) donor.transfer(gov, 100e18) + donor.transfer(tokenA_whale, 100e18) + donor.transfer(tokenB_whale, 100e18) -@pytest.fixture(scope="session", autouse=True) +@pytest.fixture(scope="module", autouse=True) def reset_chain(chain): + chain.reset() print(f"Initial Height: {chain.height}") yield print(f"\nEnd Height: {chain.height}") @@ -86,10 +90,16 @@ def strategist(accounts): def keeper(accounts): yield accounts[5] +eth_chain_ids = [1, 31337] @pytest.fixture(scope="session") def hedgilV2(): - yield Contract("0x6E7d6Daa034fD0188f879E5648f63D821F7C0702") + if chain.id in eth_chain_ids: + yield "" + elif chain.id == 250: + yield Contract("0xB6bdB19b7E1042CA3dD7b62048827d10C5e3a7FA") + else: + yield None @pytest.fixture(scope="session") @@ -104,35 +114,43 @@ def deployer(accounts): @pytest.fixture(scope="session") def dai(): - yield Contract(token_addresses["DAI"]) + if chain.id in eth_chain_ids: + yield Contract(token_addresses_eth["DAI"]) + elif chain.id == 250: + yield Contract(token_addresses_ftm["DAI"]) @pytest.fixture(scope="session") -def weth(): - token_address = "0x74b23882a30290451A17c44f4F05243b6b58C76d" - yield Contract(token_address) +def weth(chain): + if chain.id in eth_chain_ids: + yield Contract(token_addresses_eth["WETH"]) + elif chain.id == 250: + yield Contract(token_addresses_ftm["WETH"]) @pytest.fixture(scope="session") -def wftm(): - token_address = token_addresses["WFTM"] - yield Contract(token_address) - +def wftm(chain): + if chain.id == 250: + yield Contract(token_addresses_ftm["WFTM"]) + yield None @pytest.fixture(scope="session") -def usdc(): - token_address = token_addresses["USDC"] - yield Contract(token_address) - +def registry(): + yield Contract("") @pytest.fixture(scope="session") -def mim(): - token_address = token_addresses["MIM"] - yield Contract(token_address) +def healthcheck(chain): + if chain.id in eth_chain_ids: + yield "0xDDCea799fF1699e98EDF118e0629A974Df7DF012" + elif chain.id == 250: + yield "0xf13Cd6887C62B5beC145e30c38c4938c5E627fe0" @pytest.fixture(scope="session") -def registry(): - yield Contract("") +def sms(chain): + if chain.id in eth_chain_ids: + yield "0x16388463d60FFE0661Cf7F1f31a7D658aC790ff7" + elif chain.id == 250: + yield "0x72a34AbafAB09b15E7191822A679f28E067C4a16" @pytest.fixture(scope="session") @@ -145,12 +163,22 @@ def live_vaultB(registry, tokenB): yield registry.latestVault(tokenB) ######### PARAMETERS +@pytest.fixture( + params=[ + "100", + # "500", + # "3000" + ], + scope="session", + autouse=True,) +def univ3_pool_fee(request): + yield request.param # Select the type of hedge to use for the joint @pytest.fixture( params=[ - # "nohedge", - "hedgilV2", + "nohedge", + # "hedgilV2", # "hegic" ], scope="session", @@ -163,8 +191,8 @@ def hedge_type(request): # "SUSHI", # "SOLID", # "SPIRIT", - # "UNI", - "SPOOKY" + "UNIV3", + # "SPOOKY" ], scope="session", autouse=True,) @@ -176,21 +204,24 @@ def dex(request): params=[ # 'WBTC', # WBTC # "YFI", # YFI - "ETH", # WETH + # "ETH", # WETH # 'LINK', # LINK - 'fUSDT', # USDT - 'DAI', # DAI + # 'fUSDT', # USDT + # 'DAI', # DAI # "WFTM", "USDC", # USDC # "WFTM", # "BOO", - "BTC", + # "BTC", ], scope="session", autouse=True, ) -def tokenA(request): - yield Contract(token_addresses[request.param]) +def tokenA(request, chain): + if chain.id in eth_chain_ids: + yield Contract(token_addresses_eth[request.param]) + elif chain.id == 250: + yield Contract(token_addresses_ftm[request.param]) # TODO: uncomment those tokens you want to test as want @@ -200,43 +231,56 @@ def tokenA(request): # "YFI", # YFI # "WETH", # WETH # 'LINK', # LINK - # 'USDT', # USDT + 'USDT', # USDT # 'DAI', # DAI # "USDC", # USDC - "WFTM", + # "WFTM", # "MIM", # "FRAX", ], scope="session", autouse=True, ) -def tokenB(request): - yield Contract(token_addresses[request.param]) +def tokenB(request, chain): + if chain.id in eth_chain_ids: + yield Contract(token_addresses_eth[request.param]) + elif chain.id == 250: + yield Contract(token_addresses_ftm[request.param]) @pytest.fixture(params=[ # "SEX", - "BOO" + # "BOO", + "" ], scope="session", autouse=True) -def rewards(request): - rewards_address = token_addresses[request.param] # sushi - yield Contract(rewards_address) +def rewards(request, chain): + if chain.id in eth_chain_ids: + if request.param in token_addresses_eth.keys(): + yield Contract(token_addresses_eth[request.param]) + elif chain.id == 250: + if request.param in token_addresses_ftm.keys(): + yield Contract(token_addresses_ftm[request.param]) + yield None joint_type = { - "SPOOKY": { + # "SPOOKY": { + # "nohedge": "", + # "hedgilV2": SpookyJoint + # }, + # "SOLID": { + # "nohedge": SolidexJoint, + # "hedgilV2": "" + # }, + # "SUSHI": { + # "nohedge": "", + # "hedgilV2": "", + # "hegic": SushiJoint + # }, + "SPIRIT": { "nohedge": "", - "hedgilV2": SpookyJoint - }, - "SOLID": { - "nohedge": SolidexJoint, "hedgilV2": "" }, - "SUSHI": { - "nohedge": "", - "hedgilV2": "", - "hegic": SushiJoint - }, - "SPIRIT": { - "nohedge": "", + "UNIV3": { + "nohedge": UniV3StablesJoint, "hedgilV2": "" } } @@ -244,7 +288,7 @@ def rewards(request): def joint_to_use(dex, hedge_type): yield joint_type[dex][hedge_type] -token_addresses = { +token_addresses_ftm = { "YFI": "0x29b0Da86e484E1C0029B56e817912d778aC0EC69", # YFI "ETH": "0x74b23882a30290451A17c44f4F05243b6b58C76d", # WETH "DAI": "0x8D11eC38a3EB5E956B052f67Da8Bdc9bef8Abf3E", # DAI @@ -259,9 +303,15 @@ def joint_to_use(dex, hedge_type): "FRAX": "0xdc301622e621166BD8E82f2cA0A26c13Ad0BE355", #FRAX "BTC": "0x321162Cd933E2Be498Cd2267a90534A804051b11", #BTC "fUSDT": "0x049d68029688eAbF473097a2fC38ef61633A3C7A", #fUSDT +} +token_addresses_eth = { + "WETH": "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2", # WETH + "USDC": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48", # USDC + "DAI": "0x6B175474E89094C44Da98b954EedeAC495271d0F", # DAI + "USDT": "0xdAC17F958D2ee523a2206206994597C13D831ec7", # USDT } -whale_addresses = { +whale_addresses_ftm = { "SOLID": "0x1d1A1871d1830D4b5087212c820E5f1252379c2c", "SEX": "0x1434f19804789e494E271F9CeF8450e51790fcD2", "YFI": "0x29b0Da86e484E1C0029B56e817912d778aC0EC69", @@ -276,6 +326,12 @@ def joint_to_use(dex, hedge_type): "BTC": "0x38aCa5484B8603373Acc6961Ecd57a6a594510A3", "fUSDT": "0x2823D10DA533d9Ee873FEd7B16f4A962B2B7f181", } +whale_addresses_eth = { + "WETH": "0x2F0b23f53734252Bda2277357e97e1517d6B042A", # WETH + "USDC": "0x47ac0Fb4F2D84898e4D9E7b4DaB3C24507a6D503", # USDC + "USDT": "0x47ac0Fb4F2D84898e4D9E7b4DaB3C24507a6D503", # USDT + "DAI": "0x47ac0Fb4F2D84898e4D9E7b4DaB3C24507a6D503", # DAI +} lp_whales = { "SPOOKY": @@ -297,22 +353,61 @@ def joint_to_use(dex, hedge_type): "DAI": "0x9C7EaC4b4a8d37fA9dE7e4cb81F0a99256C672d1", } }, + "UNIV3": + { + "WETH": { + "USDC": "", + "USDT": "", + } + } } -@pytest.fixture(scope="session", autouse=True) +@pytest.fixture(scope="session", autouse=False) def lp_whale(dex, tokenA, tokenB): yield lp_whales[dex][tokenB.symbol()][tokenA.symbol()] +uni_v3_pols_eth = { + "WETH": { + "USDC": { + "3000": "0x8ad599c3A0ff1De082011EFDDc58f1908eb6e6D8", + } + }, + "USDT": { + "USDC": { + "100": "0x3416cf6c708da44db2624d63ea0aaef7113527c6", + "500": "0x7858e59e0c01ea06df3af3d20ac7b0003275d4bf", + } + }, + "DAI": { + "USDC": { + "100": "0x5777d92f208679db4b9778590fa3cab3ac9e2168", + } + } +} +@pytest.fixture +def uni_v3_pool(chain, tokenA, tokenB, univ3_pool_fee): + if chain.id in eth_chain_ids: + base_pool = Contract(uni_v3_pols_eth["WETH"]["USDC"]["3000"]) + yield Contract.from_abi(f"UniswapV3Pool {tokenA.symbol()} - {tokenB.symbol()}", uni_v3_pols_eth[tokenB.symbol()][tokenA.symbol()][univ3_pool_fee], base_pool.abi) + elif chain.id == 250: + yield None + @pytest.fixture(scope="session", autouse=True) -def tokenA_whale(tokenA): - yield whale_addresses[tokenA.symbol()] +def tokenA_whale(chain, tokenA): + if chain.id in eth_chain_ids: + yield whale_addresses_eth[tokenA.symbol()] + elif chain.id == 250: + yield whale_addresses_ftm[tokenA.symbol()] @pytest.fixture(scope="session", autouse=True) -def tokenB_whale(tokenB): - yield whale_addresses[tokenB.symbol()] +def tokenB_whale(chain, tokenB): + if chain.id in eth_chain_ids: + yield whale_addresses_eth[tokenB.symbol()] + elif chain.id == 250: + yield whale_addresses_ftm[tokenB.symbol()] mc_pids = { "WFTM": { @@ -334,7 +429,7 @@ def mc_pid(tokenA, tokenB): yield "" router_addresses = { - "UNI": "", + "UNIV3": "0xE592427A0AEce92De3Edee1F18E0157C05861564", "SUSHI": "", "SPOOKY": "0xF491e7B69E4244ad4002BC14e878a34207E38c29", "SOLID": "0xa38cd27185a464914D3046f0AB9d43356B34829D", @@ -357,7 +452,7 @@ def lp_depositor(dex): yield "" # Non-comprehensive, find the full list here to add your own: https://docs.chain.link/docs/fantom-price-feeds/ -oracle_addresses = { +oracle_addresses_ftm = { "WFTM": "0xf4766552D15AE4d256Ad41B6cf2933482B0680dc", "USDC": "0x2553f4eeb82d5A26427b8d1106C51499CBa5D99c", "MIM": "0x28de48D3291F31F839274B8d82691c77DF1c5ceD", @@ -367,20 +462,33 @@ def lp_depositor(dex): "ETH": "0x11DdD3d147E5b83D01cee7070027092397d63658", "fUSDT": "0xF64b636c5dFe1d3555A847341cDC449f612307d0", } +oracle_addresses_eth = { + "WETH": "0x5f4eC3Df9cbd43714FE2740f5E3616155c5b8419", # WETH + "USDC": "0x8fFfFfd4AfB6115b954Bd326cbe7B4BA576818f6", # DAI +} @pytest.fixture(scope="session") -def tokenA_oracle(tokenA): - yield Contract(oracle_addresses[tokenA.symbol()]) +def tokenA_oracle(tokenA, chain): + if chain.id in eth_chain_ids: + yield Contract(oracle_addresses_eth[tokenA.symbol()]) + elif chain.id == 250: + yield Contract(oracle_addresses_ftm[tokenA.symbol()]) @pytest.fixture(scope="session") -def tokenB_oracle(tokenB): - yield Contract(oracle_addresses[tokenB.symbol()]) +def tokenB_oracle(tokenB, chain): + if chain.id in eth_chain_ids: + yield Contract(oracle_addresses_eth[tokenB.symbol()]) + elif chain.id == 250: + yield Contract(oracle_addresses_ftm[tokenB.symbol()]) @pytest.fixture -def rewards_whale(rewards): - yield whale_addresses[rewards.symbol()] +def rewards_whale(rewards, chain): + if chain.id in eth_chain_ids: + yield whale_addresses_eth[rewards.symbol()] + elif chain.id == 250: + yield whale_addresses_ftm[rewards.symbol()] masterchef_addresses = { "SUSHI": "0xc2EdaD668740f1aA35E4D8f227fB8E17dcA888Cd", @@ -392,7 +500,9 @@ def rewards_whale(rewards): @pytest.fixture def masterchef(rewards): - yield Contract(masterchef_addresses[rewards.symbol()]) + if rewards is not None: + yield Contract(masterchef_addresses[rewards.symbol()]) + yield None hedgil_pools = { "WFTM": { @@ -406,14 +516,14 @@ def masterchef(rewards): token_prices = { "WBTC": 60_000, "BTC": 38_000, - "ETH": 4_500, + "WETH": 2_800, "LINK": 20, "YFI": 30_000, "USDT": 1, "fUSDT": 1, "USDC": 1, "DAI": 1, - "WFTM": 3, + "WFTM": 1, "MIM": 1, "FRAX": 1, "BOO": 11, @@ -457,24 +567,38 @@ def weth_amount(user, weth): ######### DEPLOYMENTS @pytest.fixture(scope="function", autouse=True) -def vaultA(pm, gov, rewards, guardian, management, tokenA): +def vaultA(pm, gov, guardian, management, tokenA): Vault = pm(config["dependencies"][0]).Vault vault = guardian.deploy(Vault) - vault.initialize(tokenA, gov, rewards, "", "", guardian, management, {"from": gov, "gas_price":0}) + vault.initialize(tokenA, gov, management, "", "", guardian, management, {"from": gov, "gas_price":0}) vault.setDepositLimit(2 ** 256 - 1, {"from": gov, "gas_price":0}) vault.setManagement(management, {"from": gov, "gas_price":0}) yield vault @pytest.fixture(scope="function", autouse=True) -def vaultB(pm, gov, rewards, guardian, management, tokenB): +def vaultB(pm, gov, guardian, management, tokenB): Vault = pm(config["dependencies"][0]).Vault vault = guardian.deploy(Vault) - vault.initialize(tokenB, gov, rewards, "", "", guardian, management, {"from": gov, "gas_price":0}) + vault.initialize(tokenB, gov, management, "", "", guardian, management, {"from": gov, "gas_price":0}) vault.setDepositLimit(2 ** 256 - 1, {"from": gov, "gas_price":0}) vault.setManagement(management, {"from": gov, "gas_price":0}) yield vault +@pytest.fixture() +def uniswap_helper_views(dex, gov): + if dex == "UNIV3": + yield gov.deploy(UniswapHelperViews) + else: + yield "" + +@pytest.fixture() +def testing_library(dex, gov): + if dex == "UNIV3": + yield gov.deploy(TestingLibrary) + else: + yield "" + @pytest.fixture def joint( providerA, @@ -488,10 +612,12 @@ def joint( hedgilV2, gov, lp_depositor, - stable + stable, + weth, + uni_v3_pool ): - if (joint_to_use == SpookyJoint): + if (joint_to_use == "SpookyJoint"): joint = gov.deploy( joint_to_use, providerA, @@ -503,7 +629,7 @@ def joint( masterchef, mc_pid, ) - elif (joint_to_use == SolidexJoint): + elif (joint_to_use == "SolidexJoint"): joint = gov.deploy( joint_to_use, providerA, @@ -514,45 +640,51 @@ def joint( lp_depositor, stable ) - - joint.setMaxPercentageLoss(500, {"from": gov}) - joint.setHedgeBudget(25) - joint.setHedgingPeriod(2 * 86400) + elif (joint_to_use == UniV3StablesJoint): + uniswap_helper_views = gov.deploy(UniswapHelperViews) + joint = gov.deploy( + joint_to_use, + providerA, + providerB, + weth, + uni_v3_pool, + 1 + ) + joint.setMaxPercentageLoss(5 * joint.maxPercentageLoss(), {"from": gov}) providerA.setJoint(joint, {"from": gov}) providerB.setJoint(joint, {"from": gov}) yield joint - @pytest.fixture -def providerA(strategist, keeper, vaultA, ProviderStrategy, gov): +def providerA(strategist, keeper, vaultA, ProviderStrategy, gov, sms, healthcheck): strategy = strategist.deploy(ProviderStrategy, vaultA) strategy.setKeeper(keeper, {"from": gov, "gas_price":0}) vaultA.addStrategy(strategy, 10_000, 0, 2 ** 256 - 1, 1_000, {"from": gov, "gas_price":0}) - strategy.setHealthCheck("0xf13Cd6887C62B5beC145e30c38c4938c5E627fe0", {"from": gov, "gas_price":0}) + strategy.setHealthCheck(healthcheck, {"from": gov, "gas_price":0}) strategy.setDoHealthCheck(False, {"from": gov, "gas_price":0}) Contract(strategy.healthCheck()).setlossLimitRatio( - 1000, {"from": "0x72a34AbafAB09b15E7191822A679f28E067C4a16", "gas_price":0} + 1000, {"from": sms, "gas_price":0} ) Contract(strategy.healthCheck()).setProfitLimitRatio( - 2000, {"from": "0x72a34AbafAB09b15E7191822A679f28E067C4a16", "gas_price":0} + 2000, {"from": sms, "gas_price":0} ) yield strategy @pytest.fixture -def providerB(strategist, keeper, vaultB, ProviderStrategy, gov): +def providerB(strategist, keeper, vaultB, ProviderStrategy, gov, sms, healthcheck): strategy = strategist.deploy(ProviderStrategy, vaultB) strategy.setKeeper(keeper, {"from": gov, "gas_price":0}) vaultB.addStrategy(strategy, 10_000, 0, 2 ** 256 - 1, 1_000, {"from": gov, "gas_price":0}) - strategy.setHealthCheck("0xf13Cd6887C62B5beC145e30c38c4938c5E627fe0", {"from": gov, "gas_price":0}) + strategy.setHealthCheck(healthcheck, {"from": gov, "gas_price":0}) strategy.setDoHealthCheck(False, {"from": gov, "gas_price":0}) Contract(strategy.healthCheck()).setlossLimitRatio( - 1000, {"from": "0x72a34AbafAB09b15E7191822A679f28E067C4a16", "gas_price":0} + 1000, {"from": sms, "gas_price":0} ) Contract(strategy.healthCheck()).setProfitLimitRatio( - 2000, {"from": "0x72a34AbafAB09b15E7191822A679f28E067C4a16", "gas_price":0} + 2000, {"from": sms, "gas_price":0} ) yield strategy @@ -604,7 +736,11 @@ def LPHedgingLibrary(LPHedgingLib, gov): @pytest.fixture(scope="session", autouse=True) def RELATIVE_APPROX(): - yield 1e-5 + yield 1e-4 + +@pytest.fixture(scope="session", autouse=True) +def RATIO_PRECISION(): + yield 1e18 @pytest.fixture(autouse=False) @@ -652,7 +788,7 @@ def reset_tenderly_fork(): yield -@pytest.fixture(autouse=True) +@pytest.fixture(autouse=False) def trade_factory(joint, yMechs_multisig): tf = Contract(joint.tradeFactory()) tf.grantRole(tf.STRATEGY(), joint, {"from": yMechs_multisig, "gas_price": 0}) @@ -664,14 +800,14 @@ def yMechs_multisig(): yield accounts.at("0x9f2A061d6fEF20ad3A656e23fd9C814b75fd5803", force=True) -@pytest.fixture(scope="function", autouse=True) +@pytest.fixture(scope="function", autouse=False) def auth_yswaps(joint, trade_factory, yMechs_multisig): gas_price(0) trade_factory.grantRole( trade_factory.STRATEGY(), joint, {"from": yMechs_multisig, "gas_price": 0} ) -@pytest.fixture(autouse=True) +@pytest.fixture(autouse=False) def trade_factory(joint, yMechs_multisig): tf = Contract(joint.tradeFactory()) tf.grantRole( diff --git a/tests/nohedge/test_harvests.py b/tests/nohedge/SOLID_test_harvests.py similarity index 98% rename from tests/nohedge/test_harvests.py rename to tests/nohedge/SOLID_test_harvests.py index 09f80a2..3c43ad2 100644 --- a/tests/nohedge/test_harvests.py +++ b/tests/nohedge/SOLID_test_harvests.py @@ -21,9 +21,11 @@ def test_profitable_harvest( gov, tokenA_whale, tokenB_whale, - hedge_type + hedge_type, + dex ): checks.check_run_test("nohedge", hedge_type) + checks.check_run_test("SOLID", dex) solid_token = Contract(joint.SOLID_SEX()) sex_token = Contract(joint.SEX()) # Deposit to the vault @@ -122,9 +124,11 @@ def test_manual_exit( gov, tokenA_whale, tokenB_whale, - hedge_type + hedge_type, + dex ): checks.check_run_test("nohedge", hedge_type) + checks.check_run_test("SOLID", dex) solid_token = Contract(joint.SOLID_SEX()) sex_token = Contract(joint.SEX()) # Deposit to the vault @@ -219,9 +223,11 @@ def test_profitable_with_big_imbalance_harvest( tokenB_whale, router, swap_from, - hedge_type + hedge_type, + dex ): checks.check_run_test("nohedge", hedge_type) + checks.check_run_test("SOLID", dex) solid_token = Contract(joint.SOLID_SEX()) sex_token = Contract(joint.SEX()) @@ -340,9 +346,11 @@ def test_profitable_harvest_yswaps( wftm, trade_factory, yMechs_multisig, - hedge_type + hedge_type, + dex ): checks.check_run_test("nohedge", hedge_type) + checks.check_run_test("SOLID", dex) solid_token = Contract(joint.SOLID_SEX()) sex_token = Contract(joint.SEX()) diff --git a/tests/nohedge/UNIV3_price_movement.py b/tests/nohedge/UNIV3_price_movement.py new file mode 100644 index 0000000..77d58a5 --- /dev/null +++ b/tests/nohedge/UNIV3_price_movement.py @@ -0,0 +1,266 @@ +import eth_utils +import pytest +from brownie import Contract, chain, interface, history +from eth_abi.packed import encode_abi_packed +from utils import actions, checks, utils + + +@pytest.mark.parametrize("swap_from", ["a", "b"]) +@pytest.mark.parametrize("swap_dex", ["uni", "crv"]) +def test_one_tick_UNIV3( + chain, + tokenA, + tokenB, + vaultA, + vaultB, + providerA, + providerB, + joint, + user, + amountA, + amountB, + RELATIVE_APPROX, + gov, + tokenA_whale, + tokenB_whale, + hedge_type, + dex, + uni_v3_pool, + router, + swap_from, + swap_dex, + uniswap_helper_views, + testing_library, + univ3_pool_fee +): + checks.check_run_test("nohedge", hedge_type) + checks.check_run_test("UNIV3", dex) + + if swap_dex == "uni": + joint.setUseCRVPool(False, {"from": gov}) + else: + joint.setUseCRVPool(True, {"from": gov}) + + # Deposit to the vault + actions.user_deposit(user, vaultA, tokenA, amountA) + actions.user_deposit(user, vaultB, tokenB, amountB) + + # Harvest 1: Send funds through the strategy + chain.sleep(1) + chain.mine(1) + + n_ticks = 1 + before_tick = uni_v3_pool.slot0()["tick"] + print(f'Pool tick before test: {uni_v3_pool.slot0()["tick"]}') + actions.gov_start_epoch_univ3(gov, providerA, providerB, joint, vaultA, vaultB, amountA, amountB) + + token_in = tokenA if swap_from == "a" else tokenB + token_out = tokenB if swap_from == "a" else tokenA + token_in_whale = tokenA_whale if swap_from == "a" else tokenB_whale + token_out_whale = tokenB_whale if swap_from == "a" else tokenA_whale + + current_tick = uni_v3_pool.slot0()["tick"] + if uni_v3_pool.token0() == tokenA.address: + next_tick = current_tick - 1 if swap_from == "a" else current_tick + 1 + else: + next_tick = current_tick + 1 if swap_from == "a" else current_tick - 1 + # limit_price = uniswap_helper_views.getSqrtRatioAtTick(next_tick) + 1 if swap_from == "a" else uniswap_helper_views.getSqrtRatioAtTick(next_tick) - 1 + limit_price = testing_library.getSqrtRatioAtTick(next_tick) + 1 + + reserves = utils.univ3_get_pool_reserves(joint.pool(), tokenA, tokenB) + + sell_amount = 100e6 * 10 ** token_in.decimals() + + # swap 1m from one token to the other + utils.univ3_sell_token(token_in, token_out, router, token_in_whale, sell_amount, univ3_pool_fee, limit_price) + + new_tick = uni_v3_pool.slot0()["tick"] + assert abs(new_tick - current_tick) == n_ticks + + providerA.setDoHealthCheck(False, {"from":gov}) + providerB.setDoHealthCheck(False, {"from":gov}) + actions.gov_end_epoch(gov, providerA, providerB, joint, vaultA, vaultB) + sell_amount = 1000e6 * 10 ** token_out.decimals() + limit_price = testing_library.getSqrtRatioAtTick(before_tick) + 1 + utils.univ3_sell_token(token_out, token_in, router, token_out_whale, sell_amount, univ3_pool_fee, limit_price) + print(f'Pool tick after test: {uni_v3_pool.slot0()["tick"]}') + +@pytest.mark.parametrize("swap_from", ["a", "b"]) +@pytest.mark.parametrize("swap_dex", ["crv"]) +def test_multiple_ticks_UNIV3( + chain, + tokenA, + tokenB, + vaultA, + vaultB, + providerA, + providerB, + joint, + user, + amountA, + amountB, + RELATIVE_APPROX, + gov, + tokenA_whale, + tokenB_whale, + hedge_type, + dex, + uni_v3_pool, + router, + swap_from, + swap_dex, + uniswap_helper_views, + testing_library, + univ3_pool_fee +): + checks.check_run_test("nohedge", hedge_type) + checks.check_run_test("UNIV3", dex) + + if swap_dex == "uni": + joint.setUseCRVPool(False, {"from": gov}) + else: + joint.setUseCRVPool(True, {"from": gov}) + + # Deposit to the vault + actions.user_deposit(user, vaultA, tokenA, amountA) + actions.user_deposit(user, vaultB, tokenB, amountB) + + # Harvest 1: Send funds through the strategy + chain.sleep(1) + chain.mine(1) + + n_ticks = 3 + before_tick = uni_v3_pool.slot0()["tick"] + print(f'Pool tick before test: {uni_v3_pool.slot0()["tick"]}') + actions.gov_start_epoch_univ3(gov, providerA, providerB, joint, vaultA, vaultB, amountA, amountB) + + token_in = tokenA if swap_from == "a" else tokenB + token_out = tokenB if swap_from == "a" else tokenA + token_in_whale = tokenA_whale if swap_from == "a" else tokenB_whale + token_out_whale = tokenB_whale if swap_from == "a" else tokenA_whale + + current_tick = uni_v3_pool.slot0()["tick"] + if uni_v3_pool.token0() == tokenA.address: + next_tick = current_tick - n_ticks if swap_from == "a" else current_tick + n_ticks + else: + next_tick = current_tick + n_ticks if swap_from == "a" else current_tick - n_ticks + + # limit_price = uniswap_helper_views.getSqrtRatioAtTick(next_tick) + 1 if swap_from == "a" else uniswap_helper_views.getSqrtRatioAtTick(next_tick) - 1 + limit_price = testing_library.getSqrtRatioAtTick(next_tick) + 1 + + reserves = utils.univ3_get_pool_reserves(joint.pool(), tokenA, tokenB) + + sell_amount = 1000e6 * 10 ** token_in.decimals() + + # swap 1m from one token to the other + utils.univ3_sell_token(token_in, token_out, router, token_in_whale, sell_amount, univ3_pool_fee, limit_price) + + new_tick = uni_v3_pool.slot0()["tick"] + assert abs(new_tick - current_tick) == n_ticks + + rewards_pending = joint.pendingRewards() + + if joint.maxTick() < new_tick or new_tick < joint.minTick(): + if swap_from == "a": + assert joint.balanceOfTokensInLP()[1] == 0 + else: + assert joint.balanceOfTokensInLP()[0] == 0 + sell_amount = 100 * 10 ** token_in.decimals() + utils.univ3_sell_token(token_in, token_out, router, token_in_whale, sell_amount, univ3_pool_fee, 0) + assert joint.pendingRewards() == rewards_pending + + providerA.setDoHealthCheck(False, {"from":gov}) + providerB.setDoHealthCheck(False, {"from":gov}) + actions.gov_end_epoch(gov, providerA, providerB, joint, vaultA, vaultB) + + # Reset the tick + sell_amount = 1000e6 * 10 ** token_out.decimals() + limit_price = testing_library.getSqrtRatioAtTick(before_tick) + 1 + utils.univ3_sell_token(token_out, token_in, router, token_out_whale, sell_amount, univ3_pool_fee, limit_price) + print(f'Pool tick after test: {uni_v3_pool.slot0()["tick"]}') + +@pytest.mark.parametrize("swap_from", ["a", "b"]) +@pytest.mark.parametrize("swap_dex", ["uni"]) +def test_not_enough_liquidity_to_balance_UNIV3( + chain, + tokenA, + tokenB, + vaultA, + vaultB, + providerA, + providerB, + joint, + user, + amountA, + amountB, + RELATIVE_APPROX, + gov, + tokenA_whale, + tokenB_whale, + hedge_type, + dex, + uni_v3_pool, + router, + swap_from, + swap_dex, + uniswap_helper_views, + RATIO_PRECISION, + testing_library, + univ3_pool_fee +): + checks.check_run_test("nohedge", hedge_type) + checks.check_run_test("UNIV3", dex) + + if swap_dex == "uni": + joint.setUseCRVPool(False, {"from": gov}) + else: + joint.setUseCRVPool(True, {"from": gov}) + + before_tick = uni_v3_pool.slot0()["tick"] + print(f'Pool tick before test: {uni_v3_pool.slot0()["tick"]}') + # Deposit to the vault + actions.user_deposit(user, vaultA, tokenA, amountA) + actions.user_deposit(user, vaultB, tokenB, amountB) + + # Harvest 1: Send funds through the strategy + chain.sleep(1) + chain.mine(1) + + actions.gov_start_epoch_univ3(gov, providerA, providerB, joint, vaultA, vaultB, amountA, amountB) + + utils.univ3_empty_pool_reserve(joint.pool(), swap_from, tokenA, tokenB, router, tokenA_whale, tokenB_whale, univ3_pool_fee) + providerA.setDoHealthCheck(False, {"from":gov}) + providerB.setDoHealthCheck(False, {"from":gov}) + assert ~joint.useCRVPool() + joint.setUseCRVPool(True, {"from": gov}) + assert joint.useCRVPool() + + # Now we can check estimated total balances and ensure they are within limits + estimated_assets = joint.estimatedTotalAssetsAfterBalance() + max_loss_tokenA = (1-joint.maxPercentageLoss() / RATIO_PRECISION) * joint.investedA() + max_loss_tokenB = (1-joint.maxPercentageLoss() / RATIO_PRECISION) * joint.investedB() + + assert estimated_assets[0] >= max_loss_tokenA + assert estimated_assets[1] >= max_loss_tokenB + + if joint.balanceOfTokensInLP()[0]: + token_in = tokenA + token_out = tokenB + token_in_whale = tokenA_whale + else: + token_in = tokenB + token_out = tokenA + token_in_whale = tokenB_whale + + actions.gov_end_epoch(gov, providerA, providerB, joint, vaultA, vaultB) + + assert joint.estimatedTotalAssetsAfterBalance() == (0, 0) + + for (vault, strat) in zip([vaultA, vaultB], [providerA, providerB]): + assert vault.strategies(strat)["totalDebt"] == 0 + + # Reset the tick + sell_amount = 1000e6 * 10 ** token_in.decimals() + limit_price = testing_library.getSqrtRatioAtTick(before_tick) + 1 + utils.univ3_sell_token(token_out, token_in, router, token_in_whale, sell_amount, univ3_pool_fee, limit_price) + print(f'Pool tick after test: {uni_v3_pool.slot0()["tick"]}') diff --git a/tests/nohedge/UNIV3_test_clone_migrate.py b/tests/nohedge/UNIV3_test_clone_migrate.py new file mode 100644 index 0000000..046ad6b --- /dev/null +++ b/tests/nohedge/UNIV3_test_clone_migrate.py @@ -0,0 +1,159 @@ +from functools import _lru_cache_wrapper +from utils import actions, checks, utils +import pytest +from brownie import Contract, chain, UniV3StablesJoint, reverts, ProviderStrategy + +def test_clone_joint( + chain, + tokenA, + tokenB, + vaultA, + vaultB, + providerA, + providerB, + joint, + user, + amountA, + amountB, + RELATIVE_APPROX, + gov, + tokenA_whale, + tokenB_whale, + hedge_type, + dex, + uni_v3_pool, + router, + uniswap_helper_views, + testing_library, + univ3_pool_fee, + joint_to_use, + weth +): + checks.check_run_test("nohedge", hedge_type) + checks.check_run_test("UNIV3", dex) + # Clone the deployed joint + if joint_to_use == UniV3StablesJoint: + cloned_joint = joint.cloneUniV3StablesJoint( + providerA, + providerB, + weth, + uni_v3_pool, + 2 + ).return_value + cloned_joint = UniV3StablesJoint.at(cloned_joint) + else: + print("Joint type not included in test!") + + # Try to clone it again + if joint_to_use == UniV3StablesJoint: + with reverts(): + cloned_joint.cloneUniV3StablesJoint( + providerA, + providerB, + weth, + uni_v3_pool, + 2, + {"from":cloned_joint, "gas_price":0} + ) + else: + print("Joint type not included in test!") + + # Try to initialize again + if joint_to_use == UniV3StablesJoint: + with reverts(): + cloned_joint.initialize( + providerA, + providerB, + weth, + uni_v3_pool, + 2, + {"from":providerA, "gas_price":0} + ) + else: + print("Joint type not included in test!") + +def test_clone_provider_migrate( + chain, + tokenA, + tokenB, + vaultA, + vaultB, + providerA, + providerB, + joint, + user, + amountA, + amountB, + RELATIVE_APPROX, + gov, + tokenA_whale, + tokenB_whale, + hedge_type, + dex, + uni_v3_pool, + router, + uniswap_helper_views, + testing_library, + univ3_pool_fee, + joint_to_use, + weth +): + checks.check_run_test("nohedge", hedge_type) + checks.check_run_test("UNIV3", dex) + # Deposit to the vault + actions.user_deposit(user, vaultA, tokenA, amountA) + actions.user_deposit(user, vaultB, tokenB, amountB) + + # Harvest 1: Send funds through the strategy + chain.mine(1, timedelta = 100) + actions.gov_start_epoch_univ3(gov, providerA, providerB, joint, vaultA, vaultB, amountA, amountB) + + balanceA_pre = tokenA.balanceOf(providerA) + balanceB_pre = tokenB.balanceOf(providerB) + + new_providerA = providerA.clone(vaultA).return_value + new_providerA = ProviderStrategy.at(new_providerA) + vaultA.migrateStrategy(providerA, new_providerA, {"from":vaultA.governance()}) + new_providerA.setHealthCheck("0xDDCea799fF1699e98EDF118e0629A974Df7DF012", {"from": gov, "gas_price":0}) + new_providerA.setDoHealthCheck(False, {"from": gov, "gas_price":0}) + + new_providerB = providerA.clone(vaultB).return_value + new_providerB = ProviderStrategy.at(new_providerB) + vaultB.migrateStrategy(providerB, new_providerB, {"from":vaultB.governance()}) + new_providerB.setHealthCheck("0xDDCea799fF1699e98EDF118e0629A974Df7DF012", {"from": gov, "gas_price":0}) + new_providerB.setDoHealthCheck(False, {"from": gov, "gas_price":0}) + + # setup joint + new_providerA.setJoint(joint, {"from": gov}) + new_providerB.setJoint(joint, {"from": gov}) + + # Previous providers are empty + assert tokenA.balanceOf(providerA) == 0 + assert tokenB.balanceOf(providerB) == 0 + + # All balance should be in new providers + assert tokenA.balanceOf(new_providerA) == balanceA_pre + assert tokenB.balanceOf(new_providerB) == balanceB_pre + + # Joint is interacting with new providers + assert joint.providerA() == new_providerA + assert joint.providerB() == new_providerB + + with reverts(): + providerA.harvest({"from": gov}) + with reverts(): + providerB.harvest({"from": gov}) + + actions.gov_end_epoch(gov, new_providerA, new_providerB, joint, vaultA, vaultB) + + assert providerA.estimatedTotalAssets() == 0 + assert new_providerA.estimatedTotalAssets() == 0 + assert providerB.estimatedTotalAssets() == 0 + assert new_providerB.estimatedTotalAssets() == 0 + + assert vaultA.strategies(providerA).dict()["totalLoss"] == 0 + assert vaultB.strategies(providerB).dict()["totalLoss"] == 0 + assert vaultA.strategies(new_providerA).dict()["totalLoss"] > 0 + assert vaultB.strategies(new_providerB).dict()["totalLoss"] > 0 + + \ No newline at end of file diff --git a/tests/nohedge/UNIV3_test_harvest_trigger.py b/tests/nohedge/UNIV3_test_harvest_trigger.py new file mode 100644 index 0000000..b79cb38 --- /dev/null +++ b/tests/nohedge/UNIV3_test_harvest_trigger.py @@ -0,0 +1,206 @@ +import eth_utils +import pytest +from brownie import Contract, chain, interface, history +from eth_abi.packed import encode_abi_packed +from utils import actions, checks, utils + +@pytest.mark.parametrize("swap_from", ["a", "b"]) +@pytest.mark.parametrize("swap_dex", ["crv"]) +def test_recenter_joint_UNIV3( + chain, + tokenA, + tokenB, + vaultA, + vaultB, + providerA, + providerB, + joint, + user, + amountA, + amountB, + RELATIVE_APPROX, + gov, + tokenA_whale, + tokenB_whale, + hedge_type, + dex, + uni_v3_pool, + router, + swap_from, + swap_dex, + uniswap_helper_views, + testing_library, + univ3_pool_fee +): + checks.check_run_test("nohedge", hedge_type) + checks.check_run_test("UNIV3", dex) + + if swap_dex == "uni": + joint.setUseCRVPool(False, {"from": gov}) + else: + joint.setUseCRVPool(True, {"from": gov}) + + # Deposit to the vault + actions.user_deposit(user, vaultA, tokenA, amountA) + actions.user_deposit(user, vaultB, tokenB, amountB) + + # Harvest 1: Send funds through the strategy + chain.sleep(1) + chain.mine(1) + + n_ticks = 3 + + print(f'Pool tick before test: {uni_v3_pool.slot0()["tick"]}') + assert providerA.harvestTrigger(1) == False + assert providerB.harvestTrigger(1) == False + actions.gov_start_epoch_univ3(gov, providerA, providerB, joint, vaultA, vaultB, amountA, amountB, True) + assert providerA.harvestTrigger(1) == False + assert providerB.harvestTrigger(1) == False + + token_in = tokenA if swap_from == "a" else tokenB + token_out = tokenB if swap_from == "a" else tokenA + token_in_whale = tokenA_whale if swap_from == "a" else tokenB_whale + + current_tick = uni_v3_pool.slot0()["tick"] + if uni_v3_pool.token0() == tokenA.address: + next_tick = current_tick - n_ticks if swap_from == "a" else current_tick + n_ticks + else: + next_tick = current_tick + n_ticks if swap_from == "a" else current_tick - n_ticks + + # limit_price = uniswap_helper_views.getSqrtRatioAtTick(next_tick) + 1 if swap_from == "a" else uniswap_helper_views.getSqrtRatioAtTick(next_tick) - 1 + limit_price = testing_library.getSqrtRatioAtTick(next_tick) + 1 + + sell_amount = 1000e6 * 10 ** token_in.decimals() + + # swap 1m from one token to the other + utils.univ3_sell_token(token_in, token_out, router, token_in_whale, sell_amount, univ3_pool_fee, limit_price) + + joint.setMinRewardToHarvest(1e18, {"from": gov}) + + assert providerA.harvestTrigger(1) == True + assert providerB.harvestTrigger(1) == True + providerA.harvest() + assert providerA.harvestTrigger(1) == False + assert providerB.harvestTrigger(1) == True + providerB.harvest() + assert providerA.harvestTrigger(1) == False + assert providerB.harvestTrigger(1) == False + + assert providerA.launchHarvest() == False + assert providerB.launchHarvest() == False + + providerA.setLaunchHarvest(True, {"from": gov}) + providerB.setLaunchHarvest(True, {"from": gov}) + + assert providerA.launchHarvest() == True + assert providerB.launchHarvest() == True + + assert providerA.harvestTrigger(1) == True + assert providerB.harvestTrigger(1) == True + providerA.harvest() + assert providerA.harvestTrigger(1) == False + assert providerB.harvestTrigger(1) == True + providerB.harvest() + assert providerA.harvestTrigger(1) == False + assert providerB.harvestTrigger(1) == False + +@pytest.mark.parametrize("swap_from", ["a", "b"]) +@pytest.mark.parametrize("swap_dex", ["crv"]) +def test_compound_fees_joint_UNIV3( + chain, + tokenA, + tokenB, + vaultA, + vaultB, + providerA, + providerB, + joint, + user, + amountA, + amountB, + RELATIVE_APPROX, + gov, + tokenA_whale, + tokenB_whale, + hedge_type, + dex, + uni_v3_pool, + router, + swap_from, + swap_dex, + uniswap_helper_views, + testing_library, + univ3_pool_fee +): + checks.check_run_test("nohedge", hedge_type) + checks.check_run_test("UNIV3", dex) + + if swap_dex == "uni": + joint.setUseCRVPool(False, {"from": gov}) + else: + joint.setUseCRVPool(True, {"from": gov}) + + # Deposit to the vault + actions.user_deposit(user, vaultA, tokenA, amountA) + actions.user_deposit(user, vaultB, tokenB, amountB) + + # Harvest 1: Send funds through the strategy + chain.sleep(1) + chain.mine(1) + + n_ticks = 1 + + print(f'Pool tick before test: {uni_v3_pool.slot0()["tick"]}') + assert providerA.harvestTrigger(1) == False + assert providerB.harvestTrigger(1) == False + assert joint.harvestTrigger(1) == False + actions.gov_start_epoch_univ3(gov, providerA, providerB, joint, vaultA, vaultB, amountA, amountB) + assert providerA.harvestTrigger(1) == False + assert providerB.harvestTrigger(1) == False + assert joint.harvestTrigger(1) == False + + token_in = tokenA if swap_from == "a" else tokenB + token_out = tokenB if swap_from == "a" else tokenA + token_in_whale = tokenA_whale if swap_from == "a" else tokenB_whale + + current_tick = uni_v3_pool.slot0()["tick"] + if uni_v3_pool.token0() == tokenA.address: + next_tick = current_tick - n_ticks if swap_from == "a" else current_tick + n_ticks + else: + next_tick = current_tick + n_ticks if swap_from == "a" else current_tick - n_ticks + + # limit_price = uniswap_helper_views.getSqrtRatioAtTick(next_tick) + 1 if swap_from == "a" else uniswap_helper_views.getSqrtRatioAtTick(next_tick) - 1 + limit_price = testing_library.getSqrtRatioAtTick(next_tick) + 1 + + sell_amount = 1000e6 * 10 ** token_in.decimals() + + # swap 1m from one token to the other + utils.univ3_sell_token(token_in, token_out, router, token_in_whale, sell_amount, univ3_pool_fee, limit_price) + joint.setMinRewardToHarvest(1e18, {"from": gov}) + assert joint.harvestTrigger(1) == False + joint.setMinRewardToHarvest(0, {"from": gov}) + swap_from = "b" if swap_from =="a" else "a" + token_in = tokenA if swap_from == "a" else tokenB + token_out = tokenB if swap_from == "a" else tokenA + token_in_whale = tokenA_whale if swap_from == "a" else tokenB_whale + + current_tick = uni_v3_pool.slot0()["tick"] + if uni_v3_pool.token0() == tokenA.address: + next_tick = current_tick - n_ticks if swap_from == "a" else current_tick + n_ticks + else: + next_tick = current_tick + n_ticks if swap_from == "a" else current_tick - n_ticks + limit_price = testing_library.getSqrtRatioAtTick(next_tick) + 1 + sell_amount = 1000e6 * 10 ** token_in.decimals() + utils.univ3_sell_token(token_in, token_out, router, token_in_whale, sell_amount, univ3_pool_fee, limit_price) + + assert joint.harvestTrigger(1) == False + (pendingA, pendingB) = joint.pendingRewards() + (beforeA, beforeB) = joint.balanceOfTokensInLP() + joint.setMinRewardToHarvest(1e18, {"from": gov}) + assert joint.harvestTrigger(1) == True + joint.harvest() + assert joint.pendingRewards() == (0, 0) + (afterA, afterB) = joint.balanceOfTokensInLP() + assert ((afterA - beforeA) == pendingA) or ((afterB - beforeB) == pendingB) + + actions.gov_end_epoch(gov, providerA, providerB, joint, vaultA, vaultB) \ No newline at end of file diff --git a/tests/nohedge/UNIV3_test_manual_operation.py b/tests/nohedge/UNIV3_test_manual_operation.py new file mode 100644 index 0000000..e949f8b --- /dev/null +++ b/tests/nohedge/UNIV3_test_manual_operation.py @@ -0,0 +1,233 @@ +from functools import _lru_cache_wrapper +from utils import actions, checks, utils +import pytest +from brownie import Contract, chain, reverts + +@pytest.mark.parametrize("swap_from", ["a", "b"]) +def test_return_loose_to_providers_manually( + chain, + tokenA, + tokenB, + vaultA, + vaultB, + providerA, + providerB, + joint, + user, + amountA, + amountB, + RELATIVE_APPROX, + gov, + tokenA_whale, + tokenB_whale, + hedge_type, + dex, + uni_v3_pool, + router, + uniswap_helper_views, + testing_library, + univ3_pool_fee, + joint_to_use, + weth, + swap_from +): + checks.check_run_test("nohedge", hedge_type) + checks.check_run_test("UNIV3", dex) + # Deposit to the vault + actions.user_deposit(user, vaultA, tokenA, amountA) + actions.user_deposit(user, vaultB, tokenB, amountB) + + # Try to inject a false address as pool + with reverts(): + joint.setUniPool("0x3416cf6c708da44db2624d63ea0aaef7113527c5", 100) + + # Harvest 1: Send funds through the strategy + chain.sleep(1) + actions.gov_start_epoch_univ3(gov, providerA, providerB, joint, vaultA, vaultB, amountA, amountB) + + (initial_amount_A, initial_amount_B) = joint.balanceOfTokensInLP() + + # All balance should be invested + assert tokenA.balanceOf(joint) == 0 + assert tokenB.balanceOf(joint) == 0 + assert joint.pendingRewards() == (0,0) + + # Trade a small amount to generate rewards + token_in = tokenA if swap_from == "a" else tokenB + token_out = tokenB if swap_from == "a" else tokenA + token_in_whale = tokenA_whale if swap_from == "a" else tokenB_whale + token_out_whale = tokenB_whale if swap_from == "a" else tokenA_whale + + sell_amount = 1_000 * (10**token_in.decimals()) + utils.univ3_sell_token(token_in, token_out, router, token_in_whale, sell_amount, univ3_pool_fee) + + # We have generated rewards + pending_rewards = joint.pendingRewards() + assert pending_rewards != (0, 0) + + reward_gains = pending_rewards[0] if pending_rewards[0] > 0 else pending_rewards[1] + # Claim rewards manually + balA, balB = joint.pendingRewards() + with reverts(): + tx = joint.burnLPManually(0, joint.minTick(), joint.maxTick(), balA*1.1, balB*1.1, {"from": gov}) + tx = joint.burnLPManually(0, joint.minTick(), joint.maxTick(), balA*0.99, balB*0.99, {"from": gov}) + if reward_gains == pending_rewards[0]: + assert tx.events["Collect"]["amount0"] == reward_gains + else: + assert tx.events["Collect"]["amount1"] == reward_gains + # Remove liquidity manually + tx = joint.removeLiquidityManually(joint.balanceOfPool(), 0, 0, {"from": gov}) + + # All balance should be in joint + assert tokenA.balanceOf(joint) > 0 + assert tokenB.balanceOf(joint) > 0 + + # Send back to providers + joint.returnLooseToProvidersManually() + assert tokenA.balanceOf(joint) == 0 + assert tokenB.balanceOf(joint) == 0 + + # All tokens accounted for + assert pytest.approx(tokenA.balanceOf(providerA), rel=1e-3) == amountA + assert pytest.approx(tokenB.balanceOf(providerB), rel=1e-3) == amountB + +def test_liquidate_position_manually( + chain, + tokenA, + tokenB, + vaultA, + vaultB, + providerA, + providerB, + joint, + user, + amountA, + amountB, + RELATIVE_APPROX, + gov, + tokenA_whale, + tokenB_whale, + hedge_type, + dex, + uni_v3_pool, + router, + uniswap_helper_views, + testing_library, + univ3_pool_fee, + joint_to_use, + weth, +): + checks.check_run_test("nohedge", hedge_type) + checks.check_run_test("UNIV3", dex) + + # Deposit to the vault + actions.user_deposit(user, vaultA, tokenA, amountA) + actions.user_deposit(user, vaultB, tokenB, amountB) + + # Harvest 1: Send funds through the strategy + chain.sleep(1) + actions.gov_start_epoch_univ3(gov, providerA, providerB, joint, vaultA, vaultB, amountA, amountB) + + (initial_amount_A, initial_amount_B) = joint.balanceOfTokensInLP() + + # CLose position manually + joint.liquidatePositionManually(0, 0) + + actions.gov_end_epoch(gov, providerA, providerB, joint, vaultA, vaultB) + + assert joint.investedA() == 0 + assert joint.investedB() == 0 + + for (vault, strat) in zip([vaultA, vaultB], [providerA, providerB]): + assert vault.strategies(strat)["totalLoss"] >= 0 + assert vault.strategies(strat)["totalGain"] == 0 + assert vault.strategies(strat)["totalDebt"] == 0 + +@pytest.mark.parametrize("swap_from", ["a", "b"]) +@pytest.mark.parametrize("swap_dex", ["uni", "crv"]) +def test_manual_swaps( + chain, + tokenA, + tokenB, + vaultA, + vaultB, + providerA, + providerB, + joint, + user, + amountA, + amountB, + RELATIVE_APPROX, + gov, + tokenA_whale, + tokenB_whale, + hedge_type, + dex, + uni_v3_pool, + router, + uniswap_helper_views, + testing_library, + univ3_pool_fee, + joint_to_use, + weth, + swap_from, + swap_dex +): + checks.check_run_test("nohedge", hedge_type) + checks.check_run_test("UNIV3", dex) + + if swap_dex == "uni": + joint.setUseCRVPool(False, {"from": gov}) + else: + joint.setUseCRVPool(True, {"from": gov}) + + # Deposit to the vault + actions.user_deposit(user, vaultA, tokenA, amountA) + actions.user_deposit(user, vaultB, tokenB, amountB) + + # Harvest 1: Send funds through the strategy + chain.sleep(1) + actions.gov_start_epoch_univ3(gov, providerA, providerB, joint, vaultA, vaultB, amountA, amountB) + + # Trade a small amount to generate rewards + token_in = tokenA if swap_from == "a" else tokenB + token_out = tokenB if swap_from == "a" else tokenA + token_in_whale = tokenA_whale if swap_from == "a" else tokenB_whale + + sell_amount = 1_000 * (10**token_in.decimals()) + utils.univ3_sell_token(token_in, token_out, router, token_in_whale, sell_amount, univ3_pool_fee) + + tx = joint.removeLiquidityManually(joint.balanceOfPool(), 0, 0, {"from": gov}) + + if swap_from == "a": + sell_A = True + amount = joint.balanceOfA() - joint.investedA() + else: + sell_A = False + amount = joint.balanceOfB() - joint.investedB() + + joint.swapTokenForTokenManually( + sell_A, + amount, + 0, + {"from": gov} + ) + + # All balance should be in joint + assert pytest.approx(joint.balanceOfA(), rel=RELATIVE_APPROX) == joint.investedA() + assert pytest.approx(joint.balanceOfB(), rel=RELATIVE_APPROX) == joint.investedB() + + # Send back to providers + joint.returnLooseToProvidersManually() + + assert joint.investedA() > 0 + assert joint.investedB() > 0 + + # All tokens accounted for + assert pytest.approx(tokenA.balanceOf(providerA), rel=1e-3) == amountA + assert pytest.approx(tokenB.balanceOf(providerB), rel=1e-3) == amountB + + actions.gov_end_epoch(gov, providerA, providerB, joint, vaultA, vaultB) + + assert joint.investedA() == 0 + assert joint.investedB() == 0 diff --git a/tests/nohedge/UNIV3_test_open_position_and_harvest.py b/tests/nohedge/UNIV3_test_open_position_and_harvest.py new file mode 100644 index 0000000..a55ac40 --- /dev/null +++ b/tests/nohedge/UNIV3_test_open_position_and_harvest.py @@ -0,0 +1,363 @@ +from utils import actions, checks, utils +import pytest +from brownie import Contract, chain, interface +import eth_utils +from eth_abi.packed import encode_abi_packed + +# tests harvesting a strategy that returns profits correctly +def test_open_close_position_UNIV3( + chain, + tokenA, + tokenB, + vaultA, + vaultB, + providerA, + providerB, + joint, + user, + amountA, + amountB, + RELATIVE_APPROX, + gov, + hedge_type, + dex, +): + checks.check_run_test("nohedge", hedge_type) + checks.check_run_test("UNIV3", dex) + + # Deposit to the vault + actions.user_deposit(user, vaultA, tokenA, amountA) + actions.user_deposit(user, vaultB, tokenB, amountB) + + # Harvest 1: Send funds through the strategy + chain.sleep(1) + chain.mine(1) + + providerA.harvest({"from": gov}) + providerB.harvest({"from": gov}) + + assert vaultA.strategies(providerA).dict()['totalDebt'] == amountA + assert vaultB.strategies(providerB).dict()['totalDebt'] == amountB + + assert pytest.approx(joint.balanceOfTokensInLP()[0] + tokenA.balanceOf(providerA), rel=RELATIVE_APPROX) == amountA + assert pytest.approx(joint.balanceOfTokensInLP()[1] + tokenB.balanceOf(providerB), rel=RELATIVE_APPROX) == amountB + + vaultA.updateStrategyDebtRatio(providerA, 0, {"from": gov}) + vaultB.updateStrategyDebtRatio(providerB, 0, {"from": gov}) + + providerA.setDoHealthCheck(False, {"from":gov}) + providerB.setDoHealthCheck(False, {"from":gov}) + + chain.sleep(1) + chain.mine(1) + + txA = providerA.harvest({"from": gov}) + txB = providerB.harvest({"from": gov}) + + assert pytest.approx(txA.events["Harvested"]['loss'], rel=RELATIVE_APPROX) == 1 + assert pytest.approx(txB.events["Harvested"]['loss'], rel=RELATIVE_APPROX) == 1 + + assert joint.balanceOfTokensInLP()[0] == 0 + assert joint.balanceOfTokensInLP()[1] == 0 + + assert providerA.estimatedTotalAssets() == 0 + assert providerB.estimatedTotalAssets() == 0 + + +def test_open_close_position_with_swap_UNIV3( + chain, + tokenA, + tokenB, + vaultA, + vaultB, + providerA, + providerB, + joint, + user, + amountA, + amountB, + RELATIVE_APPROX, + gov, + tokenA_whale, + tokenB_whale, + hedge_type, + dex, + uni_v3_pool, + router, + univ3_pool_fee +): + checks.check_run_test("nohedge", hedge_type) + checks.check_run_test("UNIV3", dex) + + # Deposit to the vault + actions.user_deposit(user, vaultA, tokenA, amountA) + actions.user_deposit(user, vaultB, tokenB, amountB) + + # Harvest 1: Send funds through the strategy + chain.sleep(1) + chain.mine(1) + + providerA.harvest({"from": gov}) + providerB.harvest({"from": gov}) + + assert vaultA.strategies(providerA).dict()['totalDebt'] == amountA + assert vaultB.strategies(providerB).dict()['totalDebt'] == amountB + + assert pytest.approx(joint.balanceOfTokensInLP()[0] + tokenA.balanceOf(providerA), rel=RELATIVE_APPROX) == amountA + assert pytest.approx(joint.balanceOfTokensInLP()[1] + tokenB.balanceOf(providerB), rel=RELATIVE_APPROX) == amountB + + print("etas", providerA.estimatedTotalAssets(), providerB.estimatedTotalAssets()) + + sell_amount = 1_000_000 * 10 ** tokenA.decimals() + # swap 1m from A to B and then from B to A to end up in the original situation + utils.univ3_sell_token(tokenA, tokenB, router, tokenA_whale, sell_amount, univ3_pool_fee) + sell_amount = 1_000_000 * 10 ** tokenB.decimals() + utils.univ3_sell_token(tokenB, tokenA, router, tokenB_whale, sell_amount, univ3_pool_fee) + + print("etas", providerA.estimatedTotalAssets(), providerB.estimatedTotalAssets()) + pending_rewards_estimation = joint.pendingRewards()[0] / 10 ** tokenA.decimals() \ + + joint.pendingRewards()[1] / 10 ** tokenB.decimals() + print("pending", joint.pendingRewards()) + + vaultA.updateStrategyDebtRatio(providerA, 0, {"from": gov}) + vaultB.updateStrategyDebtRatio(providerB, 0, {"from": gov}) + + providerA.setDoHealthCheck(False, {"from":gov}) + providerB.setDoHealthCheck(False, {"from":gov}) + + providerA.harvest({"from": gov}) + providerB.harvest({"from": gov}) + + print("etas", providerA.estimatedTotalAssets(), providerB.estimatedTotalAssets()) + + assert joint.balanceOfTokensInLP()[0] == 0 + assert joint.balanceOfTokensInLP()[1] == 0 + + assert providerA.estimatedTotalAssets() == 0 + assert providerB.estimatedTotalAssets() == 0 + + assert joint.pendingRewards() == (0, 0) + + # assert pytest.approx(vaultA.strategies(providerA)["totalGain"] / 10 ** tokenA.decimals() \ + # + vaultB.strategies(providerB)["totalGain"] / 10 ** tokenB.decimals() + # , rel=1e-3) == pending_rewards_estimation + +@pytest.mark.parametrize("swap_from", ["a", "b"]) +@pytest.mark.parametrize("swap_dex", ["uni", "crv"]) +def test_lossy_harvest_UNIV3( + chain, + tokenA, + tokenB, + vaultA, + vaultB, + providerA, + providerB, + joint, + user, + amountA, + amountB, + RELATIVE_APPROX, + gov, + tokenA_whale, + tokenB_whale, + hedge_type, + dex, + uni_v3_pool, + router, + swap_from, + swap_dex, + univ3_pool_fee, + RATIO_PRECISION +): + checks.check_run_test("nohedge", hedge_type) + checks.check_run_test("UNIV3", dex) + + if swap_dex == "uni": + joint.setUseCRVPool(False, {"from": gov}) + else: + joint.setUseCRVPool(True, {"from": gov}) + + # Deposit to the vault + actions.user_deposit(user, vaultA, tokenA, amountA) + actions.user_deposit(user, vaultB, tokenB, amountB) + + # Harvest 1: Send funds through the strategy + chain.sleep(1) + chain.mine(1) + + actions.gov_start_epoch_univ3(gov, providerA, providerB, joint, vaultA, vaultB, amountA, amountB) + + print("etas", providerA.estimatedTotalAssets(), providerB.estimatedTotalAssets()) + + token_in = tokenA if swap_from == "a" else tokenB + token_out = tokenB if swap_from == "a" else tokenA + token_in_whale = tokenA_whale if swap_from == "a" else tokenB_whale + token_out_whale = tokenB_whale if swap_from == "a" else tokenA_whale + + reserves = utils.univ3_get_pool_reserves(joint.pool(), tokenA, tokenB) + print("Reserves: ", reserves) + sell_amount = 5 / 100 * reserves[0] if swap_from == "a" else 5 / 100 * reserves[1] + # swap 1m from one token to the other + utils.univ3_sell_token(token_in, token_out, router, token_in_whale, sell_amount, univ3_pool_fee) + if swap_dex == "crv": + prev_reserve = utils.crv_ensure_bad_trade(joint.crvPool(), token_in, token_out, token_in_whale) + + assets_tokenA = providerA.estimatedTotalAssets() + assets_tokenB = providerB.estimatedTotalAssets() + + print("etas", assets_tokenA, assets_tokenB) + pending_rewards_estimation = joint.pendingRewards()[0] / 10 ** tokenA.decimals() \ + + joint.pendingRewards()[1] / 10 ** tokenB.decimals() + print("pending", joint.pendingRewards()) + + index_rewards = 0 if swap_from == "a" else 1 + assert joint.pendingRewards()[index_rewards] > 0 + assert joint.pendingRewards()[1 - index_rewards] == 0 + + assert pending_rewards_estimation > 0 + assert assets_tokenA < amountA + assert assets_tokenB < amountB + + providerA.setDoHealthCheck(False, {"from":gov}) + providerB.setDoHealthCheck(False, {"from":gov}) + utils.set_max_losses(providerA, providerB, joint, gov, RATIO_PRECISION) + actions.gov_end_epoch(gov, providerA, providerB, joint, vaultA, vaultB) + + print("etas", providerA.estimatedTotalAssets(), providerB.estimatedTotalAssets()) + + assert joint.balanceOfTokensInLP()[0] == 0 + assert joint.balanceOfTokensInLP()[1] == 0 + + assert providerA.estimatedTotalAssets() == 0 + assert providerB.estimatedTotalAssets() == 0 + + assert joint.pendingRewards() == (0, 0) + + assert pytest.approx(amountA - vaultA.strategies(providerA)["totalLoss"], rel=RELATIVE_APPROX) == assets_tokenA + assert pytest.approx(amountB - vaultB.strategies(providerB)["totalLoss"], rel=RELATIVE_APPROX) == assets_tokenB + + utils.univ3_rebalance_pool(reserves, uni_v3_pool, tokenA, tokenB, router, tokenA_whale, tokenB_whale, univ3_pool_fee) + if swap_dex == "crv": + utils.crv_re_peg_pool(joint.crvPool(), token_out, token_in, token_out_whale, prev_reserve) + +@pytest.mark.parametrize("swap_from", ["a", "b"]) +@pytest.mark.parametrize("swap_dex", ["uni", "crv"]) +def test_choppy_harvest_UNIV3( + chain, + tokenA, + tokenB, + vaultA, + vaultB, + providerA, + providerB, + joint, + user, + amountA, + amountB, + RELATIVE_APPROX, + gov, + tokenA_whale, + tokenB_whale, + hedge_type, + dex, + uni_v3_pool, + router, + swap_from, + swap_dex, + univ3_pool_fee, + RATIO_PRECISION +): + checks.check_run_test("nohedge", hedge_type) + checks.check_run_test("UNIV3", dex) + + if swap_dex == "uni": + joint.setUseCRVPool(False, {"from": gov}) + else: + joint.setUseCRVPool(True, {"from": gov}) + + # Deposit to the vault + actions.user_deposit(user, vaultA, tokenA, amountA) + actions.user_deposit(user, vaultB, tokenB, amountB) + + # Harvest 1: Send funds through the strategy + chain.sleep(1) + chain.mine(1) + + actions.gov_start_epoch_univ3(gov, providerA, providerB, joint, vaultA, vaultB, amountA, amountB, keep_dr = False) + + print("etas", providerA.estimatedTotalAssets(), providerB.estimatedTotalAssets()) + + token_in = tokenA if swap_from == "a" else tokenB + token_out = tokenB if swap_from == "a" else tokenA + token_in_whale = tokenA_whale if swap_from == "a" else tokenB_whale + token_out_whale = tokenB_whale if swap_from == "a" else tokenA_whale + + reserves = utils.univ3_get_pool_reserves(joint.pool(), tokenA, tokenB) + # if swap_from == "b": + # assert 0 + percentage_rewards_swap = 5 / 100 + sell_amount = percentage_rewards_swap * reserves[0] if swap_from == "a" else percentage_rewards_swap * reserves[1] + # swap from one token to the other + print(f"selling {sell_amount} {token_in.symbol()}") + print(reserves) + reserve_out = reserves[1] if swap_from == "a" else reserves[0] + reserve_out = reserve_out / (10**token_out.decimals()) * (10**token_in.decimals()) + if sell_amount > reserve_out: + sell_amount = int(reserve_out * 95 / 100) + utils.univ3_sell_token(token_in, token_out, router, token_in_whale, sell_amount, univ3_pool_fee) + if swap_dex == "crv": + prev_reserve = utils.crv_ensure_bad_trade(joint.crvPool(), token_in, token_out, token_in_whale) + + assets_tokenA = providerA.estimatedTotalAssets() + assets_tokenB = providerB.estimatedTotalAssets() + + print("etas", assets_tokenA, assets_tokenB) + pending_rewards_estimation = joint.pendingRewards()[0] / 10 ** tokenA.decimals() \ + + joint.pendingRewards()[1] / 10 ** tokenB.decimals() + print("pending", joint.pendingRewards()) + + providerA.setDoHealthCheck(False, {"from":gov}) + providerB.setDoHealthCheck(False, {"from":gov}) + utils.set_max_losses(providerA, providerB, joint, gov, RATIO_PRECISION) + actions.gov_end_epoch(gov, providerA, providerB, joint, vaultA, vaultB) + + for (vault, strat) in zip([vaultA, vaultB], [providerA, providerB]): + assert vault.strategies(strat)["totalLoss"] > 0 + assert vault.strategies(strat)["totalGain"] == 0 + assert vault.strategies(strat)["totalDebt"] == 0 + + if swap_dex == "crv": + utils.crv_re_peg_pool(joint.crvPool(), token_out, token_in, token_out_whale, prev_reserve) + + actions.gov_start_epoch_univ3(gov, providerA, providerB, joint, vaultA, vaultB, amountA, amountB, keep_dr = False, check=False) + + # assert 0 + print("etas", providerA.estimatedTotalAssets(), providerB.estimatedTotalAssets()) + + token_in = tokenB if swap_from == "a" else tokenA + token_out = tokenA if swap_from == "a" else tokenB + token_in_whale = tokenB_whale if swap_from == "a" else tokenA_whale + + utils.univ3_buy_token(token_out, token_in, router, token_in_whale, sell_amount, univ3_pool_fee) + + token_in = tokenA if swap_from == "a" else tokenB + token_out = tokenB if swap_from == "a" else tokenA + token_in_whale = tokenA_whale if swap_from == "a" else tokenB_whale + + utils.univ3_sell_token(token_in, token_out, router, token_in_whale, sell_amount, univ3_pool_fee) + + actions.gov_end_epoch(gov, providerA, providerB, joint, vaultA, vaultB) + + assert joint.balanceOfTokensInLP()[0] == 0 + assert joint.balanceOfTokensInLP()[1] == 0 + + assert providerA.estimatedTotalAssets() == 0 + assert providerB.estimatedTotalAssets() == 0 + + assert joint.pendingRewards() == (0, 0) + + for (vault, strat) in zip([vaultA, vaultB], [providerA, providerB]): + assert vault.strategies(strat)["totalLoss"] > 0 + assert vault.strategies(strat)["totalGain"] > 0 + assert vault.strategies(strat)["totalDebt"] == 0 + utils.univ3_rebalance_pool(reserves, uni_v3_pool, tokenA, tokenB, router, tokenA_whale, tokenB_whale, univ3_pool_fee) diff --git a/tests/utils/actions.py b/tests/utils/actions.py index b3a2e04..36f0d1d 100644 --- a/tests/utils/actions.py +++ b/tests/utils/actions.py @@ -9,6 +9,18 @@ def user_deposit(user, vault, token, amount): vault.deposit(amount, {"from": user}) assert token.balanceOf(vault.address) == amount +def gov_start_epoch_univ3(gov, providerA, providerB, joint, vaultA, vaultB, amountA, amountB, keep_dr=False, check=True): + # the first harvest sends funds (tokenA) to joint contract and waits for tokenB funds + # the second harvest sends funds (tokenB) to joint contract AND invests them (if there is enough TokenA) + providerA.harvest({"from": gov}) + providerB.harvest({"from": gov}) + # we set debtRatio to 0 after starting an epoch to be sure that funds return to vault after each epoch + if not keep_dr: + vaultA.updateStrategyDebtRatio(providerA, 0, {"from": gov}) + vaultB.updateStrategyDebtRatio(providerB, 0, {"from": gov}) + + if check: + checks.epoch_started_univ3(providerA, providerB, joint, amountA, amountB) def gov_start_epoch(gov, providerA, providerB, joint, vaultA, vaultB, amountA, amountB): # the first harvest sends funds (tokenA) to joint contract and waits for tokenB funds diff --git a/tests/utils/checks.py b/tests/utils/checks.py index 4045a2e..089ac77 100644 --- a/tests/utils/checks.py +++ b/tests/utils/checks.py @@ -7,6 +7,15 @@ def check_vault_empty(vault): assert vault.totalAssets() == 0 assert vault.totalSupply() == 0 +def epoch_started_univ3(providerA, providerB, joint, amountA, amountB): + assert pytest.approx(providerA.estimatedTotalAssets(), rel=2e-3) == amountA + # Less precision toa ccount for hedgil cost! + assert pytest.approx(providerB.estimatedTotalAssets(), rel=5e-2) == amountB + + assert joint.balanceOfA() == 0 + assert joint.balanceOfB() == 0 + assert joint.balanceOfTokensInLP()[0] > 0 + assert joint.balanceOfTokensInLP()[1] > 0 def epoch_started(providerA, providerB, joint, amountA, amountB): assert pytest.approx(providerA.estimatedTotalAssets(), rel=2e-3) == amountA diff --git a/tests/utils/utils.py b/tests/utils/utils.py index c3fc8e3..00fddfa 100644 --- a/tests/utils/utils.py +++ b/tests/utils/utils.py @@ -1,5 +1,6 @@ import brownie from brownie import interface, chain, accounts, web3, network, Contract +import iniconfig def sync_price(joint): @@ -142,3 +143,131 @@ def print_joint_status(joint, tokenA, tokenB, lp_token, rewards): def swap_tokens_value(router, tokenIn, tokenOut, amountIn): return router.getAmountsOut(amountIn, [tokenIn, tokenOut])[1] + +def univ3_get_position_info(pool, joint): + from eth_abi.packed import encode_abi_packed + from Crypto.Hash import keccak + + k = keccak.new(digest_bits=256) + k.update(encode_abi_packed(["address", "int24", "int24"], [joint.address, joint.minTick(), joint.maxTick()])) + return pool.positions(k.hexdigest()) + +def univ3_sell_token(token_to_sell, token_to_receive, router, whale, amount, fee, limit_price = 0): + token_to_sell.approve(router, 0, {'from': whale}) + token_to_sell.approve(router, 2**256-1, {'from': whale}) + router.exactInputSingle( + ( + token_to_sell, + token_to_receive, + fee, + whale, + 2**256-1, + amount, + 0, + limit_price + ), + {'from': whale} + ) + +def univ3_buy_token(token_to_buy, token_to_sell, router, whale, amount, fee, limit_price = 0): + token_to_sell.approve(router, 0, {'from': whale}) + token_to_sell.approve(router, 2**256-1, {'from': whale}) + router.exactOutputSingle( + ( + token_to_sell, + token_to_buy, + fee, + whale, + 2**256-1, + amount, + 2**255-1, + limit_price + ), + {'from': whale} + ) + +def univ3_get_pool_reserves(pool, tokenA, tokenB): + return (tokenA.balanceOf(pool), tokenB.balanceOf(pool)) + +def univ3_empty_pool_reserve(pool, swap_from, tokenA, tokenB, router, tokenA_whale, tokenB_whale, fee): + reserves = univ3_get_pool_reserves(pool, tokenA, tokenB) + buy_amount = reserves[0] - 500_000 * 10**tokenA.decimals() if swap_from == "a" else reserves[1] - 500_000 * 10**tokenB.decimals() + + token_in = tokenB if swap_from == "a" else tokenA + token_out = tokenA if swap_from == "a" else tokenB + whale = tokenB_whale if swap_from == "a" else tokenA_whale + + token_in.approve(router, 0, {'from': whale}) + token_in.approve(router, 2**256-1, {'from': whale}) + router.exactOutputSingle( + ( + token_in, + token_out, + fee, + whale, + 2**256-1, + buy_amount, + 2**256 -1 , + 0 + ), + {'from': whale} + ) + +def univ3_rebalance_pool(reserves, pool, tokenA, tokenB, router, tokenA_whale, tokenB_whale, univ3_pool_fee): + initial_ratio = reserves[0] / reserves[1] + current_reserves = univ3_get_pool_reserves(pool, tokenA, tokenB) + current_ratio = current_reserves[0] / current_reserves[1] + + if current_ratio > initial_ratio: + token_in = tokenB + token_out = tokenA + whale = tokenB_whale + amount = (current_reserves[0] - initial_ratio * current_reserves[1]) / (1 + initial_ratio) + else: + token_in = tokenA + token_out = tokenB + whale = tokenA_whale + amount = (-current_reserves[0] + initial_ratio * current_reserves[1]) / (1 + initial_ratio) + univ3_sell_token(token_in, token_out, router, whale, amount, univ3_pool_fee, 0) + +def get_crv_index(crv_pool, token): + if crv_pool.coins(0) == token.address: + return 0 + elif crv_pool.coins(1) == token.address: + return 1 + elif crv_pool.coins(2) == token.address: + return 2 + +def crv_ensure_bad_trade(crv_pool, token_in, token_out, token_in_whale): + crv_pool = Contract(crv_pool) + index_from = get_crv_index(crv_pool, token_in) + index_to = get_crv_index(crv_pool, token_out) + + reserve_token_from = crv_pool.balances(index_from) + reserve_token_to = crv_pool.balances(index_to) + sell_amount = reserve_token_to * 0.8 + sell_amount = sell_amount / (10**token_out.decimals()) * (10**token_in.decimals()) + + token_in.approve(crv_pool, 0, {"from": token_in_whale}) + token_in.approve(crv_pool, 2**256-1, {"from": token_in_whale}) + crv_pool.exchange(index_from, index_to, sell_amount, 0, {"from": token_in_whale}) + + return reserve_token_to + +def crv_re_peg_pool(crv_pool, token_in, token_out, token_in_whale, previous_reserve): + crv_pool = Contract(crv_pool) + index_from = get_crv_index(crv_pool, token_in) + index_to = get_crv_index(crv_pool, token_out) + + reserve_token_from = crv_pool.balances(index_from) + sell_amount = previous_reserve - reserve_token_from + + token_in.approve(crv_pool, 0, {"from": token_in_whale}) + token_in.approve(crv_pool, 2**256-1, {"from": token_in_whale}) + crv_pool.exchange(index_from, index_to, sell_amount, 0, {"from": token_in_whale, "gas_price":0}) + +def set_max_losses(providerA, providerB, joint, gov, RATIO_PRECISION): + max_lossA = 1+int(-(providerA.estimatedTotalAssets() / providerA.totalDebt() -1)*100) + max_lossB = 1+int(-(providerB.estimatedTotalAssets() / providerB.totalDebt() -1)*100) + + joint.setMaxPercentageLoss(max(max_lossA, max_lossB) * RATIO_PRECISION / 100, {"from":gov}) diff --git a/yarn.lock b/yarn.lock index 6face8f..53af785 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3,91 +3,91 @@ "@babel/code-frame@^7.0.0": - version "7.12.13" - resolved "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.12.13.tgz" - integrity sha512-HV1Cm0Q3ZrpCR93tkWOYiuYIgLxZXZFVG2VgK+MBWjUqZTundupbfx2aXarXuw5Ko5aMcjtJgbSs4vUGBS5v6g== + "integrity" "sha512-HV1Cm0Q3ZrpCR93tkWOYiuYIgLxZXZFVG2VgK+MBWjUqZTundupbfx2aXarXuw5Ko5aMcjtJgbSs4vUGBS5v6g==" + "resolved" "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.12.13.tgz" + "version" "7.12.13" dependencies: "@babel/highlight" "^7.12.13" "@babel/helper-validator-identifier@^7.12.11": - version "7.12.11" - resolved "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.12.11.tgz" - integrity sha512-np/lG3uARFybkoHokJUmf1QfEvRVCPbmQeUQpKow5cQ3xWrV9i3rUHodKDJPQfTVX61qKi+UdYk8kik84n7XOw== + "integrity" "sha512-np/lG3uARFybkoHokJUmf1QfEvRVCPbmQeUQpKow5cQ3xWrV9i3rUHodKDJPQfTVX61qKi+UdYk8kik84n7XOw==" + "resolved" "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.12.11.tgz" + "version" "7.12.11" "@babel/highlight@^7.12.13": - version "7.12.13" - resolved "https://registry.npmjs.org/@babel/highlight/-/highlight-7.12.13.tgz" - integrity sha512-kocDQvIbgMKlWxXe9fof3TQ+gkIPOUSEYhJjqUjvKMez3krV7vbzYCDq39Oj11UAVK7JqPVGQPlgE85dPNlQww== + "integrity" "sha512-kocDQvIbgMKlWxXe9fof3TQ+gkIPOUSEYhJjqUjvKMez3krV7vbzYCDq39Oj11UAVK7JqPVGQPlgE85dPNlQww==" + "resolved" "https://registry.npmjs.org/@babel/highlight/-/highlight-7.12.13.tgz" + "version" "7.12.13" dependencies: "@babel/helper-validator-identifier" "^7.12.11" - chalk "^2.0.0" - js-tokens "^4.0.0" + "chalk" "^2.0.0" + "js-tokens" "^4.0.0" "@babel/runtime@^7.11.2": - version "7.12.13" - resolved "https://registry.npmjs.org/@babel/runtime/-/runtime-7.12.13.tgz" - integrity sha512-8+3UMPBrjFa/6TtKi/7sehPKqfAm4g6K+YQjyyFOLUTxzOngcRZTlAVY8sc2CORJYqdHQY8gRPHmn+qo15rCBw== + "integrity" "sha512-8+3UMPBrjFa/6TtKi/7sehPKqfAm4g6K+YQjyyFOLUTxzOngcRZTlAVY8sc2CORJYqdHQY8gRPHmn+qo15rCBw==" + "resolved" "https://registry.npmjs.org/@babel/runtime/-/runtime-7.12.13.tgz" + "version" "7.12.13" dependencies: - regenerator-runtime "^0.13.4" + "regenerator-runtime" "^0.13.4" "@commitlint/cli@^11.0.0": - version "11.0.0" - resolved "https://registry.npmjs.org/@commitlint/cli/-/cli-11.0.0.tgz" - integrity sha512-YWZWg1DuqqO5Zjh7vUOeSX76vm0FFyz4y0cpGMFhrhvUi5unc4IVfCXZ6337R9zxuBtmveiRuuhQqnRRer+13g== + "integrity" "sha512-YWZWg1DuqqO5Zjh7vUOeSX76vm0FFyz4y0cpGMFhrhvUi5unc4IVfCXZ6337R9zxuBtmveiRuuhQqnRRer+13g==" + "resolved" "https://registry.npmjs.org/@commitlint/cli/-/cli-11.0.0.tgz" + "version" "11.0.0" dependencies: "@babel/runtime" "^7.11.2" "@commitlint/format" "^11.0.0" "@commitlint/lint" "^11.0.0" "@commitlint/load" "^11.0.0" "@commitlint/read" "^11.0.0" - chalk "4.1.0" - core-js "^3.6.1" - get-stdin "8.0.0" - lodash "^4.17.19" - resolve-from "5.0.0" - resolve-global "1.0.0" - yargs "^15.1.0" + "chalk" "4.1.0" + "core-js" "^3.6.1" + "get-stdin" "8.0.0" + "lodash" "^4.17.19" + "resolve-from" "5.0.0" + "resolve-global" "1.0.0" + "yargs" "^15.1.0" "@commitlint/config-conventional@^11.0.0": - version "11.0.0" - resolved "https://registry.npmjs.org/@commitlint/config-conventional/-/config-conventional-11.0.0.tgz" - integrity sha512-SNDRsb5gLuDd2PL83yCOQX6pE7gevC79UPFx+GLbLfw6jGnnbO9/tlL76MLD8MOViqGbo7ZicjChO9Gn+7tHhA== + "integrity" "sha512-SNDRsb5gLuDd2PL83yCOQX6pE7gevC79UPFx+GLbLfw6jGnnbO9/tlL76MLD8MOViqGbo7ZicjChO9Gn+7tHhA==" + "resolved" "https://registry.npmjs.org/@commitlint/config-conventional/-/config-conventional-11.0.0.tgz" + "version" "11.0.0" dependencies: - conventional-changelog-conventionalcommits "^4.3.1" + "conventional-changelog-conventionalcommits" "^4.3.1" "@commitlint/ensure@^11.0.0": - version "11.0.0" - resolved "https://registry.npmjs.org/@commitlint/ensure/-/ensure-11.0.0.tgz" - integrity sha512-/T4tjseSwlirKZdnx4AuICMNNlFvRyPQimbZIOYujp9DSO6XRtOy9NrmvWujwHsq9F5Wb80QWi4WMW6HMaENug== + "integrity" "sha512-/T4tjseSwlirKZdnx4AuICMNNlFvRyPQimbZIOYujp9DSO6XRtOy9NrmvWujwHsq9F5Wb80QWi4WMW6HMaENug==" + "resolved" "https://registry.npmjs.org/@commitlint/ensure/-/ensure-11.0.0.tgz" + "version" "11.0.0" dependencies: "@commitlint/types" "^11.0.0" - lodash "^4.17.19" + "lodash" "^4.17.19" "@commitlint/execute-rule@^11.0.0": - version "11.0.0" - resolved "https://registry.npmjs.org/@commitlint/execute-rule/-/execute-rule-11.0.0.tgz" - integrity sha512-g01p1g4BmYlZ2+tdotCavrMunnPFPhTzG1ZiLKTCYrooHRbmvqo42ZZn4QMStUEIcn+jfLb6BRZX3JzIwA1ezQ== + "integrity" "sha512-g01p1g4BmYlZ2+tdotCavrMunnPFPhTzG1ZiLKTCYrooHRbmvqo42ZZn4QMStUEIcn+jfLb6BRZX3JzIwA1ezQ==" + "resolved" "https://registry.npmjs.org/@commitlint/execute-rule/-/execute-rule-11.0.0.tgz" + "version" "11.0.0" "@commitlint/format@^11.0.0": - version "11.0.0" - resolved "https://registry.npmjs.org/@commitlint/format/-/format-11.0.0.tgz" - integrity sha512-bpBLWmG0wfZH/svzqD1hsGTpm79TKJWcf6EXZllh2J/LSSYKxGlv967lpw0hNojme0sZd4a/97R3qA2QHWWSLg== + "integrity" "sha512-bpBLWmG0wfZH/svzqD1hsGTpm79TKJWcf6EXZllh2J/LSSYKxGlv967lpw0hNojme0sZd4a/97R3qA2QHWWSLg==" + "resolved" "https://registry.npmjs.org/@commitlint/format/-/format-11.0.0.tgz" + "version" "11.0.0" dependencies: "@commitlint/types" "^11.0.0" - chalk "^4.0.0" + "chalk" "^4.0.0" "@commitlint/is-ignored@^11.0.0": - version "11.0.0" - resolved "https://registry.npmjs.org/@commitlint/is-ignored/-/is-ignored-11.0.0.tgz" - integrity sha512-VLHOUBN+sOlkYC4tGuzE41yNPO2w09sQnOpfS+pSPnBFkNUUHawEuA44PLHtDvQgVuYrMAmSWFQpWabMoP5/Xg== + "integrity" "sha512-VLHOUBN+sOlkYC4tGuzE41yNPO2w09sQnOpfS+pSPnBFkNUUHawEuA44PLHtDvQgVuYrMAmSWFQpWabMoP5/Xg==" + "resolved" "https://registry.npmjs.org/@commitlint/is-ignored/-/is-ignored-11.0.0.tgz" + "version" "11.0.0" dependencies: "@commitlint/types" "^11.0.0" - semver "7.3.2" + "semver" "7.3.2" "@commitlint/lint@^11.0.0": - version "11.0.0" - resolved "https://registry.npmjs.org/@commitlint/lint/-/lint-11.0.0.tgz" - integrity sha512-Q8IIqGIHfwKr8ecVZyYh6NtXFmKw4YSEWEr2GJTB/fTZXgaOGtGFZDWOesCZllQ63f1s/oWJYtVv5RAEuwN8BQ== + "integrity" "sha512-Q8IIqGIHfwKr8ecVZyYh6NtXFmKw4YSEWEr2GJTB/fTZXgaOGtGFZDWOesCZllQ63f1s/oWJYtVv5RAEuwN8BQ==" + "resolved" "https://registry.npmjs.org/@commitlint/lint/-/lint-11.0.0.tgz" + "version" "11.0.0" dependencies: "@commitlint/is-ignored" "^11.0.0" "@commitlint/parse" "^11.0.0" @@ -95,54 +95,54 @@ "@commitlint/types" "^11.0.0" "@commitlint/load@^11.0.0": - version "11.0.0" - resolved "https://registry.npmjs.org/@commitlint/load/-/load-11.0.0.tgz" - integrity sha512-t5ZBrtgvgCwPfxmG811FCp39/o3SJ7L+SNsxFL92OR4WQxPcu6c8taD0CG2lzOHGuRyuMxZ7ps3EbngT2WpiCg== + "integrity" "sha512-t5ZBrtgvgCwPfxmG811FCp39/o3SJ7L+SNsxFL92OR4WQxPcu6c8taD0CG2lzOHGuRyuMxZ7ps3EbngT2WpiCg==" + "resolved" "https://registry.npmjs.org/@commitlint/load/-/load-11.0.0.tgz" + "version" "11.0.0" dependencies: "@commitlint/execute-rule" "^11.0.0" "@commitlint/resolve-extends" "^11.0.0" "@commitlint/types" "^11.0.0" - chalk "4.1.0" - cosmiconfig "^7.0.0" - lodash "^4.17.19" - resolve-from "^5.0.0" + "chalk" "4.1.0" + "cosmiconfig" "^7.0.0" + "lodash" "^4.17.19" + "resolve-from" "^5.0.0" "@commitlint/message@^11.0.0": - version "11.0.0" - resolved "https://registry.npmjs.org/@commitlint/message/-/message-11.0.0.tgz" - integrity sha512-01ObK/18JL7PEIE3dBRtoMmU6S3ecPYDTQWWhcO+ErA3Ai0KDYqV5VWWEijdcVafNpdeUNrEMigRkxXHQLbyJA== + "integrity" "sha512-01ObK/18JL7PEIE3dBRtoMmU6S3ecPYDTQWWhcO+ErA3Ai0KDYqV5VWWEijdcVafNpdeUNrEMigRkxXHQLbyJA==" + "resolved" "https://registry.npmjs.org/@commitlint/message/-/message-11.0.0.tgz" + "version" "11.0.0" "@commitlint/parse@^11.0.0": - version "11.0.0" - resolved "https://registry.npmjs.org/@commitlint/parse/-/parse-11.0.0.tgz" - integrity sha512-DekKQAIYWAXIcyAZ6/PDBJylWJ1BROTfDIzr9PMVxZRxBPc1gW2TG8fLgjZfBP5mc0cuthPkVi91KQQKGri/7A== + "integrity" "sha512-DekKQAIYWAXIcyAZ6/PDBJylWJ1BROTfDIzr9PMVxZRxBPc1gW2TG8fLgjZfBP5mc0cuthPkVi91KQQKGri/7A==" + "resolved" "https://registry.npmjs.org/@commitlint/parse/-/parse-11.0.0.tgz" + "version" "11.0.0" dependencies: - conventional-changelog-angular "^5.0.0" - conventional-commits-parser "^3.0.0" + "conventional-changelog-angular" "^5.0.0" + "conventional-commits-parser" "^3.0.0" "@commitlint/read@^11.0.0": - version "11.0.0" - resolved "https://registry.npmjs.org/@commitlint/read/-/read-11.0.0.tgz" - integrity sha512-37V0V91GSv0aDzMzJioKpCoZw6l0shk7+tRG8RkW1GfZzUIytdg3XqJmM+IaIYpaop0m6BbZtfq+idzUwJnw7g== + "integrity" "sha512-37V0V91GSv0aDzMzJioKpCoZw6l0shk7+tRG8RkW1GfZzUIytdg3XqJmM+IaIYpaop0m6BbZtfq+idzUwJnw7g==" + "resolved" "https://registry.npmjs.org/@commitlint/read/-/read-11.0.0.tgz" + "version" "11.0.0" dependencies: "@commitlint/top-level" "^11.0.0" - fs-extra "^9.0.0" - git-raw-commits "^2.0.0" + "fs-extra" "^9.0.0" + "git-raw-commits" "^2.0.0" "@commitlint/resolve-extends@^11.0.0": - version "11.0.0" - resolved "https://registry.npmjs.org/@commitlint/resolve-extends/-/resolve-extends-11.0.0.tgz" - integrity sha512-WinU6Uv6L7HDGLqn/To13KM1CWvZ09VHZqryqxXa1OY+EvJkfU734CwnOEeNlSCK7FVLrB4kmodLJtL1dkEpXw== + "integrity" "sha512-WinU6Uv6L7HDGLqn/To13KM1CWvZ09VHZqryqxXa1OY+EvJkfU734CwnOEeNlSCK7FVLrB4kmodLJtL1dkEpXw==" + "resolved" "https://registry.npmjs.org/@commitlint/resolve-extends/-/resolve-extends-11.0.0.tgz" + "version" "11.0.0" dependencies: - import-fresh "^3.0.0" - lodash "^4.17.19" - resolve-from "^5.0.0" - resolve-global "^1.0.0" + "import-fresh" "^3.0.0" + "lodash" "^4.17.19" + "resolve-from" "^5.0.0" + "resolve-global" "^1.0.0" "@commitlint/rules@^11.0.0": - version "11.0.0" - resolved "https://registry.npmjs.org/@commitlint/rules/-/rules-11.0.0.tgz" - integrity sha512-2hD9y9Ep5ZfoNxDDPkQadd2jJeocrwC4vJ98I0g8pNYn/W8hS9+/FuNpolREHN8PhmexXbkjrwyQrWbuC0DVaA== + "integrity" "sha512-2hD9y9Ep5ZfoNxDDPkQadd2jJeocrwC4vJ98I0g8pNYn/W8hS9+/FuNpolREHN8PhmexXbkjrwyQrWbuC0DVaA==" + "resolved" "https://registry.npmjs.org/@commitlint/rules/-/rules-11.0.0.tgz" + "version" "11.0.0" dependencies: "@commitlint/ensure" "^11.0.0" "@commitlint/message" "^11.0.0" @@ -150,97 +150,95 @@ "@commitlint/types" "^11.0.0" "@commitlint/to-lines@^11.0.0": - version "11.0.0" - resolved "https://registry.npmjs.org/@commitlint/to-lines/-/to-lines-11.0.0.tgz" - integrity sha512-TIDTB0Y23jlCNubDROUVokbJk6860idYB5cZkLWcRS9tlb6YSoeLn1NLafPlrhhkkkZzTYnlKYzCVrBNVes1iw== + "integrity" "sha512-TIDTB0Y23jlCNubDROUVokbJk6860idYB5cZkLWcRS9tlb6YSoeLn1NLafPlrhhkkkZzTYnlKYzCVrBNVes1iw==" + "resolved" "https://registry.npmjs.org/@commitlint/to-lines/-/to-lines-11.0.0.tgz" + "version" "11.0.0" "@commitlint/top-level@^11.0.0": - version "11.0.0" - resolved "https://registry.npmjs.org/@commitlint/top-level/-/top-level-11.0.0.tgz" - integrity sha512-O0nFU8o+Ws+py5pfMQIuyxOtfR/kwtr5ybqTvR+C2lUPer2x6lnQU+OnfD7hPM+A+COIUZWx10mYQvkR3MmtAA== + "integrity" "sha512-O0nFU8o+Ws+py5pfMQIuyxOtfR/kwtr5ybqTvR+C2lUPer2x6lnQU+OnfD7hPM+A+COIUZWx10mYQvkR3MmtAA==" + "resolved" "https://registry.npmjs.org/@commitlint/top-level/-/top-level-11.0.0.tgz" + "version" "11.0.0" dependencies: - find-up "^5.0.0" + "find-up" "^5.0.0" "@commitlint/types@^11.0.0": - version "11.0.0" - resolved "https://registry.npmjs.org/@commitlint/types/-/types-11.0.0.tgz" - integrity sha512-VoNqai1vR5anRF5Tuh/+SWDFk7xi7oMwHrHrbm1BprYXjB2RJsWLhUrStMssDxEl5lW/z3EUdg8RvH/IUBccSQ== - -"@ethereumjs/block@^3.4.0", "@ethereumjs/block@^3.5.0", "@ethereumjs/block@^3.5.1": - version "3.5.1" - resolved "https://registry.npmjs.org/@ethereumjs/block/-/block-3.5.1.tgz" - integrity sha512-MoY9bHKABOBK6BW0v1N1Oc0Cve4x/giX67M3TtrVBUsKQTj2eznLGKpydoitxWSZ+WgKKSVhfRMzbCGRwk7T5w== - dependencies: - "@ethereumjs/common" "^2.5.0" - "@ethereumjs/tx" "^3.3.1" - ethereumjs-util "^7.1.1" - merkle-patricia-tree "^4.2.1" - -"@ethereumjs/blockchain@^5.4.0", "@ethereumjs/blockchain@^5.4.1": - version "5.4.2" - resolved "https://registry.npmjs.org/@ethereumjs/blockchain/-/blockchain-5.4.2.tgz" - integrity sha512-AOAAwz/lw2lciG9gf5wHi7M/qknraXXnLR66lYgbQ04qfyFC3ZE5x/5rLVm1Vu+kfJLlKrYZTmA0IbOkc7kvgw== - dependencies: - "@ethereumjs/block" "^3.5.1" - "@ethereumjs/common" "^2.5.0" + "integrity" "sha512-VoNqai1vR5anRF5Tuh/+SWDFk7xi7oMwHrHrbm1BprYXjB2RJsWLhUrStMssDxEl5lW/z3EUdg8RvH/IUBccSQ==" + "resolved" "https://registry.npmjs.org/@commitlint/types/-/types-11.0.0.tgz" + "version" "11.0.0" + +"@ethereumjs/block@^3.5.0", "@ethereumjs/block@^3.6.0", "@ethereumjs/block@^3.6.2": + "integrity" "sha512-mOqYWwMlAZpYUEOEqt7EfMFuVL2eyLqWWIzcf4odn6QgXY8jBI2NhVuJncrMCKeMZrsJAe7/auaRRB6YcdH+Qw==" + "resolved" "https://registry.npmjs.org/@ethereumjs/block/-/block-3.6.2.tgz" + "version" "3.6.2" + dependencies: + "@ethereumjs/common" "^2.6.3" + "@ethereumjs/tx" "^3.5.1" + "ethereumjs-util" "^7.1.4" + "merkle-patricia-tree" "^4.2.4" + +"@ethereumjs/blockchain@^5.5.0", "@ethereumjs/blockchain@^5.5.2": + "integrity" "sha512-Jz26iJmmsQtngerW6r5BDFaew/f2mObLrRZo3rskLOx1lmtMZ8+TX/vJexmivrnWgmAsTdNWhlKUYY4thPhPig==" + "resolved" "https://registry.npmjs.org/@ethereumjs/blockchain/-/blockchain-5.5.2.tgz" + "version" "5.5.2" + dependencies: + "@ethereumjs/block" "^3.6.2" + "@ethereumjs/common" "^2.6.3" "@ethereumjs/ethash" "^1.1.0" - debug "^2.2.0" - ethereumjs-util "^7.1.1" - level-mem "^5.0.1" - lru-cache "^5.1.1" - rlp "^2.2.4" - semaphore-async-await "^1.5.1" + "debug" "^4.3.3" + "ethereumjs-util" "^7.1.4" + "level-mem" "^5.0.1" + "lru-cache" "^5.1.1" + "semaphore-async-await" "^1.5.1" -"@ethereumjs/common@^2.4.0", "@ethereumjs/common@^2.5.0": - version "2.5.0" - resolved "https://registry.npmjs.org/@ethereumjs/common/-/common-2.5.0.tgz" - integrity sha512-DEHjW6e38o+JmB/NO3GZBpW4lpaiBpkFgXF6jLcJ6gETBYpEyaA5nTimsWBUJR3Vmtm/didUEbNjajskugZORg== +"@ethereumjs/common@^2.6.0", "@ethereumjs/common@^2.6.3", "@ethereumjs/common@^2.6.4": + "integrity" "sha512-RDJh/R/EAr+B7ZRg5LfJ0BIpf/1LydFgYdvZEuTraojCbVypO2sQ+QnpP5u2wJf9DASyooKqu8O4FJEWUV6NXw==" + "resolved" "https://registry.npmjs.org/@ethereumjs/common/-/common-2.6.4.tgz" + "version" "2.6.4" dependencies: - crc-32 "^1.2.0" - ethereumjs-util "^7.1.1" + "crc-32" "^1.2.0" + "ethereumjs-util" "^7.1.4" "@ethereumjs/ethash@^1.1.0": - version "1.1.0" - resolved "https://registry.npmjs.org/@ethereumjs/ethash/-/ethash-1.1.0.tgz" - integrity sha512-/U7UOKW6BzpA+Vt+kISAoeDie1vAvY4Zy2KF5JJb+So7+1yKmJeJEHOGSnQIj330e9Zyl3L5Nae6VZyh2TJnAA== + "integrity" "sha512-/U7UOKW6BzpA+Vt+kISAoeDie1vAvY4Zy2KF5JJb+So7+1yKmJeJEHOGSnQIj330e9Zyl3L5Nae6VZyh2TJnAA==" + "resolved" "https://registry.npmjs.org/@ethereumjs/ethash/-/ethash-1.1.0.tgz" + "version" "1.1.0" dependencies: "@ethereumjs/block" "^3.5.0" "@types/levelup" "^4.3.0" - buffer-xor "^2.0.1" - ethereumjs-util "^7.1.1" - miller-rabin "^4.0.0" - -"@ethereumjs/tx@^3.3.0", "@ethereumjs/tx@^3.3.1": - version "3.3.2" - resolved "https://registry.npmjs.org/@ethereumjs/tx/-/tx-3.3.2.tgz" - integrity sha512-6AaJhwg4ucmwTvw/1qLaZUX5miWrwZ4nLOUsKyb/HtzS3BMw/CasKhdi1ims9mBKeK9sOJCH4qGKOBGyJCeeog== - dependencies: - "@ethereumjs/common" "^2.5.0" - ethereumjs-util "^7.1.2" - -"@ethereumjs/vm@^5.5.2": - version "5.5.3" - resolved "https://registry.npmjs.org/@ethereumjs/vm/-/vm-5.5.3.tgz" - integrity sha512-0k5OreWnlgXYs54wohgO11jtGI05GDasj2EYxzuaStxTi15CS3vow5wGYELC1pG9xngE1F/mFmKi/f14XRuDow== - dependencies: - "@ethereumjs/block" "^3.5.0" - "@ethereumjs/blockchain" "^5.4.1" - "@ethereumjs/common" "^2.5.0" - "@ethereumjs/tx" "^3.3.1" - async-eventemitter "^0.2.4" - core-js-pure "^3.0.1" - debug "^2.2.0" - ethereumjs-util "^7.1.1" - functional-red-black-tree "^1.0.1" - mcl-wasm "^0.7.1" - merkle-patricia-tree "^4.2.1" - rustbn.js "~0.2.0" - util.promisify "^1.0.1" + "buffer-xor" "^2.0.1" + "ethereumjs-util" "^7.1.1" + "miller-rabin" "^4.0.0" + +"@ethereumjs/tx@^3.4.0", "@ethereumjs/tx@^3.5.1": + "integrity" "sha512-xzDrTiu4sqZXUcaBxJ4n4W5FrppwxLxZB4ZDGVLtxSQR4lVuOnFR6RcUHdg1mpUhAPVrmnzLJpxaeXnPxIyhWA==" + "resolved" "https://registry.npmjs.org/@ethereumjs/tx/-/tx-3.5.1.tgz" + "version" "3.5.1" + dependencies: + "@ethereumjs/common" "^2.6.3" + "ethereumjs-util" "^7.1.4" + +"@ethereumjs/vm@^5.6.0": + "integrity" "sha512-0IRsj4IuF8lFDWVVLc4mFOImaSX8VWF8CGm3mXHG/LLlQ/Tryy/kKXMw/bU9D+Zw03CdteW+wCGqNFS6+mPjpg==" + "resolved" "https://registry.npmjs.org/@ethereumjs/vm/-/vm-5.9.0.tgz" + "version" "5.9.0" + dependencies: + "@ethereumjs/block" "^3.6.2" + "@ethereumjs/blockchain" "^5.5.2" + "@ethereumjs/common" "^2.6.4" + "@ethereumjs/tx" "^3.5.1" + "async-eventemitter" "^0.2.4" + "core-js-pure" "^3.0.1" + "debug" "^4.3.3" + "ethereumjs-util" "^7.1.4" + "functional-red-black-tree" "^1.0.1" + "mcl-wasm" "^0.7.1" + "merkle-patricia-tree" "^4.2.4" + "rustbn.js" "~0.2.0" "@ethersproject/abi@^5.1.2": - version "5.5.0" - resolved "https://registry.npmjs.org/@ethersproject/abi/-/abi-5.5.0.tgz" - integrity sha512-loW7I4AohP5KycATvc0MgujU6JyCHPqHdeoo9z3Nr9xEiNioxa65ccdm1+fsoJhkuhdRtfcL8cfyGamz2AxZ5w== + "integrity" "sha512-loW7I4AohP5KycATvc0MgujU6JyCHPqHdeoo9z3Nr9xEiNioxa65ccdm1+fsoJhkuhdRtfcL8cfyGamz2AxZ5w==" + "resolved" "https://registry.npmjs.org/@ethersproject/abi/-/abi-5.5.0.tgz" + "version" "5.5.0" dependencies: "@ethersproject/address" "^5.5.0" "@ethersproject/bignumber" "^5.5.0" @@ -253,9 +251,9 @@ "@ethersproject/strings" "^5.5.0" "@ethersproject/abstract-provider@^5.5.0": - version "5.5.1" - resolved "https://registry.npmjs.org/@ethersproject/abstract-provider/-/abstract-provider-5.5.1.tgz" - integrity sha512-m+MA/ful6eKbxpr99xUYeRvLkfnlqzrF8SZ46d/xFB1A7ZVknYc/sXJG0RcufF52Qn2jeFj1hhcoQ7IXjNKUqg== + "integrity" "sha512-m+MA/ful6eKbxpr99xUYeRvLkfnlqzrF8SZ46d/xFB1A7ZVknYc/sXJG0RcufF52Qn2jeFj1hhcoQ7IXjNKUqg==" + "resolved" "https://registry.npmjs.org/@ethersproject/abstract-provider/-/abstract-provider-5.5.1.tgz" + "version" "5.5.1" dependencies: "@ethersproject/bignumber" "^5.5.0" "@ethersproject/bytes" "^5.5.0" @@ -266,9 +264,9 @@ "@ethersproject/web" "^5.5.0" "@ethersproject/abstract-signer@^5.5.0": - version "5.5.0" - resolved "https://registry.npmjs.org/@ethersproject/abstract-signer/-/abstract-signer-5.5.0.tgz" - integrity sha512-lj//7r250MXVLKI7sVarXAbZXbv9P50lgmJQGr2/is82EwEb8r7HrxsmMqAjTsztMYy7ohrIhGMIml+Gx4D3mA== + "integrity" "sha512-lj//7r250MXVLKI7sVarXAbZXbv9P50lgmJQGr2/is82EwEb8r7HrxsmMqAjTsztMYy7ohrIhGMIml+Gx4D3mA==" + "resolved" "https://registry.npmjs.org/@ethersproject/abstract-signer/-/abstract-signer-5.5.0.tgz" + "version" "5.5.0" dependencies: "@ethersproject/abstract-provider" "^5.5.0" "@ethersproject/bignumber" "^5.5.0" @@ -277,9 +275,9 @@ "@ethersproject/properties" "^5.5.0" "@ethersproject/address@^5.5.0": - version "5.5.0" - resolved "https://registry.npmjs.org/@ethersproject/address/-/address-5.5.0.tgz" - integrity sha512-l4Nj0eWlTUh6ro5IbPTgbpT4wRbdH5l8CQf7icF7sb/SI3Nhd9Y9HzhonTSTi6CefI0necIw7LJqQPopPLZyWw== + "integrity" "sha512-l4Nj0eWlTUh6ro5IbPTgbpT4wRbdH5l8CQf7icF7sb/SI3Nhd9Y9HzhonTSTi6CefI0necIw7LJqQPopPLZyWw==" + "resolved" "https://registry.npmjs.org/@ethersproject/address/-/address-5.5.0.tgz" + "version" "5.5.0" dependencies: "@ethersproject/bignumber" "^5.5.0" "@ethersproject/bytes" "^5.5.0" @@ -288,39 +286,39 @@ "@ethersproject/rlp" "^5.5.0" "@ethersproject/base64@^5.5.0": - version "5.5.0" - resolved "https://registry.npmjs.org/@ethersproject/base64/-/base64-5.5.0.tgz" - integrity sha512-tdayUKhU1ljrlHzEWbStXazDpsx4eg1dBXUSI6+mHlYklOXoXF6lZvw8tnD6oVaWfnMxAgRSKROg3cVKtCcppA== + "integrity" "sha512-tdayUKhU1ljrlHzEWbStXazDpsx4eg1dBXUSI6+mHlYklOXoXF6lZvw8tnD6oVaWfnMxAgRSKROg3cVKtCcppA==" + "resolved" "https://registry.npmjs.org/@ethersproject/base64/-/base64-5.5.0.tgz" + "version" "5.5.0" dependencies: "@ethersproject/bytes" "^5.5.0" "@ethersproject/bignumber@^5.5.0": - version "5.5.0" - resolved "https://registry.npmjs.org/@ethersproject/bignumber/-/bignumber-5.5.0.tgz" - integrity sha512-6Xytlwvy6Rn3U3gKEc1vP7nR92frHkv6wtVr95LFR3jREXiCPzdWxKQ1cx4JGQBXxcguAwjA8murlYN2TSiEbg== + "integrity" "sha512-6Xytlwvy6Rn3U3gKEc1vP7nR92frHkv6wtVr95LFR3jREXiCPzdWxKQ1cx4JGQBXxcguAwjA8murlYN2TSiEbg==" + "resolved" "https://registry.npmjs.org/@ethersproject/bignumber/-/bignumber-5.5.0.tgz" + "version" "5.5.0" dependencies: "@ethersproject/bytes" "^5.5.0" "@ethersproject/logger" "^5.5.0" - bn.js "^4.11.9" + "bn.js" "^4.11.9" "@ethersproject/bytes@^5.5.0": - version "5.5.0" - resolved "https://registry.npmjs.org/@ethersproject/bytes/-/bytes-5.5.0.tgz" - integrity sha512-ABvc7BHWhZU9PNM/tANm/Qx4ostPGadAuQzWTr3doklZOhDlmcBqclrQe/ZXUIj3K8wC28oYeuRa+A37tX9kog== + "integrity" "sha512-ABvc7BHWhZU9PNM/tANm/Qx4ostPGadAuQzWTr3doklZOhDlmcBqclrQe/ZXUIj3K8wC28oYeuRa+A37tX9kog==" + "resolved" "https://registry.npmjs.org/@ethersproject/bytes/-/bytes-5.5.0.tgz" + "version" "5.5.0" dependencies: "@ethersproject/logger" "^5.5.0" "@ethersproject/constants@^5.5.0": - version "5.5.0" - resolved "https://registry.npmjs.org/@ethersproject/constants/-/constants-5.5.0.tgz" - integrity sha512-2MsRRVChkvMWR+GyMGY4N1sAX9Mt3J9KykCsgUFd/1mwS0UH1qw+Bv9k1UJb3X3YJYFco9H20pjSlOIfCG5HYQ== + "integrity" "sha512-2MsRRVChkvMWR+GyMGY4N1sAX9Mt3J9KykCsgUFd/1mwS0UH1qw+Bv9k1UJb3X3YJYFco9H20pjSlOIfCG5HYQ==" + "resolved" "https://registry.npmjs.org/@ethersproject/constants/-/constants-5.5.0.tgz" + "version" "5.5.0" dependencies: "@ethersproject/bignumber" "^5.5.0" "@ethersproject/hash@^5.5.0": - version "5.5.0" - resolved "https://registry.npmjs.org/@ethersproject/hash/-/hash-5.5.0.tgz" - integrity sha512-dnGVpK1WtBjmnp3mUT0PlU2MpapnwWI0PibldQEq1408tQBAbZpPidkWoVVuNMOl/lISO3+4hXZWCL3YV7qzfg== + "integrity" "sha512-dnGVpK1WtBjmnp3mUT0PlU2MpapnwWI0PibldQEq1408tQBAbZpPidkWoVVuNMOl/lISO3+4hXZWCL3YV7qzfg==" + "resolved" "https://registry.npmjs.org/@ethersproject/hash/-/hash-5.5.0.tgz" + "version" "5.5.0" dependencies: "@ethersproject/abstract-signer" "^5.5.0" "@ethersproject/address" "^5.5.0" @@ -332,65 +330,65 @@ "@ethersproject/strings" "^5.5.0" "@ethersproject/keccak256@^5.5.0": - version "5.5.0" - resolved "https://registry.npmjs.org/@ethersproject/keccak256/-/keccak256-5.5.0.tgz" - integrity sha512-5VoFCTjo2rYbBe1l2f4mccaRFN/4VQEYFwwn04aJV2h7qf4ZvI2wFxUE1XOX+snbwCLRzIeikOqtAoPwMza9kg== + "integrity" "sha512-5VoFCTjo2rYbBe1l2f4mccaRFN/4VQEYFwwn04aJV2h7qf4ZvI2wFxUE1XOX+snbwCLRzIeikOqtAoPwMza9kg==" + "resolved" "https://registry.npmjs.org/@ethersproject/keccak256/-/keccak256-5.5.0.tgz" + "version" "5.5.0" dependencies: "@ethersproject/bytes" "^5.5.0" - js-sha3 "0.8.0" + "js-sha3" "0.8.0" "@ethersproject/logger@^5.5.0": - version "5.5.0" - resolved "https://registry.npmjs.org/@ethersproject/logger/-/logger-5.5.0.tgz" - integrity sha512-rIY/6WPm7T8n3qS2vuHTUBPdXHl+rGxWxW5okDfo9J4Z0+gRRZT0msvUdIJkE4/HS29GUMziwGaaKO2bWONBrg== + "integrity" "sha512-rIY/6WPm7T8n3qS2vuHTUBPdXHl+rGxWxW5okDfo9J4Z0+gRRZT0msvUdIJkE4/HS29GUMziwGaaKO2bWONBrg==" + "resolved" "https://registry.npmjs.org/@ethersproject/logger/-/logger-5.5.0.tgz" + "version" "5.5.0" "@ethersproject/networks@^5.5.0": - version "5.5.0" - resolved "https://registry.npmjs.org/@ethersproject/networks/-/networks-5.5.0.tgz" - integrity sha512-KWfP3xOnJeF89Uf/FCJdV1a2aDJe5XTN2N52p4fcQ34QhDqQFkgQKZ39VGtiqUgHcLI8DfT0l9azC3KFTunqtA== + "integrity" "sha512-KWfP3xOnJeF89Uf/FCJdV1a2aDJe5XTN2N52p4fcQ34QhDqQFkgQKZ39VGtiqUgHcLI8DfT0l9azC3KFTunqtA==" + "resolved" "https://registry.npmjs.org/@ethersproject/networks/-/networks-5.5.0.tgz" + "version" "5.5.0" dependencies: "@ethersproject/logger" "^5.5.0" "@ethersproject/properties@^5.5.0": - version "5.5.0" - resolved "https://registry.npmjs.org/@ethersproject/properties/-/properties-5.5.0.tgz" - integrity sha512-l3zRQg3JkD8EL3CPjNK5g7kMx4qSwiR60/uk5IVjd3oq1MZR5qUg40CNOoEJoX5wc3DyY5bt9EbMk86C7x0DNA== + "integrity" "sha512-l3zRQg3JkD8EL3CPjNK5g7kMx4qSwiR60/uk5IVjd3oq1MZR5qUg40CNOoEJoX5wc3DyY5bt9EbMk86C7x0DNA==" + "resolved" "https://registry.npmjs.org/@ethersproject/properties/-/properties-5.5.0.tgz" + "version" "5.5.0" dependencies: "@ethersproject/logger" "^5.5.0" "@ethersproject/rlp@^5.5.0": - version "5.5.0" - resolved "https://registry.npmjs.org/@ethersproject/rlp/-/rlp-5.5.0.tgz" - integrity sha512-hLv8XaQ8PTI9g2RHoQGf/WSxBfTB/NudRacbzdxmst5VHAqd1sMibWG7SENzT5Dj3yZ3kJYx+WiRYEcQTAkcYA== + "integrity" "sha512-hLv8XaQ8PTI9g2RHoQGf/WSxBfTB/NudRacbzdxmst5VHAqd1sMibWG7SENzT5Dj3yZ3kJYx+WiRYEcQTAkcYA==" + "resolved" "https://registry.npmjs.org/@ethersproject/rlp/-/rlp-5.5.0.tgz" + "version" "5.5.0" dependencies: "@ethersproject/bytes" "^5.5.0" "@ethersproject/logger" "^5.5.0" "@ethersproject/signing-key@^5.5.0": - version "5.5.0" - resolved "https://registry.npmjs.org/@ethersproject/signing-key/-/signing-key-5.5.0.tgz" - integrity sha512-5VmseH7qjtNmDdZBswavhotYbWB0bOwKIlOTSlX14rKn5c11QmJwGt4GHeo7NrL/Ycl7uo9AHvEqs5xZgFBTng== + "integrity" "sha512-5VmseH7qjtNmDdZBswavhotYbWB0bOwKIlOTSlX14rKn5c11QmJwGt4GHeo7NrL/Ycl7uo9AHvEqs5xZgFBTng==" + "resolved" "https://registry.npmjs.org/@ethersproject/signing-key/-/signing-key-5.5.0.tgz" + "version" "5.5.0" dependencies: "@ethersproject/bytes" "^5.5.0" "@ethersproject/logger" "^5.5.0" "@ethersproject/properties" "^5.5.0" - bn.js "^4.11.9" - elliptic "6.5.4" - hash.js "1.1.7" + "bn.js" "^4.11.9" + "elliptic" "6.5.4" + "hash.js" "1.1.7" "@ethersproject/strings@^5.5.0": - version "5.5.0" - resolved "https://registry.npmjs.org/@ethersproject/strings/-/strings-5.5.0.tgz" - integrity sha512-9fy3TtF5LrX/wTrBaT8FGE6TDJyVjOvXynXJz5MT5azq+E6D92zuKNx7i29sWW2FjVOaWjAsiZ1ZWznuduTIIQ== + "integrity" "sha512-9fy3TtF5LrX/wTrBaT8FGE6TDJyVjOvXynXJz5MT5azq+E6D92zuKNx7i29sWW2FjVOaWjAsiZ1ZWznuduTIIQ==" + "resolved" "https://registry.npmjs.org/@ethersproject/strings/-/strings-5.5.0.tgz" + "version" "5.5.0" dependencies: "@ethersproject/bytes" "^5.5.0" "@ethersproject/constants" "^5.5.0" "@ethersproject/logger" "^5.5.0" "@ethersproject/transactions@^5.5.0": - version "5.5.0" - resolved "https://registry.npmjs.org/@ethersproject/transactions/-/transactions-5.5.0.tgz" - integrity sha512-9RZYSKX26KfzEd/1eqvv8pLauCKzDTub0Ko4LfIgaERvRuwyaNV78mJs7cpIgZaDl6RJui4o49lHwwCM0526zA== + "integrity" "sha512-9RZYSKX26KfzEd/1eqvv8pLauCKzDTub0Ko4LfIgaERvRuwyaNV78mJs7cpIgZaDl6RJui4o49lHwwCM0526zA==" + "resolved" "https://registry.npmjs.org/@ethersproject/transactions/-/transactions-5.5.0.tgz" + "version" "5.5.0" dependencies: "@ethersproject/address" "^5.5.0" "@ethersproject/bignumber" "^5.5.0" @@ -403,9 +401,9 @@ "@ethersproject/signing-key" "^5.5.0" "@ethersproject/web@^5.5.0": - version "5.5.0" - resolved "https://registry.npmjs.org/@ethersproject/web/-/web-5.5.0.tgz" - integrity sha512-BEgY0eL5oH4mAo37TNYVrFeHsIXLRxggCRG/ksRIxI2X5uj5IsjGmcNiRN/VirQOlBxcUhCgHhaDLG4m6XAVoA== + "integrity" "sha512-BEgY0eL5oH4mAo37TNYVrFeHsIXLRxggCRG/ksRIxI2X5uj5IsjGmcNiRN/VirQOlBxcUhCgHhaDLG4m6XAVoA==" + "resolved" "https://registry.npmjs.org/@ethersproject/web/-/web-5.5.0.tgz" + "version" "5.5.0" dependencies: "@ethersproject/base64" "^5.5.0" "@ethersproject/bytes" "^5.5.0" @@ -413,4493 +411,4255 @@ "@ethersproject/properties" "^5.5.0" "@ethersproject/strings" "^5.5.0" +"@metamask/eth-sig-util@^4.0.0": + "integrity" "sha512-tghyZKLHZjcdlDqCA3gNZmLeR0XvOE9U1qoQO9ohyAZT6Pya+H9vkBPcsyXytmYLNgVoin7CKCmweo/R43V+tQ==" + "resolved" "https://registry.npmjs.org/@metamask/eth-sig-util/-/eth-sig-util-4.0.1.tgz" + "version" "4.0.1" + dependencies: + "ethereumjs-abi" "^0.6.8" + "ethereumjs-util" "^6.2.1" + "ethjs-util" "^0.1.6" + "tweetnacl" "^1.0.3" + "tweetnacl-util" "^0.15.1" + "@sentry/core@5.30.0": - version "5.30.0" - resolved "https://registry.npmjs.org/@sentry/core/-/core-5.30.0.tgz" - integrity sha512-TmfrII8w1PQZSZgPpUESqjB+jC6MvZJZdLtE/0hZ+SrnKhW3x5WlYLvTXZpcWePYBku7rl2wn1RZu6uT0qCTeg== + "integrity" "sha512-TmfrII8w1PQZSZgPpUESqjB+jC6MvZJZdLtE/0hZ+SrnKhW3x5WlYLvTXZpcWePYBku7rl2wn1RZu6uT0qCTeg==" + "resolved" "https://registry.npmjs.org/@sentry/core/-/core-5.30.0.tgz" + "version" "5.30.0" dependencies: "@sentry/hub" "5.30.0" "@sentry/minimal" "5.30.0" "@sentry/types" "5.30.0" "@sentry/utils" "5.30.0" - tslib "^1.9.3" + "tslib" "^1.9.3" "@sentry/hub@5.30.0": - version "5.30.0" - resolved "https://registry.npmjs.org/@sentry/hub/-/hub-5.30.0.tgz" - integrity sha512-2tYrGnzb1gKz2EkMDQcfLrDTvmGcQPuWxLnJKXJvYTQDGLlEvi2tWz1VIHjunmOvJrB5aIQLhm+dcMRwFZDCqQ== + "integrity" "sha512-2tYrGnzb1gKz2EkMDQcfLrDTvmGcQPuWxLnJKXJvYTQDGLlEvi2tWz1VIHjunmOvJrB5aIQLhm+dcMRwFZDCqQ==" + "resolved" "https://registry.npmjs.org/@sentry/hub/-/hub-5.30.0.tgz" + "version" "5.30.0" dependencies: "@sentry/types" "5.30.0" "@sentry/utils" "5.30.0" - tslib "^1.9.3" + "tslib" "^1.9.3" "@sentry/minimal@5.30.0": - version "5.30.0" - resolved "https://registry.npmjs.org/@sentry/minimal/-/minimal-5.30.0.tgz" - integrity sha512-BwWb/owZKtkDX+Sc4zCSTNcvZUq7YcH3uAVlmh/gtR9rmUvbzAA3ewLuB3myi4wWRAMEtny6+J/FN/x+2wn9Xw== + "integrity" "sha512-BwWb/owZKtkDX+Sc4zCSTNcvZUq7YcH3uAVlmh/gtR9rmUvbzAA3ewLuB3myi4wWRAMEtny6+J/FN/x+2wn9Xw==" + "resolved" "https://registry.npmjs.org/@sentry/minimal/-/minimal-5.30.0.tgz" + "version" "5.30.0" dependencies: "@sentry/hub" "5.30.0" "@sentry/types" "5.30.0" - tslib "^1.9.3" + "tslib" "^1.9.3" "@sentry/node@^5.18.1": - version "5.30.0" - resolved "https://registry.npmjs.org/@sentry/node/-/node-5.30.0.tgz" - integrity sha512-Br5oyVBF0fZo6ZS9bxbJZG4ApAjRqAnqFFurMVJJdunNb80brh7a5Qva2kjhm+U6r9NJAB5OmDyPkA1Qnt+QVg== + "integrity" "sha512-Br5oyVBF0fZo6ZS9bxbJZG4ApAjRqAnqFFurMVJJdunNb80brh7a5Qva2kjhm+U6r9NJAB5OmDyPkA1Qnt+QVg==" + "resolved" "https://registry.npmjs.org/@sentry/node/-/node-5.30.0.tgz" + "version" "5.30.0" dependencies: "@sentry/core" "5.30.0" "@sentry/hub" "5.30.0" "@sentry/tracing" "5.30.0" "@sentry/types" "5.30.0" "@sentry/utils" "5.30.0" - cookie "^0.4.1" - https-proxy-agent "^5.0.0" - lru_map "^0.3.3" - tslib "^1.9.3" + "cookie" "^0.4.1" + "https-proxy-agent" "^5.0.0" + "lru_map" "^0.3.3" + "tslib" "^1.9.3" "@sentry/tracing@5.30.0": - version "5.30.0" - resolved "https://registry.npmjs.org/@sentry/tracing/-/tracing-5.30.0.tgz" - integrity sha512-dUFowCr0AIMwiLD7Fs314Mdzcug+gBVo/+NCMyDw8tFxJkwWAKl7Qa2OZxLQ0ZHjakcj1hNKfCQJ9rhyfOl4Aw== + "integrity" "sha512-dUFowCr0AIMwiLD7Fs314Mdzcug+gBVo/+NCMyDw8tFxJkwWAKl7Qa2OZxLQ0ZHjakcj1hNKfCQJ9rhyfOl4Aw==" + "resolved" "https://registry.npmjs.org/@sentry/tracing/-/tracing-5.30.0.tgz" + "version" "5.30.0" dependencies: "@sentry/hub" "5.30.0" "@sentry/minimal" "5.30.0" "@sentry/types" "5.30.0" "@sentry/utils" "5.30.0" - tslib "^1.9.3" + "tslib" "^1.9.3" "@sentry/types@5.30.0": - version "5.30.0" - resolved "https://registry.npmjs.org/@sentry/types/-/types-5.30.0.tgz" - integrity sha512-R8xOqlSTZ+htqrfteCWU5Nk0CDN5ApUTvrlvBuiH1DyP6czDZ4ktbZB0hAgBlVcK0U+qpD3ag3Tqqpa5Q67rPw== + "integrity" "sha512-R8xOqlSTZ+htqrfteCWU5Nk0CDN5ApUTvrlvBuiH1DyP6czDZ4ktbZB0hAgBlVcK0U+qpD3ag3Tqqpa5Q67rPw==" + "resolved" "https://registry.npmjs.org/@sentry/types/-/types-5.30.0.tgz" + "version" "5.30.0" "@sentry/utils@5.30.0": - version "5.30.0" - resolved "https://registry.npmjs.org/@sentry/utils/-/utils-5.30.0.tgz" - integrity sha512-zaYmoH0NWWtvnJjC9/CBseXMtKHm/tm40sz3YfJRxeQjyzRqNQPgivpd9R/oDJCYj999mzdW382p/qi2ypjLww== + "integrity" "sha512-zaYmoH0NWWtvnJjC9/CBseXMtKHm/tm40sz3YfJRxeQjyzRqNQPgivpd9R/oDJCYj999mzdW382p/qi2ypjLww==" + "resolved" "https://registry.npmjs.org/@sentry/utils/-/utils-5.30.0.tgz" + "version" "5.30.0" dependencies: "@sentry/types" "5.30.0" - tslib "^1.9.3" - -"@solidity-parser/parser@^0.11.0": - version "0.11.1" - resolved "https://registry.npmjs.org/@solidity-parser/parser/-/parser-0.11.1.tgz" - integrity sha512-H8BSBoKE8EubJa0ONqecA2TviT3TnHeC4NpgnAHSUiuhZoQBfPB4L2P9bs8R6AoTW10Endvh3vc+fomVMIDIYQ== + "tslib" "^1.9.3" -"@solidity-parser/parser@^0.14.0": - version "0.14.0" - resolved "https://registry.npmjs.org/@solidity-parser/parser/-/parser-0.14.0.tgz" - integrity sha512-cX0JJRcmPtNUJpzD2K7FdA7qQsTOk1UZnFx2k7qAg9ZRvuaH5NBe5IEdBMXGlmf2+FmjhqbygJ26H8l2SV7aKQ== +"@solidity-parser/parser@^0.14.0", "@solidity-parser/parser@^0.14.1": + "integrity" "sha512-eLjj2L6AuQjBB6s/ibwCAc0DwrR5Ge+ys+wgWo+bviU7fV2nTMQhU63CGaDKXg9iTmMxwhkyoggdIR7ZGRfMgw==" + "resolved" "https://registry.npmjs.org/@solidity-parser/parser/-/parser-0.14.1.tgz" + "version" "0.14.1" dependencies: - antlr4ts "^0.5.0-alpha.4" + "antlr4ts" "^0.5.0-alpha.4" "@types/abstract-leveldown@*": - version "5.0.2" - resolved "https://registry.npmjs.org/@types/abstract-leveldown/-/abstract-leveldown-5.0.2.tgz" - integrity sha512-+jA1XXF3jsz+Z7FcuiNqgK53hTa/luglT2TyTpKPqoYbxVY+mCPF22Rm+q3KPBrMHJwNXFrTViHszBOfU4vftQ== + "integrity" "sha512-q5veSX6zjUy/DlDhR4Y4cU0k2Ar+DT2LUraP00T19WLmTO6Se1djepCCaqU6nQrwcJ5Hyo/CWqxTzrrFg8eqbQ==" + "resolved" "https://registry.npmjs.org/@types/abstract-leveldown/-/abstract-leveldown-7.2.0.tgz" + "version" "7.2.0" "@types/bn.js@^4.11.3": - version "4.11.6" - resolved "https://registry.npmjs.org/@types/bn.js/-/bn.js-4.11.6.tgz" - integrity sha512-pqr857jrp2kPuO9uRjZ3PwnJTjoQy+fcdxvBTvHm6dkmEL9q+hDD/2j/0ELOBPtPnS8LjCX0gI9nbl8lVkadpg== + "integrity" "sha512-pqr857jrp2kPuO9uRjZ3PwnJTjoQy+fcdxvBTvHm6dkmEL9q+hDD/2j/0ELOBPtPnS8LjCX0gI9nbl8lVkadpg==" + "resolved" "https://registry.npmjs.org/@types/bn.js/-/bn.js-4.11.6.tgz" + "version" "4.11.6" dependencies: "@types/node" "*" "@types/bn.js@^5.1.0": - version "5.1.0" - resolved "https://registry.npmjs.org/@types/bn.js/-/bn.js-5.1.0.tgz" - integrity sha512-QSSVYj7pYFN49kW77o2s9xTCwZ8F2xLbjLLSEVh8D2F4JUhZtPAGOFLTD+ffqksBx/u4cE/KImFjyhqCjn/LIA== + "integrity" "sha512-QSSVYj7pYFN49kW77o2s9xTCwZ8F2xLbjLLSEVh8D2F4JUhZtPAGOFLTD+ffqksBx/u4cE/KImFjyhqCjn/LIA==" + "resolved" "https://registry.npmjs.org/@types/bn.js/-/bn.js-5.1.0.tgz" + "version" "5.1.0" dependencies: "@types/node" "*" "@types/level-errors@*": - version "3.0.0" - resolved "https://registry.npmjs.org/@types/level-errors/-/level-errors-3.0.0.tgz" - integrity sha512-/lMtoq/Cf/2DVOm6zE6ORyOM+3ZVm/BvzEZVxUhf6bgh8ZHglXlBqxbxSlJeVp8FCbD3IVvk/VbsaNmDjrQvqQ== + "integrity" "sha512-/lMtoq/Cf/2DVOm6zE6ORyOM+3ZVm/BvzEZVxUhf6bgh8ZHglXlBqxbxSlJeVp8FCbD3IVvk/VbsaNmDjrQvqQ==" + "resolved" "https://registry.npmjs.org/@types/level-errors/-/level-errors-3.0.0.tgz" + "version" "3.0.0" "@types/levelup@^4.3.0": - version "4.3.3" - resolved "https://registry.npmjs.org/@types/levelup/-/levelup-4.3.3.tgz" - integrity sha512-K+OTIjJcZHVlZQN1HmU64VtrC0jC3dXWQozuEIR9zVvltIk90zaGPM2AgT+fIkChpzHhFE3YnvFLCbLtzAmexA== + "integrity" "sha512-K+OTIjJcZHVlZQN1HmU64VtrC0jC3dXWQozuEIR9zVvltIk90zaGPM2AgT+fIkChpzHhFE3YnvFLCbLtzAmexA==" + "resolved" "https://registry.npmjs.org/@types/levelup/-/levelup-4.3.3.tgz" + "version" "4.3.3" dependencies: "@types/abstract-leveldown" "*" "@types/level-errors" "*" "@types/node" "*" "@types/lru-cache@^5.1.0": - version "5.1.1" - resolved "https://registry.npmjs.org/@types/lru-cache/-/lru-cache-5.1.1.tgz" - integrity sha512-ssE3Vlrys7sdIzs5LOxCzTVMsU7i9oa/IaW92wF32JFb3CVczqOkru2xspuKczHEbG3nvmPY7IFqVmGGHdNbYw== + "integrity" "sha512-ssE3Vlrys7sdIzs5LOxCzTVMsU7i9oa/IaW92wF32JFb3CVczqOkru2xspuKczHEbG3nvmPY7IFqVmGGHdNbYw==" + "resolved" "https://registry.npmjs.org/@types/lru-cache/-/lru-cache-5.1.1.tgz" + "version" "5.1.1" "@types/minimatch@^3.0.3": - version "3.0.3" - resolved "https://registry.npmjs.org/@types/minimatch/-/minimatch-3.0.3.tgz" - integrity sha512-tHq6qdbT9U1IRSGf14CL0pUlULksvY9OZ+5eEgl1N7t+OA3tGvNpxJCzuKQlsNgCVwbAs670L1vcVQi8j9HjnA== + "integrity" "sha512-tHq6qdbT9U1IRSGf14CL0pUlULksvY9OZ+5eEgl1N7t+OA3tGvNpxJCzuKQlsNgCVwbAs670L1vcVQi8j9HjnA==" + "resolved" "https://registry.npmjs.org/@types/minimatch/-/minimatch-3.0.3.tgz" + "version" "3.0.3" "@types/minimist@^1.2.0": - version "1.2.1" - resolved "https://registry.npmjs.org/@types/minimist/-/minimist-1.2.1.tgz" - integrity sha512-fZQQafSREFyuZcdWFAExYjBiCL7AUCdgsk80iO0q4yihYYdcIiH28CcuPTGFgLOCC8RlW49GSQxdHwZP+I7CNg== + "integrity" "sha512-fZQQafSREFyuZcdWFAExYjBiCL7AUCdgsk80iO0q4yihYYdcIiH28CcuPTGFgLOCC8RlW49GSQxdHwZP+I7CNg==" + "resolved" "https://registry.npmjs.org/@types/minimist/-/minimist-1.2.1.tgz" + "version" "1.2.1" "@types/node@*": - version "16.11.6" - resolved "https://registry.npmjs.org/@types/node/-/node-16.11.6.tgz" - integrity sha512-ua7PgUoeQFjmWPcoo9khiPum3Pd60k4/2ZGXt18sm2Slk0W0xZTqt5Y0Ny1NyBiN1EVQ/+FaF9NcY4Qe6rwk5w== + "integrity" "sha512-UYmIeBnB0On70dN1iGCinsL1qH5JmIEJwa+3KX0Xw4HQJ8KA16ULlyTCNmnzfyzj/BlxZKmZLqp4TYdssnov1w==" + "resolved" "https://registry.npmjs.org/@types/node/-/node-17.0.28.tgz" + "version" "17.0.28" "@types/normalize-package-data@^2.4.0": - version "2.4.0" - resolved "https://registry.npmjs.org/@types/normalize-package-data/-/normalize-package-data-2.4.0.tgz" - integrity sha512-f5j5b/Gf71L+dbqxIpQ4Z2WlmI/mPJ0fOkGGmFgtb6sAu97EPczzbS3/tJKxmcYDj55OX6ssqwDAWOHIYDRDGA== + "integrity" "sha512-f5j5b/Gf71L+dbqxIpQ4Z2WlmI/mPJ0fOkGGmFgtb6sAu97EPczzbS3/tJKxmcYDj55OX6ssqwDAWOHIYDRDGA==" + "resolved" "https://registry.npmjs.org/@types/normalize-package-data/-/normalize-package-data-2.4.0.tgz" + "version" "2.4.0" "@types/parse-json@^4.0.0": - version "4.0.0" - resolved "https://registry.npmjs.org/@types/parse-json/-/parse-json-4.0.0.tgz" - integrity sha512-//oorEZjL6sbPcKUaCdIGlIUeH26mgzimjBB77G6XRgnDl/L5wOnpyBGRe/Mmf5CVW3PwEBE1NjiMZ/ssFh4wA== + "integrity" "sha512-//oorEZjL6sbPcKUaCdIGlIUeH26mgzimjBB77G6XRgnDl/L5wOnpyBGRe/Mmf5CVW3PwEBE1NjiMZ/ssFh4wA==" + "resolved" "https://registry.npmjs.org/@types/parse-json/-/parse-json-4.0.0.tgz" + "version" "4.0.0" "@types/pbkdf2@^3.0.0": - version "3.1.0" - resolved "https://registry.npmjs.org/@types/pbkdf2/-/pbkdf2-3.1.0.tgz" - integrity sha512-Cf63Rv7jCQ0LaL8tNXmEyqTHuIJxRdlS5vMh1mj5voN4+QFhVZnlZruezqpWYDiJ8UTzhP0VmeLXCmBk66YrMQ== + "integrity" "sha512-Cf63Rv7jCQ0LaL8tNXmEyqTHuIJxRdlS5vMh1mj5voN4+QFhVZnlZruezqpWYDiJ8UTzhP0VmeLXCmBk66YrMQ==" + "resolved" "https://registry.npmjs.org/@types/pbkdf2/-/pbkdf2-3.1.0.tgz" + "version" "3.1.0" dependencies: "@types/node" "*" "@types/secp256k1@^4.0.1": - version "4.0.3" - resolved "https://registry.npmjs.org/@types/secp256k1/-/secp256k1-4.0.3.tgz" - integrity sha512-Da66lEIFeIz9ltsdMZcpQvmrmmoqrfju8pm1BH8WbYjZSwUgCwXLb9C+9XYogwBITnbsSaMdVPb2ekf7TV+03w== + "integrity" "sha512-Da66lEIFeIz9ltsdMZcpQvmrmmoqrfju8pm1BH8WbYjZSwUgCwXLb9C+9XYogwBITnbsSaMdVPb2ekf7TV+03w==" + "resolved" "https://registry.npmjs.org/@types/secp256k1/-/secp256k1-4.0.3.tgz" + "version" "4.0.3" dependencies: "@types/node" "*" -JSONStream@^1.0.4: - version "1.3.5" - resolved "https://registry.npmjs.org/JSONStream/-/JSONStream-1.3.5.tgz" - integrity sha512-E+iruNOY8VV9s4JEbe1aNEm6MiszPRr/UfcHMz0TQh1BXSxHK+ASV1R6W4HpjBhSeS+54PIsAMCBmwD06LLsqQ== - dependencies: - jsonparse "^1.2.0" - through ">=2.2.7 <3" - -abort-controller@^3.0.0: - version "3.0.0" - resolved "https://registry.npmjs.org/abort-controller/-/abort-controller-3.0.0.tgz" - integrity sha512-h8lQ8tacZYnR3vNQTgibj+tODHI5/+l06Au2Pcriv/Gmet0eaj4TwWH41sO9wnHDiQsEj19q0drzdWdeAHtweg== - dependencies: - event-target-shim "^5.0.0" - -abstract-leveldown@^6.2.1: - version "6.3.0" - resolved "https://registry.npmjs.org/abstract-leveldown/-/abstract-leveldown-6.3.0.tgz" - integrity sha512-TU5nlYgta8YrBMNpc9FwQzRbiXsj49gsALsXadbGHt9CROPzX5fB0rWDR5mtdpOOKa5XqRFpbj1QroPAoPzVjQ== - dependencies: - buffer "^5.5.0" - immediate "^3.2.3" - level-concat-iterator "~2.0.0" - level-supports "~1.0.0" - xtend "~4.0.0" - -abstract-leveldown@~6.2.1: - version "6.2.3" - resolved "https://registry.npmjs.org/abstract-leveldown/-/abstract-leveldown-6.2.3.tgz" - integrity sha512-BsLm5vFMRUrrLeCcRc+G0t2qOaTzpoJQLOubq2XM72eNpjF5UdU5o/5NvlNhx95XHcAvcl8OMXr4mlg/fRgUXQ== - dependencies: - buffer "^5.5.0" - immediate "^3.2.3" - level-concat-iterator "~2.0.0" - level-supports "~1.0.0" - xtend "~4.0.0" - -adm-zip@^0.4.16: - version "0.4.16" - resolved "https://registry.npmjs.org/adm-zip/-/adm-zip-0.4.16.tgz" - integrity sha512-TFi4HBKSGfIKsK5YCkKaaFG2m4PEDyViZmEwof3MTIgzimHLto6muaHVpbrljdIvIrFZzEq/p4nafOeLcYegrg== - -agent-base@6: - version "6.0.2" - resolved "https://registry.npmjs.org/agent-base/-/agent-base-6.0.2.tgz" - integrity sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ== - dependencies: - debug "4" - -ajv@^5.2.2: - version "5.5.2" - resolved "https://registry.npmjs.org/ajv/-/ajv-5.5.2.tgz" - integrity sha1-c7Xuyj+rZT49P5Qis0GtQiBdyWU= - dependencies: - co "^4.6.0" - fast-deep-equal "^1.0.0" - fast-json-stable-stringify "^2.0.0" - json-schema-traverse "^0.3.0" - -ansi-colors@3.2.3: - version "3.2.3" - resolved "https://registry.npmjs.org/ansi-colors/-/ansi-colors-3.2.3.tgz" - integrity sha512-LEHHyuhlPY3TmuUYMh2oz89lTShfvgbmzaBcxve9t/9Wuy7Dwf4yoAKcND7KFT1HAQfqZ12qtc+DUrBMeKF9nw== - -ansi-colors@^4.1.1: - version "4.1.1" - resolved "https://registry.npmjs.org/ansi-colors/-/ansi-colors-4.1.1.tgz" - integrity sha512-JoX0apGbHaUJBNl6yF+p6JAFYZ666/hhCGKN5t9QFjbJQKUU/g8MNbFDbvfrgKXvI1QpZplPOnwIo99lX/AAmA== - -ansi-escapes@^4.3.0: - version "4.3.2" - resolved "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-4.3.2.tgz" - integrity sha512-gKXj5ALrKWQLsYG9jlTRmR/xKluxHV+Z9QEwNIgCfM1/uwPMCuzVVnh5mwTd+OuBZcwSIMbqssNWRm1lE51QaQ== - dependencies: - type-fest "^0.21.3" - -ansi-regex@^2.0.0: - version "2.1.1" - resolved "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz" - integrity sha1-w7M6te42DYbg5ijwRorn7yfWVN8= - -ansi-regex@^3.0.0: - version "3.0.0" - resolved "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz" - integrity sha1-7QMXwyIGT3lGbAKWa922Bas32Zg= - -ansi-regex@^4.1.0: - version "4.1.0" - resolved "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz" - integrity sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg== - -ansi-regex@^5.0.0: - version "5.0.0" - resolved "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.0.tgz" - integrity sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg== - -ansi-styles@^3.2.0, ansi-styles@^3.2.1: - version "3.2.1" - resolved "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz" - integrity sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA== - dependencies: - color-convert "^1.9.0" - -ansi-styles@^4.0.0, ansi-styles@^4.1.0: - version "4.3.0" - resolved "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz" - integrity sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg== - dependencies: - color-convert "^2.0.1" - -antlr4ts@^0.5.0-alpha.4: - version "0.5.0-alpha.4" - resolved "https://registry.npmjs.org/antlr4ts/-/antlr4ts-0.5.0-alpha.4.tgz" - integrity sha512-WPQDt1B74OfPv/IMS2ekXAKkTZIHl88uMetg6q3OTqgFxZ/dxDXI0EWLyZid/1Pe6hTftyg5N7gel5wNAGxXyQ== - -anymatch@^1.3.0: - version "1.3.2" - resolved "https://registry.npmjs.org/anymatch/-/anymatch-1.3.2.tgz" - integrity sha512-0XNayC8lTHQ2OI8aljNCN3sSx6hsr/1+rlcDAotXJR7C1oZZHCNsfpbKwMjRA3Uqb5tF1Rae2oloTr4xpq+WjA== - dependencies: - micromatch "^2.1.5" - normalize-path "^2.0.0" - -anymatch@~3.1.1, anymatch@~3.1.2: - version "3.1.2" - resolved "https://registry.npmjs.org/anymatch/-/anymatch-3.1.2.tgz" - integrity sha512-P43ePfOAIupkguHUycrc4qJ9kz8ZiuOUijaETwX7THt0Y/GNK7v0aa8rY816xWjZ7rJdA5XdMcpVFTKMq+RvWg== - dependencies: - normalize-path "^3.0.0" - picomatch "^2.0.4" - -argparse@^1.0.7: - version "1.0.10" - resolved "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz" - integrity sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg== - dependencies: - sprintf-js "~1.0.2" - -arr-diff@^2.0.0: - version "2.0.0" - resolved "https://registry.npmjs.org/arr-diff/-/arr-diff-2.0.0.tgz" - integrity sha1-jzuCf5Vai9ZpaX5KQlasPOrjVs8= - dependencies: - arr-flatten "^1.0.1" - -arr-diff@^4.0.0: - version "4.0.0" - resolved "https://registry.npmjs.org/arr-diff/-/arr-diff-4.0.0.tgz" - integrity sha1-1kYQdP6/7HHn4VI1dhoyml3HxSA= - -arr-flatten@^1.0.1, arr-flatten@^1.1.0: - version "1.1.0" - resolved "https://registry.npmjs.org/arr-flatten/-/arr-flatten-1.1.0.tgz" - integrity sha512-L3hKV5R/p5o81R7O02IGnwpDmkp6E982XhtbuwSe3O4qOtMMMtodicASA1Cny2U+aCXcNpml+m4dPsvsJ3jatg== - -arr-union@^3.1.0: - version "3.1.0" - resolved "https://registry.npmjs.org/arr-union/-/arr-union-3.1.0.tgz" - integrity sha1-45sJrqne+Gao8gbiiK9jkZuuOcQ= - -array-differ@^3.0.0: - version "3.0.0" - resolved "https://registry.npmjs.org/array-differ/-/array-differ-3.0.0.tgz" - integrity sha512-THtfYS6KtME/yIAhKjZ2ul7XI96lQGHRputJQHO80LAWQnuGP4iCIN8vdMRboGbIEYBwU33q8Tch1os2+X0kMg== - -array-ify@^1.0.0: - version "1.0.0" - resolved "https://registry.npmjs.org/array-ify/-/array-ify-1.0.0.tgz" - integrity sha1-nlKHYrSpBmrRY6aWKjZEGOlibs4= - -array-union@^2.1.0: - version "2.1.0" - resolved "https://registry.npmjs.org/array-union/-/array-union-2.1.0.tgz" - integrity sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw== - -array-unique@^0.2.1: - version "0.2.1" - resolved "https://registry.npmjs.org/array-unique/-/array-unique-0.2.1.tgz" - integrity sha1-odl8yvy8JiXMcPrc6zalDFiwGlM= - -array-unique@^0.3.2: - version "0.3.2" - resolved "https://registry.npmjs.org/array-unique/-/array-unique-0.3.2.tgz" - integrity sha1-qJS3XUvE9s1nnvMkSp/Y9Gri1Cg= - -arrify@^1.0.1: - version "1.0.1" - resolved "https://registry.npmjs.org/arrify/-/arrify-1.0.1.tgz" - integrity sha1-iYUI2iIm84DfkEcoRWhJwVAaSw0= - -arrify@^2.0.1: - version "2.0.1" - resolved "https://registry.npmjs.org/arrify/-/arrify-2.0.1.tgz" - integrity sha512-3duEwti880xqi4eAMN8AyR4a0ByT90zoYdLlevfrvU43vb0YZwZVfxOgxWrLXXXpyugL0hNZc9G6BiB5B3nUug== - -assign-symbols@^1.0.0: - version "1.0.0" - resolved "https://registry.npmjs.org/assign-symbols/-/assign-symbols-1.0.0.tgz" - integrity sha1-WWZ/QfrdTyDMvCu5a41Pf3jsA2c= - -async-each@^1.0.0: - version "1.0.3" - resolved "https://registry.npmjs.org/async-each/-/async-each-1.0.3.tgz" - integrity sha512-z/WhQ5FPySLdvREByI2vZiTWwCnF0moMJ1hK9YQwDTHKh6I7/uSckMetoRGb5UBZPC1z0jlw+n/XCgjeH7y1AQ== - -async-eventemitter@^0.2.4: - version "0.2.4" - resolved "https://registry.npmjs.org/async-eventemitter/-/async-eventemitter-0.2.4.tgz" - integrity sha512-pd20BwL7Yt1zwDFy+8MX8F1+WCT8aQeKj0kQnTrH9WaeRETlRamVhD0JtRPmrV4GfOJ2F9CvdQkZeZhnh2TuHw== - dependencies: - async "^2.4.0" - -async@^2.4.0: - version "2.6.3" - resolved "https://registry.npmjs.org/async/-/async-2.6.3.tgz" - integrity sha512-zflvls11DCy+dQWzTW2dzuilv8Z5X/pjfmZOWba6TNIVDm+2UDaJmXSOXlasHKfNBs8oo3M0aT50fDEWfKZjXg== - dependencies: - lodash "^4.17.14" - -at-least-node@^1.0.0: - version "1.0.0" - resolved "https://registry.npmjs.org/at-least-node/-/at-least-node-1.0.0.tgz" - integrity sha512-+q/t7Ekv1EDY2l6Gda6LLiX14rU9TV20Wa3ofeQmwPFZbOMo9DXrLbOjFaaclkXKWidIaopwAObQDqwWtGUjqg== - -atob@^2.1.2: - version "2.1.2" - resolved "https://registry.npmjs.org/atob/-/atob-2.1.2.tgz" - integrity sha512-Wm6ukoaOGJi/73p/cl2GvLjTI5JM1k/O14isD73YML8StrH/7/lRFgmg8nICZgD3bZZvjwCGxtMOD3wWNAu8cg== - -balanced-match@^1.0.0: - version "1.0.0" - resolved "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz" - integrity sha1-ibTRmasr7kneFk6gK4nORi1xt2c= - -base-x@^3.0.2: - version "3.0.9" - resolved "https://registry.npmjs.org/base-x/-/base-x-3.0.9.tgz" - integrity sha512-H7JU6iBHTal1gp56aKoaa//YUxEaAOUiydvrV/pILqIHXTtqxSkATOnDA2u+jZ/61sD+L/412+7kzXRtWukhpQ== - dependencies: - safe-buffer "^5.0.1" - -base64-js@^1.3.1: - version "1.5.1" - resolved "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz" - integrity sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA== - -base@^0.11.1: - version "0.11.2" - resolved "https://registry.npmjs.org/base/-/base-0.11.2.tgz" - integrity sha512-5T6P4xPgpp0YDFvSWwEZ4NoE3aM4QBQXDzmVbraCkFj8zHM+mba8SyqB5DbZWyR7mYHo6Y7BdQo3MoA4m0TeQg== - dependencies: - cache-base "^1.0.1" - class-utils "^0.3.5" - component-emitter "^1.2.1" - define-property "^1.0.0" - isobject "^3.0.1" - mixin-deep "^1.2.0" - pascalcase "^0.1.1" - -binary-extensions@^1.0.0: - version "1.13.1" - resolved "https://registry.npmjs.org/binary-extensions/-/binary-extensions-1.13.1.tgz" - integrity sha512-Un7MIEDdUC5gNpcGDV97op1Ywk748MpHcFTHoYs6qnj1Z3j7I53VG3nwZhKzoBZmbdRNnb6WRdFlwl7tSDuZGw== - -binary-extensions@^2.0.0: - version "2.2.0" - resolved "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.2.0.tgz" - integrity sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA== - -bindings@^1.5.0: - version "1.5.0" - resolved "https://registry.npmjs.org/bindings/-/bindings-1.5.0.tgz" - integrity sha512-p2q/t/mhvuOj/UeLlV6566GD/guowlr0hHxClI0W9m7MWYkL1F0hLo+0Aexs9HSPCtR1SXQ0TD3MMKrXZajbiQ== - dependencies: - file-uri-to-path "1.0.0" - -blakejs@^1.1.0: - version "1.1.1" - resolved "https://registry.npmjs.org/blakejs/-/blakejs-1.1.1.tgz" - integrity sha512-bLG6PHOCZJKNshTjGRBvET0vTciwQE6zFKOKKXPDJfwFBd4Ac0yBfPZqcGvGJap50l7ktvlpFqc2jGVaUgbJgg== - -bn.js@^4.0.0, bn.js@^4.11.0, bn.js@^4.11.8, bn.js@^4.11.9: - version "4.12.0" - resolved "https://registry.npmjs.org/bn.js/-/bn.js-4.12.0.tgz" - integrity sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA== - -bn.js@^5.1.2, bn.js@^5.2.0: - version "5.2.0" - resolved "https://registry.npmjs.org/bn.js/-/bn.js-5.2.0.tgz" - integrity sha512-D7iWRBvnZE8ecXiLj/9wbxH7Tk79fAh8IHaTNq1RWRixsS02W+5qS+iE9yq6RYl0asXx5tw0bLhmT5pIfbSquw== - -brace-expansion@^1.1.7: - version "1.1.11" - resolved "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz" - integrity sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA== - dependencies: - balanced-match "^1.0.0" - concat-map "0.0.1" - -braces@^1.8.2: - version "1.8.5" - resolved "https://registry.npmjs.org/braces/-/braces-1.8.5.tgz" - integrity sha1-uneWLhLf+WnWt2cR6RS3N4V79qc= - dependencies: - expand-range "^1.8.1" - preserve "^0.2.0" - repeat-element "^1.1.2" - -braces@^2.3.1: - version "2.3.2" - resolved "https://registry.npmjs.org/braces/-/braces-2.3.2.tgz" - integrity sha512-aNdbnj9P8PjdXU4ybaWLK2IF3jc/EoDYbC7AazW6to3TRsfXxscC9UXOB5iDiEQrkyIbWp2SLQda4+QAa7nc3w== - dependencies: - arr-flatten "^1.1.0" - array-unique "^0.3.2" - extend-shallow "^2.0.1" - fill-range "^4.0.0" - isobject "^3.0.1" - repeat-element "^1.1.2" - snapdragon "^0.8.1" - snapdragon-node "^2.0.1" - split-string "^3.0.2" - to-regex "^3.0.1" - -braces@~3.0.2: - version "3.0.2" - resolved "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz" - integrity sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A== - dependencies: - fill-range "^7.0.1" - -brorand@^1.0.1, brorand@^1.1.0: - version "1.1.0" - resolved "https://registry.npmjs.org/brorand/-/brorand-1.1.0.tgz" - integrity sha1-EsJe/kCkXjwyPrhnWgoM5XsiNx8= - -browser-stdout@1.3.0: - version "1.3.0" - resolved "https://registry.npmjs.org/browser-stdout/-/browser-stdout-1.3.0.tgz" - integrity sha1-81HTKWnTL6XXpVZxVCY9korjvR8= - -browser-stdout@1.3.1: - version "1.3.1" - resolved "https://registry.npmjs.org/browser-stdout/-/browser-stdout-1.3.1.tgz" - integrity sha512-qhAVI1+Av2X7qelOfAIYwXONood6XlZE/fXaBSmW/T5SzLAmCgzi+eiWE7fUvbHaeNBQH13UftjpXxsfLkMpgw== - -browserify-aes@^1.2.0: - version "1.2.0" - resolved "https://registry.npmjs.org/browserify-aes/-/browserify-aes-1.2.0.tgz" - integrity sha512-+7CHXqGuspUn/Sl5aO7Ea0xWGAtETPXNSAjHo48JfLdPWcMng33Xe4znFvQweqc/uzk5zSOI3H52CYnjCfb5hA== - dependencies: - buffer-xor "^1.0.3" - cipher-base "^1.0.0" - create-hash "^1.1.0" - evp_bytestokey "^1.0.3" - inherits "^2.0.1" - safe-buffer "^5.0.1" - -bs58@^4.0.0: - version "4.0.1" - resolved "https://registry.npmjs.org/bs58/-/bs58-4.0.1.tgz" - integrity sha1-vhYedsNU9veIrkBx9j806MTwpCo= - dependencies: - base-x "^3.0.2" - -bs58check@^2.1.2: - version "2.1.2" - resolved "https://registry.npmjs.org/bs58check/-/bs58check-2.1.2.tgz" - integrity sha512-0TS1jicxdU09dwJMNZtVAfzPi6Q6QeN0pM1Fkzrjn+XYHvzMKPU3pHVpva+769iNVSfIYWf7LJ6WR+BuuMf8cA== - dependencies: - bs58 "^4.0.0" - create-hash "^1.1.0" - safe-buffer "^5.1.2" - -buffer-from@^1.0.0: - version "1.1.2" - resolved "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.2.tgz" - integrity sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ== - -buffer-xor@^1.0.3: - version "1.0.3" - resolved "https://registry.npmjs.org/buffer-xor/-/buffer-xor-1.0.3.tgz" - integrity sha1-JuYe0UIvtw3ULm42cp7VHYVf6Nk= - -buffer-xor@^2.0.1: - version "2.0.2" - resolved "https://registry.npmjs.org/buffer-xor/-/buffer-xor-2.0.2.tgz" - integrity sha512-eHslX0bin3GB+Lx2p7lEYRShRewuNZL3fUl4qlVJGGiwoPGftmt8JQgk2Y9Ji5/01TnVDo33E5b5O3vUB1HdqQ== - dependencies: - safe-buffer "^5.1.1" - -buffer@^5.5.0, buffer@^5.6.0: - version "5.7.1" - resolved "https://registry.npmjs.org/buffer/-/buffer-5.7.1.tgz" - integrity sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ== - dependencies: - base64-js "^1.3.1" - ieee754 "^1.1.13" - -bytes@3.1.0: - version "3.1.0" - resolved "https://registry.npmjs.org/bytes/-/bytes-3.1.0.tgz" - integrity sha512-zauLjrfCG+xvoyaqLoV8bLVXXNGC4JqlxFCutSDWA6fJrTo2ZuvLYTqZ7aHBLZSMOopbzwv8f+wZcVzfVTI2Dg== - -cache-base@^1.0.1: - version "1.0.1" - resolved "https://registry.npmjs.org/cache-base/-/cache-base-1.0.1.tgz" - integrity sha512-AKcdTnFSWATd5/GCPRxr2ChwIJ85CeyrEyjRHlKxQ56d4XJMGym0uAiKn0xbLOGOl3+yRpOTi484dVCEc5AUzQ== - dependencies: - collection-visit "^1.0.0" - component-emitter "^1.2.1" - get-value "^2.0.6" - has-value "^1.0.0" - isobject "^3.0.1" - set-value "^2.0.0" - to-object-path "^0.3.0" - union-value "^1.0.0" - unset-value "^1.0.0" - -call-bind@^1.0.0, call-bind@^1.0.2: - version "1.0.2" - resolved "https://registry.npmjs.org/call-bind/-/call-bind-1.0.2.tgz" - integrity sha512-7O+FbCihrB5WGbFYesctwmTKae6rOiIzmz1icreWJ+0aA7LJfuqhEso2T9ncpcFtzMQtzXf2QGGueWJGTYsqrA== - dependencies: - function-bind "^1.1.1" - get-intrinsic "^1.0.2" - -callsites@^3.0.0: - version "3.1.0" - resolved "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz" - integrity sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ== - -camelcase-keys@^6.2.2: - version "6.2.2" - resolved "https://registry.npmjs.org/camelcase-keys/-/camelcase-keys-6.2.2.tgz" - integrity sha512-YrwaA0vEKazPBkn0ipTiMpSajYDSe+KjQfrjhcBMxJt/znbvlHd8Pw/Vamaz5EB4Wfhs3SUR3Z9mwRu/P3s3Yg== - dependencies: - camelcase "^5.3.1" - map-obj "^4.0.0" - quick-lru "^4.0.1" - -camelcase@^4.1.0: - version "4.1.0" - resolved "https://registry.npmjs.org/camelcase/-/camelcase-4.1.0.tgz" - integrity sha1-1UVjW+HjPFQmScaRc+Xeas+uNN0= - -camelcase@^5.0.0, camelcase@^5.3.1: - version "5.3.1" - resolved "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz" - integrity sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg== - -chalk@4.1.0, chalk@^4.0.0: - version "4.1.0" - resolved "https://registry.npmjs.org/chalk/-/chalk-4.1.0.tgz" - integrity sha512-qwx12AxXe2Q5xQ43Ac//I6v5aXTipYrSESdOgzrN+9XjgEpyjpKuvSGaN4qE93f7TQTlerQQ8S+EQ0EyDoVL1A== - dependencies: - ansi-styles "^4.1.0" - supports-color "^7.1.0" - -chalk@^2.0.0, chalk@^2.4.2: - version "2.4.2" - resolved "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz" - integrity sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ== - dependencies: - ansi-styles "^3.2.1" - escape-string-regexp "^1.0.5" - supports-color "^5.3.0" - -chalk@^3.0.0: - version "3.0.0" - resolved "https://registry.npmjs.org/chalk/-/chalk-3.0.0.tgz" - integrity sha512-4D3B6Wf41KOYRFdszmDqMCGq5VV/uMAB273JILmO+3jAlh8X4qDtdtgCR3fxtbLEMzSx22QdhnDcJvu2u1fVwg== - dependencies: - ansi-styles "^4.1.0" - supports-color "^7.1.0" - -chokidar@3.3.0: - version "3.3.0" - resolved "https://registry.npmjs.org/chokidar/-/chokidar-3.3.0.tgz" - integrity sha512-dGmKLDdT3Gdl7fBUe8XK+gAtGmzy5Fn0XkkWQuYxGIgWVPPse2CxFA5mtrlD0TOHaHjEUqkWNyP1XdHoJES/4A== - dependencies: - anymatch "~3.1.1" - braces "~3.0.2" - glob-parent "~5.1.0" - is-binary-path "~2.1.0" - is-glob "~4.0.1" - normalize-path "~3.0.0" - readdirp "~3.2.0" - optionalDependencies: - fsevents "~2.1.1" - -chokidar@^1.6.0: - version "1.7.0" - resolved "https://registry.npmjs.org/chokidar/-/chokidar-1.7.0.tgz" - integrity sha1-eY5ol3gVHIB2tLNg5e3SjNortGg= - dependencies: - anymatch "^1.3.0" - async-each "^1.0.0" - glob-parent "^2.0.0" - inherits "^2.0.1" - is-binary-path "^1.0.0" - is-glob "^2.0.0" - path-is-absolute "^1.0.0" - readdirp "^2.0.0" +"@ungap/promise-all-settled@1.1.2": + "integrity" "sha512-sL/cEvJWAnClXw0wHk85/2L0G6Sj8UB0Ctc1TEMbKSsmpRosqhwj9gWgFRZSrBr2f9tiXISwNhCPmlfqUqyb9Q==" + "resolved" "https://registry.npmjs.org/@ungap/promise-all-settled/-/promise-all-settled-1.1.2.tgz" + "version" "1.1.2" + +"abort-controller@^3.0.0": + "integrity" "sha512-h8lQ8tacZYnR3vNQTgibj+tODHI5/+l06Au2Pcriv/Gmet0eaj4TwWH41sO9wnHDiQsEj19q0drzdWdeAHtweg==" + "resolved" "https://registry.npmjs.org/abort-controller/-/abort-controller-3.0.0.tgz" + "version" "3.0.0" + dependencies: + "event-target-shim" "^5.0.0" + +"abstract-leveldown@^6.2.1": + "integrity" "sha512-TU5nlYgta8YrBMNpc9FwQzRbiXsj49gsALsXadbGHt9CROPzX5fB0rWDR5mtdpOOKa5XqRFpbj1QroPAoPzVjQ==" + "resolved" "https://registry.npmjs.org/abstract-leveldown/-/abstract-leveldown-6.3.0.tgz" + "version" "6.3.0" + dependencies: + "buffer" "^5.5.0" + "immediate" "^3.2.3" + "level-concat-iterator" "~2.0.0" + "level-supports" "~1.0.0" + "xtend" "~4.0.0" + +"abstract-leveldown@~6.2.1": + "integrity" "sha512-BsLm5vFMRUrrLeCcRc+G0t2qOaTzpoJQLOubq2XM72eNpjF5UdU5o/5NvlNhx95XHcAvcl8OMXr4mlg/fRgUXQ==" + "resolved" "https://registry.npmjs.org/abstract-leveldown/-/abstract-leveldown-6.2.3.tgz" + "version" "6.2.3" + dependencies: + "buffer" "^5.5.0" + "immediate" "^3.2.3" + "level-concat-iterator" "~2.0.0" + "level-supports" "~1.0.0" + "xtend" "~4.0.0" + +"adm-zip@^0.4.16": + "integrity" "sha512-TFi4HBKSGfIKsK5YCkKaaFG2m4PEDyViZmEwof3MTIgzimHLto6muaHVpbrljdIvIrFZzEq/p4nafOeLcYegrg==" + "resolved" "https://registry.npmjs.org/adm-zip/-/adm-zip-0.4.16.tgz" + "version" "0.4.16" + +"agent-base@6": + "integrity" "sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ==" + "resolved" "https://registry.npmjs.org/agent-base/-/agent-base-6.0.2.tgz" + "version" "6.0.2" + dependencies: + "debug" "4" + +"aggregate-error@^3.0.0": + "integrity" "sha512-4I7Td01quW/RpocfNayFdFVk1qSuoh0E7JrbRJ16nH01HhKFQ88INq9Sd+nd72zqRySlr9BmDA8xlEJ6vJMrYA==" + "resolved" "https://registry.npmjs.org/aggregate-error/-/aggregate-error-3.1.0.tgz" + "version" "3.1.0" + dependencies: + "clean-stack" "^2.0.0" + "indent-string" "^4.0.0" + +"ajv@^5.2.2": + "integrity" "sha1-c7Xuyj+rZT49P5Qis0GtQiBdyWU=" + "resolved" "https://registry.npmjs.org/ajv/-/ajv-5.5.2.tgz" + "version" "5.5.2" + dependencies: + "co" "^4.6.0" + "fast-deep-equal" "^1.0.0" + "fast-json-stable-stringify" "^2.0.0" + "json-schema-traverse" "^0.3.0" + +"ansi-colors@^4.1.1", "ansi-colors@4.1.1": + "integrity" "sha512-JoX0apGbHaUJBNl6yF+p6JAFYZ666/hhCGKN5t9QFjbJQKUU/g8MNbFDbvfrgKXvI1QpZplPOnwIo99lX/AAmA==" + "resolved" "https://registry.npmjs.org/ansi-colors/-/ansi-colors-4.1.1.tgz" + "version" "4.1.1" + +"ansi-escapes@^4.3.0": + "integrity" "sha512-gKXj5ALrKWQLsYG9jlTRmR/xKluxHV+Z9QEwNIgCfM1/uwPMCuzVVnh5mwTd+OuBZcwSIMbqssNWRm1lE51QaQ==" + "resolved" "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-4.3.2.tgz" + "version" "4.3.2" + dependencies: + "type-fest" "^0.21.3" + +"ansi-regex@^2.0.0": + "integrity" "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=" + "resolved" "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz" + "version" "2.1.1" + +"ansi-regex@^3.0.0": + "integrity" "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=" + "resolved" "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz" + "version" "3.0.0" + +"ansi-regex@^5.0.1": + "integrity" "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==" + "resolved" "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz" + "version" "5.0.1" + +"ansi-styles@^3.2.1": + "integrity" "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==" + "resolved" "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz" + "version" "3.2.1" + dependencies: + "color-convert" "^1.9.0" + +"ansi-styles@^4.0.0", "ansi-styles@^4.1.0": + "integrity" "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==" + "resolved" "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz" + "version" "4.3.0" + dependencies: + "color-convert" "^2.0.1" + +"antlr4ts@^0.5.0-alpha.4": + "integrity" "sha512-WPQDt1B74OfPv/IMS2ekXAKkTZIHl88uMetg6q3OTqgFxZ/dxDXI0EWLyZid/1Pe6hTftyg5N7gel5wNAGxXyQ==" + "resolved" "https://registry.npmjs.org/antlr4ts/-/antlr4ts-0.5.0-alpha.4.tgz" + "version" "0.5.0-alpha.4" + +"anymatch@^1.3.0": + "integrity" "sha512-0XNayC8lTHQ2OI8aljNCN3sSx6hsr/1+rlcDAotXJR7C1oZZHCNsfpbKwMjRA3Uqb5tF1Rae2oloTr4xpq+WjA==" + "resolved" "https://registry.npmjs.org/anymatch/-/anymatch-1.3.2.tgz" + "version" "1.3.2" + dependencies: + "micromatch" "^2.1.5" + "normalize-path" "^2.0.0" + +"anymatch@~3.1.2": + "integrity" "sha512-P43ePfOAIupkguHUycrc4qJ9kz8ZiuOUijaETwX7THt0Y/GNK7v0aa8rY816xWjZ7rJdA5XdMcpVFTKMq+RvWg==" + "resolved" "https://registry.npmjs.org/anymatch/-/anymatch-3.1.2.tgz" + "version" "3.1.2" + dependencies: + "normalize-path" "^3.0.0" + "picomatch" "^2.0.4" + +"argparse@^2.0.1": + "integrity" "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==" + "resolved" "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz" + "version" "2.0.1" + +"arr-diff@^2.0.0": + "integrity" "sha1-jzuCf5Vai9ZpaX5KQlasPOrjVs8=" + "resolved" "https://registry.npmjs.org/arr-diff/-/arr-diff-2.0.0.tgz" + "version" "2.0.0" + dependencies: + "arr-flatten" "^1.0.1" + +"arr-diff@^4.0.0": + "integrity" "sha1-1kYQdP6/7HHn4VI1dhoyml3HxSA=" + "resolved" "https://registry.npmjs.org/arr-diff/-/arr-diff-4.0.0.tgz" + "version" "4.0.0" + +"arr-flatten@^1.0.1", "arr-flatten@^1.1.0": + "integrity" "sha512-L3hKV5R/p5o81R7O02IGnwpDmkp6E982XhtbuwSe3O4qOtMMMtodicASA1Cny2U+aCXcNpml+m4dPsvsJ3jatg==" + "resolved" "https://registry.npmjs.org/arr-flatten/-/arr-flatten-1.1.0.tgz" + "version" "1.1.0" + +"arr-union@^3.1.0": + "integrity" "sha1-45sJrqne+Gao8gbiiK9jkZuuOcQ=" + "resolved" "https://registry.npmjs.org/arr-union/-/arr-union-3.1.0.tgz" + "version" "3.1.0" + +"array-differ@^3.0.0": + "integrity" "sha512-THtfYS6KtME/yIAhKjZ2ul7XI96lQGHRputJQHO80LAWQnuGP4iCIN8vdMRboGbIEYBwU33q8Tch1os2+X0kMg==" + "resolved" "https://registry.npmjs.org/array-differ/-/array-differ-3.0.0.tgz" + "version" "3.0.0" + +"array-ify@^1.0.0": + "integrity" "sha1-nlKHYrSpBmrRY6aWKjZEGOlibs4=" + "resolved" "https://registry.npmjs.org/array-ify/-/array-ify-1.0.0.tgz" + "version" "1.0.0" + +"array-union@^2.1.0": + "integrity" "sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==" + "resolved" "https://registry.npmjs.org/array-union/-/array-union-2.1.0.tgz" + "version" "2.1.0" + +"array-unique@^0.2.1": + "integrity" "sha1-odl8yvy8JiXMcPrc6zalDFiwGlM=" + "resolved" "https://registry.npmjs.org/array-unique/-/array-unique-0.2.1.tgz" + "version" "0.2.1" + +"array-unique@^0.3.2": + "integrity" "sha1-qJS3XUvE9s1nnvMkSp/Y9Gri1Cg=" + "resolved" "https://registry.npmjs.org/array-unique/-/array-unique-0.3.2.tgz" + "version" "0.3.2" + +"arrify@^1.0.1": + "integrity" "sha1-iYUI2iIm84DfkEcoRWhJwVAaSw0=" + "resolved" "https://registry.npmjs.org/arrify/-/arrify-1.0.1.tgz" + "version" "1.0.1" + +"arrify@^2.0.1": + "integrity" "sha512-3duEwti880xqi4eAMN8AyR4a0ByT90zoYdLlevfrvU43vb0YZwZVfxOgxWrLXXXpyugL0hNZc9G6BiB5B3nUug==" + "resolved" "https://registry.npmjs.org/arrify/-/arrify-2.0.1.tgz" + "version" "2.0.1" + +"assign-symbols@^1.0.0": + "integrity" "sha1-WWZ/QfrdTyDMvCu5a41Pf3jsA2c=" + "resolved" "https://registry.npmjs.org/assign-symbols/-/assign-symbols-1.0.0.tgz" + "version" "1.0.0" + +"async-each@^1.0.0": + "integrity" "sha512-z/WhQ5FPySLdvREByI2vZiTWwCnF0moMJ1hK9YQwDTHKh6I7/uSckMetoRGb5UBZPC1z0jlw+n/XCgjeH7y1AQ==" + "resolved" "https://registry.npmjs.org/async-each/-/async-each-1.0.3.tgz" + "version" "1.0.3" + +"async-eventemitter@^0.2.4": + "integrity" "sha512-pd20BwL7Yt1zwDFy+8MX8F1+WCT8aQeKj0kQnTrH9WaeRETlRamVhD0JtRPmrV4GfOJ2F9CvdQkZeZhnh2TuHw==" + "resolved" "https://registry.npmjs.org/async-eventemitter/-/async-eventemitter-0.2.4.tgz" + "version" "0.2.4" + dependencies: + "async" "^2.4.0" + +"async@^2.4.0": + "integrity" "sha512-mzo5dfJYwAn29PeiJ0zvwTo04zj8HDJj0Mn8TD7sno7q12prdbnasKJHhkm2c1LgrhlJ0teaea8860oxi51mGA==" + "resolved" "https://registry.npmjs.org/async/-/async-2.6.4.tgz" + "version" "2.6.4" + dependencies: + "lodash" "^4.17.14" + +"at-least-node@^1.0.0": + "integrity" "sha512-+q/t7Ekv1EDY2l6Gda6LLiX14rU9TV20Wa3ofeQmwPFZbOMo9DXrLbOjFaaclkXKWidIaopwAObQDqwWtGUjqg==" + "resolved" "https://registry.npmjs.org/at-least-node/-/at-least-node-1.0.0.tgz" + "version" "1.0.0" + +"atob@^2.1.2": + "integrity" "sha512-Wm6ukoaOGJi/73p/cl2GvLjTI5JM1k/O14isD73YML8StrH/7/lRFgmg8nICZgD3bZZvjwCGxtMOD3wWNAu8cg==" + "resolved" "https://registry.npmjs.org/atob/-/atob-2.1.2.tgz" + "version" "2.1.2" + +"balanced-match@^1.0.0": + "integrity" "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=" + "resolved" "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz" + "version" "1.0.0" + +"base-x@^3.0.2": + "integrity" "sha512-H7JU6iBHTal1gp56aKoaa//YUxEaAOUiydvrV/pILqIHXTtqxSkATOnDA2u+jZ/61sD+L/412+7kzXRtWukhpQ==" + "resolved" "https://registry.npmjs.org/base-x/-/base-x-3.0.9.tgz" + "version" "3.0.9" + dependencies: + "safe-buffer" "^5.0.1" + +"base@^0.11.1": + "integrity" "sha512-5T6P4xPgpp0YDFvSWwEZ4NoE3aM4QBQXDzmVbraCkFj8zHM+mba8SyqB5DbZWyR7mYHo6Y7BdQo3MoA4m0TeQg==" + "resolved" "https://registry.npmjs.org/base/-/base-0.11.2.tgz" + "version" "0.11.2" + dependencies: + "cache-base" "^1.0.1" + "class-utils" "^0.3.5" + "component-emitter" "^1.2.1" + "define-property" "^1.0.0" + "isobject" "^3.0.1" + "mixin-deep" "^1.2.0" + "pascalcase" "^0.1.1" + +"base64-js@^1.3.1": + "integrity" "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==" + "resolved" "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz" + "version" "1.5.1" + +"binary-extensions@^1.0.0": + "integrity" "sha512-Un7MIEDdUC5gNpcGDV97op1Ywk748MpHcFTHoYs6qnj1Z3j7I53VG3nwZhKzoBZmbdRNnb6WRdFlwl7tSDuZGw==" + "resolved" "https://registry.npmjs.org/binary-extensions/-/binary-extensions-1.13.1.tgz" + "version" "1.13.1" + +"binary-extensions@^2.0.0": + "integrity" "sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA==" + "resolved" "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.2.0.tgz" + "version" "2.2.0" + +"bindings@^1.5.0": + "integrity" "sha512-p2q/t/mhvuOj/UeLlV6566GD/guowlr0hHxClI0W9m7MWYkL1F0hLo+0Aexs9HSPCtR1SXQ0TD3MMKrXZajbiQ==" + "resolved" "https://registry.npmjs.org/bindings/-/bindings-1.5.0.tgz" + "version" "1.5.0" + dependencies: + "file-uri-to-path" "1.0.0" + +"blakejs@^1.1.0": + "integrity" "sha512-QXUSXI3QVc/gJME0dBpXrag1kbzOqCjCX8/b54ntNyW6sjtoqxqRk3LTmXzaJoh71zMsDCjM+47jS7XiwN/+fQ==" + "resolved" "https://registry.npmjs.org/blakejs/-/blakejs-1.2.1.tgz" + "version" "1.2.1" + +"bn.js@^4.0.0", "bn.js@^4.11.0", "bn.js@^4.11.8", "bn.js@^4.11.9": + "integrity" "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==" + "resolved" "https://registry.npmjs.org/bn.js/-/bn.js-4.12.0.tgz" + "version" "4.12.0" + +"bn.js@^5.1.2": + "integrity" "sha512-D7iWRBvnZE8ecXiLj/9wbxH7Tk79fAh8IHaTNq1RWRixsS02W+5qS+iE9yq6RYl0asXx5tw0bLhmT5pIfbSquw==" + "resolved" "https://registry.npmjs.org/bn.js/-/bn.js-5.2.0.tgz" + "version" "5.2.0" + +"bn.js@^5.2.0": + "integrity" "sha512-D7iWRBvnZE8ecXiLj/9wbxH7Tk79fAh8IHaTNq1RWRixsS02W+5qS+iE9yq6RYl0asXx5tw0bLhmT5pIfbSquw==" + "resolved" "https://registry.npmjs.org/bn.js/-/bn.js-5.2.0.tgz" + "version" "5.2.0" + +"brace-expansion@^1.1.7": + "integrity" "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==" + "resolved" "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz" + "version" "1.1.11" + dependencies: + "balanced-match" "^1.0.0" + "concat-map" "0.0.1" + +"braces@^1.8.2": + "integrity" "sha1-uneWLhLf+WnWt2cR6RS3N4V79qc=" + "resolved" "https://registry.npmjs.org/braces/-/braces-1.8.5.tgz" + "version" "1.8.5" + dependencies: + "expand-range" "^1.8.1" + "preserve" "^0.2.0" + "repeat-element" "^1.1.2" + +"braces@^2.3.1": + "integrity" "sha512-aNdbnj9P8PjdXU4ybaWLK2IF3jc/EoDYbC7AazW6to3TRsfXxscC9UXOB5iDiEQrkyIbWp2SLQda4+QAa7nc3w==" + "resolved" "https://registry.npmjs.org/braces/-/braces-2.3.2.tgz" + "version" "2.3.2" + dependencies: + "arr-flatten" "^1.1.0" + "array-unique" "^0.3.2" + "extend-shallow" "^2.0.1" + "fill-range" "^4.0.0" + "isobject" "^3.0.1" + "repeat-element" "^1.1.2" + "snapdragon" "^0.8.1" + "snapdragon-node" "^2.0.1" + "split-string" "^3.0.2" + "to-regex" "^3.0.1" + +"braces@~3.0.2": + "integrity" "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==" + "resolved" "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz" + "version" "3.0.2" + dependencies: + "fill-range" "^7.0.1" + +"brorand@^1.0.1", "brorand@^1.1.0": + "integrity" "sha1-EsJe/kCkXjwyPrhnWgoM5XsiNx8=" + "resolved" "https://registry.npmjs.org/brorand/-/brorand-1.1.0.tgz" + "version" "1.1.0" + +"browser-stdout@1.3.0": + "integrity" "sha1-81HTKWnTL6XXpVZxVCY9korjvR8=" + "resolved" "https://registry.npmjs.org/browser-stdout/-/browser-stdout-1.3.0.tgz" + "version" "1.3.0" + +"browser-stdout@1.3.1": + "integrity" "sha512-qhAVI1+Av2X7qelOfAIYwXONood6XlZE/fXaBSmW/T5SzLAmCgzi+eiWE7fUvbHaeNBQH13UftjpXxsfLkMpgw==" + "resolved" "https://registry.npmjs.org/browser-stdout/-/browser-stdout-1.3.1.tgz" + "version" "1.3.1" + +"browserify-aes@^1.2.0": + "integrity" "sha512-+7CHXqGuspUn/Sl5aO7Ea0xWGAtETPXNSAjHo48JfLdPWcMng33Xe4znFvQweqc/uzk5zSOI3H52CYnjCfb5hA==" + "resolved" "https://registry.npmjs.org/browserify-aes/-/browserify-aes-1.2.0.tgz" + "version" "1.2.0" + dependencies: + "buffer-xor" "^1.0.3" + "cipher-base" "^1.0.0" + "create-hash" "^1.1.0" + "evp_bytestokey" "^1.0.3" + "inherits" "^2.0.1" + "safe-buffer" "^5.0.1" + +"bs58@^4.0.0": + "integrity" "sha1-vhYedsNU9veIrkBx9j806MTwpCo=" + "resolved" "https://registry.npmjs.org/bs58/-/bs58-4.0.1.tgz" + "version" "4.0.1" + dependencies: + "base-x" "^3.0.2" + +"bs58check@^2.1.2": + "integrity" "sha512-0TS1jicxdU09dwJMNZtVAfzPi6Q6QeN0pM1Fkzrjn+XYHvzMKPU3pHVpva+769iNVSfIYWf7LJ6WR+BuuMf8cA==" + "resolved" "https://registry.npmjs.org/bs58check/-/bs58check-2.1.2.tgz" + "version" "2.1.2" + dependencies: + "bs58" "^4.0.0" + "create-hash" "^1.1.0" + "safe-buffer" "^5.1.2" + +"buffer-from@^1.0.0": + "integrity" "sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==" + "resolved" "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.2.tgz" + "version" "1.1.2" + +"buffer-xor@^1.0.3": + "integrity" "sha1-JuYe0UIvtw3ULm42cp7VHYVf6Nk=" + "resolved" "https://registry.npmjs.org/buffer-xor/-/buffer-xor-1.0.3.tgz" + "version" "1.0.3" + +"buffer-xor@^2.0.1": + "integrity" "sha512-eHslX0bin3GB+Lx2p7lEYRShRewuNZL3fUl4qlVJGGiwoPGftmt8JQgk2Y9Ji5/01TnVDo33E5b5O3vUB1HdqQ==" + "resolved" "https://registry.npmjs.org/buffer-xor/-/buffer-xor-2.0.2.tgz" + "version" "2.0.2" + dependencies: + "safe-buffer" "^5.1.1" + +"buffer@^5.5.0", "buffer@^5.6.0": + "integrity" "sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ==" + "resolved" "https://registry.npmjs.org/buffer/-/buffer-5.7.1.tgz" + "version" "5.7.1" + dependencies: + "base64-js" "^1.3.1" + "ieee754" "^1.1.13" + +"bytes@3.1.0": + "integrity" "sha512-zauLjrfCG+xvoyaqLoV8bLVXXNGC4JqlxFCutSDWA6fJrTo2ZuvLYTqZ7aHBLZSMOopbzwv8f+wZcVzfVTI2Dg==" + "resolved" "https://registry.npmjs.org/bytes/-/bytes-3.1.0.tgz" + "version" "3.1.0" + +"cache-base@^1.0.1": + "integrity" "sha512-AKcdTnFSWATd5/GCPRxr2ChwIJ85CeyrEyjRHlKxQ56d4XJMGym0uAiKn0xbLOGOl3+yRpOTi484dVCEc5AUzQ==" + "resolved" "https://registry.npmjs.org/cache-base/-/cache-base-1.0.1.tgz" + "version" "1.0.1" + dependencies: + "collection-visit" "^1.0.0" + "component-emitter" "^1.2.1" + "get-value" "^2.0.6" + "has-value" "^1.0.0" + "isobject" "^3.0.1" + "set-value" "^2.0.0" + "to-object-path" "^0.3.0" + "union-value" "^1.0.0" + "unset-value" "^1.0.0" + +"call-bind@^1.0.0": + "integrity" "sha512-7O+FbCihrB5WGbFYesctwmTKae6rOiIzmz1icreWJ+0aA7LJfuqhEso2T9ncpcFtzMQtzXf2QGGueWJGTYsqrA==" + "resolved" "https://registry.npmjs.org/call-bind/-/call-bind-1.0.2.tgz" + "version" "1.0.2" + dependencies: + "function-bind" "^1.1.1" + "get-intrinsic" "^1.0.2" + +"callsites@^3.0.0": + "integrity" "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==" + "resolved" "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz" + "version" "3.1.0" + +"camelcase-keys@^6.2.2": + "integrity" "sha512-YrwaA0vEKazPBkn0ipTiMpSajYDSe+KjQfrjhcBMxJt/znbvlHd8Pw/Vamaz5EB4Wfhs3SUR3Z9mwRu/P3s3Yg==" + "resolved" "https://registry.npmjs.org/camelcase-keys/-/camelcase-keys-6.2.2.tgz" + "version" "6.2.2" + dependencies: + "camelcase" "^5.3.1" + "map-obj" "^4.0.0" + "quick-lru" "^4.0.1" + +"camelcase@^4.1.0": + "integrity" "sha1-1UVjW+HjPFQmScaRc+Xeas+uNN0=" + "resolved" "https://registry.npmjs.org/camelcase/-/camelcase-4.1.0.tgz" + "version" "4.1.0" + +"camelcase@^5.0.0", "camelcase@^5.3.1": + "integrity" "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==" + "resolved" "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz" + "version" "5.3.1" + +"camelcase@^6.0.0": + "integrity" "sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA==" + "resolved" "https://registry.npmjs.org/camelcase/-/camelcase-6.3.0.tgz" + "version" "6.3.0" + +"chalk@^2.0.0": + "integrity" "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==" + "resolved" "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz" + "version" "2.4.2" + dependencies: + "ansi-styles" "^3.2.1" + "escape-string-regexp" "^1.0.5" + "supports-color" "^5.3.0" + +"chalk@^2.4.2": + "integrity" "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==" + "resolved" "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz" + "version" "2.4.2" + dependencies: + "ansi-styles" "^3.2.1" + "escape-string-regexp" "^1.0.5" + "supports-color" "^5.3.0" + +"chalk@^3.0.0": + "integrity" "sha512-4D3B6Wf41KOYRFdszmDqMCGq5VV/uMAB273JILmO+3jAlh8X4qDtdtgCR3fxtbLEMzSx22QdhnDcJvu2u1fVwg==" + "resolved" "https://registry.npmjs.org/chalk/-/chalk-3.0.0.tgz" + "version" "3.0.0" + dependencies: + "ansi-styles" "^4.1.0" + "supports-color" "^7.1.0" + +"chalk@^4.0.0", "chalk@^4.1.0", "chalk@4.1.0": + "integrity" "sha512-qwx12AxXe2Q5xQ43Ac//I6v5aXTipYrSESdOgzrN+9XjgEpyjpKuvSGaN4qE93f7TQTlerQQ8S+EQ0EyDoVL1A==" + "resolved" "https://registry.npmjs.org/chalk/-/chalk-4.1.0.tgz" + "version" "4.1.0" + dependencies: + "ansi-styles" "^4.1.0" + "supports-color" "^7.1.0" + +"chokidar@^1.6.0": + "integrity" "sha1-eY5ol3gVHIB2tLNg5e3SjNortGg=" + "resolved" "https://registry.npmjs.org/chokidar/-/chokidar-1.7.0.tgz" + "version" "1.7.0" + dependencies: + "anymatch" "^1.3.0" + "async-each" "^1.0.0" + "glob-parent" "^2.0.0" + "inherits" "^2.0.1" + "is-binary-path" "^1.0.0" + "is-glob" "^2.0.0" + "path-is-absolute" "^1.0.0" + "readdirp" "^2.0.0" optionalDependencies: - fsevents "^1.0.0" - -chokidar@^3.4.0: - version "3.5.2" - resolved "https://registry.npmjs.org/chokidar/-/chokidar-3.5.2.tgz" - integrity sha512-ekGhOnNVPgT77r4K/U3GDhu+FQ2S8TnK/s2KbIGXi0SZWuwkZ2QNyfWdZW+TVfn84DpEP7rLeCt2UI6bJ8GwbQ== - dependencies: - anymatch "~3.1.2" - braces "~3.0.2" - glob-parent "~5.1.2" - is-binary-path "~2.1.0" - is-glob "~4.0.1" - normalize-path "~3.0.0" - readdirp "~3.6.0" + "fsevents" "^1.0.0" + +"chokidar@^3.4.0", "chokidar@3.5.3": + "integrity" "sha512-Dr3sfKRP6oTcjf2JmUmFJfeVMvXBdegxB0iVQ5eb2V10uFJUCAS8OByZdVAyVb8xXNz3GjjTgj9kLWsZTqE6kw==" + "resolved" "https://registry.npmjs.org/chokidar/-/chokidar-3.5.3.tgz" + "version" "3.5.3" + dependencies: + "anymatch" "~3.1.2" + "braces" "~3.0.2" + "glob-parent" "~5.1.2" + "is-binary-path" "~2.1.0" + "is-glob" "~4.0.1" + "normalize-path" "~3.0.0" + "readdirp" "~3.6.0" optionalDependencies: - fsevents "~2.3.2" - -ci-info@^2.0.0: - version "2.0.0" - resolved "https://registry.npmjs.org/ci-info/-/ci-info-2.0.0.tgz" - integrity sha512-5tK7EtrZ0N+OLFMthtqOj4fI2Jeb88C4CAZPu25LDVUgXJ0A3Js4PMGqrn0JU1W0Mh1/Z8wZzYPxqUrXeBboCQ== - -cipher-base@^1.0.0, cipher-base@^1.0.1, cipher-base@^1.0.3: - version "1.0.4" - resolved "https://registry.npmjs.org/cipher-base/-/cipher-base-1.0.4.tgz" - integrity sha512-Kkht5ye6ZGmwv40uUDZztayT2ThLQGfnj/T71N/XzeZeo3nf8foyW7zGTsPYkEya3m5f3cAypH+qe7YOrM1U2Q== - dependencies: - inherits "^2.0.1" - safe-buffer "^5.0.1" - -class-utils@^0.3.5: - version "0.3.6" - resolved "https://registry.npmjs.org/class-utils/-/class-utils-0.3.6.tgz" - integrity sha512-qOhPa/Fj7s6TY8H8esGu5QNpMMQxz79h+urzrNYN6mn+9BnxlDGf5QZ+XeCDsxSjPqsSR56XOZOJmpeurnLMeg== - dependencies: - arr-union "^3.1.0" - define-property "^0.2.5" - isobject "^3.0.0" - static-extend "^0.1.1" - -cliui@^4.0.0: - version "4.1.0" - resolved "https://registry.npmjs.org/cliui/-/cliui-4.1.0.tgz" - integrity sha512-4FG+RSG9DL7uEwRUZXZn3SS34DiDPfzP0VOiEwtUWlE+AR2EIg+hSyvrIgUUfhdgR/UkAeW2QHgeP+hWrXs7jQ== - dependencies: - string-width "^2.1.1" - strip-ansi "^4.0.0" - wrap-ansi "^2.0.0" - -cliui@^5.0.0: - version "5.0.0" - resolved "https://registry.npmjs.org/cliui/-/cliui-5.0.0.tgz" - integrity sha512-PYeGSEmmHM6zvoef2w8TPzlrnNpXIjTipYK780YswmIP9vjxmd6Y2a3CB2Ks6/AU8NHjZugXvo8w3oWM2qnwXA== - dependencies: - string-width "^3.1.0" - strip-ansi "^5.2.0" - wrap-ansi "^5.1.0" - -cliui@^6.0.0: - version "6.0.0" - resolved "https://registry.npmjs.org/cliui/-/cliui-6.0.0.tgz" - integrity sha512-t6wbgtoCXvAzst7QgXxJYqPt0usEfbgQdftEPbLL/cvv6HPE5VgvqCuAIDR0NgU52ds6rFwqrgakNLrHEjCbrQ== - dependencies: - string-width "^4.2.0" - strip-ansi "^6.0.0" - wrap-ansi "^6.2.0" - -co@^4.6.0: - version "4.6.0" - resolved "https://registry.npmjs.org/co/-/co-4.6.0.tgz" - integrity sha1-bqa989hTrlTMuOR7+gvz+QMfsYQ= - -code-point-at@^1.0.0: - version "1.1.0" - resolved "https://registry.npmjs.org/code-point-at/-/code-point-at-1.1.0.tgz" - integrity sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c= - -collection-visit@^1.0.0: - version "1.0.0" - resolved "https://registry.npmjs.org/collection-visit/-/collection-visit-1.0.0.tgz" - integrity sha1-S8A3PBZLwykbTTaMgpzxqApZ3KA= - dependencies: - map-visit "^1.0.0" - object-visit "^1.0.0" - -color-convert@^1.9.0: - version "1.9.3" - resolved "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz" - integrity sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg== - dependencies: - color-name "1.1.3" - -color-convert@^2.0.1: - version "2.0.1" - resolved "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz" - integrity sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ== - dependencies: - color-name "~1.1.4" - -color-name@1.1.3: - version "1.1.3" - resolved "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz" - integrity sha1-p9BVi9icQveV3UIyj3QIMcpTvCU= - -color-name@~1.1.4: - version "1.1.4" - resolved "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz" - integrity sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA== - -colors@^1.1.2: - version "1.4.0" - resolved "https://registry.npmjs.org/colors/-/colors-1.4.0.tgz" - integrity sha512-a+UqTh4kgZg/SlGvfbzDHpgRu7AAQOmmqRHJnxhRZICKFUT91brVhNNt58CMWU9PsBbv3PDCZUHbVxuDiH2mtA== - -command-exists@^1.2.8: - version "1.2.9" - resolved "https://registry.npmjs.org/command-exists/-/command-exists-1.2.9.tgz" - integrity sha512-LTQ/SGc+s0Xc0Fu5WaKnR0YiygZkm9eKFvyS+fRsU7/ZWFF8ykFM6Pc9aCVf1+xasOOZpO3BAVgVrKvsqKHV7w== - -commander@2.11.0: - version "2.11.0" - resolved "https://registry.npmjs.org/commander/-/commander-2.11.0.tgz" - integrity sha512-b0553uYA5YAEGgyYIGYROzKQ7X5RAqedkfjiZxwi0kL1g3bOaBNNZfYkzt/CL0umgD5wc9Jec2FbB98CjkMRvQ== - -commander@3.0.2: - version "3.0.2" - resolved "https://registry.npmjs.org/commander/-/commander-3.0.2.tgz" - integrity sha512-Gar0ASD4BDyKC4hl4DwHqDrmvjoxWKZigVnAbn5H1owvm4CxCPdb0HQDehwNYMJpla5+M2tPmPARzhtYuwpHow== - -commander@^2.9.0: - version "2.20.3" - resolved "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz" - integrity sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ== - -compare-func@^2.0.0: - version "2.0.0" - resolved "https://registry.npmjs.org/compare-func/-/compare-func-2.0.0.tgz" - integrity sha512-zHig5N+tPWARooBnb0Zx1MFcdfpyJrfTJ3Y5L+IFvUm8rM74hHz66z0gw0x4tijh5CorKkKUCnW82R2vmpeCRA== - dependencies: - array-ify "^1.0.0" - dot-prop "^5.1.0" - -compare-versions@^3.6.0: - version "3.6.0" - resolved "https://registry.npmjs.org/compare-versions/-/compare-versions-3.6.0.tgz" - integrity sha512-W6Af2Iw1z4CB7q4uU4hv646dW9GQuBM+YpC0UvUCWSD8w90SJjp+ujJuXaEMtAXBtSqGfMPuFOVn4/+FlaqfBA== - -component-emitter@^1.2.1: - version "1.3.0" - resolved "https://registry.npmjs.org/component-emitter/-/component-emitter-1.3.0.tgz" - integrity sha512-Rd3se6QB+sO1TwqZjscQrurpEPIfO0/yYnSin6Q/rD3mOutHvUrCAhJub3r90uNb+SESBuE0QYoB90YdfatsRg== - -concat-map@0.0.1: - version "0.0.1" - resolved "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz" - integrity sha1-2Klr13/Wjfd5OnMDajug1UBdR3s= - -conventional-changelog-angular@^5.0.0: - version "5.0.12" - resolved "https://registry.npmjs.org/conventional-changelog-angular/-/conventional-changelog-angular-5.0.12.tgz" - integrity sha512-5GLsbnkR/7A89RyHLvvoExbiGbd9xKdKqDTrArnPbOqBqG/2wIosu0fHwpeIRI8Tl94MhVNBXcLJZl92ZQ5USw== - dependencies: - compare-func "^2.0.0" - q "^1.5.1" - -conventional-changelog-conventionalcommits@^4.3.1: - version "4.5.0" - resolved "https://registry.npmjs.org/conventional-changelog-conventionalcommits/-/conventional-changelog-conventionalcommits-4.5.0.tgz" - integrity sha512-buge9xDvjjOxJlyxUnar/+6i/aVEVGA7EEh4OafBCXPlLUQPGbRUBhBUveWRxzvR8TEjhKEP4BdepnpG2FSZXw== - dependencies: - compare-func "^2.0.0" - lodash "^4.17.15" - q "^1.5.1" - -conventional-commits-parser@^3.0.0: - version "3.2.0" - resolved "https://registry.npmjs.org/conventional-commits-parser/-/conventional-commits-parser-3.2.0.tgz" - integrity sha512-XmJiXPxsF0JhAKyfA2Nn+rZwYKJ60nanlbSWwwkGwLQFbugsc0gv1rzc7VbbUWAzJfR1qR87/pNgv9NgmxtBMQ== - dependencies: - JSONStream "^1.0.4" - is-text-path "^1.0.1" - lodash "^4.17.15" - meow "^8.0.0" - split2 "^2.0.0" - through2 "^4.0.0" - trim-off-newlines "^1.0.0" - -cookie@^0.4.1: - version "0.4.1" - resolved "https://registry.npmjs.org/cookie/-/cookie-0.4.1.tgz" - integrity sha512-ZwrFkGJxUR3EIoXtO+yVE69Eb7KlixbaeAWfBQB9vVsNn/o+Yw69gBWSSDK825hQNdN+wF8zELf3dFNl/kxkUA== - -copy-descriptor@^0.1.0: - version "0.1.1" - resolved "https://registry.npmjs.org/copy-descriptor/-/copy-descriptor-0.1.1.tgz" - integrity sha1-Z29us8OZl8LuGsOpJP1hJHSPV40= - -core-js-pure@^3.0.1: - version "3.19.0" - resolved "https://registry.npmjs.org/core-js-pure/-/core-js-pure-3.19.0.tgz" - integrity sha512-UEQk8AxyCYvNAs6baNoPqDADv7BX0AmBLGxVsrAifPPx/C8EAzV4Q+2ZUJqVzfI2TQQEZITnwUkWcHpgc/IubQ== - -core-js@^3.6.1: - version "3.8.3" - resolved "https://registry.npmjs.org/core-js/-/core-js-3.8.3.tgz" - integrity sha512-KPYXeVZYemC2TkNEkX/01I+7yd+nX3KddKwZ1Ww7SKWdI2wQprSgLmrTddT8nw92AjEklTsPBoSdQBhbI1bQ6Q== - -core-util-is@~1.0.0: - version "1.0.2" - resolved "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz" - integrity sha1-tf1UIgqivFq1eqtxQMlAdUUDwac= - -cosmiconfig@^7.0.0: - version "7.0.0" - resolved "https://registry.npmjs.org/cosmiconfig/-/cosmiconfig-7.0.0.tgz" - integrity sha512-pondGvTuVYDk++upghXJabWzL6Kxu6f26ljFw64Swq9v6sQPUL3EUlVDV56diOjpCayKihL6hVe8exIACU4XcA== + "fsevents" "~2.3.2" + +"ci-info@^2.0.0": + "integrity" "sha512-5tK7EtrZ0N+OLFMthtqOj4fI2Jeb88C4CAZPu25LDVUgXJ0A3Js4PMGqrn0JU1W0Mh1/Z8wZzYPxqUrXeBboCQ==" + "resolved" "https://registry.npmjs.org/ci-info/-/ci-info-2.0.0.tgz" + "version" "2.0.0" + +"cipher-base@^1.0.0", "cipher-base@^1.0.1", "cipher-base@^1.0.3": + "integrity" "sha512-Kkht5ye6ZGmwv40uUDZztayT2ThLQGfnj/T71N/XzeZeo3nf8foyW7zGTsPYkEya3m5f3cAypH+qe7YOrM1U2Q==" + "resolved" "https://registry.npmjs.org/cipher-base/-/cipher-base-1.0.4.tgz" + "version" "1.0.4" + dependencies: + "inherits" "^2.0.1" + "safe-buffer" "^5.0.1" + +"class-utils@^0.3.5": + "integrity" "sha512-qOhPa/Fj7s6TY8H8esGu5QNpMMQxz79h+urzrNYN6mn+9BnxlDGf5QZ+XeCDsxSjPqsSR56XOZOJmpeurnLMeg==" + "resolved" "https://registry.npmjs.org/class-utils/-/class-utils-0.3.6.tgz" + "version" "0.3.6" + dependencies: + "arr-union" "^3.1.0" + "define-property" "^0.2.5" + "isobject" "^3.0.0" + "static-extend" "^0.1.1" + +"clean-stack@^2.0.0": + "integrity" "sha512-4diC9HaTE+KRAMWhDhrGOECgWZxoevMc5TlkObMqNSsVU62PYzXZ/SMTjzyGAFF1YusgxGcSWTEXBhp0CPwQ1A==" + "resolved" "https://registry.npmjs.org/clean-stack/-/clean-stack-2.2.0.tgz" + "version" "2.2.0" + +"cliui@^4.0.0": + "integrity" "sha512-4FG+RSG9DL7uEwRUZXZn3SS34DiDPfzP0VOiEwtUWlE+AR2EIg+hSyvrIgUUfhdgR/UkAeW2QHgeP+hWrXs7jQ==" + "resolved" "https://registry.npmjs.org/cliui/-/cliui-4.1.0.tgz" + "version" "4.1.0" + dependencies: + "string-width" "^2.1.1" + "strip-ansi" "^4.0.0" + "wrap-ansi" "^2.0.0" + +"cliui@^6.0.0": + "integrity" "sha512-t6wbgtoCXvAzst7QgXxJYqPt0usEfbgQdftEPbLL/cvv6HPE5VgvqCuAIDR0NgU52ds6rFwqrgakNLrHEjCbrQ==" + "resolved" "https://registry.npmjs.org/cliui/-/cliui-6.0.0.tgz" + "version" "6.0.0" + dependencies: + "string-width" "^4.2.0" + "strip-ansi" "^6.0.0" + "wrap-ansi" "^6.2.0" + +"cliui@^7.0.2": + "integrity" "sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ==" + "resolved" "https://registry.npmjs.org/cliui/-/cliui-7.0.4.tgz" + "version" "7.0.4" + dependencies: + "string-width" "^4.2.0" + "strip-ansi" "^6.0.0" + "wrap-ansi" "^7.0.0" + +"co@^4.6.0": + "integrity" "sha1-bqa989hTrlTMuOR7+gvz+QMfsYQ=" + "resolved" "https://registry.npmjs.org/co/-/co-4.6.0.tgz" + "version" "4.6.0" + +"code-point-at@^1.0.0": + "integrity" "sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c=" + "resolved" "https://registry.npmjs.org/code-point-at/-/code-point-at-1.1.0.tgz" + "version" "1.1.0" + +"collection-visit@^1.0.0": + "integrity" "sha1-S8A3PBZLwykbTTaMgpzxqApZ3KA=" + "resolved" "https://registry.npmjs.org/collection-visit/-/collection-visit-1.0.0.tgz" + "version" "1.0.0" + dependencies: + "map-visit" "^1.0.0" + "object-visit" "^1.0.0" + +"color-convert@^1.9.0": + "integrity" "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==" + "resolved" "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz" + "version" "1.9.3" + dependencies: + "color-name" "1.1.3" + +"color-convert@^2.0.1": + "integrity" "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==" + "resolved" "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz" + "version" "2.0.1" + dependencies: + "color-name" "~1.1.4" + +"color-name@~1.1.4": + "integrity" "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==" + "resolved" "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz" + "version" "1.1.4" + +"color-name@1.1.3": + "integrity" "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=" + "resolved" "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz" + "version" "1.1.3" + +"colors@^1.1.2": + "integrity" "sha512-a+UqTh4kgZg/SlGvfbzDHpgRu7AAQOmmqRHJnxhRZICKFUT91brVhNNt58CMWU9PsBbv3PDCZUHbVxuDiH2mtA==" + "resolved" "https://registry.npmjs.org/colors/-/colors-1.4.0.tgz" + "version" "1.4.0" + +"command-exists@^1.2.8": + "integrity" "sha512-LTQ/SGc+s0Xc0Fu5WaKnR0YiygZkm9eKFvyS+fRsU7/ZWFF8ykFM6Pc9aCVf1+xasOOZpO3BAVgVrKvsqKHV7w==" + "resolved" "https://registry.npmjs.org/command-exists/-/command-exists-1.2.9.tgz" + "version" "1.2.9" + +"commander@^2.9.0": + "integrity" "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==" + "resolved" "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz" + "version" "2.20.3" + +"commander@2.11.0": + "integrity" "sha512-b0553uYA5YAEGgyYIGYROzKQ7X5RAqedkfjiZxwi0kL1g3bOaBNNZfYkzt/CL0umgD5wc9Jec2FbB98CjkMRvQ==" + "resolved" "https://registry.npmjs.org/commander/-/commander-2.11.0.tgz" + "version" "2.11.0" + +"commander@3.0.2": + "integrity" "sha512-Gar0ASD4BDyKC4hl4DwHqDrmvjoxWKZigVnAbn5H1owvm4CxCPdb0HQDehwNYMJpla5+M2tPmPARzhtYuwpHow==" + "resolved" "https://registry.npmjs.org/commander/-/commander-3.0.2.tgz" + "version" "3.0.2" + +"compare-func@^2.0.0": + "integrity" "sha512-zHig5N+tPWARooBnb0Zx1MFcdfpyJrfTJ3Y5L+IFvUm8rM74hHz66z0gw0x4tijh5CorKkKUCnW82R2vmpeCRA==" + "resolved" "https://registry.npmjs.org/compare-func/-/compare-func-2.0.0.tgz" + "version" "2.0.0" + dependencies: + "array-ify" "^1.0.0" + "dot-prop" "^5.1.0" + +"compare-versions@^3.6.0": + "integrity" "sha512-W6Af2Iw1z4CB7q4uU4hv646dW9GQuBM+YpC0UvUCWSD8w90SJjp+ujJuXaEMtAXBtSqGfMPuFOVn4/+FlaqfBA==" + "resolved" "https://registry.npmjs.org/compare-versions/-/compare-versions-3.6.0.tgz" + "version" "3.6.0" + +"component-emitter@^1.2.1": + "integrity" "sha512-Rd3se6QB+sO1TwqZjscQrurpEPIfO0/yYnSin6Q/rD3mOutHvUrCAhJub3r90uNb+SESBuE0QYoB90YdfatsRg==" + "resolved" "https://registry.npmjs.org/component-emitter/-/component-emitter-1.3.0.tgz" + "version" "1.3.0" + +"concat-map@0.0.1": + "integrity" "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=" + "resolved" "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz" + "version" "0.0.1" + +"conventional-changelog-angular@^5.0.0": + "integrity" "sha512-5GLsbnkR/7A89RyHLvvoExbiGbd9xKdKqDTrArnPbOqBqG/2wIosu0fHwpeIRI8Tl94MhVNBXcLJZl92ZQ5USw==" + "resolved" "https://registry.npmjs.org/conventional-changelog-angular/-/conventional-changelog-angular-5.0.12.tgz" + "version" "5.0.12" + dependencies: + "compare-func" "^2.0.0" + "q" "^1.5.1" + +"conventional-changelog-conventionalcommits@^4.3.1": + "integrity" "sha512-buge9xDvjjOxJlyxUnar/+6i/aVEVGA7EEh4OafBCXPlLUQPGbRUBhBUveWRxzvR8TEjhKEP4BdepnpG2FSZXw==" + "resolved" "https://registry.npmjs.org/conventional-changelog-conventionalcommits/-/conventional-changelog-conventionalcommits-4.5.0.tgz" + "version" "4.5.0" + dependencies: + "compare-func" "^2.0.0" + "lodash" "^4.17.15" + "q" "^1.5.1" + +"conventional-commits-parser@^3.0.0": + "integrity" "sha512-XmJiXPxsF0JhAKyfA2Nn+rZwYKJ60nanlbSWwwkGwLQFbugsc0gv1rzc7VbbUWAzJfR1qR87/pNgv9NgmxtBMQ==" + "resolved" "https://registry.npmjs.org/conventional-commits-parser/-/conventional-commits-parser-3.2.0.tgz" + "version" "3.2.0" + dependencies: + "is-text-path" "^1.0.1" + "JSONStream" "^1.0.4" + "lodash" "^4.17.15" + "meow" "^8.0.0" + "split2" "^2.0.0" + "through2" "^4.0.0" + "trim-off-newlines" "^1.0.0" + +"cookie@^0.4.1": + "integrity" "sha512-ZwrFkGJxUR3EIoXtO+yVE69Eb7KlixbaeAWfBQB9vVsNn/o+Yw69gBWSSDK825hQNdN+wF8zELf3dFNl/kxkUA==" + "resolved" "https://registry.npmjs.org/cookie/-/cookie-0.4.1.tgz" + "version" "0.4.1" + +"copy-descriptor@^0.1.0": + "integrity" "sha1-Z29us8OZl8LuGsOpJP1hJHSPV40=" + "resolved" "https://registry.npmjs.org/copy-descriptor/-/copy-descriptor-0.1.1.tgz" + "version" "0.1.1" + +"core-js-pure@^3.0.1": + "integrity" "sha512-Lb+/XT4WC4PaCWWtZpNPaXmjiNDUe5CJuUtbkMrIM1kb1T/jJoAIp+bkVP/r5lHzMr+ZAAF8XHp7+my6Ol0ysQ==" + "resolved" "https://registry.npmjs.org/core-js-pure/-/core-js-pure-3.22.2.tgz" + "version" "3.22.2" + +"core-js@^3.6.1": + "integrity" "sha512-KPYXeVZYemC2TkNEkX/01I+7yd+nX3KddKwZ1Ww7SKWdI2wQprSgLmrTddT8nw92AjEklTsPBoSdQBhbI1bQ6Q==" + "resolved" "https://registry.npmjs.org/core-js/-/core-js-3.8.3.tgz" + "version" "3.8.3" + +"core-util-is@~1.0.0": + "integrity" "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=" + "resolved" "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz" + "version" "1.0.2" + +"cosmiconfig@^7.0.0": + "integrity" "sha512-pondGvTuVYDk++upghXJabWzL6Kxu6f26ljFw64Swq9v6sQPUL3EUlVDV56diOjpCayKihL6hVe8exIACU4XcA==" + "resolved" "https://registry.npmjs.org/cosmiconfig/-/cosmiconfig-7.0.0.tgz" + "version" "7.0.0" dependencies: "@types/parse-json" "^4.0.0" - import-fresh "^3.2.1" - parse-json "^5.0.0" - path-type "^4.0.0" - yaml "^1.10.0" - -crc-32@^1.2.0: - version "1.2.0" - resolved "https://registry.npmjs.org/crc-32/-/crc-32-1.2.0.tgz" - integrity sha512-1uBwHxF+Y/4yF5G48fwnKq6QsIXheor3ZLPT80yGBV1oEUwpPojlEhQbWKVw1VwcTQyMGHK1/XMmTjmlsmTTGA== - dependencies: - exit-on-epipe "~1.0.1" - printj "~1.1.0" - -create-hash@^1.1.0, create-hash@^1.1.2, create-hash@^1.2.0: - version "1.2.0" - resolved "https://registry.npmjs.org/create-hash/-/create-hash-1.2.0.tgz" - integrity sha512-z00bCGNHDG8mHAkP7CtT1qVu+bFQUPjYq/4Iv3C3kWjTFV10zIjfSoeqXo9Asws8gwSHDGj/hl2u4OGIjapeCg== - dependencies: - cipher-base "^1.0.1" - inherits "^2.0.1" - md5.js "^1.3.4" - ripemd160 "^2.0.1" - sha.js "^2.4.0" - -create-hmac@^1.1.4, create-hmac@^1.1.7: - version "1.1.7" - resolved "https://registry.npmjs.org/create-hmac/-/create-hmac-1.1.7.tgz" - integrity sha512-MJG9liiZ+ogc4TzUwuvbER1JRdgvUFSB5+VR/g5h82fGaIRWMWddtKBHi7/sVhfjQZ6SehlyhvQYrcYkaUIpLg== - dependencies: - cipher-base "^1.0.3" - create-hash "^1.1.0" - inherits "^2.0.1" - ripemd160 "^2.0.0" - safe-buffer "^5.0.1" - sha.js "^2.4.8" - -cross-spawn@^5.0.1: - version "5.1.0" - resolved "https://registry.npmjs.org/cross-spawn/-/cross-spawn-5.1.0.tgz" - integrity sha1-6L0O/uWPz/b4+UUQoKVUu/ojVEk= - dependencies: - lru-cache "^4.0.1" - shebang-command "^1.2.0" - which "^1.2.9" - -cross-spawn@^7.0.0: - version "7.0.3" - resolved "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz" - integrity sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w== - dependencies: - path-key "^3.1.0" - shebang-command "^2.0.0" - which "^2.0.1" - -dargs@^7.0.0: - version "7.0.0" - resolved "https://registry.npmjs.org/dargs/-/dargs-7.0.0.tgz" - integrity sha512-2iy1EkLdlBzQGvbweYRFxmFath8+K7+AKB0TlhHWkNuH+TmovaMH/Wp7V7R4u7f4SnX3OgLsU9t1NI9ioDnUpg== - -debug@3.1.0: - version "3.1.0" - resolved "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz" - integrity sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g== - dependencies: - ms "2.0.0" - -debug@3.2.6: - version "3.2.6" - resolved "https://registry.npmjs.org/debug/-/debug-3.2.6.tgz" - integrity sha512-mel+jf7nrtEl5Pn1Qx46zARXKDpBbvzezse7p7LqINmdoIk8PYP5SySaxEmYv6TZ0JyEKA1hsCId6DIhgITtWQ== - dependencies: - ms "^2.1.1" - -debug@4, debug@^4.1.1: - version "4.3.2" - resolved "https://registry.npmjs.org/debug/-/debug-4.3.2.tgz" - integrity sha512-mOp8wKcvj7XxC78zLgw/ZA+6TSgkoE2C/ienthhRD298T7UNwAg9diBpLRxC0mOezLl4B0xV7M0cCO6P/O0Xhw== - dependencies: - ms "2.1.2" - -debug@^2.2.0, debug@^2.3.3: - version "2.6.9" - resolved "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz" - integrity sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA== - dependencies: - ms "2.0.0" - -decamelize-keys@^1.1.0: - version "1.1.0" - resolved "https://registry.npmjs.org/decamelize-keys/-/decamelize-keys-1.1.0.tgz" - integrity sha1-0XGoeTMlKAfrPLYdwcFEXQeN8tk= - dependencies: - decamelize "^1.1.0" - map-obj "^1.0.0" - -decamelize@^1.1.0, decamelize@^1.1.1, decamelize@^1.2.0: - version "1.2.0" - resolved "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz" - integrity sha1-9lNNFRSCabIDUue+4m9QH5oZEpA= - -decode-uri-component@^0.2.0: - version "0.2.0" - resolved "https://registry.npmjs.org/decode-uri-component/-/decode-uri-component-0.2.0.tgz" - integrity sha1-6zkTMzRYd1y4TNGh+uBiEGu4dUU= - -deferred-leveldown@~5.3.0: - version "5.3.0" - resolved "https://registry.npmjs.org/deferred-leveldown/-/deferred-leveldown-5.3.0.tgz" - integrity sha512-a59VOT+oDy7vtAbLRCZwWgxu2BaCfd5Hk7wxJd48ei7I+nsg8Orlb9CLG0PMZienk9BSUKgeAqkO2+Lw+1+Ukw== - dependencies: - abstract-leveldown "~6.2.1" - inherits "^2.0.3" - -define-properties@^1.1.2, define-properties@^1.1.3: - version "1.1.3" - resolved "https://registry.npmjs.org/define-properties/-/define-properties-1.1.3.tgz" - integrity sha512-3MqfYKj2lLzdMSf8ZIZE/V+Zuy+BgD6f164e8K2w7dgnpKArBDerGYpM46IYYcjnkdPNMjPk9A6VFB8+3SKlXQ== - dependencies: - object-keys "^1.0.12" - -define-property@^0.2.5: - version "0.2.5" - resolved "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz" - integrity sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY= - dependencies: - is-descriptor "^0.1.0" - -define-property@^1.0.0: - version "1.0.0" - resolved "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz" - integrity sha1-dp66rz9KY6rTr56NMEybvnm/sOY= - dependencies: - is-descriptor "^1.0.0" - -define-property@^2.0.2: - version "2.0.2" - resolved "https://registry.npmjs.org/define-property/-/define-property-2.0.2.tgz" - integrity sha512-jwK2UV4cnPpbcG7+VRARKTZPUWowwXA8bzH5NP6ud0oeAxyYPuGZUAC7hMugpCdz4BeSZl2Dl9k66CHJ/46ZYQ== - dependencies: - is-descriptor "^1.0.2" - isobject "^3.0.1" - -depd@~1.1.2: - version "1.1.2" - resolved "https://registry.npmjs.org/depd/-/depd-1.1.2.tgz" - integrity sha1-m81S4UwJd2PnSbJ0xDRu0uVgtak= - -diff@3.3.1: - version "3.3.1" - resolved "https://registry.npmjs.org/diff/-/diff-3.3.1.tgz" - integrity sha512-MKPHZDMB0o6yHyDryUOScqZibp914ksXwAMYMTHj6KO8UeKsRYNJD3oNCKjTqZon+V488P7N/HzXF8t7ZR95ww== - -diff@3.5.0, diff@^3.5.0: - version "3.5.0" - resolved "https://registry.npmjs.org/diff/-/diff-3.5.0.tgz" - integrity sha512-A46qtFgd+g7pDZinpnwiRJtxbC1hpgf0uzP3iG89scHk0AUC7A1TGxf5OiiOUv/JMZR8GOt8hL900hV0bOy5xA== - -dir-to-object@^2.0.0: - version "2.0.0" - resolved "https://registry.npmjs.org/dir-to-object/-/dir-to-object-2.0.0.tgz" - integrity sha512-sXs0JKIhymON7T1UZuO2Ud6VTNAx/VTBXIl4+3mjb2RgfOpt+hectX0x04YqPOPdkeOAKoJuKqwqnXXURNPNEA== - -dot-prop@^5.1.0: - version "5.3.0" - resolved "https://registry.npmjs.org/dot-prop/-/dot-prop-5.3.0.tgz" - integrity sha512-QM8q3zDe58hqUqjraQOmzZ1LIH9SWQJTlEKCH4kJ2oQvLZk7RbQXvtDM2XEq3fwkV9CCvvH4LA0AV+ogFsBM2Q== - dependencies: - is-obj "^2.0.0" - -elliptic@6.5.4, elliptic@^6.5.2: - version "6.5.4" - resolved "https://registry.npmjs.org/elliptic/-/elliptic-6.5.4.tgz" - integrity sha512-iLhC6ULemrljPZb+QutR5TQGB+pdW6KGD5RSegS+8sorOZT+rdQFbsQFJgvN3eRqNALqJer4oQ16YvJHlU8hzQ== - dependencies: - bn.js "^4.11.9" - brorand "^1.1.0" - hash.js "^1.0.0" - hmac-drbg "^1.0.1" - inherits "^2.0.4" - minimalistic-assert "^1.0.1" - minimalistic-crypto-utils "^1.0.1" - -emoji-regex@^7.0.1: - version "7.0.3" - resolved "https://registry.npmjs.org/emoji-regex/-/emoji-regex-7.0.3.tgz" - integrity sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA== - -emoji-regex@^8.0.0: - version "8.0.0" - resolved "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz" - integrity sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A== - -emoji-regex@^9.0.0: - version "9.2.1" - resolved "https://registry.npmjs.org/emoji-regex/-/emoji-regex-9.2.1.tgz" - integrity sha512-117l1H6U4X3Krn+MrzYrL57d5H7siRHWraBs7s+LjRuFK7Fe7hJqnJ0skWlinqsycVLU5YAo6L8CsEYQ0V5prg== - -encoding-down@^6.3.0: - version "6.3.0" - resolved "https://registry.npmjs.org/encoding-down/-/encoding-down-6.3.0.tgz" - integrity sha512-QKrV0iKR6MZVJV08QY0wp1e7vF6QbhnbQhb07bwpEyuz4uZiZgPlEGdkCROuFkUwdxlFaiPIhjyarH1ee/3vhw== - dependencies: - abstract-leveldown "^6.2.1" - inherits "^2.0.3" - level-codec "^9.0.0" - level-errors "^2.0.0" - -end-of-stream@^1.1.0: - version "1.4.4" - resolved "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.4.tgz" - integrity sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q== - dependencies: - once "^1.4.0" - -enquirer@^2.3.0: - version "2.3.6" - resolved "https://registry.npmjs.org/enquirer/-/enquirer-2.3.6.tgz" - integrity sha512-yjNnPr315/FjS4zIsUxYguYUPP2e1NK4d7E7ZOLiyYCcbFBiTMyID+2wvm2w6+pZ/odMA7cRkjhsPbltwBOrLg== - dependencies: - ansi-colors "^4.1.1" - -env-paths@^2.2.0: - version "2.2.1" - resolved "https://registry.npmjs.org/env-paths/-/env-paths-2.2.1.tgz" - integrity sha512-+h1lkLKhZMTYjog1VEpJNG7NZJWcuc2DDk/qsqSTRRCOXiLjeQ1d1/udrUGhqMxUgAlwKNZ0cf2uqan5GLuS2A== - -eol@^0.9.1: - version "0.9.1" - resolved "https://registry.npmjs.org/eol/-/eol-0.9.1.tgz" - integrity sha512-Ds/TEoZjwggRoz/Q2O7SE3i4Jm66mqTDfmdHdq/7DKVk3bro9Q8h6WdXKdPqFLMoqxrDK5SVRzHVPOS6uuGtrg== - -errno@~0.1.1: - version "0.1.8" - resolved "https://registry.npmjs.org/errno/-/errno-0.1.8.tgz" - integrity sha512-dJ6oBr5SQ1VSd9qkk7ByRgb/1SH4JZjCHSW/mr63/QcXO9zLVxvJ6Oy13nio03rxpSnVDDjFor75SjVeZWPW/A== - dependencies: - prr "~1.0.1" - -error-ex@^1.3.1: - version "1.3.2" - resolved "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz" - integrity sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g== - dependencies: - is-arrayish "^0.2.1" - -es-abstract@^1.19.1: - version "1.19.1" - resolved "https://registry.npmjs.org/es-abstract/-/es-abstract-1.19.1.tgz" - integrity sha512-2vJ6tjA/UfqLm2MPs7jxVybLoB8i1t1Jd9R3kISld20sIxPcTbLuggQOUxeWeAvIUkduv/CfMjuh4WmiXr2v9w== - dependencies: - call-bind "^1.0.2" - es-to-primitive "^1.2.1" - function-bind "^1.1.1" - get-intrinsic "^1.1.1" - get-symbol-description "^1.0.0" - has "^1.0.3" - has-symbols "^1.0.2" - internal-slot "^1.0.3" - is-callable "^1.2.4" - is-negative-zero "^2.0.1" - is-regex "^1.1.4" - is-shared-array-buffer "^1.0.1" - is-string "^1.0.7" - is-weakref "^1.0.1" - object-inspect "^1.11.0" - object-keys "^1.1.1" - object.assign "^4.1.2" - string.prototype.trimend "^1.0.4" - string.prototype.trimstart "^1.0.4" - unbox-primitive "^1.0.1" - -es-to-primitive@^1.2.1: - version "1.2.1" - resolved "https://registry.npmjs.org/es-to-primitive/-/es-to-primitive-1.2.1.tgz" - integrity sha512-QCOllgZJtaUo9miYBcLChTUaHNjJF3PYs1VidD7AwiEj1kYxKeQTctLAezAOH5ZKRH0g2IgPn6KwB4IT8iRpvA== - dependencies: - is-callable "^1.1.4" - is-date-object "^1.0.1" - is-symbol "^1.0.2" - -escape-string-regexp@1.0.5, escape-string-regexp@^1.0.5: - version "1.0.5" - resolved "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz" - integrity sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ= - -escape-string-regexp@^4.0.0: - version "4.0.0" - resolved "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz" - integrity sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA== - -esprima@^4.0.0: - version "4.0.1" - resolved "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz" - integrity sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A== - -eth-sig-util@^2.5.2: - version "2.5.4" - resolved "https://registry.npmjs.org/eth-sig-util/-/eth-sig-util-2.5.4.tgz" - integrity sha512-aCMBwp8q/4wrW4QLsF/HYBOSA7TpLKmkVwP3pYQNkEEseW2Rr8Z5Uxc9/h6HX+OG3tuHo+2bINVSihIeBfym6A== - dependencies: - ethereumjs-abi "0.6.8" - ethereumjs-util "^5.1.1" - tweetnacl "^1.0.3" - tweetnacl-util "^0.15.0" - -ethereum-cryptography@^0.1.2, ethereum-cryptography@^0.1.3: - version "0.1.3" - resolved "https://registry.npmjs.org/ethereum-cryptography/-/ethereum-cryptography-0.1.3.tgz" - integrity sha512-w8/4x1SGGzc+tO97TASLja6SLd3fRIK2tLVcV2Gx4IB21hE19atll5Cq9o3d0ZmAYC/8aw0ipieTSiekAea4SQ== + "import-fresh" "^3.2.1" + "parse-json" "^5.0.0" + "path-type" "^4.0.0" + "yaml" "^1.10.0" + +"crc-32@^1.2.0": + "integrity" "sha512-ROmzCKrTnOwybPcJApAA6WBWij23HVfGVNKqqrZpuyZOHqK2CwHSvpGuyt/UNNvaIjEd8X5IFGp4Mh+Ie1IHJQ==" + "resolved" "https://registry.npmjs.org/crc-32/-/crc-32-1.2.2.tgz" + "version" "1.2.2" + +"create-hash@^1.1.0", "create-hash@^1.1.2", "create-hash@^1.2.0": + "integrity" "sha512-z00bCGNHDG8mHAkP7CtT1qVu+bFQUPjYq/4Iv3C3kWjTFV10zIjfSoeqXo9Asws8gwSHDGj/hl2u4OGIjapeCg==" + "resolved" "https://registry.npmjs.org/create-hash/-/create-hash-1.2.0.tgz" + "version" "1.2.0" + dependencies: + "cipher-base" "^1.0.1" + "inherits" "^2.0.1" + "md5.js" "^1.3.4" + "ripemd160" "^2.0.1" + "sha.js" "^2.4.0" + +"create-hmac@^1.1.4", "create-hmac@^1.1.7": + "integrity" "sha512-MJG9liiZ+ogc4TzUwuvbER1JRdgvUFSB5+VR/g5h82fGaIRWMWddtKBHi7/sVhfjQZ6SehlyhvQYrcYkaUIpLg==" + "resolved" "https://registry.npmjs.org/create-hmac/-/create-hmac-1.1.7.tgz" + "version" "1.1.7" + dependencies: + "cipher-base" "^1.0.3" + "create-hash" "^1.1.0" + "inherits" "^2.0.1" + "ripemd160" "^2.0.0" + "safe-buffer" "^5.0.1" + "sha.js" "^2.4.8" + +"cross-spawn@^5.0.1": + "integrity" "sha1-6L0O/uWPz/b4+UUQoKVUu/ojVEk=" + "resolved" "https://registry.npmjs.org/cross-spawn/-/cross-spawn-5.1.0.tgz" + "version" "5.1.0" + dependencies: + "lru-cache" "^4.0.1" + "shebang-command" "^1.2.0" + "which" "^1.2.9" + +"cross-spawn@^7.0.0": + "integrity" "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==" + "resolved" "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz" + "version" "7.0.3" + dependencies: + "path-key" "^3.1.0" + "shebang-command" "^2.0.0" + "which" "^2.0.1" + +"dargs@^7.0.0": + "integrity" "sha512-2iy1EkLdlBzQGvbweYRFxmFath8+K7+AKB0TlhHWkNuH+TmovaMH/Wp7V7R4u7f4SnX3OgLsU9t1NI9ioDnUpg==" + "resolved" "https://registry.npmjs.org/dargs/-/dargs-7.0.0.tgz" + "version" "7.0.0" + +"debug@^2.2.0", "debug@^2.3.3": + "integrity" "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==" + "resolved" "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz" + "version" "2.6.9" + dependencies: + "ms" "2.0.0" + +"debug@^4.1.1", "debug@4.3.3": + "integrity" "sha512-/zxw5+vh1Tfv+4Qn7a5nsbcJKPaSvCDhojn6FEl9vupwK2VCSDtEiEtqr8DFtzYFOdz63LBkxec7DYuc2jon6Q==" + "resolved" "https://registry.npmjs.org/debug/-/debug-4.3.3.tgz" + "version" "4.3.3" + dependencies: + "ms" "2.1.2" + +"debug@^4.3.3": + "integrity" "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==" + "resolved" "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz" + "version" "4.3.4" + dependencies: + "ms" "2.1.2" + +"debug@3.1.0": + "integrity" "sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==" + "resolved" "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz" + "version" "3.1.0" + dependencies: + "ms" "2.0.0" + +"debug@4": + "integrity" "sha512-mOp8wKcvj7XxC78zLgw/ZA+6TSgkoE2C/ienthhRD298T7UNwAg9diBpLRxC0mOezLl4B0xV7M0cCO6P/O0Xhw==" + "resolved" "https://registry.npmjs.org/debug/-/debug-4.3.2.tgz" + "version" "4.3.2" + dependencies: + "ms" "2.1.2" + +"decamelize-keys@^1.1.0": + "integrity" "sha1-0XGoeTMlKAfrPLYdwcFEXQeN8tk=" + "resolved" "https://registry.npmjs.org/decamelize-keys/-/decamelize-keys-1.1.0.tgz" + "version" "1.1.0" + dependencies: + "decamelize" "^1.1.0" + "map-obj" "^1.0.0" + +"decamelize@^1.1.0", "decamelize@^1.1.1", "decamelize@^1.2.0": + "integrity" "sha1-9lNNFRSCabIDUue+4m9QH5oZEpA=" + "resolved" "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz" + "version" "1.2.0" + +"decamelize@^4.0.0": + "integrity" "sha512-9iE1PgSik9HeIIw2JO94IidnE3eBoQrFJ3w7sFuzSX4DpmZ3v5sZpUiV5Swcf6mQEF+Y0ru8Neo+p+nyh2J+hQ==" + "resolved" "https://registry.npmjs.org/decamelize/-/decamelize-4.0.0.tgz" + "version" "4.0.0" + +"decode-uri-component@^0.2.0": + "integrity" "sha1-6zkTMzRYd1y4TNGh+uBiEGu4dUU=" + "resolved" "https://registry.npmjs.org/decode-uri-component/-/decode-uri-component-0.2.0.tgz" + "version" "0.2.0" + +"deferred-leveldown@~5.3.0": + "integrity" "sha512-a59VOT+oDy7vtAbLRCZwWgxu2BaCfd5Hk7wxJd48ei7I+nsg8Orlb9CLG0PMZienk9BSUKgeAqkO2+Lw+1+Ukw==" + "resolved" "https://registry.npmjs.org/deferred-leveldown/-/deferred-leveldown-5.3.0.tgz" + "version" "5.3.0" + dependencies: + "abstract-leveldown" "~6.2.1" + "inherits" "^2.0.3" + +"define-property@^0.2.5": + "integrity" "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=" + "resolved" "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz" + "version" "0.2.5" + dependencies: + "is-descriptor" "^0.1.0" + +"define-property@^1.0.0": + "integrity" "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=" + "resolved" "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz" + "version" "1.0.0" + dependencies: + "is-descriptor" "^1.0.0" + +"define-property@^2.0.2": + "integrity" "sha512-jwK2UV4cnPpbcG7+VRARKTZPUWowwXA8bzH5NP6ud0oeAxyYPuGZUAC7hMugpCdz4BeSZl2Dl9k66CHJ/46ZYQ==" + "resolved" "https://registry.npmjs.org/define-property/-/define-property-2.0.2.tgz" + "version" "2.0.2" + dependencies: + "is-descriptor" "^1.0.2" + "isobject" "^3.0.1" + +"depd@~1.1.2": + "integrity" "sha1-m81S4UwJd2PnSbJ0xDRu0uVgtak=" + "resolved" "https://registry.npmjs.org/depd/-/depd-1.1.2.tgz" + "version" "1.1.2" + +"diff@^3.5.0": + "integrity" "sha512-A46qtFgd+g7pDZinpnwiRJtxbC1hpgf0uzP3iG89scHk0AUC7A1TGxf5OiiOUv/JMZR8GOt8hL900hV0bOy5xA==" + "resolved" "https://registry.npmjs.org/diff/-/diff-3.5.0.tgz" + "version" "3.5.0" + +"diff@3.3.1": + "integrity" "sha512-MKPHZDMB0o6yHyDryUOScqZibp914ksXwAMYMTHj6KO8UeKsRYNJD3oNCKjTqZon+V488P7N/HzXF8t7ZR95ww==" + "resolved" "https://registry.npmjs.org/diff/-/diff-3.3.1.tgz" + "version" "3.3.1" + +"diff@5.0.0": + "integrity" "sha512-/VTCrvm5Z0JGty/BWHljh+BAiw3IK+2j87NGMu8Nwc/f48WoDAC395uomO9ZD117ZOBaHmkX1oyLvkVM/aIT3w==" + "resolved" "https://registry.npmjs.org/diff/-/diff-5.0.0.tgz" + "version" "5.0.0" + +"dot-prop@^5.1.0": + "integrity" "sha512-QM8q3zDe58hqUqjraQOmzZ1LIH9SWQJTlEKCH4kJ2oQvLZk7RbQXvtDM2XEq3fwkV9CCvvH4LA0AV+ogFsBM2Q==" + "resolved" "https://registry.npmjs.org/dot-prop/-/dot-prop-5.3.0.tgz" + "version" "5.3.0" + dependencies: + "is-obj" "^2.0.0" + +"elliptic@^6.5.2", "elliptic@^6.5.4", "elliptic@6.5.4": + "integrity" "sha512-iLhC6ULemrljPZb+QutR5TQGB+pdW6KGD5RSegS+8sorOZT+rdQFbsQFJgvN3eRqNALqJer4oQ16YvJHlU8hzQ==" + "resolved" "https://registry.npmjs.org/elliptic/-/elliptic-6.5.4.tgz" + "version" "6.5.4" + dependencies: + "bn.js" "^4.11.9" + "brorand" "^1.1.0" + "hash.js" "^1.0.0" + "hmac-drbg" "^1.0.1" + "inherits" "^2.0.4" + "minimalistic-assert" "^1.0.1" + "minimalistic-crypto-utils" "^1.0.1" + +"emoji-regex@^10.0.0": + "integrity" "sha512-xAEnNCT3w2Tg6MA7ly6QqYJvEoY1tm9iIjJ3yMKK9JPlWuRHAMoe5iETwQnx3M9TVbFMfsrBgWKR+IsmswwNjg==" + "resolved" "https://registry.npmjs.org/emoji-regex/-/emoji-regex-10.1.0.tgz" + "version" "10.1.0" + +"emoji-regex@^8.0.0": + "integrity" "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==" + "resolved" "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz" + "version" "8.0.0" + +"encoding-down@^6.3.0": + "integrity" "sha512-QKrV0iKR6MZVJV08QY0wp1e7vF6QbhnbQhb07bwpEyuz4uZiZgPlEGdkCROuFkUwdxlFaiPIhjyarH1ee/3vhw==" + "resolved" "https://registry.npmjs.org/encoding-down/-/encoding-down-6.3.0.tgz" + "version" "6.3.0" + dependencies: + "abstract-leveldown" "^6.2.1" + "inherits" "^2.0.3" + "level-codec" "^9.0.0" + "level-errors" "^2.0.0" + +"end-of-stream@^1.1.0": + "integrity" "sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q==" + "resolved" "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.4.tgz" + "version" "1.4.4" + dependencies: + "once" "^1.4.0" + +"enquirer@^2.3.0": + "integrity" "sha512-yjNnPr315/FjS4zIsUxYguYUPP2e1NK4d7E7ZOLiyYCcbFBiTMyID+2wvm2w6+pZ/odMA7cRkjhsPbltwBOrLg==" + "resolved" "https://registry.npmjs.org/enquirer/-/enquirer-2.3.6.tgz" + "version" "2.3.6" + dependencies: + "ansi-colors" "^4.1.1" + +"env-paths@^2.2.0": + "integrity" "sha512-+h1lkLKhZMTYjog1VEpJNG7NZJWcuc2DDk/qsqSTRRCOXiLjeQ1d1/udrUGhqMxUgAlwKNZ0cf2uqan5GLuS2A==" + "resolved" "https://registry.npmjs.org/env-paths/-/env-paths-2.2.1.tgz" + "version" "2.2.1" + +"eol@^0.9.1": + "integrity" "sha512-Ds/TEoZjwggRoz/Q2O7SE3i4Jm66mqTDfmdHdq/7DKVk3bro9Q8h6WdXKdPqFLMoqxrDK5SVRzHVPOS6uuGtrg==" + "resolved" "https://registry.npmjs.org/eol/-/eol-0.9.1.tgz" + "version" "0.9.1" + +"errno@~0.1.1": + "integrity" "sha512-dJ6oBr5SQ1VSd9qkk7ByRgb/1SH4JZjCHSW/mr63/QcXO9zLVxvJ6Oy13nio03rxpSnVDDjFor75SjVeZWPW/A==" + "resolved" "https://registry.npmjs.org/errno/-/errno-0.1.8.tgz" + "version" "0.1.8" + dependencies: + "prr" "~1.0.1" + +"error-ex@^1.3.1": + "integrity" "sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==" + "resolved" "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz" + "version" "1.3.2" + dependencies: + "is-arrayish" "^0.2.1" + +"escalade@^3.1.1": + "integrity" "sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw==" + "resolved" "https://registry.npmjs.org/escalade/-/escalade-3.1.1.tgz" + "version" "3.1.1" + +"escape-string-regexp@^1.0.5", "escape-string-regexp@1.0.5": + "integrity" "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=" + "resolved" "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz" + "version" "1.0.5" + +"escape-string-regexp@^4.0.0": + "integrity" "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==" + "resolved" "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz" + "version" "4.0.0" + +"escape-string-regexp@4.0.0": + "integrity" "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==" + "resolved" "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz" + "version" "4.0.0" + +"ethereum-cryptography@^0.1.2", "ethereum-cryptography@^0.1.3": + "integrity" "sha512-w8/4x1SGGzc+tO97TASLja6SLd3fRIK2tLVcV2Gx4IB21hE19atll5Cq9o3d0ZmAYC/8aw0ipieTSiekAea4SQ==" + "resolved" "https://registry.npmjs.org/ethereum-cryptography/-/ethereum-cryptography-0.1.3.tgz" + "version" "0.1.3" dependencies: "@types/pbkdf2" "^3.0.0" "@types/secp256k1" "^4.0.1" - blakejs "^1.1.0" - browserify-aes "^1.2.0" - bs58check "^2.1.2" - create-hash "^1.2.0" - create-hmac "^1.1.7" - hash.js "^1.1.7" - keccak "^3.0.0" - pbkdf2 "^3.0.17" - randombytes "^2.1.0" - safe-buffer "^5.1.2" - scrypt-js "^3.0.0" - secp256k1 "^4.0.1" - setimmediate "^1.0.5" - -ethereumjs-abi@0.6.8, ethereumjs-abi@^0.6.8: - version "0.6.8" - resolved "https://registry.npmjs.org/ethereumjs-abi/-/ethereumjs-abi-0.6.8.tgz" - integrity sha512-Tx0r/iXI6r+lRsdvkFDlut0N08jWMnKRZ6Gkq+Nmw75lZe4e6o3EkSnkaBP5NF6+m5PTGAr9JP43N3LyeoglsA== - dependencies: - bn.js "^4.11.8" - ethereumjs-util "^6.0.0" - -ethereumjs-util@^5.1.1: - version "5.2.1" - resolved "https://registry.npmjs.org/ethereumjs-util/-/ethereumjs-util-5.2.1.tgz" - integrity sha512-v3kT+7zdyCm1HIqWlLNrHGqHGLpGYIhjeHxQjnDXjLT2FyGJDsd3LWMYUo7pAFRrk86CR3nUJfhC81CCoJNNGQ== - dependencies: - bn.js "^4.11.0" - create-hash "^1.1.2" - elliptic "^6.5.2" - ethereum-cryptography "^0.1.3" - ethjs-util "^0.1.3" - rlp "^2.0.0" - safe-buffer "^5.1.1" - -ethereumjs-util@^6.0.0: - version "6.2.1" - resolved "https://registry.npmjs.org/ethereumjs-util/-/ethereumjs-util-6.2.1.tgz" - integrity sha512-W2Ktez4L01Vexijrm5EB6w7dg4n/TgpoYU4avuT5T3Vmnw/eCRtiBrJfQYS/DCSvDIOLn2k57GcHdeBcgVxAqw== + "blakejs" "^1.1.0" + "browserify-aes" "^1.2.0" + "bs58check" "^2.1.2" + "create-hash" "^1.2.0" + "create-hmac" "^1.1.7" + "hash.js" "^1.1.7" + "keccak" "^3.0.0" + "pbkdf2" "^3.0.17" + "randombytes" "^2.1.0" + "safe-buffer" "^5.1.2" + "scrypt-js" "^3.0.0" + "secp256k1" "^4.0.1" + "setimmediate" "^1.0.5" + +"ethereumjs-abi@^0.6.8": + "integrity" "sha512-Tx0r/iXI6r+lRsdvkFDlut0N08jWMnKRZ6Gkq+Nmw75lZe4e6o3EkSnkaBP5NF6+m5PTGAr9JP43N3LyeoglsA==" + "resolved" "https://registry.npmjs.org/ethereumjs-abi/-/ethereumjs-abi-0.6.8.tgz" + "version" "0.6.8" + dependencies: + "bn.js" "^4.11.8" + "ethereumjs-util" "^6.0.0" + +"ethereumjs-util@^6.0.0": + "integrity" "sha512-W2Ktez4L01Vexijrm5EB6w7dg4n/TgpoYU4avuT5T3Vmnw/eCRtiBrJfQYS/DCSvDIOLn2k57GcHdeBcgVxAqw==" + "resolved" "https://registry.npmjs.org/ethereumjs-util/-/ethereumjs-util-6.2.1.tgz" + "version" "6.2.1" dependencies: "@types/bn.js" "^4.11.3" - bn.js "^4.11.0" - create-hash "^1.1.2" - elliptic "^6.5.2" - ethereum-cryptography "^0.1.3" - ethjs-util "0.1.6" - rlp "^2.2.3" - -ethereumjs-util@^7.1.0, ethereumjs-util@^7.1.1, ethereumjs-util@^7.1.2: - version "7.1.3" - resolved "https://registry.npmjs.org/ethereumjs-util/-/ethereumjs-util-7.1.3.tgz" - integrity sha512-y+82tEbyASO0K0X1/SRhbJJoAlfcvq8JbrG4a5cjrOks7HS/36efU/0j2flxCPOUM++HFahk33kr/ZxyC4vNuw== + "bn.js" "^4.11.0" + "create-hash" "^1.1.2" + "elliptic" "^6.5.2" + "ethereum-cryptography" "^0.1.3" + "ethjs-util" "0.1.6" + "rlp" "^2.2.3" + +"ethereumjs-util@^6.2.1": + "integrity" "sha512-W2Ktez4L01Vexijrm5EB6w7dg4n/TgpoYU4avuT5T3Vmnw/eCRtiBrJfQYS/DCSvDIOLn2k57GcHdeBcgVxAqw==" + "resolved" "https://registry.npmjs.org/ethereumjs-util/-/ethereumjs-util-6.2.1.tgz" + "version" "6.2.1" + dependencies: + "@types/bn.js" "^4.11.3" + "bn.js" "^4.11.0" + "create-hash" "^1.1.2" + "elliptic" "^6.5.2" + "ethereum-cryptography" "^0.1.3" + "ethjs-util" "0.1.6" + "rlp" "^2.2.3" + +"ethereumjs-util@^7.1.1", "ethereumjs-util@^7.1.3", "ethereumjs-util@^7.1.4": + "integrity" "sha512-p6KmuPCX4mZIqsQzXfmSx9Y0l2hqf+VkAiwSisW3UKUFdk8ZkAt+AYaor83z2nSi6CU2zSsXMlD80hAbNEGM0A==" + "resolved" "https://registry.npmjs.org/ethereumjs-util/-/ethereumjs-util-7.1.4.tgz" + "version" "7.1.4" dependencies: "@types/bn.js" "^5.1.0" - bn.js "^5.1.2" - create-hash "^1.1.2" - ethereum-cryptography "^0.1.3" - rlp "^2.2.4" - -ethjs-util@0.1.6, ethjs-util@^0.1.3: - version "0.1.6" - resolved "https://registry.npmjs.org/ethjs-util/-/ethjs-util-0.1.6.tgz" - integrity sha512-CUnVOQq7gSpDHZVVrQW8ExxUETWrnrvXYvYz55wOU8Uj4VCgw56XC2B/fVqQN+f7gmrnRHSLVnFAwsCuNwji8w== - dependencies: - is-hex-prefixed "1.0.0" - strip-hex-prefix "1.0.0" - -ethlint@^1.2.5: - version "1.2.5" - resolved "https://registry.npmjs.org/ethlint/-/ethlint-1.2.5.tgz" - integrity sha512-x2nKK98zmd72SFWL3Ul1S6scWYf5QqG221N6/mFNMO661g7ASvTRINGIWVvHzsvflW6y4tvgMSjnTN5RCTuZug== - dependencies: - ajv "^5.2.2" - chokidar "^1.6.0" - colors "^1.1.2" - commander "^2.9.0" - diff "^3.5.0" - eol "^0.9.1" - js-string-escape "^1.0.1" - lodash "^4.14.2" - sol-digger "0.0.2" - sol-explore "1.6.1" - solium-plugin-security "0.1.1" - solparse "2.2.8" - text-table "^0.2.0" - -event-target-shim@^5.0.0: - version "5.0.1" - resolved "https://registry.npmjs.org/event-target-shim/-/event-target-shim-5.0.1.tgz" - integrity sha512-i/2XbnSz/uxRCU6+NdVJgKWDTM427+MqYbkQzD321DuCQJUqOuJKIA0IM2+W2xtYHdKOmZ4dR6fExsd4SXL+WQ== - -evp_bytestokey@^1.0.3: - version "1.0.3" - resolved "https://registry.npmjs.org/evp_bytestokey/-/evp_bytestokey-1.0.3.tgz" - integrity sha512-/f2Go4TognH/KvCISP7OUsHn85hT9nUkxxA9BEWxFn+Oj9o8ZNLm/40hdlgSLyuOimsrTKLUMEorQexp/aPQeA== - dependencies: - md5.js "^1.3.4" - safe-buffer "^5.1.1" - -execa@^0.7.0: - version "0.7.0" - resolved "https://registry.npmjs.org/execa/-/execa-0.7.0.tgz" - integrity sha1-lEvs00zEHuMqY6n68nrVpl/Fl3c= - dependencies: - cross-spawn "^5.0.1" - get-stream "^3.0.0" - is-stream "^1.1.0" - npm-run-path "^2.0.0" - p-finally "^1.0.0" - signal-exit "^3.0.0" - strip-eof "^1.0.0" - -execa@^4.0.0: - version "4.1.0" - resolved "https://registry.npmjs.org/execa/-/execa-4.1.0.tgz" - integrity sha512-j5W0//W7f8UxAn8hXVnwG8tLwdiUy4FJLcSupCg6maBYZDpyBvTApK7KyuI4bKj8KOh1r2YH+6ucuYtJv1bTZA== - dependencies: - cross-spawn "^7.0.0" - get-stream "^5.0.0" - human-signals "^1.1.1" - is-stream "^2.0.0" - merge-stream "^2.0.0" - npm-run-path "^4.0.0" - onetime "^5.1.0" - signal-exit "^3.0.2" - strip-final-newline "^2.0.0" - -exit-on-epipe@~1.0.1: - version "1.0.1" - resolved "https://registry.npmjs.org/exit-on-epipe/-/exit-on-epipe-1.0.1.tgz" - integrity sha512-h2z5mrROTxce56S+pnvAV890uu7ls7f1kEvVGJbw1OlFH3/mlJ5bkXu0KRyW94v37zzHPiUd55iLn3DA7TjWpw== - -expand-brackets@^0.1.4: - version "0.1.5" - resolved "https://registry.npmjs.org/expand-brackets/-/expand-brackets-0.1.5.tgz" - integrity sha1-3wcoTjQqgHzXM6xa9yQR5YHRF3s= - dependencies: - is-posix-bracket "^0.1.0" - -expand-brackets@^2.1.4: - version "2.1.4" - resolved "https://registry.npmjs.org/expand-brackets/-/expand-brackets-2.1.4.tgz" - integrity sha1-t3c14xXOMPa27/D4OwQVGiJEliI= - dependencies: - debug "^2.3.3" - define-property "^0.2.5" - extend-shallow "^2.0.1" - posix-character-classes "^0.1.0" - regex-not "^1.0.0" - snapdragon "^0.8.1" - to-regex "^3.0.1" - -expand-range@^1.8.1: - version "1.8.2" - resolved "https://registry.npmjs.org/expand-range/-/expand-range-1.8.2.tgz" - integrity sha1-opnv/TNf4nIeuujiV+x5ZE/IUzc= - dependencies: - fill-range "^2.1.0" - -extend-shallow@^2.0.1: - version "2.0.1" - resolved "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz" - integrity sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8= - dependencies: - is-extendable "^0.1.0" - -extend-shallow@^3.0.0, extend-shallow@^3.0.2: - version "3.0.2" - resolved "https://registry.npmjs.org/extend-shallow/-/extend-shallow-3.0.2.tgz" - integrity sha1-Jqcarwc7OfshJxcnRhMcJwQCjbg= - dependencies: - assign-symbols "^1.0.0" - is-extendable "^1.0.1" - -extglob@^0.3.1: - version "0.3.2" - resolved "https://registry.npmjs.org/extglob/-/extglob-0.3.2.tgz" - integrity sha1-Lhj/PS9JqydlzskCPwEdqo2DSaE= - dependencies: - is-extglob "^1.0.0" - -extglob@^2.0.4: - version "2.0.4" - resolved "https://registry.npmjs.org/extglob/-/extglob-2.0.4.tgz" - integrity sha512-Nmb6QXkELsuBr24CJSkilo6UHHgbekK5UiZgfE6UHD3Eb27YC6oD+bhcT+tJ6cl8dmsgdQxnWlcry8ksBIBLpw== - dependencies: - array-unique "^0.3.2" - define-property "^1.0.0" - expand-brackets "^2.1.4" - extend-shallow "^2.0.1" - fragment-cache "^0.2.1" - regex-not "^1.0.0" - snapdragon "^0.8.1" - to-regex "^3.0.1" - -fast-deep-equal@^1.0.0: - version "1.1.0" - resolved "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-1.1.0.tgz" - integrity sha1-wFNHeBfIa1HaqFPIHgWbcz0CNhQ= - -fast-json-stable-stringify@^2.0.0: - version "2.1.0" - resolved "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz" - integrity sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw== - -file-uri-to-path@1.0.0: - version "1.0.0" - resolved "https://registry.npmjs.org/file-uri-to-path/-/file-uri-to-path-1.0.0.tgz" - integrity sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw== - -filename-regex@^2.0.0: - version "2.0.1" - resolved "https://registry.npmjs.org/filename-regex/-/filename-regex-2.0.1.tgz" - integrity sha1-wcS5vuPglyXdsQa3XB4wH+LxiyY= - -fill-range@^2.1.0: - version "2.2.4" - resolved "https://registry.npmjs.org/fill-range/-/fill-range-2.2.4.tgz" - integrity sha512-cnrcCbj01+j2gTG921VZPnHbjmdAf8oQV/iGeV2kZxGSyfYjjTyY79ErsK1WJWMpw6DaApEX72binqJE+/d+5Q== - dependencies: - is-number "^2.1.0" - isobject "^2.0.0" - randomatic "^3.0.0" - repeat-element "^1.1.2" - repeat-string "^1.5.2" - -fill-range@^4.0.0: - version "4.0.0" - resolved "https://registry.npmjs.org/fill-range/-/fill-range-4.0.0.tgz" - integrity sha1-1USBHUKPmOsGpj3EAtJAPDKMOPc= - dependencies: - extend-shallow "^2.0.1" - is-number "^3.0.0" - repeat-string "^1.6.1" - to-regex-range "^2.1.0" - -fill-range@^7.0.1: - version "7.0.1" - resolved "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz" - integrity sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ== - dependencies: - to-regex-range "^5.0.1" - -find-up@3.0.0, find-up@^3.0.0: - version "3.0.0" - resolved "https://registry.npmjs.org/find-up/-/find-up-3.0.0.tgz" - integrity sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg== - dependencies: - locate-path "^3.0.0" - -find-up@^2.1.0: - version "2.1.0" - resolved "https://registry.npmjs.org/find-up/-/find-up-2.1.0.tgz" - integrity sha1-RdG35QbHF93UgndaK3eSCjwMV6c= - dependencies: - locate-path "^2.0.0" - -find-up@^4.1.0: - version "4.1.0" - resolved "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz" - integrity sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw== - dependencies: - locate-path "^5.0.0" - path-exists "^4.0.0" - -find-up@^5.0.0: - version "5.0.0" - resolved "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz" - integrity sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng== - dependencies: - locate-path "^6.0.0" - path-exists "^4.0.0" - -find-versions@^4.0.0: - version "4.0.0" - resolved "https://registry.npmjs.org/find-versions/-/find-versions-4.0.0.tgz" - integrity sha512-wgpWy002tA+wgmO27buH/9KzyEOQnKsG/R0yrcjPT9BOFm0zRBVQbZ95nRGXWMywS8YR5knRbpohio0bcJABxQ== - dependencies: - semver-regex "^3.1.2" - -flat@^4.1.0: - version "4.1.1" - resolved "https://registry.npmjs.org/flat/-/flat-4.1.1.tgz" - integrity sha512-FmTtBsHskrU6FJ2VxCnsDb84wu9zhmO3cUX2kGFb5tuwhfXxGciiT0oRY+cck35QmG+NmGh5eLz6lLCpWTqwpA== - dependencies: - is-buffer "~2.0.3" - -follow-redirects@^1.12.1: - version "1.14.4" - resolved "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.14.4.tgz" - integrity sha512-zwGkiSXC1MUJG/qmeIFH2HBJx9u0V46QGUe3YR1fXG8bXQxq7fLj0RjLZQ5nubr9qNJUZrH+xUcwXEoXNpfS+g== - -for-each@^0.3.3: - version "0.3.3" - resolved "https://registry.npmjs.org/for-each/-/for-each-0.3.3.tgz" - integrity sha512-jqYfLp7mo9vIyQf8ykW2v7A+2N4QjeCeI5+Dz9XraiO1ign81wjiH7Fb9vSOWvQfNtmSa4H2RoQTrrXivdUZmw== - dependencies: - is-callable "^1.1.3" - -for-in@^1.0.1, for-in@^1.0.2: - version "1.0.2" - resolved "https://registry.npmjs.org/for-in/-/for-in-1.0.2.tgz" - integrity sha1-gQaNKVqBQuwKxybG4iAMMPttXoA= - -for-own@^0.1.4: - version "0.1.5" - resolved "https://registry.npmjs.org/for-own/-/for-own-0.1.5.tgz" - integrity sha1-UmXGgaTylNq78XyVCbZ2OqhFEM4= - dependencies: - for-in "^1.0.1" - -fp-ts@1.19.3, fp-ts@^1.0.0: - version "1.19.3" - resolved "https://registry.npmjs.org/fp-ts/-/fp-ts-1.19.3.tgz" - integrity sha512-H5KQDspykdHuztLTg+ajGN0Z2qUjcEf3Ybxc6hLt0k7/zPkn29XnKnxlBPyW2XIddWrGaJBzBl4VLYOtk39yZg== - -fragment-cache@^0.2.1: - version "0.2.1" - resolved "https://registry.npmjs.org/fragment-cache/-/fragment-cache-0.2.1.tgz" - integrity sha1-QpD60n8T6Jvn8zeZxrxaCr//DRk= - dependencies: - map-cache "^0.2.2" - -fs-extra@^0.30.0: - version "0.30.0" - resolved "https://registry.npmjs.org/fs-extra/-/fs-extra-0.30.0.tgz" - integrity sha1-8jP/zAjU2n1DLapEl3aYnbHfk/A= - dependencies: - graceful-fs "^4.1.2" - jsonfile "^2.1.0" - klaw "^1.0.0" - path-is-absolute "^1.0.0" - rimraf "^2.2.8" - -fs-extra@^7.0.1: - version "7.0.1" - resolved "https://registry.npmjs.org/fs-extra/-/fs-extra-7.0.1.tgz" - integrity sha512-YJDaCJZEnBmcbw13fvdAM9AwNOJwOzrE4pqMqBq5nFiEqXUqHwlK4B+3pUw6JNvfSPtX05xFHtYy/1ni01eGCw== - dependencies: - graceful-fs "^4.1.2" - jsonfile "^4.0.0" - universalify "^0.1.0" - -fs-extra@^9.0.0: - version "9.1.0" - resolved "https://registry.npmjs.org/fs-extra/-/fs-extra-9.1.0.tgz" - integrity sha512-hcg3ZmepS30/7BSFqRvoo3DOMQu7IjqxO5nCDt+zM9XWjb33Wg7ziNT+Qvqbuc3+gWpzO02JubVyk2G4Zvo1OQ== - dependencies: - at-least-node "^1.0.0" - graceful-fs "^4.2.0" - jsonfile "^6.0.1" - universalify "^2.0.0" - -fs.realpath@^1.0.0: - version "1.0.0" - resolved "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz" - integrity sha1-FQStJSMVjKpA20onh8sBQRmU6k8= - -fsevents@^1.0.0: - version "1.2.13" - resolved "https://registry.npmjs.org/fsevents/-/fsevents-1.2.13.tgz" - integrity sha512-oWb1Z6mkHIskLzEJ/XWX0srkpkTQ7vaopMQkyaEIoq0fmtFVxOthb8cCxeT+p3ynTdkk/RZwbgG4brR5BeWECw== - dependencies: - bindings "^1.5.0" - nan "^2.12.1" - -fsevents@~2.1.1: - version "2.1.3" - resolved "https://registry.npmjs.org/fsevents/-/fsevents-2.1.3.tgz" - integrity sha512-Auw9a4AxqWpa9GUfj370BMPzzyncfBABW8Mab7BGWBYDj4Isgq+cDKtx0i6u9jcX9pQDnswsaaOTgTmA5pEjuQ== - -fsevents@~2.3.2: - version "2.3.2" - resolved "https://registry.npmjs.org/fsevents/-/fsevents-2.3.2.tgz" - integrity sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA== - -function-bind@^1.1.1: - version "1.1.1" - resolved "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz" - integrity sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A== - -functional-red-black-tree@^1.0.1, functional-red-black-tree@~1.0.1: - version "1.0.1" - resolved "https://registry.npmjs.org/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz" - integrity sha1-GwqzvVU7Kg1jmdKcDj6gslIHgyc= - -get-caller-file@^1.0.1: - version "1.0.3" - resolved "https://registry.npmjs.org/get-caller-file/-/get-caller-file-1.0.3.tgz" - integrity sha512-3t6rVToeoZfYSGd8YoLFR2DJkiQrIiUrGcjvFX2mDw3bn6k2OtwHN0TNCLbBO+w8qTvimhDkv+LSscbJY1vE6w== - -get-caller-file@^2.0.1: - version "2.0.5" - resolved "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz" - integrity sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg== - -get-intrinsic@^1.0.2, get-intrinsic@^1.1.0, get-intrinsic@^1.1.1: - version "1.1.1" - resolved "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.1.1.tgz" - integrity sha512-kWZrnVM42QCiEA2Ig1bG8zjoIMOgxWwYCEeNdwY6Tv/cOSeGpcoX4pXHfKUxNKVoArnrEr2e9srnAxxGIraS9Q== - dependencies: - function-bind "^1.1.1" - has "^1.0.3" - has-symbols "^1.0.1" - -get-stdin@8.0.0: - version "8.0.0" - resolved "https://registry.npmjs.org/get-stdin/-/get-stdin-8.0.0.tgz" - integrity sha512-sY22aA6xchAzprjyqmSEQv4UbAAzRN0L2dQB0NlN5acTTK9Don6nhoc3eAbUnpZiCANAMfd/+40kVdKfFygohg== - -get-stream@^3.0.0: - version "3.0.0" - resolved "https://registry.npmjs.org/get-stream/-/get-stream-3.0.0.tgz" - integrity sha1-jpQ9E1jcN1VQVOy+LtsFqhdO3hQ= - -get-stream@^5.0.0: - version "5.2.0" - resolved "https://registry.npmjs.org/get-stream/-/get-stream-5.2.0.tgz" - integrity sha512-nBF+F1rAZVCu/p7rjzgA+Yb4lfYXrpl7a6VmJrU8wF9I1CKvP/QwPNZHnOlwbTkY6dvtFIzFMSyQXbLoTQPRpA== - dependencies: - pump "^3.0.0" - -get-symbol-description@^1.0.0: - version "1.0.0" - resolved "https://registry.npmjs.org/get-symbol-description/-/get-symbol-description-1.0.0.tgz" - integrity sha512-2EmdH1YvIQiZpltCNgkuiUnyukzxM/R6NDJX31Ke3BG1Nq5b0S2PhX59UKi9vZpPDQVdqn+1IcaAwnzTT5vCjw== - dependencies: - call-bind "^1.0.2" - get-intrinsic "^1.1.1" - -get-value@^2.0.3, get-value@^2.0.6: - version "2.0.6" - resolved "https://registry.npmjs.org/get-value/-/get-value-2.0.6.tgz" - integrity sha1-3BXKHGcjh8p2vTesCjlbogQqLCg= - -git-raw-commits@^2.0.0: - version "2.0.10" - resolved "https://registry.npmjs.org/git-raw-commits/-/git-raw-commits-2.0.10.tgz" - integrity sha512-sHhX5lsbG9SOO6yXdlwgEMQ/ljIn7qMpAbJZCGfXX2fq5T8M5SrDnpYk9/4HswTildcIqatsWa91vty6VhWSaQ== - dependencies: - dargs "^7.0.0" - lodash "^4.17.15" - meow "^8.0.0" - split2 "^3.0.0" - through2 "^4.0.0" - -glob-base@^0.3.0: - version "0.3.0" - resolved "https://registry.npmjs.org/glob-base/-/glob-base-0.3.0.tgz" - integrity sha1-27Fk9iIbHAscz4Kuoyi0l98Oo8Q= - dependencies: - glob-parent "^2.0.0" - is-glob "^2.0.0" - -glob-parent@^2.0.0: - version "2.0.0" - resolved "https://registry.npmjs.org/glob-parent/-/glob-parent-2.0.0.tgz" - integrity sha1-gTg9ctsFT8zPUzbaqQLxgvbtuyg= - dependencies: - is-glob "^2.0.0" - -glob-parent@~5.1.0, glob-parent@~5.1.2: - version "5.1.2" - resolved "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz" - integrity sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow== - dependencies: - is-glob "^4.0.1" - -glob@7.1.2: - version "7.1.2" - resolved "https://registry.npmjs.org/glob/-/glob-7.1.2.tgz" - integrity sha512-MJTUg1kjuLeQCJ+ccE4Vpa6kKVXkPYJ2mOCQyUuKLcLQsdrMCpBPUi8qVE6+YuaJkozeA9NusTAw3hLr8Xe5EQ== - dependencies: - fs.realpath "^1.0.0" - inflight "^1.0.4" - inherits "2" - minimatch "^3.0.4" - once "^1.3.0" - path-is-absolute "^1.0.0" - -glob@7.1.3: - version "7.1.3" - resolved "https://registry.npmjs.org/glob/-/glob-7.1.3.tgz" - integrity sha512-vcfuiIxogLV4DlGBHIUOwI0IbrJ8HWPc4MU7HzviGeNho/UJDfi6B5p3sHeWIQ0KGIU0Jpxi5ZHxemQfLkkAwQ== - dependencies: - fs.realpath "^1.0.0" - inflight "^1.0.4" - inherits "2" - minimatch "^3.0.4" - once "^1.3.0" - path-is-absolute "^1.0.0" - -glob@^7.1.3: - version "7.2.0" - resolved "https://registry.npmjs.org/glob/-/glob-7.2.0.tgz" - integrity sha512-lmLf6gtyrPq8tTjSmrO94wBeQbFR3HbLHbuyD69wuyQkImp2hWqMGB47OX65FBkPffO641IP9jWa1z4ivqG26Q== - dependencies: - fs.realpath "^1.0.0" - inflight "^1.0.4" - inherits "2" - minimatch "^3.0.4" - once "^1.3.0" - path-is-absolute "^1.0.0" - -global-dirs@^0.1.1: - version "0.1.1" - resolved "https://registry.npmjs.org/global-dirs/-/global-dirs-0.1.1.tgz" - integrity sha1-sxnA3UYH81PzvpzKTHL8FIxJ9EU= - dependencies: - ini "^1.3.4" - -graceful-fs@^4.1.11, graceful-fs@^4.1.2, graceful-fs@^4.1.6, graceful-fs@^4.1.9, graceful-fs@^4.2.0: - version "4.2.4" - resolved "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.4.tgz" - integrity sha512-WjKPNJF79dtJAVniUlGGWHYGz2jWxT6VhN/4m1NdkbZ2nOsEF+cI1Edgql5zCRhs/VsQYRvrXctxktVXZUkixw== - -growl@1.10.3: - version "1.10.3" - resolved "https://registry.npmjs.org/growl/-/growl-1.10.3.tgz" - integrity sha512-hKlsbA5Vu3xsh1Cg3J7jSmX/WaW6A5oBeqzM88oNbCRQFz+zUaXm6yxS4RVytp1scBoJzSYl4YAEOQIt6O8V1Q== - -growl@1.10.5: - version "1.10.5" - resolved "https://registry.npmjs.org/growl/-/growl-1.10.5.tgz" - integrity sha512-qBr4OuELkhPenW6goKVXiv47US3clb3/IbuWF9KNKEijAy9oeHxU9IgzjvJhHkUzhaj7rOUD7+YGWqUjLp5oSA== - -hard-rejection@^2.1.0: - version "2.1.0" - resolved "https://registry.npmjs.org/hard-rejection/-/hard-rejection-2.1.0.tgz" - integrity sha512-VIZB+ibDhx7ObhAe7OVtoEbuP4h/MuOTHJ+J8h/eBXotJYl0fBgR72xDFCKgIh22OJZIOVNxBMWuhAr10r8HdA== - -hardhat@^2.6.8: - version "2.6.8" - resolved "https://registry.yarnpkg.com/hardhat/-/hardhat-2.6.8.tgz#9ef6f8c16f9044acb95609d15a760b89177b8181" - integrity sha512-iRVd5DgcIVV3rNXMlogOfwlXAhHp7Wy/OjjFiUhTey8Unvo6oq5+Is5ANiKVN+Iw07Pcb/HpkGt7jCB6a4ITgg== - dependencies: - "@ethereumjs/block" "^3.4.0" - "@ethereumjs/blockchain" "^5.4.0" - "@ethereumjs/common" "^2.4.0" - "@ethereumjs/tx" "^3.3.0" - "@ethereumjs/vm" "^5.5.2" + "bn.js" "^5.1.2" + "create-hash" "^1.1.2" + "ethereum-cryptography" "^0.1.3" + "rlp" "^2.2.4" + +"ethjs-util@^0.1.6", "ethjs-util@0.1.6": + "integrity" "sha512-CUnVOQq7gSpDHZVVrQW8ExxUETWrnrvXYvYz55wOU8Uj4VCgw56XC2B/fVqQN+f7gmrnRHSLVnFAwsCuNwji8w==" + "resolved" "https://registry.npmjs.org/ethjs-util/-/ethjs-util-0.1.6.tgz" + "version" "0.1.6" + dependencies: + "is-hex-prefixed" "1.0.0" + "strip-hex-prefix" "1.0.0" + +"ethlint@^1.2.5": + "integrity" "sha512-x2nKK98zmd72SFWL3Ul1S6scWYf5QqG221N6/mFNMO661g7ASvTRINGIWVvHzsvflW6y4tvgMSjnTN5RCTuZug==" + "resolved" "https://registry.npmjs.org/ethlint/-/ethlint-1.2.5.tgz" + "version" "1.2.5" + dependencies: + "ajv" "^5.2.2" + "chokidar" "^1.6.0" + "colors" "^1.1.2" + "commander" "^2.9.0" + "diff" "^3.5.0" + "eol" "^0.9.1" + "js-string-escape" "^1.0.1" + "lodash" "^4.14.2" + "sol-digger" "0.0.2" + "sol-explore" "1.6.1" + "solium-plugin-security" "0.1.1" + "solparse" "2.2.8" + "text-table" "^0.2.0" + +"event-target-shim@^5.0.0": + "integrity" "sha512-i/2XbnSz/uxRCU6+NdVJgKWDTM427+MqYbkQzD321DuCQJUqOuJKIA0IM2+W2xtYHdKOmZ4dR6fExsd4SXL+WQ==" + "resolved" "https://registry.npmjs.org/event-target-shim/-/event-target-shim-5.0.1.tgz" + "version" "5.0.1" + +"evp_bytestokey@^1.0.3": + "integrity" "sha512-/f2Go4TognH/KvCISP7OUsHn85hT9nUkxxA9BEWxFn+Oj9o8ZNLm/40hdlgSLyuOimsrTKLUMEorQexp/aPQeA==" + "resolved" "https://registry.npmjs.org/evp_bytestokey/-/evp_bytestokey-1.0.3.tgz" + "version" "1.0.3" + dependencies: + "md5.js" "^1.3.4" + "safe-buffer" "^5.1.1" + +"execa@^0.7.0": + "integrity" "sha1-lEvs00zEHuMqY6n68nrVpl/Fl3c=" + "resolved" "https://registry.npmjs.org/execa/-/execa-0.7.0.tgz" + "version" "0.7.0" + dependencies: + "cross-spawn" "^5.0.1" + "get-stream" "^3.0.0" + "is-stream" "^1.1.0" + "npm-run-path" "^2.0.0" + "p-finally" "^1.0.0" + "signal-exit" "^3.0.0" + "strip-eof" "^1.0.0" + +"execa@^4.0.0": + "integrity" "sha512-j5W0//W7f8UxAn8hXVnwG8tLwdiUy4FJLcSupCg6maBYZDpyBvTApK7KyuI4bKj8KOh1r2YH+6ucuYtJv1bTZA==" + "resolved" "https://registry.npmjs.org/execa/-/execa-4.1.0.tgz" + "version" "4.1.0" + dependencies: + "cross-spawn" "^7.0.0" + "get-stream" "^5.0.0" + "human-signals" "^1.1.1" + "is-stream" "^2.0.0" + "merge-stream" "^2.0.0" + "npm-run-path" "^4.0.0" + "onetime" "^5.1.0" + "signal-exit" "^3.0.2" + "strip-final-newline" "^2.0.0" + +"expand-brackets@^0.1.4": + "integrity" "sha1-3wcoTjQqgHzXM6xa9yQR5YHRF3s=" + "resolved" "https://registry.npmjs.org/expand-brackets/-/expand-brackets-0.1.5.tgz" + "version" "0.1.5" + dependencies: + "is-posix-bracket" "^0.1.0" + +"expand-brackets@^2.1.4": + "integrity" "sha1-t3c14xXOMPa27/D4OwQVGiJEliI=" + "resolved" "https://registry.npmjs.org/expand-brackets/-/expand-brackets-2.1.4.tgz" + "version" "2.1.4" + dependencies: + "debug" "^2.3.3" + "define-property" "^0.2.5" + "extend-shallow" "^2.0.1" + "posix-character-classes" "^0.1.0" + "regex-not" "^1.0.0" + "snapdragon" "^0.8.1" + "to-regex" "^3.0.1" + +"expand-range@^1.8.1": + "integrity" "sha1-opnv/TNf4nIeuujiV+x5ZE/IUzc=" + "resolved" "https://registry.npmjs.org/expand-range/-/expand-range-1.8.2.tgz" + "version" "1.8.2" + dependencies: + "fill-range" "^2.1.0" + +"extend-shallow@^2.0.1": + "integrity" "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=" + "resolved" "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz" + "version" "2.0.1" + dependencies: + "is-extendable" "^0.1.0" + +"extend-shallow@^3.0.0": + "integrity" "sha1-Jqcarwc7OfshJxcnRhMcJwQCjbg=" + "resolved" "https://registry.npmjs.org/extend-shallow/-/extend-shallow-3.0.2.tgz" + "version" "3.0.2" + dependencies: + "assign-symbols" "^1.0.0" + "is-extendable" "^1.0.1" + +"extend-shallow@^3.0.2": + "integrity" "sha1-Jqcarwc7OfshJxcnRhMcJwQCjbg=" + "resolved" "https://registry.npmjs.org/extend-shallow/-/extend-shallow-3.0.2.tgz" + "version" "3.0.2" + dependencies: + "assign-symbols" "^1.0.0" + "is-extendable" "^1.0.1" + +"extglob@^0.3.1": + "integrity" "sha1-Lhj/PS9JqydlzskCPwEdqo2DSaE=" + "resolved" "https://registry.npmjs.org/extglob/-/extglob-0.3.2.tgz" + "version" "0.3.2" + dependencies: + "is-extglob" "^1.0.0" + +"extglob@^2.0.4": + "integrity" "sha512-Nmb6QXkELsuBr24CJSkilo6UHHgbekK5UiZgfE6UHD3Eb27YC6oD+bhcT+tJ6cl8dmsgdQxnWlcry8ksBIBLpw==" + "resolved" "https://registry.npmjs.org/extglob/-/extglob-2.0.4.tgz" + "version" "2.0.4" + dependencies: + "array-unique" "^0.3.2" + "define-property" "^1.0.0" + "expand-brackets" "^2.1.4" + "extend-shallow" "^2.0.1" + "fragment-cache" "^0.2.1" + "regex-not" "^1.0.0" + "snapdragon" "^0.8.1" + "to-regex" "^3.0.1" + +"fast-deep-equal@^1.0.0": + "integrity" "sha1-wFNHeBfIa1HaqFPIHgWbcz0CNhQ=" + "resolved" "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-1.1.0.tgz" + "version" "1.1.0" + +"fast-json-stable-stringify@^2.0.0": + "integrity" "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==" + "resolved" "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz" + "version" "2.1.0" + +"file-uri-to-path@1.0.0": + "integrity" "sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw==" + "resolved" "https://registry.npmjs.org/file-uri-to-path/-/file-uri-to-path-1.0.0.tgz" + "version" "1.0.0" + +"filename-regex@^2.0.0": + "integrity" "sha1-wcS5vuPglyXdsQa3XB4wH+LxiyY=" + "resolved" "https://registry.npmjs.org/filename-regex/-/filename-regex-2.0.1.tgz" + "version" "2.0.1" + +"fill-range@^2.1.0": + "integrity" "sha512-cnrcCbj01+j2gTG921VZPnHbjmdAf8oQV/iGeV2kZxGSyfYjjTyY79ErsK1WJWMpw6DaApEX72binqJE+/d+5Q==" + "resolved" "https://registry.npmjs.org/fill-range/-/fill-range-2.2.4.tgz" + "version" "2.2.4" + dependencies: + "is-number" "^2.1.0" + "isobject" "^2.0.0" + "randomatic" "^3.0.0" + "repeat-element" "^1.1.2" + "repeat-string" "^1.5.2" + +"fill-range@^4.0.0": + "integrity" "sha1-1USBHUKPmOsGpj3EAtJAPDKMOPc=" + "resolved" "https://registry.npmjs.org/fill-range/-/fill-range-4.0.0.tgz" + "version" "4.0.0" + dependencies: + "extend-shallow" "^2.0.1" + "is-number" "^3.0.0" + "repeat-string" "^1.6.1" + "to-regex-range" "^2.1.0" + +"fill-range@^7.0.1": + "integrity" "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==" + "resolved" "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz" + "version" "7.0.1" + dependencies: + "to-regex-range" "^5.0.1" + +"find-up@^2.1.0": + "integrity" "sha1-RdG35QbHF93UgndaK3eSCjwMV6c=" + "resolved" "https://registry.npmjs.org/find-up/-/find-up-2.1.0.tgz" + "version" "2.1.0" + dependencies: + "locate-path" "^2.0.0" + +"find-up@^4.1.0": + "integrity" "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==" + "resolved" "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz" + "version" "4.1.0" + dependencies: + "locate-path" "^5.0.0" + "path-exists" "^4.0.0" + +"find-up@^5.0.0": + "integrity" "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==" + "resolved" "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz" + "version" "5.0.0" + dependencies: + "locate-path" "^6.0.0" + "path-exists" "^4.0.0" + +"find-up@5.0.0": + "integrity" "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==" + "resolved" "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz" + "version" "5.0.0" + dependencies: + "locate-path" "^6.0.0" + "path-exists" "^4.0.0" + +"find-versions@^4.0.0": + "integrity" "sha512-wgpWy002tA+wgmO27buH/9KzyEOQnKsG/R0yrcjPT9BOFm0zRBVQbZ95nRGXWMywS8YR5knRbpohio0bcJABxQ==" + "resolved" "https://registry.npmjs.org/find-versions/-/find-versions-4.0.0.tgz" + "version" "4.0.0" + dependencies: + "semver-regex" "^3.1.2" + +"flat@^5.0.2": + "integrity" "sha512-b6suED+5/3rTpUBdG1gupIl8MPFCAMA0QXwmljLhvCUKcUvdE4gWky9zpuGCcXHOsz4J9wPGNWq6OKpmIzz3hQ==" + "resolved" "https://registry.npmjs.org/flat/-/flat-5.0.2.tgz" + "version" "5.0.2" + +"follow-redirects@^1.12.1": + "integrity" "sha512-zwGkiSXC1MUJG/qmeIFH2HBJx9u0V46QGUe3YR1fXG8bXQxq7fLj0RjLZQ5nubr9qNJUZrH+xUcwXEoXNpfS+g==" + "resolved" "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.14.4.tgz" + "version" "1.14.4" + +"for-in@^1.0.1", "for-in@^1.0.2": + "integrity" "sha1-gQaNKVqBQuwKxybG4iAMMPttXoA=" + "resolved" "https://registry.npmjs.org/for-in/-/for-in-1.0.2.tgz" + "version" "1.0.2" + +"for-own@^0.1.4": + "integrity" "sha1-UmXGgaTylNq78XyVCbZ2OqhFEM4=" + "resolved" "https://registry.npmjs.org/for-own/-/for-own-0.1.5.tgz" + "version" "0.1.5" + dependencies: + "for-in" "^1.0.1" + +"fp-ts@^1.0.0", "fp-ts@1.19.3": + "integrity" "sha512-H5KQDspykdHuztLTg+ajGN0Z2qUjcEf3Ybxc6hLt0k7/zPkn29XnKnxlBPyW2XIddWrGaJBzBl4VLYOtk39yZg==" + "resolved" "https://registry.npmjs.org/fp-ts/-/fp-ts-1.19.3.tgz" + "version" "1.19.3" + +"fragment-cache@^0.2.1": + "integrity" "sha1-QpD60n8T6Jvn8zeZxrxaCr//DRk=" + "resolved" "https://registry.npmjs.org/fragment-cache/-/fragment-cache-0.2.1.tgz" + "version" "0.2.1" + dependencies: + "map-cache" "^0.2.2" + +"fs-extra@^0.30.0": + "integrity" "sha1-8jP/zAjU2n1DLapEl3aYnbHfk/A=" + "resolved" "https://registry.npmjs.org/fs-extra/-/fs-extra-0.30.0.tgz" + "version" "0.30.0" + dependencies: + "graceful-fs" "^4.1.2" + "jsonfile" "^2.1.0" + "klaw" "^1.0.0" + "path-is-absolute" "^1.0.0" + "rimraf" "^2.2.8" + +"fs-extra@^7.0.1": + "integrity" "sha512-YJDaCJZEnBmcbw13fvdAM9AwNOJwOzrE4pqMqBq5nFiEqXUqHwlK4B+3pUw6JNvfSPtX05xFHtYy/1ni01eGCw==" + "resolved" "https://registry.npmjs.org/fs-extra/-/fs-extra-7.0.1.tgz" + "version" "7.0.1" + dependencies: + "graceful-fs" "^4.1.2" + "jsonfile" "^4.0.0" + "universalify" "^0.1.0" + +"fs-extra@^9.0.0": + "integrity" "sha512-hcg3ZmepS30/7BSFqRvoo3DOMQu7IjqxO5nCDt+zM9XWjb33Wg7ziNT+Qvqbuc3+gWpzO02JubVyk2G4Zvo1OQ==" + "resolved" "https://registry.npmjs.org/fs-extra/-/fs-extra-9.1.0.tgz" + "version" "9.1.0" + dependencies: + "at-least-node" "^1.0.0" + "graceful-fs" "^4.2.0" + "jsonfile" "^6.0.1" + "universalify" "^2.0.0" + +"fs.realpath@^1.0.0": + "integrity" "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=" + "resolved" "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz" + "version" "1.0.0" + +"fsevents@^1.0.0": + "integrity" "sha512-oWb1Z6mkHIskLzEJ/XWX0srkpkTQ7vaopMQkyaEIoq0fmtFVxOthb8cCxeT+p3ynTdkk/RZwbgG4brR5BeWECw==" + "resolved" "https://registry.npmjs.org/fsevents/-/fsevents-1.2.13.tgz" + "version" "1.2.13" + dependencies: + "bindings" "^1.5.0" + "nan" "^2.12.1" + +"fsevents@~2.3.2": + "integrity" "sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==" + "resolved" "https://registry.npmjs.org/fsevents/-/fsevents-2.3.2.tgz" + "version" "2.3.2" + +"function-bind@^1.1.1": + "integrity" "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==" + "resolved" "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz" + "version" "1.1.1" + +"functional-red-black-tree@^1.0.1", "functional-red-black-tree@~1.0.1": + "integrity" "sha1-GwqzvVU7Kg1jmdKcDj6gslIHgyc=" + "resolved" "https://registry.npmjs.org/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz" + "version" "1.0.1" + +"get-caller-file@^1.0.1": + "integrity" "sha512-3t6rVToeoZfYSGd8YoLFR2DJkiQrIiUrGcjvFX2mDw3bn6k2OtwHN0TNCLbBO+w8qTvimhDkv+LSscbJY1vE6w==" + "resolved" "https://registry.npmjs.org/get-caller-file/-/get-caller-file-1.0.3.tgz" + "version" "1.0.3" + +"get-caller-file@^2.0.1", "get-caller-file@^2.0.5": + "integrity" "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==" + "resolved" "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz" + "version" "2.0.5" + +"get-intrinsic@^1.0.2": + "integrity" "sha512-kWZrnVM42QCiEA2Ig1bG8zjoIMOgxWwYCEeNdwY6Tv/cOSeGpcoX4pXHfKUxNKVoArnrEr2e9srnAxxGIraS9Q==" + "resolved" "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.1.1.tgz" + "version" "1.1.1" + dependencies: + "function-bind" "^1.1.1" + "has" "^1.0.3" + "has-symbols" "^1.0.1" + +"get-stdin@8.0.0": + "integrity" "sha512-sY22aA6xchAzprjyqmSEQv4UbAAzRN0L2dQB0NlN5acTTK9Don6nhoc3eAbUnpZiCANAMfd/+40kVdKfFygohg==" + "resolved" "https://registry.npmjs.org/get-stdin/-/get-stdin-8.0.0.tgz" + "version" "8.0.0" + +"get-stream@^3.0.0": + "integrity" "sha1-jpQ9E1jcN1VQVOy+LtsFqhdO3hQ=" + "resolved" "https://registry.npmjs.org/get-stream/-/get-stream-3.0.0.tgz" + "version" "3.0.0" + +"get-stream@^5.0.0": + "integrity" "sha512-nBF+F1rAZVCu/p7rjzgA+Yb4lfYXrpl7a6VmJrU8wF9I1CKvP/QwPNZHnOlwbTkY6dvtFIzFMSyQXbLoTQPRpA==" + "resolved" "https://registry.npmjs.org/get-stream/-/get-stream-5.2.0.tgz" + "version" "5.2.0" + dependencies: + "pump" "^3.0.0" + +"get-value@^2.0.3", "get-value@^2.0.6": + "integrity" "sha1-3BXKHGcjh8p2vTesCjlbogQqLCg=" + "resolved" "https://registry.npmjs.org/get-value/-/get-value-2.0.6.tgz" + "version" "2.0.6" + +"git-raw-commits@^2.0.0": + "integrity" "sha512-sHhX5lsbG9SOO6yXdlwgEMQ/ljIn7qMpAbJZCGfXX2fq5T8M5SrDnpYk9/4HswTildcIqatsWa91vty6VhWSaQ==" + "resolved" "https://registry.npmjs.org/git-raw-commits/-/git-raw-commits-2.0.10.tgz" + "version" "2.0.10" + dependencies: + "dargs" "^7.0.0" + "lodash" "^4.17.15" + "meow" "^8.0.0" + "split2" "^3.0.0" + "through2" "^4.0.0" + +"glob-base@^0.3.0": + "integrity" "sha1-27Fk9iIbHAscz4Kuoyi0l98Oo8Q=" + "resolved" "https://registry.npmjs.org/glob-base/-/glob-base-0.3.0.tgz" + "version" "0.3.0" + dependencies: + "glob-parent" "^2.0.0" + "is-glob" "^2.0.0" + +"glob-parent@^2.0.0": + "integrity" "sha1-gTg9ctsFT8zPUzbaqQLxgvbtuyg=" + "resolved" "https://registry.npmjs.org/glob-parent/-/glob-parent-2.0.0.tgz" + "version" "2.0.0" + dependencies: + "is-glob" "^2.0.0" + +"glob-parent@~5.1.2": + "integrity" "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==" + "resolved" "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz" + "version" "5.1.2" + dependencies: + "is-glob" "^4.0.1" + +"glob@^7.1.3", "glob@7.2.0": + "integrity" "sha512-lmLf6gtyrPq8tTjSmrO94wBeQbFR3HbLHbuyD69wuyQkImp2hWqMGB47OX65FBkPffO641IP9jWa1z4ivqG26Q==" + "resolved" "https://registry.npmjs.org/glob/-/glob-7.2.0.tgz" + "version" "7.2.0" + dependencies: + "fs.realpath" "^1.0.0" + "inflight" "^1.0.4" + "inherits" "2" + "minimatch" "^3.0.4" + "once" "^1.3.0" + "path-is-absolute" "^1.0.0" + +"glob@7.1.2": + "integrity" "sha512-MJTUg1kjuLeQCJ+ccE4Vpa6kKVXkPYJ2mOCQyUuKLcLQsdrMCpBPUi8qVE6+YuaJkozeA9NusTAw3hLr8Xe5EQ==" + "resolved" "https://registry.npmjs.org/glob/-/glob-7.1.2.tgz" + "version" "7.1.2" + dependencies: + "fs.realpath" "^1.0.0" + "inflight" "^1.0.4" + "inherits" "2" + "minimatch" "^3.0.4" + "once" "^1.3.0" + "path-is-absolute" "^1.0.0" + +"global-dirs@^0.1.1": + "integrity" "sha1-sxnA3UYH81PzvpzKTHL8FIxJ9EU=" + "resolved" "https://registry.npmjs.org/global-dirs/-/global-dirs-0.1.1.tgz" + "version" "0.1.1" + dependencies: + "ini" "^1.3.4" + +"graceful-fs@^4.1.11", "graceful-fs@^4.1.2", "graceful-fs@^4.1.6", "graceful-fs@^4.1.9", "graceful-fs@^4.2.0": + "integrity" "sha512-WjKPNJF79dtJAVniUlGGWHYGz2jWxT6VhN/4m1NdkbZ2nOsEF+cI1Edgql5zCRhs/VsQYRvrXctxktVXZUkixw==" + "resolved" "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.4.tgz" + "version" "4.2.4" + +"growl@1.10.3": + "integrity" "sha512-hKlsbA5Vu3xsh1Cg3J7jSmX/WaW6A5oBeqzM88oNbCRQFz+zUaXm6yxS4RVytp1scBoJzSYl4YAEOQIt6O8V1Q==" + "resolved" "https://registry.npmjs.org/growl/-/growl-1.10.3.tgz" + "version" "1.10.3" + +"growl@1.10.5": + "integrity" "sha512-qBr4OuELkhPenW6goKVXiv47US3clb3/IbuWF9KNKEijAy9oeHxU9IgzjvJhHkUzhaj7rOUD7+YGWqUjLp5oSA==" + "resolved" "https://registry.npmjs.org/growl/-/growl-1.10.5.tgz" + "version" "1.10.5" + +"hard-rejection@^2.1.0": + "integrity" "sha512-VIZB+ibDhx7ObhAe7OVtoEbuP4h/MuOTHJ+J8h/eBXotJYl0fBgR72xDFCKgIh22OJZIOVNxBMWuhAr10r8HdA==" + "resolved" "https://registry.npmjs.org/hard-rejection/-/hard-rejection-2.1.0.tgz" + "version" "2.1.0" + +"hardhat@^2.9.3": + "integrity" "sha512-7Vw99RbYbMZ15UzegOR/nqIYIqddZXvLwJGaX5sX4G5bydILnbjmDU6g3jMKJSiArEixS3vHAEaOs5CW1JQ3hg==" + "resolved" "https://registry.npmjs.org/hardhat/-/hardhat-2.9.3.tgz" + "version" "2.9.3" + dependencies: + "@ethereumjs/block" "^3.6.0" + "@ethereumjs/blockchain" "^5.5.0" + "@ethereumjs/common" "^2.6.0" + "@ethereumjs/tx" "^3.4.0" + "@ethereumjs/vm" "^5.6.0" "@ethersproject/abi" "^5.1.2" + "@metamask/eth-sig-util" "^4.0.0" "@sentry/node" "^5.18.1" - "@solidity-parser/parser" "^0.14.0" + "@solidity-parser/parser" "^0.14.1" "@types/bn.js" "^5.1.0" "@types/lru-cache" "^5.1.0" - abort-controller "^3.0.0" - adm-zip "^0.4.16" - ansi-escapes "^4.3.0" - chalk "^2.4.2" - chokidar "^3.4.0" - ci-info "^2.0.0" - debug "^4.1.1" - enquirer "^2.3.0" - env-paths "^2.2.0" - eth-sig-util "^2.5.2" - ethereum-cryptography "^0.1.2" - ethereumjs-abi "^0.6.8" - ethereumjs-util "^7.1.0" - find-up "^2.1.0" - fp-ts "1.19.3" - fs-extra "^7.0.1" - glob "^7.1.3" - https-proxy-agent "^5.0.0" - immutable "^4.0.0-rc.12" - io-ts "1.10.4" - lodash "^4.17.11" - merkle-patricia-tree "^4.2.0" - mnemonist "^0.38.0" - mocha "^7.1.2" - node-fetch "^2.6.0" - qs "^6.7.0" - raw-body "^2.4.1" - resolve "1.17.0" - semver "^6.3.0" - slash "^3.0.0" - solc "0.7.3" - source-map-support "^0.5.13" - stacktrace-parser "^0.1.10" + "abort-controller" "^3.0.0" + "adm-zip" "^0.4.16" + "aggregate-error" "^3.0.0" + "ansi-escapes" "^4.3.0" + "chalk" "^2.4.2" + "chokidar" "^3.4.0" + "ci-info" "^2.0.0" + "debug" "^4.1.1" + "enquirer" "^2.3.0" + "env-paths" "^2.2.0" + "ethereum-cryptography" "^0.1.2" + "ethereumjs-abi" "^0.6.8" + "ethereumjs-util" "^7.1.3" + "find-up" "^2.1.0" + "fp-ts" "1.19.3" + "fs-extra" "^7.0.1" + "glob" "^7.1.3" + "immutable" "^4.0.0-rc.12" + "io-ts" "1.10.4" + "lodash" "^4.17.11" + "merkle-patricia-tree" "^4.2.2" + "mnemonist" "^0.38.0" + "mocha" "^9.2.0" + "p-map" "^4.0.0" + "qs" "^6.7.0" + "raw-body" "^2.4.1" + "resolve" "1.17.0" + "semver" "^6.3.0" + "slash" "^3.0.0" + "solc" "0.7.3" + "source-map-support" "^0.5.13" + "stacktrace-parser" "^0.1.10" "true-case-path" "^2.2.1" - tsort "0.0.1" - uuid "^3.3.2" - ws "^7.4.6" - -has-bigints@^1.0.1: - version "1.0.1" - resolved "https://registry.npmjs.org/has-bigints/-/has-bigints-1.0.1.tgz" - integrity sha512-LSBS2LjbNBTf6287JEbEzvJgftkF5qFkmCo9hDRpAzKhUOlJ+hx8dd4USs00SgsUNwc4617J9ki5YtEClM2ffA== - -has-flag@^2.0.0: - version "2.0.0" - resolved "https://registry.npmjs.org/has-flag/-/has-flag-2.0.0.tgz" - integrity sha1-6CB68cx7MNRGzHC3NLXovhj4jVE= - -has-flag@^3.0.0: - version "3.0.0" - resolved "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz" - integrity sha1-tdRU3CGZriJWmfNGfloH87lVuv0= - -has-flag@^4.0.0: - version "4.0.0" - resolved "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz" - integrity sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ== - -has-symbols@^1.0.0, has-symbols@^1.0.1, has-symbols@^1.0.2: - version "1.0.2" - resolved "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.2.tgz" - integrity sha512-chXa79rL/UC2KlX17jo3vRGz0azaWEx5tGqZg5pO3NUyEJVB17dMruQlzCCOfUvElghKcm5194+BCRvi2Rv/Gw== - -has-tostringtag@^1.0.0: - version "1.0.0" - resolved "https://registry.npmjs.org/has-tostringtag/-/has-tostringtag-1.0.0.tgz" - integrity sha512-kFjcSNhnlGV1kyoGk7OXKSawH5JOb/LzUc5w9B02hOTO0dfFRjbHQKvg1d6cf3HbeUmtU9VbbV3qzZ2Teh97WQ== - dependencies: - has-symbols "^1.0.2" - -has-value@^0.3.1: - version "0.3.1" - resolved "https://registry.npmjs.org/has-value/-/has-value-0.3.1.tgz" - integrity sha1-ex9YutpiyoJ+wKIHgCVlSEWZXh8= - dependencies: - get-value "^2.0.3" - has-values "^0.1.4" - isobject "^2.0.0" - -has-value@^1.0.0: - version "1.0.0" - resolved "https://registry.npmjs.org/has-value/-/has-value-1.0.0.tgz" - integrity sha1-GLKB2lhbHFxR3vJMkw7SmgvmsXc= - dependencies: - get-value "^2.0.6" - has-values "^1.0.0" - isobject "^3.0.0" - -has-values@^0.1.4: - version "0.1.4" - resolved "https://registry.npmjs.org/has-values/-/has-values-0.1.4.tgz" - integrity sha1-bWHeldkd/Km5oCCJrThL/49it3E= - -has-values@^1.0.0: - version "1.0.0" - resolved "https://registry.npmjs.org/has-values/-/has-values-1.0.0.tgz" - integrity sha1-lbC2P+whRmGab+V/51Yo1aOe/k8= - dependencies: - is-number "^3.0.0" - kind-of "^4.0.0" - -has@^1.0.3: - version "1.0.3" - resolved "https://registry.npmjs.org/has/-/has-1.0.3.tgz" - integrity sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw== - dependencies: - function-bind "^1.1.1" - -hash-base@^3.0.0: - version "3.1.0" - resolved "https://registry.npmjs.org/hash-base/-/hash-base-3.1.0.tgz" - integrity sha512-1nmYp/rhMDiE7AYkDw+lLwlAzz0AntGIe51F3RfFfEqyQ3feY2eI/NcwC6umIQVOASPMsWJLJScWKSSvzL9IVA== - dependencies: - inherits "^2.0.4" - readable-stream "^3.6.0" - safe-buffer "^5.2.0" - -hash.js@1.1.7, hash.js@^1.0.0, hash.js@^1.0.3, hash.js@^1.1.7: - version "1.1.7" - resolved "https://registry.npmjs.org/hash.js/-/hash.js-1.1.7.tgz" - integrity sha512-taOaskGt4z4SOANNseOviYDvjEJinIkRgmp7LbKP2YTTmVxWBl87s/uzK9r+44BclBSp2X7K1hqeNfz9JbBeXA== - dependencies: - inherits "^2.0.3" - minimalistic-assert "^1.0.1" - -he@1.1.1: - version "1.1.1" - resolved "https://registry.npmjs.org/he/-/he-1.1.1.tgz" - integrity sha1-k0EP0hsAlzUVH4howvJx80J+I/0= - -he@1.2.0: - version "1.2.0" - resolved "https://registry.npmjs.org/he/-/he-1.2.0.tgz" - integrity sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw== - -hmac-drbg@^1.0.1: - version "1.0.1" - resolved "https://registry.npmjs.org/hmac-drbg/-/hmac-drbg-1.0.1.tgz" - integrity sha1-0nRXAQJabHdabFRXk+1QL8DGSaE= - dependencies: - hash.js "^1.0.3" - minimalistic-assert "^1.0.0" - minimalistic-crypto-utils "^1.0.1" - -hosted-git-info@^2.1.4: - version "2.8.8" - resolved "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.8.tgz" - integrity sha512-f/wzC2QaWBs7t9IYqB4T3sR1xviIViXJRJTWBlx2Gf3g0Xi5vI7Yy4koXQ1c9OYDGHN9sBy1DQ2AB8fqZBWhUg== - -hosted-git-info@^3.0.6: - version "3.0.8" - resolved "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-3.0.8.tgz" - integrity sha512-aXpmwoOhRBrw6X3j0h5RloK4x1OzsxMPyxqIHyNfSe2pypkVTZFpEiRoSipPEPlMrh0HW/XsjkJ5WgnCirpNUw== - dependencies: - lru-cache "^6.0.0" - -http-errors@1.7.3: - version "1.7.3" - resolved "https://registry.npmjs.org/http-errors/-/http-errors-1.7.3.tgz" - integrity sha512-ZTTX0MWrsQ2ZAhA1cejAwDLycFsd7I7nVtnkT3Ol0aqodaKW+0CTZDQ1uBv5whptCnc8e8HeRRJxRs0kmm/Qfw== - dependencies: - depd "~1.1.2" - inherits "2.0.4" - setprototypeof "1.1.1" - statuses ">= 1.5.0 < 2" - toidentifier "1.0.0" - -https-proxy-agent@^5.0.0: - version "5.0.0" - resolved "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-5.0.0.tgz" - integrity sha512-EkYm5BcKUGiduxzSt3Eppko+PiNWNEpa4ySk9vTC6wDsQJW9rHSa+UhGNJoRYp7bz6Ht1eaRIa6QaJqO5rCFbA== - dependencies: - agent-base "6" - debug "4" - -human-signals@^1.1.1: - version "1.1.1" - resolved "https://registry.npmjs.org/human-signals/-/human-signals-1.1.1.tgz" - integrity sha512-SEQu7vl8KjNL2eoGBLF3+wAjpsNfA9XMlXAYj/3EdaNfAlxKthD1xjEQfGOUhllCGGJVNY34bRr6lPINhNjyZw== - -husky@^4.3.0: - version "4.3.8" - resolved "https://registry.npmjs.org/husky/-/husky-4.3.8.tgz" - integrity sha512-LCqqsB0PzJQ/AlCgfrfzRe3e3+NvmefAdKQhRYpxS4u6clblBoDdzzvHi8fmxKRzvMxPY/1WZWzomPZww0Anow== - dependencies: - chalk "^4.0.0" - ci-info "^2.0.0" - compare-versions "^3.6.0" - cosmiconfig "^7.0.0" - find-versions "^4.0.0" - opencollective-postinstall "^2.0.2" - pkg-dir "^5.0.0" - please-upgrade-node "^3.2.0" - slash "^3.0.0" - which-pm-runs "^1.0.0" - -iconv-lite@0.4.24: - version "0.4.24" - resolved "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz" - integrity sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA== - dependencies: - safer-buffer ">= 2.1.2 < 3" - -ieee754@^1.1.13: - version "1.2.1" - resolved "https://registry.npmjs.org/ieee754/-/ieee754-1.2.1.tgz" - integrity sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA== - -ignore@^5.1.4: - version "5.1.8" - resolved "https://registry.npmjs.org/ignore/-/ignore-5.1.8.tgz" - integrity sha512-BMpfD7PpiETpBl/A6S498BaIJ6Y/ABT93ETbby2fP00v4EbvPBXWEoaR1UBPKs3iR53pJY7EtZk5KACI57i1Uw== - -immediate@^3.2.3: - version "3.3.0" - resolved "https://registry.npmjs.org/immediate/-/immediate-3.3.0.tgz" - integrity sha512-HR7EVodfFUdQCTIeySw+WDRFJlPcLOJbXfwwZ7Oom6tjsvZ3bOkCDJHehQC3nxJrv7+f9XecwazynjU8e4Vw3Q== - -immediate@~3.2.3: - version "3.2.3" - resolved "https://registry.npmjs.org/immediate/-/immediate-3.2.3.tgz" - integrity sha1-0UD6j2FGWb1lQSMwl92qwlzdmRw= - -immutable@^4.0.0-rc.12: - version "4.0.0" - resolved "https://registry.npmjs.org/immutable/-/immutable-4.0.0.tgz" - integrity sha512-zIE9hX70qew5qTUjSS7wi1iwj/l7+m54KWU247nhM3v806UdGj1yDndXj+IOYxxtW9zyLI+xqFNZjTuDaLUqFw== - -import-fresh@^3.0.0, import-fresh@^3.2.1: - version "3.3.0" - resolved "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.0.tgz" - integrity sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw== - dependencies: - parent-module "^1.0.0" - resolve-from "^4.0.0" - -indent-string@^4.0.0: - version "4.0.0" - resolved "https://registry.npmjs.org/indent-string/-/indent-string-4.0.0.tgz" - integrity sha512-EdDDZu4A2OyIK7Lr/2zG+w5jmbuk1DVBnEwREQvBzspBJkCEbRa8GxU1lghYcaGJCnRWibjDXlq779X1/y5xwg== - -inflight@^1.0.4: - version "1.0.6" - resolved "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz" - integrity sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk= - dependencies: - once "^1.3.0" - wrappy "1" - -inherits@2, inherits@2.0.4, inherits@^2.0.1, inherits@^2.0.3, inherits@^2.0.4, inherits@~2.0.1, inherits@~2.0.3: - version "2.0.4" - resolved "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz" - integrity sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ== - -ini@^1.3.4: - version "1.3.8" - resolved "https://registry.npmjs.org/ini/-/ini-1.3.8.tgz" - integrity sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew== - -internal-slot@^1.0.3: - version "1.0.3" - resolved "https://registry.npmjs.org/internal-slot/-/internal-slot-1.0.3.tgz" - integrity sha512-O0DB1JC/sPyZl7cIo78n5dR7eUSwwpYPiXRhTzNxZVAMUuB8vlnRFyLxdrVToks6XPLVnFfbzaVd5WLjhgg+vA== - dependencies: - get-intrinsic "^1.1.0" - has "^1.0.3" - side-channel "^1.0.4" - -invert-kv@^1.0.0: - version "1.0.0" - resolved "https://registry.npmjs.org/invert-kv/-/invert-kv-1.0.0.tgz" - integrity sha1-EEqOSqym09jNFXqO+L+rLXo//bY= - -io-ts@1.10.4: - version "1.10.4" - resolved "https://registry.npmjs.org/io-ts/-/io-ts-1.10.4.tgz" - integrity sha512-b23PteSnYXSONJ6JQXRAlvJhuw8KOtkqa87W4wDtvMrud/DTJd5X+NpOOI+O/zZwVq6v0VLAaJ+1EDViKEuN9g== - dependencies: - fp-ts "^1.0.0" - -is-accessor-descriptor@^0.1.6: - version "0.1.6" - resolved "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz" - integrity sha1-qeEss66Nh2cn7u84Q/igiXtcmNY= - dependencies: - kind-of "^3.0.2" - -is-accessor-descriptor@^1.0.0: - version "1.0.0" - resolved "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz" - integrity sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ== - dependencies: - kind-of "^6.0.0" - -is-arrayish@^0.2.1: - version "0.2.1" - resolved "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz" - integrity sha1-d8mYQFJ6qOyxqLppe4BkWnqSap0= - -is-bigint@^1.0.1: - version "1.0.4" - resolved "https://registry.npmjs.org/is-bigint/-/is-bigint-1.0.4.tgz" - integrity sha512-zB9CruMamjym81i2JZ3UMn54PKGsQzsJeo6xvN3HJJ4CAsQNB6iRutp2To77OfCNuoxspsIhzaPoO1zyCEhFOg== - dependencies: - has-bigints "^1.0.1" - -is-binary-path@^1.0.0: - version "1.0.1" - resolved "https://registry.npmjs.org/is-binary-path/-/is-binary-path-1.0.1.tgz" - integrity sha1-dfFmQrSA8YenEcgUFh/TpKdlWJg= - dependencies: - binary-extensions "^1.0.0" + "tsort" "0.0.1" + "undici" "^4.14.1" + "uuid" "^8.3.2" + "ws" "^7.4.6" + +"has-flag@^2.0.0": + "integrity" "sha1-6CB68cx7MNRGzHC3NLXovhj4jVE=" + "resolved" "https://registry.npmjs.org/has-flag/-/has-flag-2.0.0.tgz" + "version" "2.0.0" + +"has-flag@^3.0.0": + "integrity" "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=" + "resolved" "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz" + "version" "3.0.0" + +"has-flag@^4.0.0": + "integrity" "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==" + "resolved" "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz" + "version" "4.0.0" + +"has-symbols@^1.0.1": + "integrity" "sha512-chXa79rL/UC2KlX17jo3vRGz0azaWEx5tGqZg5pO3NUyEJVB17dMruQlzCCOfUvElghKcm5194+BCRvi2Rv/Gw==" + "resolved" "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.2.tgz" + "version" "1.0.2" + +"has-value@^0.3.1": + "integrity" "sha1-ex9YutpiyoJ+wKIHgCVlSEWZXh8=" + "resolved" "https://registry.npmjs.org/has-value/-/has-value-0.3.1.tgz" + "version" "0.3.1" + dependencies: + "get-value" "^2.0.3" + "has-values" "^0.1.4" + "isobject" "^2.0.0" + +"has-value@^1.0.0": + "integrity" "sha1-GLKB2lhbHFxR3vJMkw7SmgvmsXc=" + "resolved" "https://registry.npmjs.org/has-value/-/has-value-1.0.0.tgz" + "version" "1.0.0" + dependencies: + "get-value" "^2.0.6" + "has-values" "^1.0.0" + "isobject" "^3.0.0" + +"has-values@^0.1.4": + "integrity" "sha1-bWHeldkd/Km5oCCJrThL/49it3E=" + "resolved" "https://registry.npmjs.org/has-values/-/has-values-0.1.4.tgz" + "version" "0.1.4" + +"has-values@^1.0.0": + "integrity" "sha1-lbC2P+whRmGab+V/51Yo1aOe/k8=" + "resolved" "https://registry.npmjs.org/has-values/-/has-values-1.0.0.tgz" + "version" "1.0.0" + dependencies: + "is-number" "^3.0.0" + "kind-of" "^4.0.0" + +"has@^1.0.3": + "integrity" "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==" + "resolved" "https://registry.npmjs.org/has/-/has-1.0.3.tgz" + "version" "1.0.3" + dependencies: + "function-bind" "^1.1.1" + +"hash-base@^3.0.0": + "integrity" "sha512-1nmYp/rhMDiE7AYkDw+lLwlAzz0AntGIe51F3RfFfEqyQ3feY2eI/NcwC6umIQVOASPMsWJLJScWKSSvzL9IVA==" + "resolved" "https://registry.npmjs.org/hash-base/-/hash-base-3.1.0.tgz" + "version" "3.1.0" + dependencies: + "inherits" "^2.0.4" + "readable-stream" "^3.6.0" + "safe-buffer" "^5.2.0" + +"hash.js@^1.0.0", "hash.js@^1.0.3", "hash.js@^1.1.7", "hash.js@1.1.7": + "integrity" "sha512-taOaskGt4z4SOANNseOviYDvjEJinIkRgmp7LbKP2YTTmVxWBl87s/uzK9r+44BclBSp2X7K1hqeNfz9JbBeXA==" + "resolved" "https://registry.npmjs.org/hash.js/-/hash.js-1.1.7.tgz" + "version" "1.1.7" + dependencies: + "inherits" "^2.0.3" + "minimalistic-assert" "^1.0.1" + +"he@1.1.1": + "integrity" "sha1-k0EP0hsAlzUVH4howvJx80J+I/0=" + "resolved" "https://registry.npmjs.org/he/-/he-1.1.1.tgz" + "version" "1.1.1" + +"he@1.2.0": + "integrity" "sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw==" + "resolved" "https://registry.npmjs.org/he/-/he-1.2.0.tgz" + "version" "1.2.0" + +"hmac-drbg@^1.0.1": + "integrity" "sha1-0nRXAQJabHdabFRXk+1QL8DGSaE=" + "resolved" "https://registry.npmjs.org/hmac-drbg/-/hmac-drbg-1.0.1.tgz" + "version" "1.0.1" + dependencies: + "hash.js" "^1.0.3" + "minimalistic-assert" "^1.0.0" + "minimalistic-crypto-utils" "^1.0.1" + +"hosted-git-info@^2.1.4": + "integrity" "sha512-f/wzC2QaWBs7t9IYqB4T3sR1xviIViXJRJTWBlx2Gf3g0Xi5vI7Yy4koXQ1c9OYDGHN9sBy1DQ2AB8fqZBWhUg==" + "resolved" "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.8.tgz" + "version" "2.8.8" + +"hosted-git-info@^3.0.6": + "integrity" "sha512-aXpmwoOhRBrw6X3j0h5RloK4x1OzsxMPyxqIHyNfSe2pypkVTZFpEiRoSipPEPlMrh0HW/XsjkJ5WgnCirpNUw==" + "resolved" "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-3.0.8.tgz" + "version" "3.0.8" + dependencies: + "lru-cache" "^6.0.0" + +"http-errors@1.7.3": + "integrity" "sha512-ZTTX0MWrsQ2ZAhA1cejAwDLycFsd7I7nVtnkT3Ol0aqodaKW+0CTZDQ1uBv5whptCnc8e8HeRRJxRs0kmm/Qfw==" + "resolved" "https://registry.npmjs.org/http-errors/-/http-errors-1.7.3.tgz" + "version" "1.7.3" + dependencies: + "depd" "~1.1.2" + "inherits" "2.0.4" + "setprototypeof" "1.1.1" + "statuses" ">= 1.5.0 < 2" + "toidentifier" "1.0.0" + +"https-proxy-agent@^5.0.0": + "integrity" "sha512-EkYm5BcKUGiduxzSt3Eppko+PiNWNEpa4ySk9vTC6wDsQJW9rHSa+UhGNJoRYp7bz6Ht1eaRIa6QaJqO5rCFbA==" + "resolved" "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-5.0.0.tgz" + "version" "5.0.0" + dependencies: + "agent-base" "6" + "debug" "4" + +"human-signals@^1.1.1": + "integrity" "sha512-SEQu7vl8KjNL2eoGBLF3+wAjpsNfA9XMlXAYj/3EdaNfAlxKthD1xjEQfGOUhllCGGJVNY34bRr6lPINhNjyZw==" + "resolved" "https://registry.npmjs.org/human-signals/-/human-signals-1.1.1.tgz" + "version" "1.1.1" + +"husky@^4.3.0": + "integrity" "sha512-LCqqsB0PzJQ/AlCgfrfzRe3e3+NvmefAdKQhRYpxS4u6clblBoDdzzvHi8fmxKRzvMxPY/1WZWzomPZww0Anow==" + "resolved" "https://registry.npmjs.org/husky/-/husky-4.3.8.tgz" + "version" "4.3.8" + dependencies: + "chalk" "^4.0.0" + "ci-info" "^2.0.0" + "compare-versions" "^3.6.0" + "cosmiconfig" "^7.0.0" + "find-versions" "^4.0.0" + "opencollective-postinstall" "^2.0.2" + "pkg-dir" "^5.0.0" + "please-upgrade-node" "^3.2.0" + "slash" "^3.0.0" + "which-pm-runs" "^1.0.0" + +"iconv-lite@0.4.24": + "integrity" "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==" + "resolved" "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz" + "version" "0.4.24" + dependencies: + "safer-buffer" ">= 2.1.2 < 3" + +"ieee754@^1.1.13": + "integrity" "sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==" + "resolved" "https://registry.npmjs.org/ieee754/-/ieee754-1.2.1.tgz" + "version" "1.2.1" + +"ignore@^5.1.4": + "integrity" "sha512-BMpfD7PpiETpBl/A6S498BaIJ6Y/ABT93ETbby2fP00v4EbvPBXWEoaR1UBPKs3iR53pJY7EtZk5KACI57i1Uw==" + "resolved" "https://registry.npmjs.org/ignore/-/ignore-5.1.8.tgz" + "version" "5.1.8" + +"immediate@^3.2.3": + "integrity" "sha512-HR7EVodfFUdQCTIeySw+WDRFJlPcLOJbXfwwZ7Oom6tjsvZ3bOkCDJHehQC3nxJrv7+f9XecwazynjU8e4Vw3Q==" + "resolved" "https://registry.npmjs.org/immediate/-/immediate-3.3.0.tgz" + "version" "3.3.0" + +"immediate@~3.2.3": + "integrity" "sha1-0UD6j2FGWb1lQSMwl92qwlzdmRw=" + "resolved" "https://registry.npmjs.org/immediate/-/immediate-3.2.3.tgz" + "version" "3.2.3" + +"immutable@^4.0.0-rc.12": + "integrity" "sha512-zIE9hX70qew5qTUjSS7wi1iwj/l7+m54KWU247nhM3v806UdGj1yDndXj+IOYxxtW9zyLI+xqFNZjTuDaLUqFw==" + "resolved" "https://registry.npmjs.org/immutable/-/immutable-4.0.0.tgz" + "version" "4.0.0" + +"import-fresh@^3.0.0", "import-fresh@^3.2.1": + "integrity" "sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw==" + "resolved" "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.0.tgz" + "version" "3.3.0" + dependencies: + "parent-module" "^1.0.0" + "resolve-from" "^4.0.0" + +"indent-string@^4.0.0": + "integrity" "sha512-EdDDZu4A2OyIK7Lr/2zG+w5jmbuk1DVBnEwREQvBzspBJkCEbRa8GxU1lghYcaGJCnRWibjDXlq779X1/y5xwg==" + "resolved" "https://registry.npmjs.org/indent-string/-/indent-string-4.0.0.tgz" + "version" "4.0.0" + +"inflight@^1.0.4": + "integrity" "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=" + "resolved" "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz" + "version" "1.0.6" + dependencies: + "once" "^1.3.0" + "wrappy" "1" + +"inherits@^2.0.1", "inherits@^2.0.3", "inherits@^2.0.4", "inherits@~2.0.1", "inherits@~2.0.3", "inherits@2", "inherits@2.0.4": + "integrity" "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" + "resolved" "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz" + "version" "2.0.4" + +"ini@^1.3.4": + "integrity" "sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew==" + "resolved" "https://registry.npmjs.org/ini/-/ini-1.3.8.tgz" + "version" "1.3.8" + +"invert-kv@^1.0.0": + "integrity" "sha1-EEqOSqym09jNFXqO+L+rLXo//bY=" + "resolved" "https://registry.npmjs.org/invert-kv/-/invert-kv-1.0.0.tgz" + "version" "1.0.0" + +"io-ts@1.10.4": + "integrity" "sha512-b23PteSnYXSONJ6JQXRAlvJhuw8KOtkqa87W4wDtvMrud/DTJd5X+NpOOI+O/zZwVq6v0VLAaJ+1EDViKEuN9g==" + "resolved" "https://registry.npmjs.org/io-ts/-/io-ts-1.10.4.tgz" + "version" "1.10.4" + dependencies: + "fp-ts" "^1.0.0" + +"is-accessor-descriptor@^0.1.6": + "integrity" "sha1-qeEss66Nh2cn7u84Q/igiXtcmNY=" + "resolved" "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz" + "version" "0.1.6" + dependencies: + "kind-of" "^3.0.2" + +"is-accessor-descriptor@^1.0.0": + "integrity" "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==" + "resolved" "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz" + "version" "1.0.0" + dependencies: + "kind-of" "^6.0.0" + +"is-arrayish@^0.2.1": + "integrity" "sha1-d8mYQFJ6qOyxqLppe4BkWnqSap0=" + "resolved" "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz" + "version" "0.2.1" + +"is-binary-path@^1.0.0": + "integrity" "sha1-dfFmQrSA8YenEcgUFh/TpKdlWJg=" + "resolved" "https://registry.npmjs.org/is-binary-path/-/is-binary-path-1.0.1.tgz" + "version" "1.0.1" + dependencies: + "binary-extensions" "^1.0.0" + +"is-binary-path@~2.1.0": + "integrity" "sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==" + "resolved" "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz" + "version" "2.1.0" + dependencies: + "binary-extensions" "^2.0.0" + +"is-buffer@^1.1.5": + "integrity" "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==" + "resolved" "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz" + "version" "1.1.6" + +"is-core-module@^2.1.0": + "integrity" "sha512-XRAfAdyyY5F5cOXn7hYQDqh2Xmii+DEfIcQGxK/uNwMHhIkPWO0g8msXcbzLe+MpGoR951MlqM/2iIlU4vKDdQ==" + "resolved" "https://registry.npmjs.org/is-core-module/-/is-core-module-2.2.0.tgz" + "version" "2.2.0" + dependencies: + "has" "^1.0.3" + +"is-data-descriptor@^0.1.4": + "integrity" "sha1-C17mSDiOLIYCgueT8YVv7D8wG1Y=" + "resolved" "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz" + "version" "0.1.4" + dependencies: + "kind-of" "^3.0.2" -is-binary-path@~2.1.0: - version "2.1.0" - resolved "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz" - integrity sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw== +"is-data-descriptor@^1.0.0": + "integrity" "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==" + "resolved" "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz" + "version" "1.0.0" dependencies: - binary-extensions "^2.0.0" - -is-boolean-object@^1.1.0: - version "1.1.2" - resolved "https://registry.npmjs.org/is-boolean-object/-/is-boolean-object-1.1.2.tgz" - integrity sha512-gDYaKHJmnj4aWxyj6YHyXVpdQawtVLHU5cb+eztPGczf6cjuTdwve5ZIEfgXqH4e57An1D1AKf8CZ3kYrQRqYA== - dependencies: - call-bind "^1.0.2" - has-tostringtag "^1.0.0" + "kind-of" "^6.0.0" -is-buffer@^1.1.5: - version "1.1.6" - resolved "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz" - integrity sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w== - -is-buffer@~2.0.3: - version "2.0.5" - resolved "https://registry.npmjs.org/is-buffer/-/is-buffer-2.0.5.tgz" - integrity sha512-i2R6zNFDwgEHJyQUtJEk0XFi1i0dPFn/oqjK3/vPCcDeJvW5NQ83V8QbicfF1SupOaB0h8ntgBC2YiE7dfyctQ== - -is-callable@^1.1.3, is-callable@^1.1.4, is-callable@^1.2.4: - version "1.2.4" - resolved "https://registry.npmjs.org/is-callable/-/is-callable-1.2.4.tgz" - integrity sha512-nsuwtxZfMX67Oryl9LCQ+upnC0Z0BgpwntpS89m1H/TLF0zNfzfLMV/9Wa/6MZsj0acpEjAO0KF1xT6ZdLl95w== - -is-core-module@^2.1.0: - version "2.2.0" - resolved "https://registry.npmjs.org/is-core-module/-/is-core-module-2.2.0.tgz" - integrity sha512-XRAfAdyyY5F5cOXn7hYQDqh2Xmii+DEfIcQGxK/uNwMHhIkPWO0g8msXcbzLe+MpGoR951MlqM/2iIlU4vKDdQ== - dependencies: - has "^1.0.3" - -is-data-descriptor@^0.1.4: - version "0.1.4" - resolved "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz" - integrity sha1-C17mSDiOLIYCgueT8YVv7D8wG1Y= - dependencies: - kind-of "^3.0.2" - -is-data-descriptor@^1.0.0: - version "1.0.0" - resolved "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz" - integrity sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ== - dependencies: - kind-of "^6.0.0" - -is-date-object@^1.0.1: - version "1.0.5" - resolved "https://registry.npmjs.org/is-date-object/-/is-date-object-1.0.5.tgz" - integrity sha512-9YQaSxsAiSwcvS33MBk3wTCVnWK+HhF8VZR2jRxehM16QcVOdHqPn4VPHmRK4lSr38n9JriurInLcP90xsYNfQ== +"is-descriptor@^0.1.0": + "integrity" "sha512-avDYr0SB3DwO9zsMov0gKCESFYqCnE4hq/4z3TdUlukEy5t9C0YRq7HLrsN52NAcqXKaepeCD0n+B0arnVG3Hg==" + "resolved" "https://registry.npmjs.org/is-descriptor/-/is-descriptor-0.1.6.tgz" + "version" "0.1.6" dependencies: - has-tostringtag "^1.0.0" + "is-accessor-descriptor" "^0.1.6" + "is-data-descriptor" "^0.1.4" + "kind-of" "^5.0.0" -is-descriptor@^0.1.0: - version "0.1.6" - resolved "https://registry.npmjs.org/is-descriptor/-/is-descriptor-0.1.6.tgz" - integrity sha512-avDYr0SB3DwO9zsMov0gKCESFYqCnE4hq/4z3TdUlukEy5t9C0YRq7HLrsN52NAcqXKaepeCD0n+B0arnVG3Hg== +"is-descriptor@^1.0.0", "is-descriptor@^1.0.2": + "integrity" "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==" + "resolved" "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz" + "version" "1.0.2" dependencies: - is-accessor-descriptor "^0.1.6" - is-data-descriptor "^0.1.4" - kind-of "^5.0.0" + "is-accessor-descriptor" "^1.0.0" + "is-data-descriptor" "^1.0.0" + "kind-of" "^6.0.2" -is-descriptor@^1.0.0, is-descriptor@^1.0.2: - version "1.0.2" - resolved "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz" - integrity sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg== - dependencies: - is-accessor-descriptor "^1.0.0" - is-data-descriptor "^1.0.0" - kind-of "^6.0.2" - -is-dotfile@^1.0.0: - version "1.0.3" - resolved "https://registry.npmjs.org/is-dotfile/-/is-dotfile-1.0.3.tgz" - integrity sha1-pqLzL/0t+wT1yiXs0Pa4PPeYoeE= +"is-dotfile@^1.0.0": + "integrity" "sha1-pqLzL/0t+wT1yiXs0Pa4PPeYoeE=" + "resolved" "https://registry.npmjs.org/is-dotfile/-/is-dotfile-1.0.3.tgz" + "version" "1.0.3" -is-equal-shallow@^0.1.3: - version "0.1.3" - resolved "https://registry.npmjs.org/is-equal-shallow/-/is-equal-shallow-0.1.3.tgz" - integrity sha1-IjgJj8Ih3gvPpdnqxMRdY4qhxTQ= +"is-equal-shallow@^0.1.3": + "integrity" "sha1-IjgJj8Ih3gvPpdnqxMRdY4qhxTQ=" + "resolved" "https://registry.npmjs.org/is-equal-shallow/-/is-equal-shallow-0.1.3.tgz" + "version" "0.1.3" dependencies: - is-primitive "^2.0.0" - -is-extendable@^0.1.0, is-extendable@^0.1.1: - version "0.1.1" - resolved "https://registry.npmjs.org/is-extendable/-/is-extendable-0.1.1.tgz" - integrity sha1-YrEQ4omkcUGOPsNqYX1HLjAd/Ik= + "is-primitive" "^2.0.0" + +"is-extendable@^0.1.0", "is-extendable@^0.1.1": + "integrity" "sha1-YrEQ4omkcUGOPsNqYX1HLjAd/Ik=" + "resolved" "https://registry.npmjs.org/is-extendable/-/is-extendable-0.1.1.tgz" + "version" "0.1.1" -is-extendable@^1.0.1: - version "1.0.1" - resolved "https://registry.npmjs.org/is-extendable/-/is-extendable-1.0.1.tgz" - integrity sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA== +"is-extendable@^1.0.1": + "integrity" "sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA==" + "resolved" "https://registry.npmjs.org/is-extendable/-/is-extendable-1.0.1.tgz" + "version" "1.0.1" dependencies: - is-plain-object "^2.0.4" - -is-extglob@^1.0.0: - version "1.0.0" - resolved "https://registry.npmjs.org/is-extglob/-/is-extglob-1.0.0.tgz" - integrity sha1-rEaBd8SUNAWgkvyPKXYMb/xiBsA= - -is-extglob@^2.1.1: - version "2.1.1" - resolved "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz" - integrity sha1-qIwCU1eR8C7TfHahueqXc8gz+MI= - -is-fullwidth-code-point@^1.0.0: - version "1.0.0" - resolved "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz" - integrity sha1-754xOG8DGn8NZDr4L95QxFfvAMs= - dependencies: - number-is-nan "^1.0.0" - -is-fullwidth-code-point@^2.0.0: - version "2.0.0" - resolved "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz" - integrity sha1-o7MKXE8ZkYMWeqq5O+764937ZU8= - -is-fullwidth-code-point@^3.0.0: - version "3.0.0" - resolved "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz" - integrity sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg== - -is-glob@^2.0.0, is-glob@^2.0.1: - version "2.0.1" - resolved "https://registry.npmjs.org/is-glob/-/is-glob-2.0.1.tgz" - integrity sha1-0Jb5JqPe1WAPP9/ZEZjLCIjC2GM= - dependencies: - is-extglob "^1.0.0" - -is-glob@^4.0.1, is-glob@~4.0.1: - version "4.0.3" - resolved "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz" - integrity sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg== - dependencies: - is-extglob "^2.1.1" - -is-hex-prefixed@1.0.0: - version "1.0.0" - resolved "https://registry.npmjs.org/is-hex-prefixed/-/is-hex-prefixed-1.0.0.tgz" - integrity sha1-fY035q135dEnFIkTxXPggtd39VQ= - -is-negative-zero@^2.0.1: - version "2.0.1" - resolved "https://registry.npmjs.org/is-negative-zero/-/is-negative-zero-2.0.1.tgz" - integrity sha512-2z6JzQvZRa9A2Y7xC6dQQm4FSTSTNWjKIYYTt4246eMTJmIo0Q+ZyOsU66X8lxK1AbB92dFeglPLrhwpeRKO6w== - -is-number-object@^1.0.4: - version "1.0.6" - resolved "https://registry.npmjs.org/is-number-object/-/is-number-object-1.0.6.tgz" - integrity sha512-bEVOqiRcvo3zO1+G2lVMy+gkkEm9Yh7cDMRusKKu5ZJKPUYSJwICTKZrNKHA2EbSP0Tu0+6B/emsYNHZyn6K8g== - dependencies: - has-tostringtag "^1.0.0" - -is-number@^2.1.0: - version "2.1.0" - resolved "https://registry.npmjs.org/is-number/-/is-number-2.1.0.tgz" - integrity sha1-Afy7s5NGOlSPL0ZszhbezknbkI8= - dependencies: - kind-of "^3.0.2" - -is-number@^3.0.0: - version "3.0.0" - resolved "https://registry.npmjs.org/is-number/-/is-number-3.0.0.tgz" - integrity sha1-JP1iAaR4LPUFYcgQJ2r8fRLXEZU= - dependencies: - kind-of "^3.0.2" - -is-number@^4.0.0: - version "4.0.0" - resolved "https://registry.npmjs.org/is-number/-/is-number-4.0.0.tgz" - integrity sha512-rSklcAIlf1OmFdyAqbnWTLVelsQ58uvZ66S/ZyawjWqIviTWCjg2PzVGw8WUA+nNuPTqb4wgA+NszrJ+08LlgQ== - -is-number@^7.0.0: - version "7.0.0" - resolved "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz" - integrity sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng== - -is-obj@^2.0.0: - version "2.0.0" - resolved "https://registry.npmjs.org/is-obj/-/is-obj-2.0.0.tgz" - integrity sha512-drqDG3cbczxxEJRoOXcOjtdp1J/lyp1mNn0xaznRs8+muBhgQcrnbspox5X5fOw0HnMnbfDzvnEMEtqDEJEo8w== - -is-plain-obj@^1.1.0: - version "1.1.0" - resolved "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-1.1.0.tgz" - integrity sha1-caUMhCnfync8kqOQpKA7OfzVHT4= - -is-plain-object@^2.0.3, is-plain-object@^2.0.4: - version "2.0.4" - resolved "https://registry.npmjs.org/is-plain-object/-/is-plain-object-2.0.4.tgz" - integrity sha512-h5PpgXkWitc38BBMYawTYMWJHFZJVnBquFE57xFpjB8pJFiF6gZ+bU+WyI/yqXiFR5mdLsgYNaPe8uao6Uv9Og== - dependencies: - isobject "^3.0.1" - -is-posix-bracket@^0.1.0: - version "0.1.1" - resolved "https://registry.npmjs.org/is-posix-bracket/-/is-posix-bracket-0.1.1.tgz" - integrity sha1-MzTceXdDaOkvAW5vvAqI9c1ua8Q= - -is-primitive@^2.0.0: - version "2.0.0" - resolved "https://registry.npmjs.org/is-primitive/-/is-primitive-2.0.0.tgz" - integrity sha1-IHurkWOEmcB7Kt8kCkGochADRXU= - -is-regex@^1.1.4: - version "1.1.4" - resolved "https://registry.npmjs.org/is-regex/-/is-regex-1.1.4.tgz" - integrity sha512-kvRdxDsxZjhzUX07ZnLydzS1TU/TJlTUHHY4YLL87e37oUA49DfkLqgy+VjFocowy29cKvcSiu+kIv728jTTVg== - dependencies: - call-bind "^1.0.2" - has-tostringtag "^1.0.0" - -is-shared-array-buffer@^1.0.1: - version "1.0.1" - resolved "https://registry.npmjs.org/is-shared-array-buffer/-/is-shared-array-buffer-1.0.1.tgz" - integrity sha512-IU0NmyknYZN0rChcKhRO1X8LYz5Isj/Fsqh8NJOSf+N/hCOTwy29F32Ik7a+QszE63IdvmwdTPDd6cZ5pg4cwA== - -is-stream@^1.1.0: - version "1.1.0" - resolved "https://registry.npmjs.org/is-stream/-/is-stream-1.1.0.tgz" - integrity sha1-EtSj3U5o4Lec6428hBc66A2RykQ= - -is-stream@^2.0.0: - version "2.0.0" - resolved "https://registry.npmjs.org/is-stream/-/is-stream-2.0.0.tgz" - integrity sha512-XCoy+WlUr7d1+Z8GgSuXmpuUFC9fOhRXglJMx+dwLKTkL44Cjd4W1Z5P+BQZpr+cR93aGP4S/s7Ftw6Nd/kiEw== - -is-string@^1.0.5, is-string@^1.0.7: - version "1.0.7" - resolved "https://registry.npmjs.org/is-string/-/is-string-1.0.7.tgz" - integrity sha512-tE2UXzivje6ofPW7l23cjDOMa09gb7xlAqG6jG5ej6uPV32TlWP3NKPigtaGeHNu9fohccRYvIiZMfOOnOYUtg== - dependencies: - has-tostringtag "^1.0.0" - -is-symbol@^1.0.2, is-symbol@^1.0.3: - version "1.0.4" - resolved "https://registry.npmjs.org/is-symbol/-/is-symbol-1.0.4.tgz" - integrity sha512-C/CPBqKWnvdcxqIARxyOh4v1UUEOCHpgDa0WYgpKDFMszcrPcffg5uhwSgPCLD2WWxmq6isisz87tzT01tuGhg== - dependencies: - has-symbols "^1.0.2" - -is-text-path@^1.0.1: - version "1.0.1" - resolved "https://registry.npmjs.org/is-text-path/-/is-text-path-1.0.1.tgz" - integrity sha1-Thqg+1G/vLPpJogAE5cgLBd1tm4= - dependencies: - text-extensions "^1.0.0" - -is-weakref@^1.0.1: - version "1.0.1" - resolved "https://registry.npmjs.org/is-weakref/-/is-weakref-1.0.1.tgz" - integrity sha512-b2jKc2pQZjaeFYWEf7ScFj+Be1I+PXmlu572Q8coTXZ+LD/QQZ7ShPMst8h16riVgyXTQwUsFEl74mDvc/3MHQ== - dependencies: - call-bind "^1.0.0" - -is-windows@^1.0.2: - version "1.0.2" - resolved "https://registry.npmjs.org/is-windows/-/is-windows-1.0.2.tgz" - integrity sha512-eXK1UInq2bPmjyX6e3VHIzMLobc4J94i4AWn+Hpq3OU5KkrRC96OAcR3PRJ/pGu6m8TRnBHP9dkXQVsT/COVIA== - -isarray@1.0.0, isarray@~1.0.0: - version "1.0.0" - resolved "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz" - integrity sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE= - -isexe@^2.0.0: - version "2.0.0" - resolved "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz" - integrity sha1-6PvzdNxVb/iUehDcsFctYz8s+hA= - -isobject@^2.0.0: - version "2.1.0" - resolved "https://registry.npmjs.org/isobject/-/isobject-2.1.0.tgz" - integrity sha1-8GVWEJaj8dou9GJy+BXIQNh+DIk= - dependencies: - isarray "1.0.0" - -isobject@^3.0.0, isobject@^3.0.1: - version "3.0.1" - resolved "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz" - integrity sha1-TkMekrEalzFjaqH5yNHMvP2reN8= - -js-sha3@0.8.0: - version "0.8.0" - resolved "https://registry.npmjs.org/js-sha3/-/js-sha3-0.8.0.tgz" - integrity sha512-gF1cRrHhIzNfToc802P800N8PpXS+evLLXfsVpowqmAFR9uwbi89WvXg2QspOmXL8QL86J4T1EpFu+yUkwJY3Q== - -js-string-escape@^1.0.1: - version "1.0.1" - resolved "https://registry.npmjs.org/js-string-escape/-/js-string-escape-1.0.1.tgz" - integrity sha1-4mJbrbwNZ8dTPp7cEGjFh65BN+8= - -js-tokens@^4.0.0: - version "4.0.0" - resolved "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz" - integrity sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ== - -js-yaml@3.13.1: - version "3.13.1" - resolved "https://registry.npmjs.org/js-yaml/-/js-yaml-3.13.1.tgz" - integrity sha512-YfbcO7jXDdyj0DGxYVSlSeQNHbD7XPWvrVWeVUujrQEoZzWJIRrCPoyk6kL6IAjAG2IolMK4T0hNUe0HOUs5Jw== - dependencies: - argparse "^1.0.7" - esprima "^4.0.0" - -json-parse-even-better-errors@^2.3.0: - version "2.3.1" - resolved "https://registry.npmjs.org/json-parse-even-better-errors/-/json-parse-even-better-errors-2.3.1.tgz" - integrity sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w== - -json-schema-traverse@^0.3.0: - version "0.3.1" - resolved "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.3.1.tgz" - integrity sha1-NJptRMU6Ud6JtAgFxdXlm0F9M0A= - -jsonfile@^2.1.0: - version "2.4.0" - resolved "https://registry.npmjs.org/jsonfile/-/jsonfile-2.4.0.tgz" - integrity sha1-NzaitCi4e72gzIO1P6PWM6NcKug= + "is-plain-object" "^2.0.4" + +"is-extglob@^1.0.0": + "integrity" "sha1-rEaBd8SUNAWgkvyPKXYMb/xiBsA=" + "resolved" "https://registry.npmjs.org/is-extglob/-/is-extglob-1.0.0.tgz" + "version" "1.0.0" + +"is-extglob@^2.1.1": + "integrity" "sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=" + "resolved" "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz" + "version" "2.1.1" + +"is-fullwidth-code-point@^1.0.0": + "integrity" "sha1-754xOG8DGn8NZDr4L95QxFfvAMs=" + "resolved" "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz" + "version" "1.0.0" + dependencies: + "number-is-nan" "^1.0.0" + +"is-fullwidth-code-point@^2.0.0": + "integrity" "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=" + "resolved" "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz" + "version" "2.0.0" + +"is-fullwidth-code-point@^3.0.0": + "integrity" "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==" + "resolved" "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz" + "version" "3.0.0" + +"is-glob@^2.0.0", "is-glob@^2.0.1": + "integrity" "sha1-0Jb5JqPe1WAPP9/ZEZjLCIjC2GM=" + "resolved" "https://registry.npmjs.org/is-glob/-/is-glob-2.0.1.tgz" + "version" "2.0.1" + dependencies: + "is-extglob" "^1.0.0" + +"is-glob@^4.0.1", "is-glob@~4.0.1": + "integrity" "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==" + "resolved" "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz" + "version" "4.0.3" + dependencies: + "is-extglob" "^2.1.1" + +"is-hex-prefixed@1.0.0": + "integrity" "sha1-fY035q135dEnFIkTxXPggtd39VQ=" + "resolved" "https://registry.npmjs.org/is-hex-prefixed/-/is-hex-prefixed-1.0.0.tgz" + "version" "1.0.0" + +"is-number@^2.1.0": + "integrity" "sha1-Afy7s5NGOlSPL0ZszhbezknbkI8=" + "resolved" "https://registry.npmjs.org/is-number/-/is-number-2.1.0.tgz" + "version" "2.1.0" + dependencies: + "kind-of" "^3.0.2" + +"is-number@^3.0.0": + "integrity" "sha1-JP1iAaR4LPUFYcgQJ2r8fRLXEZU=" + "resolved" "https://registry.npmjs.org/is-number/-/is-number-3.0.0.tgz" + "version" "3.0.0" + dependencies: + "kind-of" "^3.0.2" + +"is-number@^4.0.0": + "integrity" "sha512-rSklcAIlf1OmFdyAqbnWTLVelsQ58uvZ66S/ZyawjWqIviTWCjg2PzVGw8WUA+nNuPTqb4wgA+NszrJ+08LlgQ==" + "resolved" "https://registry.npmjs.org/is-number/-/is-number-4.0.0.tgz" + "version" "4.0.0" + +"is-number@^7.0.0": + "integrity" "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==" + "resolved" "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz" + "version" "7.0.0" + +"is-obj@^2.0.0": + "integrity" "sha512-drqDG3cbczxxEJRoOXcOjtdp1J/lyp1mNn0xaznRs8+muBhgQcrnbspox5X5fOw0HnMnbfDzvnEMEtqDEJEo8w==" + "resolved" "https://registry.npmjs.org/is-obj/-/is-obj-2.0.0.tgz" + "version" "2.0.0" + +"is-plain-obj@^1.1.0": + "integrity" "sha1-caUMhCnfync8kqOQpKA7OfzVHT4=" + "resolved" "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-1.1.0.tgz" + "version" "1.1.0" + +"is-plain-obj@^2.1.0": + "integrity" "sha512-YWnfyRwxL/+SsrWYfOpUtz5b3YD+nyfkHvjbcanzk8zgyO4ASD67uVMRt8k5bM4lLMDnXfriRhOpemw+NfT1eA==" + "resolved" "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-2.1.0.tgz" + "version" "2.1.0" + +"is-plain-object@^2.0.3", "is-plain-object@^2.0.4": + "integrity" "sha512-h5PpgXkWitc38BBMYawTYMWJHFZJVnBquFE57xFpjB8pJFiF6gZ+bU+WyI/yqXiFR5mdLsgYNaPe8uao6Uv9Og==" + "resolved" "https://registry.npmjs.org/is-plain-object/-/is-plain-object-2.0.4.tgz" + "version" "2.0.4" + dependencies: + "isobject" "^3.0.1" + +"is-posix-bracket@^0.1.0": + "integrity" "sha1-MzTceXdDaOkvAW5vvAqI9c1ua8Q=" + "resolved" "https://registry.npmjs.org/is-posix-bracket/-/is-posix-bracket-0.1.1.tgz" + "version" "0.1.1" + +"is-primitive@^2.0.0": + "integrity" "sha1-IHurkWOEmcB7Kt8kCkGochADRXU=" + "resolved" "https://registry.npmjs.org/is-primitive/-/is-primitive-2.0.0.tgz" + "version" "2.0.0" + +"is-stream@^1.1.0": + "integrity" "sha1-EtSj3U5o4Lec6428hBc66A2RykQ=" + "resolved" "https://registry.npmjs.org/is-stream/-/is-stream-1.1.0.tgz" + "version" "1.1.0" + +"is-stream@^2.0.0": + "integrity" "sha512-XCoy+WlUr7d1+Z8GgSuXmpuUFC9fOhRXglJMx+dwLKTkL44Cjd4W1Z5P+BQZpr+cR93aGP4S/s7Ftw6Nd/kiEw==" + "resolved" "https://registry.npmjs.org/is-stream/-/is-stream-2.0.0.tgz" + "version" "2.0.0" + +"is-text-path@^1.0.1": + "integrity" "sha1-Thqg+1G/vLPpJogAE5cgLBd1tm4=" + "resolved" "https://registry.npmjs.org/is-text-path/-/is-text-path-1.0.1.tgz" + "version" "1.0.1" + dependencies: + "text-extensions" "^1.0.0" + +"is-unicode-supported@^0.1.0": + "integrity" "sha512-knxG2q4UC3u8stRGyAVJCOdxFmv5DZiRcdlIaAQXAbSfJya+OhopNotLQrstBhququ4ZpuKbDc/8S6mgXgPFPw==" + "resolved" "https://registry.npmjs.org/is-unicode-supported/-/is-unicode-supported-0.1.0.tgz" + "version" "0.1.0" + +"is-windows@^1.0.2": + "integrity" "sha512-eXK1UInq2bPmjyX6e3VHIzMLobc4J94i4AWn+Hpq3OU5KkrRC96OAcR3PRJ/pGu6m8TRnBHP9dkXQVsT/COVIA==" + "resolved" "https://registry.npmjs.org/is-windows/-/is-windows-1.0.2.tgz" + "version" "1.0.2" + +"isarray@~1.0.0", "isarray@1.0.0": + "integrity" "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=" + "resolved" "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz" + "version" "1.0.0" + +"isexe@^2.0.0": + "integrity" "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=" + "resolved" "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz" + "version" "2.0.0" + +"isobject@^2.0.0": + "integrity" "sha1-8GVWEJaj8dou9GJy+BXIQNh+DIk=" + "resolved" "https://registry.npmjs.org/isobject/-/isobject-2.1.0.tgz" + "version" "2.1.0" + dependencies: + "isarray" "1.0.0" + +"isobject@^3.0.0", "isobject@^3.0.1": + "integrity" "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=" + "resolved" "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz" + "version" "3.0.1" + +"js-sha3@0.8.0": + "integrity" "sha512-gF1cRrHhIzNfToc802P800N8PpXS+evLLXfsVpowqmAFR9uwbi89WvXg2QspOmXL8QL86J4T1EpFu+yUkwJY3Q==" + "resolved" "https://registry.npmjs.org/js-sha3/-/js-sha3-0.8.0.tgz" + "version" "0.8.0" + +"js-string-escape@^1.0.1": + "integrity" "sha1-4mJbrbwNZ8dTPp7cEGjFh65BN+8=" + "resolved" "https://registry.npmjs.org/js-string-escape/-/js-string-escape-1.0.1.tgz" + "version" "1.0.1" + +"js-tokens@^4.0.0": + "integrity" "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==" + "resolved" "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz" + "version" "4.0.0" + +"js-yaml@4.1.0": + "integrity" "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==" + "resolved" "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz" + "version" "4.1.0" + dependencies: + "argparse" "^2.0.1" + +"json-parse-even-better-errors@^2.3.0": + "integrity" "sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w==" + "resolved" "https://registry.npmjs.org/json-parse-even-better-errors/-/json-parse-even-better-errors-2.3.1.tgz" + "version" "2.3.1" + +"json-schema-traverse@^0.3.0": + "integrity" "sha1-NJptRMU6Ud6JtAgFxdXlm0F9M0A=" + "resolved" "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.3.1.tgz" + "version" "0.3.1" + +"jsonfile@^2.1.0": + "integrity" "sha1-NzaitCi4e72gzIO1P6PWM6NcKug=" + "resolved" "https://registry.npmjs.org/jsonfile/-/jsonfile-2.4.0.tgz" + "version" "2.4.0" optionalDependencies: - graceful-fs "^4.1.6" + "graceful-fs" "^4.1.6" -jsonfile@^4.0.0: - version "4.0.0" - resolved "https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz" - integrity sha1-h3Gq4HmbZAdrdmQPygWPnBDjPss= +"jsonfile@^4.0.0": + "integrity" "sha1-h3Gq4HmbZAdrdmQPygWPnBDjPss=" + "resolved" "https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz" + "version" "4.0.0" optionalDependencies: - graceful-fs "^4.1.6" + "graceful-fs" "^4.1.6" -jsonfile@^6.0.1: - version "6.1.0" - resolved "https://registry.npmjs.org/jsonfile/-/jsonfile-6.1.0.tgz" - integrity sha512-5dgndWOriYSm5cnYaJNhalLNDKOqFwyDB/rr1E9ZsGciGvKPs8R2xYGCacuf3z6K1YKDz182fd+fY3cn3pMqXQ== +"jsonfile@^6.0.1": + "integrity" "sha512-5dgndWOriYSm5cnYaJNhalLNDKOqFwyDB/rr1E9ZsGciGvKPs8R2xYGCacuf3z6K1YKDz182fd+fY3cn3pMqXQ==" + "resolved" "https://registry.npmjs.org/jsonfile/-/jsonfile-6.1.0.tgz" + "version" "6.1.0" dependencies: - universalify "^2.0.0" + "universalify" "^2.0.0" optionalDependencies: - graceful-fs "^4.1.6" - -jsonparse@^1.2.0: - version "1.3.1" - resolved "https://registry.npmjs.org/jsonparse/-/jsonparse-1.3.1.tgz" - integrity sha1-P02uSpH6wxX3EGL4UhzCOfE2YoA= - -keccak@^3.0.0: - version "3.0.2" - resolved "https://registry.npmjs.org/keccak/-/keccak-3.0.2.tgz" - integrity sha512-PyKKjkH53wDMLGrvmRGSNWgmSxZOUqbnXwKL9tmgbFYA1iAYqW21kfR7mZXV0MlESiefxQQE9X9fTa3X+2MPDQ== - dependencies: - node-addon-api "^2.0.0" - node-gyp-build "^4.2.0" - readable-stream "^3.6.0" - -kind-of@^3.0.2, kind-of@^3.0.3, kind-of@^3.2.0: - version "3.2.2" - resolved "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz" - integrity sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ= - dependencies: - is-buffer "^1.1.5" - -kind-of@^4.0.0: - version "4.0.0" - resolved "https://registry.npmjs.org/kind-of/-/kind-of-4.0.0.tgz" - integrity sha1-IIE989cSkosgc3hpGkUGb65y3Vc= - dependencies: - is-buffer "^1.1.5" - -kind-of@^5.0.0: - version "5.1.0" - resolved "https://registry.npmjs.org/kind-of/-/kind-of-5.1.0.tgz" - integrity sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw== - -kind-of@^6.0.0, kind-of@^6.0.2, kind-of@^6.0.3: - version "6.0.3" - resolved "https://registry.npmjs.org/kind-of/-/kind-of-6.0.3.tgz" - integrity sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw== - -klaw@^1.0.0: - version "1.3.1" - resolved "https://registry.npmjs.org/klaw/-/klaw-1.3.1.tgz" - integrity sha1-QIhDO0azsbolnXh4XY6W9zugJDk= + "graceful-fs" "^4.1.6" + +"jsonparse@^1.2.0": + "integrity" "sha1-P02uSpH6wxX3EGL4UhzCOfE2YoA=" + "resolved" "https://registry.npmjs.org/jsonparse/-/jsonparse-1.3.1.tgz" + "version" "1.3.1" + +"JSONStream@^1.0.4": + "integrity" "sha512-E+iruNOY8VV9s4JEbe1aNEm6MiszPRr/UfcHMz0TQh1BXSxHK+ASV1R6W4HpjBhSeS+54PIsAMCBmwD06LLsqQ==" + "resolved" "https://registry.npmjs.org/JSONStream/-/JSONStream-1.3.5.tgz" + "version" "1.3.5" + dependencies: + "jsonparse" "^1.2.0" + "through" ">=2.2.7 <3" + +"keccak@^3.0.0": + "integrity" "sha512-PyKKjkH53wDMLGrvmRGSNWgmSxZOUqbnXwKL9tmgbFYA1iAYqW21kfR7mZXV0MlESiefxQQE9X9fTa3X+2MPDQ==" + "resolved" "https://registry.npmjs.org/keccak/-/keccak-3.0.2.tgz" + "version" "3.0.2" + dependencies: + "node-addon-api" "^2.0.0" + "node-gyp-build" "^4.2.0" + "readable-stream" "^3.6.0" + +"kind-of@^3.0.2", "kind-of@^3.0.3", "kind-of@^3.2.0": + "integrity" "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=" + "resolved" "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz" + "version" "3.2.2" + dependencies: + "is-buffer" "^1.1.5" + +"kind-of@^4.0.0": + "integrity" "sha1-IIE989cSkosgc3hpGkUGb65y3Vc=" + "resolved" "https://registry.npmjs.org/kind-of/-/kind-of-4.0.0.tgz" + "version" "4.0.0" + dependencies: + "is-buffer" "^1.1.5" + +"kind-of@^5.0.0": + "integrity" "sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw==" + "resolved" "https://registry.npmjs.org/kind-of/-/kind-of-5.1.0.tgz" + "version" "5.1.0" + +"kind-of@^6.0.0": + "integrity" "sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw==" + "resolved" "https://registry.npmjs.org/kind-of/-/kind-of-6.0.3.tgz" + "version" "6.0.3" + +"kind-of@^6.0.2": + "integrity" "sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw==" + "resolved" "https://registry.npmjs.org/kind-of/-/kind-of-6.0.3.tgz" + "version" "6.0.3" + +"kind-of@^6.0.3": + "integrity" "sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw==" + "resolved" "https://registry.npmjs.org/kind-of/-/kind-of-6.0.3.tgz" + "version" "6.0.3" + +"klaw@^1.0.0": + "integrity" "sha1-QIhDO0azsbolnXh4XY6W9zugJDk=" + "resolved" "https://registry.npmjs.org/klaw/-/klaw-1.3.1.tgz" + "version" "1.3.1" optionalDependencies: - graceful-fs "^4.1.9" - -lcid@^1.0.0: - version "1.0.0" - resolved "https://registry.npmjs.org/lcid/-/lcid-1.0.0.tgz" - integrity sha1-MIrMr6C8SDo4Z7S28rlQYlHRuDU= - dependencies: - invert-kv "^1.0.0" + "graceful-fs" "^4.1.9" -level-codec@^9.0.0: - version "9.0.2" - resolved "https://registry.npmjs.org/level-codec/-/level-codec-9.0.2.tgz" - integrity sha512-UyIwNb1lJBChJnGfjmO0OR+ezh2iVu1Kas3nvBS/BzGnx79dv6g7unpKIDNPMhfdTEGoc7mC8uAu51XEtX+FHQ== +"lcid@^1.0.0": + "integrity" "sha1-MIrMr6C8SDo4Z7S28rlQYlHRuDU=" + "resolved" "https://registry.npmjs.org/lcid/-/lcid-1.0.0.tgz" + "version" "1.0.0" dependencies: - buffer "^5.6.0" - -level-concat-iterator@~2.0.0: - version "2.0.1" - resolved "https://registry.npmjs.org/level-concat-iterator/-/level-concat-iterator-2.0.1.tgz" - integrity sha512-OTKKOqeav2QWcERMJR7IS9CUo1sHnke2C0gkSmcR7QuEtFNLLzHQAvnMw8ykvEcv0Qtkg0p7FOwP1v9e5Smdcw== + "invert-kv" "^1.0.0" -level-errors@^2.0.0, level-errors@~2.0.0: - version "2.0.1" - resolved "https://registry.npmjs.org/level-errors/-/level-errors-2.0.1.tgz" - integrity sha512-UVprBJXite4gPS+3VznfgDSU8PTRuVX0NXwoWW50KLxd2yw4Y1t2JUR5In1itQnudZqRMT9DlAM3Q//9NCjCFw== +"level-codec@^9.0.0": + "integrity" "sha512-UyIwNb1lJBChJnGfjmO0OR+ezh2iVu1Kas3nvBS/BzGnx79dv6g7unpKIDNPMhfdTEGoc7mC8uAu51XEtX+FHQ==" + "resolved" "https://registry.npmjs.org/level-codec/-/level-codec-9.0.2.tgz" + "version" "9.0.2" dependencies: - errno "~0.1.1" + "buffer" "^5.6.0" + +"level-concat-iterator@~2.0.0": + "integrity" "sha512-OTKKOqeav2QWcERMJR7IS9CUo1sHnke2C0gkSmcR7QuEtFNLLzHQAvnMw8ykvEcv0Qtkg0p7FOwP1v9e5Smdcw==" + "resolved" "https://registry.npmjs.org/level-concat-iterator/-/level-concat-iterator-2.0.1.tgz" + "version" "2.0.1" -level-iterator-stream@~4.0.0: - version "4.0.2" - resolved "https://registry.npmjs.org/level-iterator-stream/-/level-iterator-stream-4.0.2.tgz" - integrity sha512-ZSthfEqzGSOMWoUGhTXdX9jv26d32XJuHz/5YnuHZzH6wldfWMOVwI9TBtKcya4BKTyTt3XVA0A3cF3q5CY30Q== +"level-errors@^2.0.0", "level-errors@~2.0.0": + "integrity" "sha512-UVprBJXite4gPS+3VznfgDSU8PTRuVX0NXwoWW50KLxd2yw4Y1t2JUR5In1itQnudZqRMT9DlAM3Q//9NCjCFw==" + "resolved" "https://registry.npmjs.org/level-errors/-/level-errors-2.0.1.tgz" + "version" "2.0.1" dependencies: - inherits "^2.0.4" - readable-stream "^3.4.0" - xtend "^4.0.2" - -level-mem@^5.0.1: - version "5.0.1" - resolved "https://registry.npmjs.org/level-mem/-/level-mem-5.0.1.tgz" - integrity sha512-qd+qUJHXsGSFoHTziptAKXoLX87QjR7v2KMbqncDXPxQuCdsQlzmyX+gwrEHhlzn08vkf8TyipYyMmiC6Gobzg== + "errno" "~0.1.1" + +"level-iterator-stream@~4.0.0": + "integrity" "sha512-ZSthfEqzGSOMWoUGhTXdX9jv26d32XJuHz/5YnuHZzH6wldfWMOVwI9TBtKcya4BKTyTt3XVA0A3cF3q5CY30Q==" + "resolved" "https://registry.npmjs.org/level-iterator-stream/-/level-iterator-stream-4.0.2.tgz" + "version" "4.0.2" dependencies: - level-packager "^5.0.3" - memdown "^5.0.0" - -level-packager@^5.0.3: - version "5.1.1" - resolved "https://registry.npmjs.org/level-packager/-/level-packager-5.1.1.tgz" - integrity sha512-HMwMaQPlTC1IlcwT3+swhqf/NUO+ZhXVz6TY1zZIIZlIR0YSn8GtAAWmIvKjNY16ZkEg/JcpAuQskxsXqC0yOQ== + "inherits" "^2.0.4" + "readable-stream" "^3.4.0" + "xtend" "^4.0.2" + +"level-mem@^5.0.1": + "integrity" "sha512-qd+qUJHXsGSFoHTziptAKXoLX87QjR7v2KMbqncDXPxQuCdsQlzmyX+gwrEHhlzn08vkf8TyipYyMmiC6Gobzg==" + "resolved" "https://registry.npmjs.org/level-mem/-/level-mem-5.0.1.tgz" + "version" "5.0.1" dependencies: - encoding-down "^6.3.0" - levelup "^4.3.2" + "level-packager" "^5.0.3" + "memdown" "^5.0.0" -level-supports@~1.0.0: - version "1.0.1" - resolved "https://registry.npmjs.org/level-supports/-/level-supports-1.0.1.tgz" - integrity sha512-rXM7GYnW8gsl1vedTJIbzOrRv85c/2uCMpiiCzO2fndd06U/kUXEEU9evYn4zFggBOg36IsBW8LzqIpETwwQzg== +"level-packager@^5.0.3": + "integrity" "sha512-HMwMaQPlTC1IlcwT3+swhqf/NUO+ZhXVz6TY1zZIIZlIR0YSn8GtAAWmIvKjNY16ZkEg/JcpAuQskxsXqC0yOQ==" + "resolved" "https://registry.npmjs.org/level-packager/-/level-packager-5.1.1.tgz" + "version" "5.1.1" dependencies: - xtend "^4.0.2" + "encoding-down" "^6.3.0" + "levelup" "^4.3.2" -level-ws@^2.0.0: - version "2.0.0" - resolved "https://registry.npmjs.org/level-ws/-/level-ws-2.0.0.tgz" - integrity sha512-1iv7VXx0G9ec1isqQZ7y5LmoZo/ewAsyDHNA8EFDW5hqH2Kqovm33nSFkSdnLLAK+I5FlT+lo5Cw9itGe+CpQA== +"level-supports@~1.0.0": + "integrity" "sha512-rXM7GYnW8gsl1vedTJIbzOrRv85c/2uCMpiiCzO2fndd06U/kUXEEU9evYn4zFggBOg36IsBW8LzqIpETwwQzg==" + "resolved" "https://registry.npmjs.org/level-supports/-/level-supports-1.0.1.tgz" + "version" "1.0.1" dependencies: - inherits "^2.0.3" - readable-stream "^3.1.0" - xtend "^4.0.1" - -levelup@^4.3.2: - version "4.4.0" - resolved "https://registry.npmjs.org/levelup/-/levelup-4.4.0.tgz" - integrity sha512-94++VFO3qN95cM/d6eBXvd894oJE0w3cInq9USsyQzzoJxmiYzPAocNcuGCPGGjoXqDVJcr3C1jzt1TSjyaiLQ== + "xtend" "^4.0.2" + +"level-ws@^2.0.0": + "integrity" "sha512-1iv7VXx0G9ec1isqQZ7y5LmoZo/ewAsyDHNA8EFDW5hqH2Kqovm33nSFkSdnLLAK+I5FlT+lo5Cw9itGe+CpQA==" + "resolved" "https://registry.npmjs.org/level-ws/-/level-ws-2.0.0.tgz" + "version" "2.0.0" + dependencies: + "inherits" "^2.0.3" + "readable-stream" "^3.1.0" + "xtend" "^4.0.1" + +"levelup@^4.3.2": + "integrity" "sha512-94++VFO3qN95cM/d6eBXvd894oJE0w3cInq9USsyQzzoJxmiYzPAocNcuGCPGGjoXqDVJcr3C1jzt1TSjyaiLQ==" + "resolved" "https://registry.npmjs.org/levelup/-/levelup-4.4.0.tgz" + "version" "4.4.0" dependencies: - deferred-leveldown "~5.3.0" - level-errors "~2.0.0" - level-iterator-stream "~4.0.0" - level-supports "~1.0.0" - xtend "~4.0.0" - -lines-and-columns@^1.1.6: - version "1.1.6" - resolved "https://registry.npmjs.org/lines-and-columns/-/lines-and-columns-1.1.6.tgz" - integrity sha1-HADHQ7QzzQpOgHWPe2SldEDZ/wA= - -locate-path@^2.0.0: - version "2.0.0" - resolved "https://registry.npmjs.org/locate-path/-/locate-path-2.0.0.tgz" - integrity sha1-K1aLJl7slExtnA3pw9u7ygNUzY4= - dependencies: - p-locate "^2.0.0" - path-exists "^3.0.0" - -locate-path@^3.0.0: - version "3.0.0" - resolved "https://registry.npmjs.org/locate-path/-/locate-path-3.0.0.tgz" - integrity sha512-7AO748wWnIhNqAuaty2ZWHkQHRSNfPVIsPIfwEOWO22AmaoVrWavlOcMR5nzTLNYvp36X220/maaRsrec1G65A== - dependencies: - p-locate "^3.0.0" - path-exists "^3.0.0" - -locate-path@^5.0.0: - version "5.0.0" - resolved "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz" - integrity sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g== - dependencies: - p-locate "^4.1.0" - -locate-path@^6.0.0: - version "6.0.0" - resolved "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz" - integrity sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw== - dependencies: - p-locate "^5.0.0" - -lodash@^4.14.2, lodash@^4.17.11, lodash@^4.17.14, lodash@^4.17.15, lodash@^4.17.19: - version "4.17.20" - resolved "https://registry.npmjs.org/lodash/-/lodash-4.17.20.tgz" - integrity sha512-PlhdFcillOINfeV7Ni6oF1TAEayyZBoZ8bcshTHqOYJYlrqzRK5hagpagky5o4HfCzzd1TRkXPMFq6cKk9rGmA== - -log-symbols@3.0.0: - version "3.0.0" - resolved "https://registry.npmjs.org/log-symbols/-/log-symbols-3.0.0.tgz" - integrity sha512-dSkNGuI7iG3mfvDzUuYZyvk5dD9ocYCYzNU6CYDE6+Xqd+gwme6Z00NS3dUh8mq/73HaEtT7m6W+yUPtU6BZnQ== - dependencies: - chalk "^2.4.2" - -lru-cache@^4.0.1: - version "4.1.5" - resolved "https://registry.npmjs.org/lru-cache/-/lru-cache-4.1.5.tgz" - integrity sha512-sWZlbEP2OsHNkXrMl5GYk/jKk70MBng6UU4YI/qGDYbgf6YbP4EvmqISbXCoJiRKs+1bSpFHVgQxvJ17F2li5g== - dependencies: - pseudomap "^1.0.2" - yallist "^2.1.2" - -lru-cache@^5.1.1: - version "5.1.1" - resolved "https://registry.npmjs.org/lru-cache/-/lru-cache-5.1.1.tgz" - integrity sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w== - dependencies: - yallist "^3.0.2" - -lru-cache@^6.0.0: - version "6.0.0" - resolved "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz" - integrity sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA== - dependencies: - yallist "^4.0.0" - -lru_map@^0.3.3: - version "0.3.3" - resolved "https://registry.npmjs.org/lru_map/-/lru_map-0.3.3.tgz" - integrity sha1-tcg1G5Rky9dQM1p5ZQoOwOVhGN0= - -ltgt@~2.2.0: - version "2.2.1" - resolved "https://registry.npmjs.org/ltgt/-/ltgt-2.2.1.tgz" - integrity sha1-81ypHEk/e3PaDgdJUwTxezH4fuU= - -map-cache@^0.2.2: - version "0.2.2" - resolved "https://registry.npmjs.org/map-cache/-/map-cache-0.2.2.tgz" - integrity sha1-wyq9C9ZSXZsFFkW7TyasXcmKDb8= - -map-obj@^1.0.0: - version "1.0.1" - resolved "https://registry.npmjs.org/map-obj/-/map-obj-1.0.1.tgz" - integrity sha1-2TPOuSBdgr3PSIb2dCvcK03qFG0= - -map-obj@^4.0.0: - version "4.1.0" - resolved "https://registry.npmjs.org/map-obj/-/map-obj-4.1.0.tgz" - integrity sha512-glc9y00wgtwcDmp7GaE/0b0OnxpNJsVf3ael/An6Fe2Q51LLwN1er6sdomLRzz5h0+yMpiYLhWYF5R7HeqVd4g== - -map-visit@^1.0.0: - version "1.0.0" - resolved "https://registry.npmjs.org/map-visit/-/map-visit-1.0.0.tgz" - integrity sha1-7Nyo8TFE5mDxtb1B8S80edmN+48= - dependencies: - object-visit "^1.0.0" - -math-random@^1.0.1: - version "1.0.4" - resolved "https://registry.npmjs.org/math-random/-/math-random-1.0.4.tgz" - integrity sha512-rUxjysqif/BZQH2yhd5Aaq7vXMSx9NdEsQcyA07uEzIvxgI7zIr33gGsh+RU0/XjmQpCW7RsVof1vlkvQVCK5A== - -mcl-wasm@^0.7.1: - version "0.7.9" - resolved "https://registry.npmjs.org/mcl-wasm/-/mcl-wasm-0.7.9.tgz" - integrity sha512-iJIUcQWA88IJB/5L15GnJVnSQJmf/YaxxV6zRavv83HILHaJQb6y0iFyDMdDO0gN8X37tdxmAOrH/P8B6RB8sQ== - -md5.js@^1.3.4: - version "1.3.5" - resolved "https://registry.npmjs.org/md5.js/-/md5.js-1.3.5.tgz" - integrity sha512-xitP+WxNPcTTOgnTJcrhM0xvdPepipPSf3I8EIpGKeFLjt3PlJLIDG3u8EX53ZIubkb+5U2+3rELYpEhHhzdkg== - dependencies: - hash-base "^3.0.0" - inherits "^2.0.1" - safe-buffer "^5.1.2" - -mem@^1.1.0: - version "1.1.0" - resolved "https://registry.npmjs.org/mem/-/mem-1.1.0.tgz" - integrity sha1-Xt1StIXKHZAP5kiVUFOZoN+kX3Y= - dependencies: - mimic-fn "^1.0.0" - -memdown@^5.0.0: - version "5.1.0" - resolved "https://registry.npmjs.org/memdown/-/memdown-5.1.0.tgz" - integrity sha512-B3J+UizMRAlEArDjWHTMmadet+UKwHd3UjMgGBkZcKAxAYVPS9o0Yeiha4qvz7iGiL2Sb3igUft6p7nbFWctpw== - dependencies: - abstract-leveldown "~6.2.1" - functional-red-black-tree "~1.0.1" - immediate "~3.2.3" - inherits "~2.0.1" - ltgt "~2.2.0" - safe-buffer "~5.2.0" - -memorystream@^0.3.1: - version "0.3.1" - resolved "https://registry.npmjs.org/memorystream/-/memorystream-0.3.1.tgz" - integrity sha1-htcJCzDORV1j+64S3aUaR93K+bI= - -meow@^8.0.0: - version "8.1.2" - resolved "https://registry.npmjs.org/meow/-/meow-8.1.2.tgz" - integrity sha512-r85E3NdZ+mpYk1C6RjPFEMSE+s1iZMuHtsHAqY0DT3jZczl0diWUZ8g6oU7h0M9cD2EL+PzaYghhCLzR0ZNn5Q== + "deferred-leveldown" "~5.3.0" + "level-errors" "~2.0.0" + "level-iterator-stream" "~4.0.0" + "level-supports" "~1.0.0" + "xtend" "~4.0.0" + +"lines-and-columns@^1.1.6": + "integrity" "sha1-HADHQ7QzzQpOgHWPe2SldEDZ/wA=" + "resolved" "https://registry.npmjs.org/lines-and-columns/-/lines-and-columns-1.1.6.tgz" + "version" "1.1.6" + +"locate-path@^2.0.0": + "integrity" "sha1-K1aLJl7slExtnA3pw9u7ygNUzY4=" + "resolved" "https://registry.npmjs.org/locate-path/-/locate-path-2.0.0.tgz" + "version" "2.0.0" + dependencies: + "p-locate" "^2.0.0" + "path-exists" "^3.0.0" + +"locate-path@^5.0.0": + "integrity" "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==" + "resolved" "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz" + "version" "5.0.0" + dependencies: + "p-locate" "^4.1.0" + +"locate-path@^6.0.0": + "integrity" "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==" + "resolved" "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz" + "version" "6.0.0" + dependencies: + "p-locate" "^5.0.0" + +"lodash@^4.14.2", "lodash@^4.17.11", "lodash@^4.17.14", "lodash@^4.17.15", "lodash@^4.17.19": + "integrity" "sha512-PlhdFcillOINfeV7Ni6oF1TAEayyZBoZ8bcshTHqOYJYlrqzRK5hagpagky5o4HfCzzd1TRkXPMFq6cKk9rGmA==" + "resolved" "https://registry.npmjs.org/lodash/-/lodash-4.17.20.tgz" + "version" "4.17.20" + +"log-symbols@4.1.0": + "integrity" "sha512-8XPvpAA8uyhfteu8pIvQxpJZ7SYYdpUivZpGy6sFsBuKRY/7rQGavedeB8aK+Zkyq6upMFVL/9AW6vOYzfRyLg==" + "resolved" "https://registry.npmjs.org/log-symbols/-/log-symbols-4.1.0.tgz" + "version" "4.1.0" + dependencies: + "chalk" "^4.1.0" + "is-unicode-supported" "^0.1.0" + +"lru_map@^0.3.3": + "integrity" "sha1-tcg1G5Rky9dQM1p5ZQoOwOVhGN0=" + "resolved" "https://registry.npmjs.org/lru_map/-/lru_map-0.3.3.tgz" + "version" "0.3.3" + +"lru-cache@^4.0.1": + "integrity" "sha512-sWZlbEP2OsHNkXrMl5GYk/jKk70MBng6UU4YI/qGDYbgf6YbP4EvmqISbXCoJiRKs+1bSpFHVgQxvJ17F2li5g==" + "resolved" "https://registry.npmjs.org/lru-cache/-/lru-cache-4.1.5.tgz" + "version" "4.1.5" + dependencies: + "pseudomap" "^1.0.2" + "yallist" "^2.1.2" + +"lru-cache@^5.1.1": + "integrity" "sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==" + "resolved" "https://registry.npmjs.org/lru-cache/-/lru-cache-5.1.1.tgz" + "version" "5.1.1" + dependencies: + "yallist" "^3.0.2" + +"lru-cache@^6.0.0": + "integrity" "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==" + "resolved" "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz" + "version" "6.0.0" + dependencies: + "yallist" "^4.0.0" + +"ltgt@~2.2.0": + "integrity" "sha1-81ypHEk/e3PaDgdJUwTxezH4fuU=" + "resolved" "https://registry.npmjs.org/ltgt/-/ltgt-2.2.1.tgz" + "version" "2.2.1" + +"map-cache@^0.2.2": + "integrity" "sha1-wyq9C9ZSXZsFFkW7TyasXcmKDb8=" + "resolved" "https://registry.npmjs.org/map-cache/-/map-cache-0.2.2.tgz" + "version" "0.2.2" + +"map-obj@^1.0.0": + "integrity" "sha1-2TPOuSBdgr3PSIb2dCvcK03qFG0=" + "resolved" "https://registry.npmjs.org/map-obj/-/map-obj-1.0.1.tgz" + "version" "1.0.1" + +"map-obj@^4.0.0": + "integrity" "sha512-glc9y00wgtwcDmp7GaE/0b0OnxpNJsVf3ael/An6Fe2Q51LLwN1er6sdomLRzz5h0+yMpiYLhWYF5R7HeqVd4g==" + "resolved" "https://registry.npmjs.org/map-obj/-/map-obj-4.1.0.tgz" + "version" "4.1.0" + +"map-visit@^1.0.0": + "integrity" "sha1-7Nyo8TFE5mDxtb1B8S80edmN+48=" + "resolved" "https://registry.npmjs.org/map-visit/-/map-visit-1.0.0.tgz" + "version" "1.0.0" + dependencies: + "object-visit" "^1.0.0" + +"math-random@^1.0.1": + "integrity" "sha512-rUxjysqif/BZQH2yhd5Aaq7vXMSx9NdEsQcyA07uEzIvxgI7zIr33gGsh+RU0/XjmQpCW7RsVof1vlkvQVCK5A==" + "resolved" "https://registry.npmjs.org/math-random/-/math-random-1.0.4.tgz" + "version" "1.0.4" + +"mcl-wasm@^0.7.1": + "integrity" "sha512-iJIUcQWA88IJB/5L15GnJVnSQJmf/YaxxV6zRavv83HILHaJQb6y0iFyDMdDO0gN8X37tdxmAOrH/P8B6RB8sQ==" + "resolved" "https://registry.npmjs.org/mcl-wasm/-/mcl-wasm-0.7.9.tgz" + "version" "0.7.9" + +"md5.js@^1.3.4": + "integrity" "sha512-xitP+WxNPcTTOgnTJcrhM0xvdPepipPSf3I8EIpGKeFLjt3PlJLIDG3u8EX53ZIubkb+5U2+3rELYpEhHhzdkg==" + "resolved" "https://registry.npmjs.org/md5.js/-/md5.js-1.3.5.tgz" + "version" "1.3.5" + dependencies: + "hash-base" "^3.0.0" + "inherits" "^2.0.1" + "safe-buffer" "^5.1.2" + +"mem@^1.1.0": + "integrity" "sha1-Xt1StIXKHZAP5kiVUFOZoN+kX3Y=" + "resolved" "https://registry.npmjs.org/mem/-/mem-1.1.0.tgz" + "version" "1.1.0" + dependencies: + "mimic-fn" "^1.0.0" + +"memdown@^5.0.0": + "integrity" "sha512-B3J+UizMRAlEArDjWHTMmadet+UKwHd3UjMgGBkZcKAxAYVPS9o0Yeiha4qvz7iGiL2Sb3igUft6p7nbFWctpw==" + "resolved" "https://registry.npmjs.org/memdown/-/memdown-5.1.0.tgz" + "version" "5.1.0" + dependencies: + "abstract-leveldown" "~6.2.1" + "functional-red-black-tree" "~1.0.1" + "immediate" "~3.2.3" + "inherits" "~2.0.1" + "ltgt" "~2.2.0" + "safe-buffer" "~5.2.0" + +"memorystream@^0.3.1": + "integrity" "sha1-htcJCzDORV1j+64S3aUaR93K+bI=" + "resolved" "https://registry.npmjs.org/memorystream/-/memorystream-0.3.1.tgz" + "version" "0.3.1" + +"meow@^8.0.0": + "integrity" "sha512-r85E3NdZ+mpYk1C6RjPFEMSE+s1iZMuHtsHAqY0DT3jZczl0diWUZ8g6oU7h0M9cD2EL+PzaYghhCLzR0ZNn5Q==" + "resolved" "https://registry.npmjs.org/meow/-/meow-8.1.2.tgz" + "version" "8.1.2" dependencies: "@types/minimist" "^1.2.0" - camelcase-keys "^6.2.2" - decamelize-keys "^1.1.0" - hard-rejection "^2.1.0" - minimist-options "4.1.0" - normalize-package-data "^3.0.0" - read-pkg-up "^7.0.1" - redent "^3.0.0" - trim-newlines "^3.0.0" - type-fest "^0.18.0" - yargs-parser "^20.2.3" - -merge-stream@^2.0.0: - version "2.0.0" - resolved "https://registry.npmjs.org/merge-stream/-/merge-stream-2.0.0.tgz" - integrity sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w== - -merkle-patricia-tree@^4.2.0, merkle-patricia-tree@^4.2.1: - version "4.2.2" - resolved "https://registry.npmjs.org/merkle-patricia-tree/-/merkle-patricia-tree-4.2.2.tgz" - integrity sha512-eqZYNTshcYx9aESkSPr71EqwsR/QmpnObDEV4iLxkt/x/IoLYZYjJvKY72voP/27Vy61iMOrfOG6jrn7ttXD+Q== + "camelcase-keys" "^6.2.2" + "decamelize-keys" "^1.1.0" + "hard-rejection" "^2.1.0" + "minimist-options" "4.1.0" + "normalize-package-data" "^3.0.0" + "read-pkg-up" "^7.0.1" + "redent" "^3.0.0" + "trim-newlines" "^3.0.0" + "type-fest" "^0.18.0" + "yargs-parser" "^20.2.3" + +"merge-stream@^2.0.0": + "integrity" "sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==" + "resolved" "https://registry.npmjs.org/merge-stream/-/merge-stream-2.0.0.tgz" + "version" "2.0.0" + +"merkle-patricia-tree@^4.2.2", "merkle-patricia-tree@^4.2.4": + "integrity" "sha512-eHbf/BG6eGNsqqfbLED9rIqbsF4+sykEaBn6OLNs71tjclbMcMOk1tEPmJKcNcNCLkvbpY/lwyOlizWsqPNo8w==" + "resolved" "https://registry.npmjs.org/merkle-patricia-tree/-/merkle-patricia-tree-4.2.4.tgz" + "version" "4.2.4" dependencies: "@types/levelup" "^4.3.0" - ethereumjs-util "^7.1.2" - level-mem "^5.0.1" - level-ws "^2.0.0" - readable-stream "^3.6.0" - rlp "^2.2.4" - semaphore-async-await "^1.5.1" - -micromatch@^2.1.5: - version "2.3.11" - resolved "https://registry.npmjs.org/micromatch/-/micromatch-2.3.11.tgz" - integrity sha1-hmd8l9FyCzY0MdBNDRUpO9OMFWU= - dependencies: - arr-diff "^2.0.0" - array-unique "^0.2.1" - braces "^1.8.2" - expand-brackets "^0.1.4" - extglob "^0.3.1" - filename-regex "^2.0.0" - is-extglob "^1.0.0" - is-glob "^2.0.1" - kind-of "^3.0.2" - normalize-path "^2.0.1" - object.omit "^2.0.0" - parse-glob "^3.0.4" - regex-cache "^0.4.2" - -micromatch@^3.1.10: - version "3.1.10" - resolved "https://registry.npmjs.org/micromatch/-/micromatch-3.1.10.tgz" - integrity sha512-MWikgl9n9M3w+bpsY3He8L+w9eF9338xRl8IAO5viDizwSzziFEyUzo2xrrloB64ADbTf8uA8vRqqttDTOmccg== - dependencies: - arr-diff "^4.0.0" - array-unique "^0.3.2" - braces "^2.3.1" - define-property "^2.0.2" - extend-shallow "^3.0.2" - extglob "^2.0.4" - fragment-cache "^0.2.1" - kind-of "^6.0.2" - nanomatch "^1.2.9" - object.pick "^1.3.0" - regex-not "^1.0.0" - snapdragon "^0.8.1" - to-regex "^3.0.2" - -miller-rabin@^4.0.0: - version "4.0.1" - resolved "https://registry.npmjs.org/miller-rabin/-/miller-rabin-4.0.1.tgz" - integrity sha512-115fLhvZVqWwHPbClyntxEVfVDfl9DLLTuJvq3g2O/Oxi8AiNouAHvDSzHS0viUJc+V5vm3eq91Xwqn9dp4jRA== - dependencies: - bn.js "^4.0.0" - brorand "^1.0.1" - -mimic-fn@^1.0.0: - version "1.2.0" - resolved "https://registry.npmjs.org/mimic-fn/-/mimic-fn-1.2.0.tgz" - integrity sha512-jf84uxzwiuiIVKiOLpfYk7N46TSy8ubTonmneY9vrpHNAnp0QBt2BxWV9dO3/j+BoVAb+a5G6YDPW3M5HOdMWQ== - -mimic-fn@^2.1.0: - version "2.1.0" - resolved "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.1.0.tgz" - integrity sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg== - -min-indent@^1.0.0: - version "1.0.1" - resolved "https://registry.npmjs.org/min-indent/-/min-indent-1.0.1.tgz" - integrity sha512-I9jwMn07Sy/IwOj3zVkVik2JTvgpaykDZEigL6Rx6N9LbMywwUSMtxET+7lVoDLLd3O3IXwJwvuuns8UB/HeAg== - -minimalistic-assert@^1.0.0, minimalistic-assert@^1.0.1: - version "1.0.1" - resolved "https://registry.npmjs.org/minimalistic-assert/-/minimalistic-assert-1.0.1.tgz" - integrity sha512-UtJcAD4yEaGtjPezWuO9wC4nwUnVH/8/Im3yEHQP4b67cXlD/Qr9hdITCU1xDbSEXg2XKNaP8jsReV7vQd00/A== - -minimalistic-crypto-utils@^1.0.1: - version "1.0.1" - resolved "https://registry.npmjs.org/minimalistic-crypto-utils/-/minimalistic-crypto-utils-1.0.1.tgz" - integrity sha1-9sAMHAsIIkblxNmd+4x8CDsrWCo= - -minimatch@3.0.4, minimatch@^3.0.4: - version "3.0.4" - resolved "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz" - integrity sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA== - dependencies: - brace-expansion "^1.1.7" - -minimist-options@4.1.0: - version "4.1.0" - resolved "https://registry.npmjs.org/minimist-options/-/minimist-options-4.1.0.tgz" - integrity sha512-Q4r8ghd80yhO/0j1O3B2BjweX3fiHg9cdOwjJd2J76Q135c+NDxGCqdYKQ1SKBuFfgWbAUzBfvYjPUEeNgqN1A== - dependencies: - arrify "^1.0.1" - is-plain-obj "^1.1.0" - kind-of "^6.0.3" - -minimist@0.0.8: - version "0.0.8" - resolved "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz" - integrity sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0= - -minimist@^1.2.5: - version "1.2.5" - resolved "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz" - integrity sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw== - -mixin-deep@^1.2.0: - version "1.3.2" - resolved "https://registry.npmjs.org/mixin-deep/-/mixin-deep-1.3.2.tgz" - integrity sha512-WRoDn//mXBiJ1H40rqa3vH0toePwSsGb45iInWlTySa+Uu4k3tYUSxa2v1KqAiLtvlrSzaExqS1gtk96A9zvEA== - dependencies: - for-in "^1.0.2" - is-extendable "^1.0.1" - -mkdirp@0.5.1: - version "0.5.1" - resolved "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz" - integrity sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM= - dependencies: - minimist "0.0.8" - -mkdirp@0.5.5: - version "0.5.5" - resolved "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.5.tgz" - integrity sha512-NKmAlESf6jMGym1++R0Ra7wvhV+wFW63FaSOFPwRahvea0gMUcGUhVeAg/0BC0wiv9ih5NYPB1Wn1UEI1/L+xQ== - dependencies: - minimist "^1.2.5" - -mnemonist@^0.38.0: - version "0.38.5" - resolved "https://registry.npmjs.org/mnemonist/-/mnemonist-0.38.5.tgz" - integrity sha512-bZTFT5rrPKtPJxj8KSV0WkPyNxl72vQepqqVUAW2ARUpUSF2qXMB6jZj7hW5/k7C1rtpzqbD/IIbJwLXUjCHeg== - dependencies: - obliterator "^2.0.0" - -mocha@^4.0.1: - version "4.1.0" - resolved "https://registry.npmjs.org/mocha/-/mocha-4.1.0.tgz" - integrity sha512-0RVnjg1HJsXY2YFDoTNzcc1NKhYuXKRrBAG2gDygmJJA136Cs2QlRliZG1mA0ap7cuaT30mw16luAeln+4RiNA== - dependencies: - browser-stdout "1.3.0" - commander "2.11.0" - debug "3.1.0" - diff "3.3.1" - escape-string-regexp "1.0.5" - glob "7.1.2" - growl "1.10.3" - he "1.1.1" - mkdirp "0.5.1" - supports-color "4.4.0" - -mocha@^7.1.2: - version "7.2.0" - resolved "https://registry.npmjs.org/mocha/-/mocha-7.2.0.tgz" - integrity sha512-O9CIypScywTVpNaRrCAgoUnJgozpIofjKUYmJhiCIJMiuYnLI6otcb1/kpW9/n/tJODHGZ7i8aLQoDVsMtOKQQ== - dependencies: - ansi-colors "3.2.3" - browser-stdout "1.3.1" - chokidar "3.3.0" - debug "3.2.6" - diff "3.5.0" - escape-string-regexp "1.0.5" - find-up "3.0.0" - glob "7.1.3" - growl "1.10.5" - he "1.2.0" - js-yaml "3.13.1" - log-symbols "3.0.0" - minimatch "3.0.4" - mkdirp "0.5.5" - ms "2.1.1" - node-environment-flags "1.0.6" - object.assign "4.1.0" - strip-json-comments "2.0.1" - supports-color "6.0.0" - which "1.3.1" - wide-align "1.1.3" - yargs "13.3.2" - yargs-parser "13.1.2" - yargs-unparser "1.6.0" - -mri@^1.1.5: - version "1.1.6" - resolved "https://registry.npmjs.org/mri/-/mri-1.1.6.tgz" - integrity sha512-oi1b3MfbyGa7FJMP9GmLTttni5JoICpYBRlq+x5V16fZbLsnL9N3wFqqIm/nIG43FjUFkFh9Epzp/kzUGUnJxQ== - -ms@2.0.0: - version "2.0.0" - resolved "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz" - integrity sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g= - -ms@2.1.1, ms@^2.1.1: - version "2.1.1" - resolved "https://registry.npmjs.org/ms/-/ms-2.1.1.tgz" - integrity sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg== - -ms@2.1.2: - version "2.1.2" - resolved "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz" - integrity sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w== - -multimatch@^4.0.0: - version "4.0.0" - resolved "https://registry.npmjs.org/multimatch/-/multimatch-4.0.0.tgz" - integrity sha512-lDmx79y1z6i7RNx0ZGCPq1bzJ6ZoDDKbvh7jxr9SJcWLkShMzXrHbYVpTdnhNM5MXpDUxCQ4DgqVttVXlBgiBQ== + "ethereumjs-util" "^7.1.4" + "level-mem" "^5.0.1" + "level-ws" "^2.0.0" + "readable-stream" "^3.6.0" + "semaphore-async-await" "^1.5.1" + +"micromatch@^2.1.5": + "integrity" "sha1-hmd8l9FyCzY0MdBNDRUpO9OMFWU=" + "resolved" "https://registry.npmjs.org/micromatch/-/micromatch-2.3.11.tgz" + "version" "2.3.11" + dependencies: + "arr-diff" "^2.0.0" + "array-unique" "^0.2.1" + "braces" "^1.8.2" + "expand-brackets" "^0.1.4" + "extglob" "^0.3.1" + "filename-regex" "^2.0.0" + "is-extglob" "^1.0.0" + "is-glob" "^2.0.1" + "kind-of" "^3.0.2" + "normalize-path" "^2.0.1" + "object.omit" "^2.0.0" + "parse-glob" "^3.0.4" + "regex-cache" "^0.4.2" + +"micromatch@^3.1.10": + "integrity" "sha512-MWikgl9n9M3w+bpsY3He8L+w9eF9338xRl8IAO5viDizwSzziFEyUzo2xrrloB64ADbTf8uA8vRqqttDTOmccg==" + "resolved" "https://registry.npmjs.org/micromatch/-/micromatch-3.1.10.tgz" + "version" "3.1.10" + dependencies: + "arr-diff" "^4.0.0" + "array-unique" "^0.3.2" + "braces" "^2.3.1" + "define-property" "^2.0.2" + "extend-shallow" "^3.0.2" + "extglob" "^2.0.4" + "fragment-cache" "^0.2.1" + "kind-of" "^6.0.2" + "nanomatch" "^1.2.9" + "object.pick" "^1.3.0" + "regex-not" "^1.0.0" + "snapdragon" "^0.8.1" + "to-regex" "^3.0.2" + +"miller-rabin@^4.0.0": + "integrity" "sha512-115fLhvZVqWwHPbClyntxEVfVDfl9DLLTuJvq3g2O/Oxi8AiNouAHvDSzHS0viUJc+V5vm3eq91Xwqn9dp4jRA==" + "resolved" "https://registry.npmjs.org/miller-rabin/-/miller-rabin-4.0.1.tgz" + "version" "4.0.1" + dependencies: + "bn.js" "^4.0.0" + "brorand" "^1.0.1" + +"mimic-fn@^1.0.0": + "integrity" "sha512-jf84uxzwiuiIVKiOLpfYk7N46TSy8ubTonmneY9vrpHNAnp0QBt2BxWV9dO3/j+BoVAb+a5G6YDPW3M5HOdMWQ==" + "resolved" "https://registry.npmjs.org/mimic-fn/-/mimic-fn-1.2.0.tgz" + "version" "1.2.0" + +"mimic-fn@^2.1.0": + "integrity" "sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==" + "resolved" "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.1.0.tgz" + "version" "2.1.0" + +"min-indent@^1.0.0": + "integrity" "sha512-I9jwMn07Sy/IwOj3zVkVik2JTvgpaykDZEigL6Rx6N9LbMywwUSMtxET+7lVoDLLd3O3IXwJwvuuns8UB/HeAg==" + "resolved" "https://registry.npmjs.org/min-indent/-/min-indent-1.0.1.tgz" + "version" "1.0.1" + +"minimalistic-assert@^1.0.0", "minimalistic-assert@^1.0.1": + "integrity" "sha512-UtJcAD4yEaGtjPezWuO9wC4nwUnVH/8/Im3yEHQP4b67cXlD/Qr9hdITCU1xDbSEXg2XKNaP8jsReV7vQd00/A==" + "resolved" "https://registry.npmjs.org/minimalistic-assert/-/minimalistic-assert-1.0.1.tgz" + "version" "1.0.1" + +"minimalistic-crypto-utils@^1.0.1": + "integrity" "sha1-9sAMHAsIIkblxNmd+4x8CDsrWCo=" + "resolved" "https://registry.npmjs.org/minimalistic-crypto-utils/-/minimalistic-crypto-utils-1.0.1.tgz" + "version" "1.0.1" + +"minimatch@^3.0.4": + "integrity" "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==" + "resolved" "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz" + "version" "3.0.4" + dependencies: + "brace-expansion" "^1.1.7" + +"minimatch@4.2.1": + "integrity" "sha512-9Uq1ChtSZO+Mxa/CL1eGizn2vRn3MlLgzhT0Iz8zaY8NdvxvB0d5QdPFmCKf7JKA9Lerx5vRrnwO03jsSfGG9g==" + "resolved" "https://registry.npmjs.org/minimatch/-/minimatch-4.2.1.tgz" + "version" "4.2.1" + dependencies: + "brace-expansion" "^1.1.7" + +"minimist-options@4.1.0": + "integrity" "sha512-Q4r8ghd80yhO/0j1O3B2BjweX3fiHg9cdOwjJd2J76Q135c+NDxGCqdYKQ1SKBuFfgWbAUzBfvYjPUEeNgqN1A==" + "resolved" "https://registry.npmjs.org/minimist-options/-/minimist-options-4.1.0.tgz" + "version" "4.1.0" + dependencies: + "arrify" "^1.0.1" + "is-plain-obj" "^1.1.0" + "kind-of" "^6.0.3" + +"minimist@0.0.8": + "integrity" "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=" + "resolved" "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz" + "version" "0.0.8" + +"mixin-deep@^1.2.0": + "integrity" "sha512-WRoDn//mXBiJ1H40rqa3vH0toePwSsGb45iInWlTySa+Uu4k3tYUSxa2v1KqAiLtvlrSzaExqS1gtk96A9zvEA==" + "resolved" "https://registry.npmjs.org/mixin-deep/-/mixin-deep-1.3.2.tgz" + "version" "1.3.2" + dependencies: + "for-in" "^1.0.2" + "is-extendable" "^1.0.1" + +"mkdirp@0.5.1": + "integrity" "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=" + "resolved" "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz" + "version" "0.5.1" + dependencies: + "minimist" "0.0.8" + +"mnemonist@^0.38.0": + "integrity" "sha512-bZTFT5rrPKtPJxj8KSV0WkPyNxl72vQepqqVUAW2ARUpUSF2qXMB6jZj7hW5/k7C1rtpzqbD/IIbJwLXUjCHeg==" + "resolved" "https://registry.npmjs.org/mnemonist/-/mnemonist-0.38.5.tgz" + "version" "0.38.5" + dependencies: + "obliterator" "^2.0.0" + +"mocha@^4.0.1": + "integrity" "sha512-0RVnjg1HJsXY2YFDoTNzcc1NKhYuXKRrBAG2gDygmJJA136Cs2QlRliZG1mA0ap7cuaT30mw16luAeln+4RiNA==" + "resolved" "https://registry.npmjs.org/mocha/-/mocha-4.1.0.tgz" + "version" "4.1.0" + dependencies: + "browser-stdout" "1.3.0" + "commander" "2.11.0" + "debug" "3.1.0" + "diff" "3.3.1" + "escape-string-regexp" "1.0.5" + "glob" "7.1.2" + "growl" "1.10.3" + "he" "1.1.1" + "mkdirp" "0.5.1" + "supports-color" "4.4.0" + +"mocha@^9.2.0": + "integrity" "sha512-L6XC3EdwT6YrIk0yXpavvLkn8h+EU+Y5UcCHKECyMbdUIxyMuZj4bX4U9e1nvnvUUvQVsV2VHQr5zLdcUkhW/g==" + "resolved" "https://registry.npmjs.org/mocha/-/mocha-9.2.2.tgz" + "version" "9.2.2" + dependencies: + "@ungap/promise-all-settled" "1.1.2" + "ansi-colors" "4.1.1" + "browser-stdout" "1.3.1" + "chokidar" "3.5.3" + "debug" "4.3.3" + "diff" "5.0.0" + "escape-string-regexp" "4.0.0" + "find-up" "5.0.0" + "glob" "7.2.0" + "growl" "1.10.5" + "he" "1.2.0" + "js-yaml" "4.1.0" + "log-symbols" "4.1.0" + "minimatch" "4.2.1" + "ms" "2.1.3" + "nanoid" "3.3.1" + "serialize-javascript" "6.0.0" + "strip-json-comments" "3.1.1" + "supports-color" "8.1.1" + "which" "2.0.2" + "workerpool" "6.2.0" + "yargs" "16.2.0" + "yargs-parser" "20.2.4" + "yargs-unparser" "2.0.0" + +"mri@^1.1.5": + "integrity" "sha512-oi1b3MfbyGa7FJMP9GmLTttni5JoICpYBRlq+x5V16fZbLsnL9N3wFqqIm/nIG43FjUFkFh9Epzp/kzUGUnJxQ==" + "resolved" "https://registry.npmjs.org/mri/-/mri-1.1.6.tgz" + "version" "1.1.6" + +"ms@2.0.0": + "integrity" "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=" + "resolved" "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz" + "version" "2.0.0" + +"ms@2.1.2": + "integrity" "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" + "resolved" "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz" + "version" "2.1.2" + +"ms@2.1.3": + "integrity" "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==" + "resolved" "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz" + "version" "2.1.3" + +"multimatch@^4.0.0": + "integrity" "sha512-lDmx79y1z6i7RNx0ZGCPq1bzJ6ZoDDKbvh7jxr9SJcWLkShMzXrHbYVpTdnhNM5MXpDUxCQ4DgqVttVXlBgiBQ==" + "resolved" "https://registry.npmjs.org/multimatch/-/multimatch-4.0.0.tgz" + "version" "4.0.0" dependencies: "@types/minimatch" "^3.0.3" - array-differ "^3.0.0" - array-union "^2.1.0" - arrify "^2.0.1" - minimatch "^3.0.4" - -nan@^2.12.1: - version "2.14.2" - resolved "https://registry.npmjs.org/nan/-/nan-2.14.2.tgz" - integrity sha512-M2ufzIiINKCuDfBSAUr1vWQ+vuVcA9kqx8JJUsbQi6yf1uGRyb7HfpdfUr5qLXf3B/t8dPvcjhKMmlfnP47EzQ== - -nanomatch@^1.2.9: - version "1.2.13" - resolved "https://registry.npmjs.org/nanomatch/-/nanomatch-1.2.13.tgz" - integrity sha512-fpoe2T0RbHwBTBUOftAfBPaDEi06ufaUai0mE6Yn1kacc3SnTErfb/h+X94VXzI64rKFHYImXSvdwGGCmwOqCA== - dependencies: - arr-diff "^4.0.0" - array-unique "^0.3.2" - define-property "^2.0.2" - extend-shallow "^3.0.2" - fragment-cache "^0.2.1" - is-windows "^1.0.2" - kind-of "^6.0.2" - object.pick "^1.3.0" - regex-not "^1.0.0" - snapdragon "^0.8.1" - to-regex "^3.0.1" - -node-addon-api@^2.0.0: - version "2.0.2" - resolved "https://registry.npmjs.org/node-addon-api/-/node-addon-api-2.0.2.tgz" - integrity sha512-Ntyt4AIXyaLIuMHF6IOoTakB3K+RWxwtsHNRxllEoA6vPwP9o4866g6YWDLUdnucilZhmkxiHwHr11gAENw+QA== - -node-environment-flags@1.0.6: - version "1.0.6" - resolved "https://registry.npmjs.org/node-environment-flags/-/node-environment-flags-1.0.6.tgz" - integrity sha512-5Evy2epuL+6TM0lCQGpFIj6KwiEsGh1SrHUhTbNX+sLbBtjidPZFAnVK9y5yU1+h//RitLbRHTIMyxQPtxMdHw== - dependencies: - object.getownpropertydescriptors "^2.0.3" - semver "^5.7.0" - -node-fetch@^2.6.0: - version "2.6.5" - resolved "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.5.tgz" - integrity sha512-mmlIVHJEu5rnIxgEgez6b9GgWXbkZj5YZ7fx+2r94a2E+Uirsp6HsPTPlomfdHtpt/B0cdKviwkoaM6pyvUOpQ== - dependencies: - whatwg-url "^5.0.0" - -node-gyp-build@^4.2.0: - version "4.3.0" - resolved "https://registry.npmjs.org/node-gyp-build/-/node-gyp-build-4.3.0.tgz" - integrity sha512-iWjXZvmboq0ja1pUGULQBexmxq8CV4xBhX7VDOTbL7ZR4FOowwY/VOtRxBN/yKxmdGoIp4j5ysNT4u3S2pDQ3Q== - -normalize-package-data@^2.5.0: - version "2.5.0" - resolved "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.5.0.tgz" - integrity sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA== - dependencies: - hosted-git-info "^2.1.4" - resolve "^1.10.0" - semver "2 || 3 || 4 || 5" - validate-npm-package-license "^3.0.1" - -normalize-package-data@^3.0.0: - version "3.0.0" - resolved "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-3.0.0.tgz" - integrity sha512-6lUjEI0d3v6kFrtgA/lOx4zHCWULXsFNIjHolnZCKCTLA6m/G625cdn3O7eNmT0iD3jfo6HZ9cdImGZwf21prw== - dependencies: - hosted-git-info "^3.0.6" - resolve "^1.17.0" - semver "^7.3.2" - validate-npm-package-license "^3.0.1" - -normalize-path@^2.0.0, normalize-path@^2.0.1: - version "2.1.1" - resolved "https://registry.npmjs.org/normalize-path/-/normalize-path-2.1.1.tgz" - integrity sha1-GrKLVW4Zg2Oowab35vogE3/mrtk= - dependencies: - remove-trailing-separator "^1.0.1" - -normalize-path@^3.0.0, normalize-path@~3.0.0: - version "3.0.0" - resolved "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz" - integrity sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA== - -npm-run-path@^2.0.0: - version "2.0.2" - resolved "https://registry.npmjs.org/npm-run-path/-/npm-run-path-2.0.2.tgz" - integrity sha1-NakjLfo11wZ7TLLd8jV7GHFTbF8= - dependencies: - path-key "^2.0.0" - -npm-run-path@^4.0.0: - version "4.0.1" - resolved "https://registry.npmjs.org/npm-run-path/-/npm-run-path-4.0.1.tgz" - integrity sha512-S48WzZW777zhNIrn7gxOlISNAqi9ZC/uQFnRdbeIHhZhCA6UqpkOT8T1G7BvfdgP4Er8gF4sUbaS0i7QvIfCWw== - dependencies: - path-key "^3.0.0" - -number-is-nan@^1.0.0: - version "1.0.1" - resolved "https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.1.tgz" - integrity sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0= - -object-copy@^0.1.0: - version "0.1.0" - resolved "https://registry.npmjs.org/object-copy/-/object-copy-0.1.0.tgz" - integrity sha1-fn2Fi3gb18mRpBupde04EnVOmYw= - dependencies: - copy-descriptor "^0.1.0" - define-property "^0.2.5" - kind-of "^3.0.3" - -object-inspect@^1.11.0, object-inspect@^1.9.0: - version "1.11.0" - resolved "https://registry.npmjs.org/object-inspect/-/object-inspect-1.11.0.tgz" - integrity sha512-jp7ikS6Sd3GxQfZJPyH3cjcbJF6GZPClgdV+EFygjFLQ5FmW/dRUnTd9PQ9k0JhoNDabWFbpF1yCdSWCC6gexg== - -object-keys@^1.0.11, object-keys@^1.0.12, object-keys@^1.1.1: - version "1.1.1" - resolved "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz" - integrity sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA== - -object-visit@^1.0.0: - version "1.0.1" - resolved "https://registry.npmjs.org/object-visit/-/object-visit-1.0.1.tgz" - integrity sha1-95xEk68MU3e1n+OdOV5BBC3QRbs= - dependencies: - isobject "^3.0.0" - -object.assign@4.1.0: - version "4.1.0" - resolved "https://registry.npmjs.org/object.assign/-/object.assign-4.1.0.tgz" - integrity sha512-exHJeq6kBKj58mqGyTQ9DFvrZC/eR6OwxzoM9YRoGBqrXYonaFyGiFMuc9VZrXf7DarreEwMpurG3dd+CNyW5w== - dependencies: - define-properties "^1.1.2" - function-bind "^1.1.1" - has-symbols "^1.0.0" - object-keys "^1.0.11" - -object.assign@^4.1.2: - version "4.1.2" - resolved "https://registry.npmjs.org/object.assign/-/object.assign-4.1.2.tgz" - integrity sha512-ixT2L5THXsApyiUPYKmW+2EHpXXe5Ii3M+f4e+aJFAHao5amFRW6J0OO6c/LU8Be47utCx2GL89hxGB6XSmKuQ== - dependencies: - call-bind "^1.0.0" - define-properties "^1.1.3" - has-symbols "^1.0.1" - object-keys "^1.1.1" - -object.getownpropertydescriptors@^2.0.3, object.getownpropertydescriptors@^2.1.1: - version "2.1.3" - resolved "https://registry.npmjs.org/object.getownpropertydescriptors/-/object.getownpropertydescriptors-2.1.3.tgz" - integrity sha512-VdDoCwvJI4QdC6ndjpqFmoL3/+HxffFBbcJzKi5hwLLqqx3mdbedRpfZDdK0SrOSauj8X4GzBvnDZl4vTN7dOw== - dependencies: - call-bind "^1.0.2" - define-properties "^1.1.3" - es-abstract "^1.19.1" - -object.omit@^2.0.0: - version "2.0.1" - resolved "https://registry.npmjs.org/object.omit/-/object.omit-2.0.1.tgz" - integrity sha1-Gpx0SCnznbuFjHbKNXmuKlTr0fo= - dependencies: - for-own "^0.1.4" - is-extendable "^0.1.1" + "array-differ" "^3.0.0" + "array-union" "^2.1.0" + "arrify" "^2.0.1" + "minimatch" "^3.0.4" + +"nan@^2.12.1": + "integrity" "sha512-M2ufzIiINKCuDfBSAUr1vWQ+vuVcA9kqx8JJUsbQi6yf1uGRyb7HfpdfUr5qLXf3B/t8dPvcjhKMmlfnP47EzQ==" + "resolved" "https://registry.npmjs.org/nan/-/nan-2.14.2.tgz" + "version" "2.14.2" + +"nanoid@3.3.1": + "integrity" "sha512-n6Vs/3KGyxPQd6uO0eH4Bv0ojGSUvuLlIHtC3Y0kEO23YRge8H9x1GCzLn28YX0H66pMkxuaeESFq4tKISKwdw==" + "resolved" "https://registry.npmjs.org/nanoid/-/nanoid-3.3.1.tgz" + "version" "3.3.1" + +"nanomatch@^1.2.9": + "integrity" "sha512-fpoe2T0RbHwBTBUOftAfBPaDEi06ufaUai0mE6Yn1kacc3SnTErfb/h+X94VXzI64rKFHYImXSvdwGGCmwOqCA==" + "resolved" "https://registry.npmjs.org/nanomatch/-/nanomatch-1.2.13.tgz" + "version" "1.2.13" + dependencies: + "arr-diff" "^4.0.0" + "array-unique" "^0.3.2" + "define-property" "^2.0.2" + "extend-shallow" "^3.0.2" + "fragment-cache" "^0.2.1" + "is-windows" "^1.0.2" + "kind-of" "^6.0.2" + "object.pick" "^1.3.0" + "regex-not" "^1.0.0" + "snapdragon" "^0.8.1" + "to-regex" "^3.0.1" + +"node-addon-api@^2.0.0": + "integrity" "sha512-Ntyt4AIXyaLIuMHF6IOoTakB3K+RWxwtsHNRxllEoA6vPwP9o4866g6YWDLUdnucilZhmkxiHwHr11gAENw+QA==" + "resolved" "https://registry.npmjs.org/node-addon-api/-/node-addon-api-2.0.2.tgz" + "version" "2.0.2" + +"node-gyp-build@^4.2.0": + "integrity" "sha512-amJnQCcgtRVw9SvoebO3BKGESClrfXGCUTX9hSn1OuGQTQBOZmVd0Z0OlecpuRksKvbsUqALE8jls/ErClAPuQ==" + "resolved" "https://registry.npmjs.org/node-gyp-build/-/node-gyp-build-4.4.0.tgz" + "version" "4.4.0" + +"normalize-package-data@^2.5.0": + "integrity" "sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA==" + "resolved" "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.5.0.tgz" + "version" "2.5.0" + dependencies: + "hosted-git-info" "^2.1.4" + "resolve" "^1.10.0" + "semver" "2 || 3 || 4 || 5" + "validate-npm-package-license" "^3.0.1" + +"normalize-package-data@^3.0.0": + "integrity" "sha512-6lUjEI0d3v6kFrtgA/lOx4zHCWULXsFNIjHolnZCKCTLA6m/G625cdn3O7eNmT0iD3jfo6HZ9cdImGZwf21prw==" + "resolved" "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-3.0.0.tgz" + "version" "3.0.0" + dependencies: + "hosted-git-info" "^3.0.6" + "resolve" "^1.17.0" + "semver" "^7.3.2" + "validate-npm-package-license" "^3.0.1" + +"normalize-path@^2.0.0", "normalize-path@^2.0.1": + "integrity" "sha1-GrKLVW4Zg2Oowab35vogE3/mrtk=" + "resolved" "https://registry.npmjs.org/normalize-path/-/normalize-path-2.1.1.tgz" + "version" "2.1.1" + dependencies: + "remove-trailing-separator" "^1.0.1" + +"normalize-path@^3.0.0", "normalize-path@~3.0.0": + "integrity" "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==" + "resolved" "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz" + "version" "3.0.0" + +"npm-run-path@^2.0.0": + "integrity" "sha1-NakjLfo11wZ7TLLd8jV7GHFTbF8=" + "resolved" "https://registry.npmjs.org/npm-run-path/-/npm-run-path-2.0.2.tgz" + "version" "2.0.2" + dependencies: + "path-key" "^2.0.0" + +"npm-run-path@^4.0.0": + "integrity" "sha512-S48WzZW777zhNIrn7gxOlISNAqi9ZC/uQFnRdbeIHhZhCA6UqpkOT8T1G7BvfdgP4Er8gF4sUbaS0i7QvIfCWw==" + "resolved" "https://registry.npmjs.org/npm-run-path/-/npm-run-path-4.0.1.tgz" + "version" "4.0.1" + dependencies: + "path-key" "^3.0.0" + +"number-is-nan@^1.0.0": + "integrity" "sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0=" + "resolved" "https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.1.tgz" + "version" "1.0.1" + +"object-copy@^0.1.0": + "integrity" "sha1-fn2Fi3gb18mRpBupde04EnVOmYw=" + "resolved" "https://registry.npmjs.org/object-copy/-/object-copy-0.1.0.tgz" + "version" "0.1.0" + dependencies: + "copy-descriptor" "^0.1.0" + "define-property" "^0.2.5" + "kind-of" "^3.0.3" + +"object-inspect@^1.9.0": + "integrity" "sha512-jp7ikS6Sd3GxQfZJPyH3cjcbJF6GZPClgdV+EFygjFLQ5FmW/dRUnTd9PQ9k0JhoNDabWFbpF1yCdSWCC6gexg==" + "resolved" "https://registry.npmjs.org/object-inspect/-/object-inspect-1.11.0.tgz" + "version" "1.11.0" + +"object-visit@^1.0.0": + "integrity" "sha1-95xEk68MU3e1n+OdOV5BBC3QRbs=" + "resolved" "https://registry.npmjs.org/object-visit/-/object-visit-1.0.1.tgz" + "version" "1.0.1" + dependencies: + "isobject" "^3.0.0" + +"object.omit@^2.0.0": + "integrity" "sha1-Gpx0SCnznbuFjHbKNXmuKlTr0fo=" + "resolved" "https://registry.npmjs.org/object.omit/-/object.omit-2.0.1.tgz" + "version" "2.0.1" + dependencies: + "for-own" "^0.1.4" + "is-extendable" "^0.1.1" + +"object.pick@^1.3.0": + "integrity" "sha1-h6EKxMFpS9Lhy/U1kaZhQftd10c=" + "resolved" "https://registry.npmjs.org/object.pick/-/object.pick-1.3.0.tgz" + "version" "1.3.0" + dependencies: + "isobject" "^3.0.1" + +"obliterator@^2.0.0": + "integrity" "sha512-DJaXYKqe9Rs7c2+Xu08Knkt8P60rTeByyy7IWoXLqyc6ln9ph9NAo6ZbiylDpAshsygzBr81pZL5q6/dqi0RtQ==" + "resolved" "https://registry.npmjs.org/obliterator/-/obliterator-2.0.0.tgz" + "version" "2.0.0" + +"once@^1.3.0", "once@^1.3.1", "once@^1.4.0": + "integrity" "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=" + "resolved" "https://registry.npmjs.org/once/-/once-1.4.0.tgz" + "version" "1.4.0" + dependencies: + "wrappy" "1" -object.pick@^1.3.0: - version "1.3.0" - resolved "https://registry.npmjs.org/object.pick/-/object.pick-1.3.0.tgz" - integrity sha1-h6EKxMFpS9Lhy/U1kaZhQftd10c= +"onetime@^5.1.0": + "integrity" "sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg==" + "resolved" "https://registry.npmjs.org/onetime/-/onetime-5.1.2.tgz" + "version" "5.1.2" dependencies: - isobject "^3.0.1" - -obliterator@^2.0.0: - version "2.0.0" - resolved "https://registry.npmjs.org/obliterator/-/obliterator-2.0.0.tgz" - integrity sha512-DJaXYKqe9Rs7c2+Xu08Knkt8P60rTeByyy7IWoXLqyc6ln9ph9NAo6ZbiylDpAshsygzBr81pZL5q6/dqi0RtQ== - -once@^1.3.0, once@^1.3.1, once@^1.4.0: - version "1.4.0" - resolved "https://registry.npmjs.org/once/-/once-1.4.0.tgz" - integrity sha1-WDsap3WWHUsROsF9nFC6753Xa9E= + "mimic-fn" "^2.1.0" + +"opencollective-postinstall@^2.0.2": + "integrity" "sha512-8AV/sCtuzUeTo8gQK5qDZzARrulB3egtLzFgteqB2tcT4Mw7B8Kt7JcDHmltjz6FOAHsvTevk70gZEbhM4ZS9Q==" + "resolved" "https://registry.npmjs.org/opencollective-postinstall/-/opencollective-postinstall-2.0.3.tgz" + "version" "2.0.3" + +"os-locale@^2.0.0": + "integrity" "sha512-3sslG3zJbEYcaC4YVAvDorjGxc7tv6KVATnLPZONiljsUncvihe9BQoVCEs0RZ1kmf4Hk9OBqlZfJZWI4GanKA==" + "resolved" "https://registry.npmjs.org/os-locale/-/os-locale-2.1.0.tgz" + "version" "2.1.0" dependencies: - wrappy "1" - -onetime@^5.1.0: - version "5.1.2" - resolved "https://registry.npmjs.org/onetime/-/onetime-5.1.2.tgz" - integrity sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg== - dependencies: - mimic-fn "^2.1.0" - -opencollective-postinstall@^2.0.2: - version "2.0.3" - resolved "https://registry.npmjs.org/opencollective-postinstall/-/opencollective-postinstall-2.0.3.tgz" - integrity sha512-8AV/sCtuzUeTo8gQK5qDZzARrulB3egtLzFgteqB2tcT4Mw7B8Kt7JcDHmltjz6FOAHsvTevk70gZEbhM4ZS9Q== - -os-locale@^2.0.0: - version "2.1.0" - resolved "https://registry.npmjs.org/os-locale/-/os-locale-2.1.0.tgz" - integrity sha512-3sslG3zJbEYcaC4YVAvDorjGxc7tv6KVATnLPZONiljsUncvihe9BQoVCEs0RZ1kmf4Hk9OBqlZfJZWI4GanKA== - dependencies: - execa "^0.7.0" - lcid "^1.0.0" - mem "^1.1.0" - -os-tmpdir@~1.0.2: - version "1.0.2" - resolved "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz" - integrity sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ= + "execa" "^0.7.0" + "lcid" "^1.0.0" + "mem" "^1.1.0" + +"os-tmpdir@~1.0.2": + "integrity" "sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ=" + "resolved" "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz" + "version" "1.0.2" -p-finally@^1.0.0: - version "1.0.0" - resolved "https://registry.npmjs.org/p-finally/-/p-finally-1.0.0.tgz" - integrity sha1-P7z7FbiZpEEjs0ttzBi3JDNqLK4= +"p-finally@^1.0.0": + "integrity" "sha1-P7z7FbiZpEEjs0ttzBi3JDNqLK4=" + "resolved" "https://registry.npmjs.org/p-finally/-/p-finally-1.0.0.tgz" + "version" "1.0.0" -p-limit@^1.1.0: - version "1.3.0" - resolved "https://registry.npmjs.org/p-limit/-/p-limit-1.3.0.tgz" - integrity sha512-vvcXsLAJ9Dr5rQOPk7toZQZJApBl2K4J6dANSsEuh6QI41JYcsS/qhTGa9ErIUUgK3WNQoJYvylxvjqmiqEA9Q== +"p-limit@^1.1.0": + "integrity" "sha512-vvcXsLAJ9Dr5rQOPk7toZQZJApBl2K4J6dANSsEuh6QI41JYcsS/qhTGa9ErIUUgK3WNQoJYvylxvjqmiqEA9Q==" + "resolved" "https://registry.npmjs.org/p-limit/-/p-limit-1.3.0.tgz" + "version" "1.3.0" dependencies: - p-try "^1.0.0" + "p-try" "^1.0.0" -p-limit@^2.0.0, p-limit@^2.2.0: - version "2.3.0" - resolved "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz" - integrity sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w== +"p-limit@^2.2.0": + "integrity" "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==" + "resolved" "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz" + "version" "2.3.0" dependencies: - p-try "^2.0.0" - -p-limit@^3.0.2: - version "3.1.0" - resolved "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz" - integrity sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ== + "p-try" "^2.0.0" + +"p-limit@^3.0.2": + "integrity" "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==" + "resolved" "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz" + "version" "3.1.0" dependencies: - yocto-queue "^0.1.0" + "yocto-queue" "^0.1.0" -p-locate@^2.0.0: - version "2.0.0" - resolved "https://registry.npmjs.org/p-locate/-/p-locate-2.0.0.tgz" - integrity sha1-IKAQOyIqcMj9OcwuWAaA893l7EM= +"p-locate@^2.0.0": + "integrity" "sha1-IKAQOyIqcMj9OcwuWAaA893l7EM=" + "resolved" "https://registry.npmjs.org/p-locate/-/p-locate-2.0.0.tgz" + "version" "2.0.0" dependencies: - p-limit "^1.1.0" + "p-limit" "^1.1.0" -p-locate@^3.0.0: - version "3.0.0" - resolved "https://registry.npmjs.org/p-locate/-/p-locate-3.0.0.tgz" - integrity sha512-x+12w/To+4GFfgJhBEpiDcLozRJGegY+Ei7/z0tSLkMmxGZNybVMSfWj9aJn8Z5Fc7dBUNJOOVgPv2H7IwulSQ== +"p-locate@^4.1.0": + "integrity" "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==" + "resolved" "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz" + "version" "4.1.0" dependencies: - p-limit "^2.0.0" + "p-limit" "^2.2.0" -p-locate@^4.1.0: - version "4.1.0" - resolved "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz" - integrity sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A== +"p-locate@^5.0.0": + "integrity" "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==" + "resolved" "https://registry.npmjs.org/p-locate/-/p-locate-5.0.0.tgz" + "version" "5.0.0" dependencies: - p-limit "^2.2.0" + "p-limit" "^3.0.2" -p-locate@^5.0.0: - version "5.0.0" - resolved "https://registry.npmjs.org/p-locate/-/p-locate-5.0.0.tgz" - integrity sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw== +"p-map@^4.0.0": + "integrity" "sha512-/bjOqmgETBYB5BoEeGVea8dmvHb2m9GLy1E9W43yeyfP6QQCZGFNa+XRceJEuDB6zqr+gKpIAmlLebMpykw/MQ==" + "resolved" "https://registry.npmjs.org/p-map/-/p-map-4.0.0.tgz" + "version" "4.0.0" dependencies: - p-limit "^3.0.2" + "aggregate-error" "^3.0.0" -p-try@^1.0.0: - version "1.0.0" - resolved "https://registry.npmjs.org/p-try/-/p-try-1.0.0.tgz" - integrity sha1-y8ec26+P1CKOE/Yh8rGiN8GyB7M= +"p-try@^1.0.0": + "integrity" "sha1-y8ec26+P1CKOE/Yh8rGiN8GyB7M=" + "resolved" "https://registry.npmjs.org/p-try/-/p-try-1.0.0.tgz" + "version" "1.0.0" -p-try@^2.0.0: - version "2.2.0" - resolved "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz" - integrity sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ== +"p-try@^2.0.0": + "integrity" "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==" + "resolved" "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz" + "version" "2.2.0" -parent-module@^1.0.0: - version "1.0.1" - resolved "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz" - integrity sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g== +"parent-module@^1.0.0": + "integrity" "sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==" + "resolved" "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz" + "version" "1.0.1" dependencies: - callsites "^3.0.0" + "callsites" "^3.0.0" -parse-glob@^3.0.4: - version "3.0.4" - resolved "https://registry.npmjs.org/parse-glob/-/parse-glob-3.0.4.tgz" - integrity sha1-ssN2z7EfNVE7rdFz7wu246OIORw= +"parse-glob@^3.0.4": + "integrity" "sha1-ssN2z7EfNVE7rdFz7wu246OIORw=" + "resolved" "https://registry.npmjs.org/parse-glob/-/parse-glob-3.0.4.tgz" + "version" "3.0.4" dependencies: - glob-base "^0.3.0" - is-dotfile "^1.0.0" - is-extglob "^1.0.0" - is-glob "^2.0.0" + "glob-base" "^0.3.0" + "is-dotfile" "^1.0.0" + "is-extglob" "^1.0.0" + "is-glob" "^2.0.0" -parse-json@^5.0.0: - version "5.2.0" - resolved "https://registry.npmjs.org/parse-json/-/parse-json-5.2.0.tgz" - integrity sha512-ayCKvm/phCGxOkYRSCM82iDwct8/EonSEgCSxWxD7ve6jHggsFl4fZVQBPRNgQoKiuV/odhFrGzQXZwbifC8Rg== +"parse-json@^5.0.0": + "integrity" "sha512-ayCKvm/phCGxOkYRSCM82iDwct8/EonSEgCSxWxD7ve6jHggsFl4fZVQBPRNgQoKiuV/odhFrGzQXZwbifC8Rg==" + "resolved" "https://registry.npmjs.org/parse-json/-/parse-json-5.2.0.tgz" + "version" "5.2.0" dependencies: "@babel/code-frame" "^7.0.0" - error-ex "^1.3.1" - json-parse-even-better-errors "^2.3.0" - lines-and-columns "^1.1.6" - -pascalcase@^0.1.1: - version "0.1.1" - resolved "https://registry.npmjs.org/pascalcase/-/pascalcase-0.1.1.tgz" - integrity sha1-s2PlXoAGym/iF4TS2yK9FdeRfxQ= - -path-exists@^3.0.0: - version "3.0.0" - resolved "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz" - integrity sha1-zg6+ql94yxiSXqfYENe1mwEP1RU= - -path-exists@^4.0.0: - version "4.0.0" - resolved "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz" - integrity sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w== - -path-is-absolute@^1.0.0: - version "1.0.1" - resolved "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz" - integrity sha1-F0uSaHNVNP+8es5r9TpanhtcX18= - -path-key@^2.0.0: - version "2.0.1" - resolved "https://registry.npmjs.org/path-key/-/path-key-2.0.1.tgz" - integrity sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A= - -path-key@^3.0.0, path-key@^3.1.0: - version "3.1.1" - resolved "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz" - integrity sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q== - -path-parse@^1.0.6: - version "1.0.6" - resolved "https://registry.npmjs.org/path-parse/-/path-parse-1.0.6.tgz" - integrity sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw== - -path-type@^4.0.0: - version "4.0.0" - resolved "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz" - integrity sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw== - -pbkdf2@^3.0.17: - version "3.1.2" - resolved "https://registry.npmjs.org/pbkdf2/-/pbkdf2-3.1.2.tgz" - integrity sha512-iuh7L6jA7JEGu2WxDwtQP1ddOpaJNC4KlDEFfdQajSGgGPNi4OyDc2R7QnbY2bR9QjBVGwgvTdNJZoE7RaxUMA== - dependencies: - create-hash "^1.1.2" - create-hmac "^1.1.4" - ripemd160 "^2.0.1" - safe-buffer "^5.0.1" - sha.js "^2.4.8" - -pegjs@^0.10.0: - version "0.10.0" - resolved "https://registry.npmjs.org/pegjs/-/pegjs-0.10.0.tgz" - integrity sha1-z4uvrm7d/0tafvsYUmnqr0YQ3b0= - -picomatch@^2.0.4, picomatch@^2.2.1: - version "2.3.0" - resolved "https://registry.npmjs.org/picomatch/-/picomatch-2.3.0.tgz" - integrity sha512-lY1Q/PiJGC2zOv/z391WOTD+Z02bCgsFfvxoXXf6h7kv9o+WmsmzYqrAwY63sNgOxE4xEdq0WyUnXfKeBrSvYw== - -pkg-dir@^5.0.0: - version "5.0.0" - resolved "https://registry.npmjs.org/pkg-dir/-/pkg-dir-5.0.0.tgz" - integrity sha512-NPE8TDbzl/3YQYY7CSS228s3g2ollTFnc+Qi3tqmqJp9Vg2ovUpixcJEo2HJScN2Ez+kEaal6y70c0ehqJBJeA== - dependencies: - find-up "^5.0.0" - -please-upgrade-node@^3.2.0: - version "3.2.0" - resolved "https://registry.npmjs.org/please-upgrade-node/-/please-upgrade-node-3.2.0.tgz" - integrity sha512-gQR3WpIgNIKwBMVLkpMUeR3e1/E1y42bqDQZfql+kDeXd8COYfM8PQA4X6y7a8u9Ua9FHmsrrmirW2vHs45hWg== - dependencies: - semver-compare "^1.0.0" - -posix-character-classes@^0.1.0: - version "0.1.1" - resolved "https://registry.npmjs.org/posix-character-classes/-/posix-character-classes-0.1.1.tgz" - integrity sha1-AerA/jta9xoqbAL+q7jB/vfgDqs= - -preserve@^0.2.0: - version "0.2.0" - resolved "https://registry.npmjs.org/preserve/-/preserve-0.2.0.tgz" - integrity sha1-gV7R9uvGWSb4ZbMQwHE7yzMVzks= - -prettier-plugin-solidity@^1.0.0-alpha.57: - version "1.0.0-beta.3" - resolved "https://registry.npmjs.org/prettier-plugin-solidity/-/prettier-plugin-solidity-1.0.0-beta.3.tgz" - integrity sha512-iLbf5ZqwSUqi/BQuRGh+fHy0y3VLX9WayI7qB3wqakSUHItbiKsUKyXbTeho4pfTJVr0D3M4c8BNuEr2OMAOVg== - dependencies: - "@solidity-parser/parser" "^0.11.0" - dir-to-object "^2.0.0" - emoji-regex "^9.0.0" - escape-string-regexp "^4.0.0" - prettier "^2.0.5" - semver "^7.3.2" - solidity-comments-extractor "^0.0.4" - string-width "^4.2.0" - -prettier@^2.0.5, prettier@^2.1.2: - version "2.2.1" - resolved "https://registry.npmjs.org/prettier/-/prettier-2.2.1.tgz" - integrity sha512-PqyhM2yCjg/oKkFPtTGUojv7gnZAoG80ttl45O6x2Ug/rMJw4wcc9k6aaf2hibP7BGVCCM33gZoGjyvt9mm16Q== - -pretty-quick@^3.0.2: - version "3.1.0" - resolved "https://registry.npmjs.org/pretty-quick/-/pretty-quick-3.1.0.tgz" - integrity sha512-DtxIxksaUWCgPFN7E1ZZk4+Aav3CCuRdhrDSFZENb404sYMtuo9Zka823F+Mgeyt8Zt3bUiCjFzzWYE9LYqkmQ== - dependencies: - chalk "^3.0.0" - execa "^4.0.0" - find-up "^4.1.0" - ignore "^5.1.4" - mri "^1.1.5" - multimatch "^4.0.0" - -printj@~1.1.0: - version "1.1.2" - resolved "https://registry.npmjs.org/printj/-/printj-1.1.2.tgz" - integrity sha512-zA2SmoLaxZyArQTOPj5LXecR+RagfPSU5Kw1qP+jkWeNlrq+eJZyY2oS68SU1Z/7/myXM4lo9716laOFAVStCQ== - -process-nextick-args@~2.0.0: - version "2.0.1" - resolved "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz" - integrity sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag== - -prr@~1.0.1: - version "1.0.1" - resolved "https://registry.npmjs.org/prr/-/prr-1.0.1.tgz" - integrity sha1-0/wRS6BplaRexok/SEzrHXj19HY= - -pseudomap@^1.0.2: - version "1.0.2" - resolved "https://registry.npmjs.org/pseudomap/-/pseudomap-1.0.2.tgz" - integrity sha1-8FKijacOYYkX7wqKw0wa5aaChrM= - -pump@^3.0.0: - version "3.0.0" - resolved "https://registry.npmjs.org/pump/-/pump-3.0.0.tgz" - integrity sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww== - dependencies: - end-of-stream "^1.1.0" - once "^1.3.1" - -q@^1.5.1: - version "1.5.1" - resolved "https://registry.npmjs.org/q/-/q-1.5.1.tgz" - integrity sha1-fjL3W0E4EpHQRhHxvxQQmsAGUdc= - -qs@^6.7.0: - version "6.10.1" - resolved "https://registry.npmjs.org/qs/-/qs-6.10.1.tgz" - integrity sha512-M528Hph6wsSVOBiYUnGf+K/7w0hNshs/duGsNXPUCLH5XAqjEtiPGwNONLV0tBH8NoGb0mvD5JubnUTrujKDTg== - dependencies: - side-channel "^1.0.4" - -quick-lru@^4.0.1: - version "4.0.1" - resolved "https://registry.npmjs.org/quick-lru/-/quick-lru-4.0.1.tgz" - integrity sha512-ARhCpm70fzdcvNQfPoy49IaanKkTlRWF2JMzqhcJbhSFRZv7nPTvZJdcY7301IPmvW+/p0RgIWnQDLJxifsQ7g== - -randomatic@^3.0.0: - version "3.1.1" - resolved "https://registry.npmjs.org/randomatic/-/randomatic-3.1.1.tgz" - integrity sha512-TuDE5KxZ0J461RVjrJZCJc+J+zCkTb1MbH9AQUq68sMhOMcy9jLcb3BrZKgp9q9Ncltdg4QVqWrH02W2EFFVYw== - dependencies: - is-number "^4.0.0" - kind-of "^6.0.0" - math-random "^1.0.1" - -randombytes@^2.1.0: - version "2.1.0" - resolved "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz" - integrity sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ== - dependencies: - safe-buffer "^5.1.0" - -raw-body@^2.4.1: - version "2.4.1" - resolved "https://registry.npmjs.org/raw-body/-/raw-body-2.4.1.tgz" - integrity sha512-9WmIKF6mkvA0SLmA2Knm9+qj89e+j1zqgyn8aXGd7+nAduPoqgI9lO57SAZNn/Byzo5P7JhXTyg9PzaJbH73bA== - dependencies: - bytes "3.1.0" - http-errors "1.7.3" - iconv-lite "0.4.24" - unpipe "1.0.0" - -read-pkg-up@^7.0.1: - version "7.0.1" - resolved "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-7.0.1.tgz" - integrity sha512-zK0TB7Xd6JpCLmlLmufqykGE+/TlOePD6qKClNW7hHDKFh/J7/7gCWGR7joEQEW1bKq3a3yUZSObOoWLFQ4ohg== - dependencies: - find-up "^4.1.0" - read-pkg "^5.2.0" - type-fest "^0.8.1" - -read-pkg@^5.2.0: - version "5.2.0" - resolved "https://registry.npmjs.org/read-pkg/-/read-pkg-5.2.0.tgz" - integrity sha512-Ug69mNOpfvKDAc2Q8DRpMjjzdtrnv9HcSMX+4VsZxD1aZ6ZzrIE7rlzXBtWTyhULSMKg076AW6WR5iZpD0JiOg== + "error-ex" "^1.3.1" + "json-parse-even-better-errors" "^2.3.0" + "lines-and-columns" "^1.1.6" + +"pascalcase@^0.1.1": + "integrity" "sha1-s2PlXoAGym/iF4TS2yK9FdeRfxQ=" + "resolved" "https://registry.npmjs.org/pascalcase/-/pascalcase-0.1.1.tgz" + "version" "0.1.1" + +"path-exists@^3.0.0": + "integrity" "sha1-zg6+ql94yxiSXqfYENe1mwEP1RU=" + "resolved" "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz" + "version" "3.0.0" + +"path-exists@^4.0.0": + "integrity" "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==" + "resolved" "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz" + "version" "4.0.0" + +"path-is-absolute@^1.0.0": + "integrity" "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=" + "resolved" "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz" + "version" "1.0.1" + +"path-key@^2.0.0": + "integrity" "sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A=" + "resolved" "https://registry.npmjs.org/path-key/-/path-key-2.0.1.tgz" + "version" "2.0.1" + +"path-key@^3.0.0", "path-key@^3.1.0": + "integrity" "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==" + "resolved" "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz" + "version" "3.1.1" + +"path-parse@^1.0.6": + "integrity" "sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw==" + "resolved" "https://registry.npmjs.org/path-parse/-/path-parse-1.0.6.tgz" + "version" "1.0.6" + +"path-type@^4.0.0": + "integrity" "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==" + "resolved" "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz" + "version" "4.0.0" + +"pbkdf2@^3.0.17": + "integrity" "sha512-iuh7L6jA7JEGu2WxDwtQP1ddOpaJNC4KlDEFfdQajSGgGPNi4OyDc2R7QnbY2bR9QjBVGwgvTdNJZoE7RaxUMA==" + "resolved" "https://registry.npmjs.org/pbkdf2/-/pbkdf2-3.1.2.tgz" + "version" "3.1.2" + dependencies: + "create-hash" "^1.1.2" + "create-hmac" "^1.1.4" + "ripemd160" "^2.0.1" + "safe-buffer" "^5.0.1" + "sha.js" "^2.4.8" + +"pegjs@^0.10.0": + "integrity" "sha1-z4uvrm7d/0tafvsYUmnqr0YQ3b0=" + "resolved" "https://registry.npmjs.org/pegjs/-/pegjs-0.10.0.tgz" + "version" "0.10.0" + +"picomatch@^2.0.4", "picomatch@^2.2.1": + "integrity" "sha512-lY1Q/PiJGC2zOv/z391WOTD+Z02bCgsFfvxoXXf6h7kv9o+WmsmzYqrAwY63sNgOxE4xEdq0WyUnXfKeBrSvYw==" + "resolved" "https://registry.npmjs.org/picomatch/-/picomatch-2.3.0.tgz" + "version" "2.3.0" + +"pkg-dir@^5.0.0": + "integrity" "sha512-NPE8TDbzl/3YQYY7CSS228s3g2ollTFnc+Qi3tqmqJp9Vg2ovUpixcJEo2HJScN2Ez+kEaal6y70c0ehqJBJeA==" + "resolved" "https://registry.npmjs.org/pkg-dir/-/pkg-dir-5.0.0.tgz" + "version" "5.0.0" + dependencies: + "find-up" "^5.0.0" + +"please-upgrade-node@^3.2.0": + "integrity" "sha512-gQR3WpIgNIKwBMVLkpMUeR3e1/E1y42bqDQZfql+kDeXd8COYfM8PQA4X6y7a8u9Ua9FHmsrrmirW2vHs45hWg==" + "resolved" "https://registry.npmjs.org/please-upgrade-node/-/please-upgrade-node-3.2.0.tgz" + "version" "3.2.0" + dependencies: + "semver-compare" "^1.0.0" + +"posix-character-classes@^0.1.0": + "integrity" "sha1-AerA/jta9xoqbAL+q7jB/vfgDqs=" + "resolved" "https://registry.npmjs.org/posix-character-classes/-/posix-character-classes-0.1.1.tgz" + "version" "0.1.1" + +"preserve@^0.2.0": + "integrity" "sha1-gV7R9uvGWSb4ZbMQwHE7yzMVzks=" + "resolved" "https://registry.npmjs.org/preserve/-/preserve-0.2.0.tgz" + "version" "0.2.0" + +"prettier-plugin-solidity@^1.0.0-beta.19": + "integrity" "sha512-xxRQ5ZiiZyUoMFLE9h7HnUDXI/daf1tnmL1msEdcKmyh7ZGQ4YklkYLC71bfBpYU2WruTb5/SFLUaEb3RApg5g==" + "resolved" "https://registry.npmjs.org/prettier-plugin-solidity/-/prettier-plugin-solidity-1.0.0-beta.19.tgz" + "version" "1.0.0-beta.19" + dependencies: + "@solidity-parser/parser" "^0.14.0" + "emoji-regex" "^10.0.0" + "escape-string-regexp" "^4.0.0" + "semver" "^7.3.5" + "solidity-comments-extractor" "^0.0.7" + "string-width" "^4.2.3" + +"prettier@^2.1.2", "prettier@^2.3.0", "prettier@>=2.0.0": + "integrity" "sha512-PkUpF+qoXTqhOeWL9fu7As8LXsIUZ1WYaJiY/a7McAQzxjk82OF0tibkFXVCDImZtWxbvojFjerkiLb0/q8mew==" + "resolved" "https://registry.npmjs.org/prettier/-/prettier-2.6.2.tgz" + "version" "2.6.2" + +"pretty-quick@^3.0.2": + "integrity" "sha512-DtxIxksaUWCgPFN7E1ZZk4+Aav3CCuRdhrDSFZENb404sYMtuo9Zka823F+Mgeyt8Zt3bUiCjFzzWYE9LYqkmQ==" + "resolved" "https://registry.npmjs.org/pretty-quick/-/pretty-quick-3.1.0.tgz" + "version" "3.1.0" + dependencies: + "chalk" "^3.0.0" + "execa" "^4.0.0" + "find-up" "^4.1.0" + "ignore" "^5.1.4" + "mri" "^1.1.5" + "multimatch" "^4.0.0" + +"process-nextick-args@~2.0.0": + "integrity" "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==" + "resolved" "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz" + "version" "2.0.1" + +"prr@~1.0.1": + "integrity" "sha1-0/wRS6BplaRexok/SEzrHXj19HY=" + "resolved" "https://registry.npmjs.org/prr/-/prr-1.0.1.tgz" + "version" "1.0.1" + +"pseudomap@^1.0.2": + "integrity" "sha1-8FKijacOYYkX7wqKw0wa5aaChrM=" + "resolved" "https://registry.npmjs.org/pseudomap/-/pseudomap-1.0.2.tgz" + "version" "1.0.2" + +"pump@^3.0.0": + "integrity" "sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww==" + "resolved" "https://registry.npmjs.org/pump/-/pump-3.0.0.tgz" + "version" "3.0.0" + dependencies: + "end-of-stream" "^1.1.0" + "once" "^1.3.1" + +"q@^1.5.1": + "integrity" "sha1-fjL3W0E4EpHQRhHxvxQQmsAGUdc=" + "resolved" "https://registry.npmjs.org/q/-/q-1.5.1.tgz" + "version" "1.5.1" + +"qs@^6.7.0": + "integrity" "sha512-M528Hph6wsSVOBiYUnGf+K/7w0hNshs/duGsNXPUCLH5XAqjEtiPGwNONLV0tBH8NoGb0mvD5JubnUTrujKDTg==" + "resolved" "https://registry.npmjs.org/qs/-/qs-6.10.1.tgz" + "version" "6.10.1" + dependencies: + "side-channel" "^1.0.4" + +"quick-lru@^4.0.1": + "integrity" "sha512-ARhCpm70fzdcvNQfPoy49IaanKkTlRWF2JMzqhcJbhSFRZv7nPTvZJdcY7301IPmvW+/p0RgIWnQDLJxifsQ7g==" + "resolved" "https://registry.npmjs.org/quick-lru/-/quick-lru-4.0.1.tgz" + "version" "4.0.1" + +"randomatic@^3.0.0": + "integrity" "sha512-TuDE5KxZ0J461RVjrJZCJc+J+zCkTb1MbH9AQUq68sMhOMcy9jLcb3BrZKgp9q9Ncltdg4QVqWrH02W2EFFVYw==" + "resolved" "https://registry.npmjs.org/randomatic/-/randomatic-3.1.1.tgz" + "version" "3.1.1" + dependencies: + "is-number" "^4.0.0" + "kind-of" "^6.0.0" + "math-random" "^1.0.1" + +"randombytes@^2.1.0": + "integrity" "sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ==" + "resolved" "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz" + "version" "2.1.0" + dependencies: + "safe-buffer" "^5.1.0" + +"raw-body@^2.4.1": + "integrity" "sha512-9WmIKF6mkvA0SLmA2Knm9+qj89e+j1zqgyn8aXGd7+nAduPoqgI9lO57SAZNn/Byzo5P7JhXTyg9PzaJbH73bA==" + "resolved" "https://registry.npmjs.org/raw-body/-/raw-body-2.4.1.tgz" + "version" "2.4.1" + dependencies: + "bytes" "3.1.0" + "http-errors" "1.7.3" + "iconv-lite" "0.4.24" + "unpipe" "1.0.0" + +"read-pkg-up@^7.0.1": + "integrity" "sha512-zK0TB7Xd6JpCLmlLmufqykGE+/TlOePD6qKClNW7hHDKFh/J7/7gCWGR7joEQEW1bKq3a3yUZSObOoWLFQ4ohg==" + "resolved" "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-7.0.1.tgz" + "version" "7.0.1" + dependencies: + "find-up" "^4.1.0" + "read-pkg" "^5.2.0" + "type-fest" "^0.8.1" + +"read-pkg@^5.2.0": + "integrity" "sha512-Ug69mNOpfvKDAc2Q8DRpMjjzdtrnv9HcSMX+4VsZxD1aZ6ZzrIE7rlzXBtWTyhULSMKg076AW6WR5iZpD0JiOg==" + "resolved" "https://registry.npmjs.org/read-pkg/-/read-pkg-5.2.0.tgz" + "version" "5.2.0" dependencies: "@types/normalize-package-data" "^2.4.0" - normalize-package-data "^2.5.0" - parse-json "^5.0.0" - type-fest "^0.6.0" - -readable-stream@3, readable-stream@^3.0.0, readable-stream@^3.1.0, readable-stream@^3.4.0, readable-stream@^3.6.0: - version "3.6.0" - resolved "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz" - integrity sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA== - dependencies: - inherits "^2.0.3" - string_decoder "^1.1.1" - util-deprecate "^1.0.1" - -readable-stream@^2.0.2, readable-stream@~2.3.6: - version "2.3.7" - resolved "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz" - integrity sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw== - dependencies: - core-util-is "~1.0.0" - inherits "~2.0.3" - isarray "~1.0.0" - process-nextick-args "~2.0.0" - safe-buffer "~5.1.1" - string_decoder "~1.1.1" - util-deprecate "~1.0.1" - -readdirp@^2.0.0: - version "2.2.1" - resolved "https://registry.npmjs.org/readdirp/-/readdirp-2.2.1.tgz" - integrity sha512-1JU/8q+VgFZyxwrJ+SVIOsh+KywWGpds3NTqikiKpDMZWScmAYyKIgqkO+ARvNWJfXeXR1zxz7aHF4u4CyH6vQ== - dependencies: - graceful-fs "^4.1.11" - micromatch "^3.1.10" - readable-stream "^2.0.2" - -readdirp@~3.2.0: - version "3.2.0" - resolved "https://registry.npmjs.org/readdirp/-/readdirp-3.2.0.tgz" - integrity sha512-crk4Qu3pmXwgxdSgGhgA/eXiJAPQiX4GMOZZMXnqKxHX7TaoL+3gQVo/WeuAiogr07DpnfjIMpXXa+PAIvwPGQ== - dependencies: - picomatch "^2.0.4" - -readdirp@~3.6.0: - version "3.6.0" - resolved "https://registry.npmjs.org/readdirp/-/readdirp-3.6.0.tgz" - integrity sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA== - dependencies: - picomatch "^2.2.1" - -redent@^3.0.0: - version "3.0.0" - resolved "https://registry.npmjs.org/redent/-/redent-3.0.0.tgz" - integrity sha512-6tDA8g98We0zd0GvVeMT9arEOnTw9qM03L9cJXaCjrip1OO764RDBLBfrB4cwzNGDj5OA5ioymC9GkizgWJDUg== - dependencies: - indent-string "^4.0.0" - strip-indent "^3.0.0" - -regenerator-runtime@^0.13.4: - version "0.13.7" - resolved "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.13.7.tgz" - integrity sha512-a54FxoJDIr27pgf7IgeQGxmqUNYrcV338lf/6gH456HZ/PhX+5BcwHXG9ajESmwe6WRO0tAzRUrRmNONWgkrew== - -regex-cache@^0.4.2: - version "0.4.4" - resolved "https://registry.npmjs.org/regex-cache/-/regex-cache-0.4.4.tgz" - integrity sha512-nVIZwtCjkC9YgvWkpM55B5rBhBYRZhAaJbgcFYXXsHnbZ9UZI9nnVWYZpBlCqv9ho2eZryPnWrZGsOdPwVWXWQ== - dependencies: - is-equal-shallow "^0.1.3" - -regex-not@^1.0.0, regex-not@^1.0.2: - version "1.0.2" - resolved "https://registry.npmjs.org/regex-not/-/regex-not-1.0.2.tgz" - integrity sha512-J6SDjUgDxQj5NusnOtdFxDwN/+HWykR8GELwctJ7mdqhcyy1xEc4SRFHUXvxTp661YaVKAjfRLZ9cCqS6tn32A== - dependencies: - extend-shallow "^3.0.2" - safe-regex "^1.1.0" - -remove-trailing-separator@^1.0.1: - version "1.1.0" - resolved "https://registry.npmjs.org/remove-trailing-separator/-/remove-trailing-separator-1.1.0.tgz" - integrity sha1-wkvOKig62tW8P1jg1IJJuSN52O8= - -repeat-element@^1.1.2: - version "1.1.3" - resolved "https://registry.npmjs.org/repeat-element/-/repeat-element-1.1.3.tgz" - integrity sha512-ahGq0ZnV5m5XtZLMb+vP76kcAM5nkLqk0lpqAuojSKGgQtn4eRi4ZZGm2olo2zKFH+sMsWaqOCW1dqAnOru72g== - -repeat-string@^1.5.2, repeat-string@^1.6.1: - version "1.6.1" - resolved "https://registry.npmjs.org/repeat-string/-/repeat-string-1.6.1.tgz" - integrity sha1-jcrkcOHIirwtYA//Sndihtp15jc= - -require-directory@^2.1.1: - version "2.1.1" - resolved "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz" - integrity sha1-jGStX9MNqxyXbiNE/+f3kqam30I= - -require-from-string@^2.0.0: - version "2.0.2" - resolved "https://registry.npmjs.org/require-from-string/-/require-from-string-2.0.2.tgz" - integrity sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw== - -require-main-filename@^1.0.1: - version "1.0.1" - resolved "https://registry.npmjs.org/require-main-filename/-/require-main-filename-1.0.1.tgz" - integrity sha1-l/cXtp1IeE9fUmpsWqj/3aBVpNE= - -require-main-filename@^2.0.0: - version "2.0.0" - resolved "https://registry.npmjs.org/require-main-filename/-/require-main-filename-2.0.0.tgz" - integrity sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg== - -resolve-from@5.0.0, resolve-from@^5.0.0: - version "5.0.0" - resolved "https://registry.npmjs.org/resolve-from/-/resolve-from-5.0.0.tgz" - integrity sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw== - -resolve-from@^4.0.0: - version "4.0.0" - resolved "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz" - integrity sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g== - -resolve-global@1.0.0, resolve-global@^1.0.0: - version "1.0.0" - resolved "https://registry.npmjs.org/resolve-global/-/resolve-global-1.0.0.tgz" - integrity sha512-zFa12V4OLtT5XUX/Q4VLvTfBf+Ok0SPc1FNGM/z9ctUdiU618qwKpWnd0CHs3+RqROfyEg/DhuHbMWYqcgljEw== - dependencies: - global-dirs "^0.1.1" - -resolve-url@^0.2.1: - version "0.2.1" - resolved "https://registry.npmjs.org/resolve-url/-/resolve-url-0.2.1.tgz" - integrity sha1-LGN/53yJOv0qZj/iGqkIAGjiBSo= - -resolve@1.17.0: - version "1.17.0" - resolved "https://registry.npmjs.org/resolve/-/resolve-1.17.0.tgz" - integrity sha512-ic+7JYiV8Vi2yzQGFWOkiZD5Z9z7O2Zhm9XMaTxdJExKasieFCr+yXZ/WmXsckHiKl12ar0y6XiXDx3m4RHn1w== - dependencies: - path-parse "^1.0.6" - -resolve@^1.10.0, resolve@^1.17.0: - version "1.19.0" - resolved "https://registry.npmjs.org/resolve/-/resolve-1.19.0.tgz" - integrity sha512-rArEXAgsBG4UgRGcynxWIWKFvh/XZCcS8UJdHhwy91zwAvCZIbcs+vAbflgBnNjYMs/i/i+/Ux6IZhML1yPvxg== - dependencies: - is-core-module "^2.1.0" - path-parse "^1.0.6" - -ret@~0.1.10: - version "0.1.15" - resolved "https://registry.npmjs.org/ret/-/ret-0.1.15.tgz" - integrity sha512-TTlYpa+OL+vMMNG24xSlQGEJ3B/RzEfUlLct7b5G/ytav+wPrplCpVMFuwzXbkecJrb6IYo1iFb0S9v37754mg== - -rimraf@^2.2.8: - version "2.7.1" - resolved "https://registry.npmjs.org/rimraf/-/rimraf-2.7.1.tgz" - integrity sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w== - dependencies: - glob "^7.1.3" - -ripemd160@^2.0.0, ripemd160@^2.0.1: - version "2.0.2" - resolved "https://registry.npmjs.org/ripemd160/-/ripemd160-2.0.2.tgz" - integrity sha512-ii4iagi25WusVoiC4B4lq7pbXfAp3D9v5CwfkY33vffw2+pkDjY1D8GaN7spsxvCSx8dkPqOZCEZyfxcmJG2IA== - dependencies: - hash-base "^3.0.0" - inherits "^2.0.1" - -rlp@^2.0.0, rlp@^2.2.3, rlp@^2.2.4: - version "2.2.7" - resolved "https://registry.npmjs.org/rlp/-/rlp-2.2.7.tgz" - integrity sha512-d5gdPmgQ0Z+AklL2NVXr/IoSjNZFfTVvQWzL/AM2AOcSzYP2xjlb0AC8YyCLc41MSNf6P6QVtjgPdmVtzb+4lQ== - dependencies: - bn.js "^5.2.0" - -rustbn.js@~0.2.0: - version "0.2.0" - resolved "https://registry.npmjs.org/rustbn.js/-/rustbn.js-0.2.0.tgz" - integrity sha512-4VlvkRUuCJvr2J6Y0ImW7NvTCriMi7ErOAqWk1y69vAdoNIzCF3yPmgeNzx+RQTLEDFq5sHfscn1MwHxP9hNfA== - -safe-buffer@^5.0.1, safe-buffer@^5.1.0, safe-buffer@^5.1.1, safe-buffer@^5.1.2, safe-buffer@~5.1.0, safe-buffer@~5.1.1: - version "5.1.2" - resolved "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz" - integrity sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g== - -safe-buffer@^5.2.0, safe-buffer@~5.2.0: - version "5.2.1" - resolved "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz" - integrity sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ== - -safe-regex@^1.1.0: - version "1.1.0" - resolved "https://registry.npmjs.org/safe-regex/-/safe-regex-1.1.0.tgz" - integrity sha1-QKNmnzsHfR6UPURinhV91IAjvy4= + "normalize-package-data" "^2.5.0" + "parse-json" "^5.0.0" + "type-fest" "^0.6.0" + +"readable-stream@^2.0.2", "readable-stream@~2.3.6": + "integrity" "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==" + "resolved" "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz" + "version" "2.3.7" + dependencies: + "core-util-is" "~1.0.0" + "inherits" "~2.0.3" + "isarray" "~1.0.0" + "process-nextick-args" "~2.0.0" + "safe-buffer" "~5.1.1" + "string_decoder" "~1.1.1" + "util-deprecate" "~1.0.1" + +"readable-stream@^3.0.0": + "integrity" "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==" + "resolved" "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz" + "version" "3.6.0" + dependencies: + "inherits" "^2.0.3" + "string_decoder" "^1.1.1" + "util-deprecate" "^1.0.1" + +"readable-stream@^3.1.0": + "integrity" "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==" + "resolved" "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz" + "version" "3.6.0" + dependencies: + "inherits" "^2.0.3" + "string_decoder" "^1.1.1" + "util-deprecate" "^1.0.1" + +"readable-stream@^3.4.0": + "integrity" "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==" + "resolved" "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz" + "version" "3.6.0" + dependencies: + "inherits" "^2.0.3" + "string_decoder" "^1.1.1" + "util-deprecate" "^1.0.1" + +"readable-stream@^3.6.0": + "integrity" "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==" + "resolved" "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz" + "version" "3.6.0" + dependencies: + "inherits" "^2.0.3" + "string_decoder" "^1.1.1" + "util-deprecate" "^1.0.1" + +"readable-stream@3": + "integrity" "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==" + "resolved" "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz" + "version" "3.6.0" + dependencies: + "inherits" "^2.0.3" + "string_decoder" "^1.1.1" + "util-deprecate" "^1.0.1" + +"readdirp@^2.0.0": + "integrity" "sha512-1JU/8q+VgFZyxwrJ+SVIOsh+KywWGpds3NTqikiKpDMZWScmAYyKIgqkO+ARvNWJfXeXR1zxz7aHF4u4CyH6vQ==" + "resolved" "https://registry.npmjs.org/readdirp/-/readdirp-2.2.1.tgz" + "version" "2.2.1" + dependencies: + "graceful-fs" "^4.1.11" + "micromatch" "^3.1.10" + "readable-stream" "^2.0.2" + +"readdirp@~3.6.0": + "integrity" "sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==" + "resolved" "https://registry.npmjs.org/readdirp/-/readdirp-3.6.0.tgz" + "version" "3.6.0" + dependencies: + "picomatch" "^2.2.1" + +"redent@^3.0.0": + "integrity" "sha512-6tDA8g98We0zd0GvVeMT9arEOnTw9qM03L9cJXaCjrip1OO764RDBLBfrB4cwzNGDj5OA5ioymC9GkizgWJDUg==" + "resolved" "https://registry.npmjs.org/redent/-/redent-3.0.0.tgz" + "version" "3.0.0" + dependencies: + "indent-string" "^4.0.0" + "strip-indent" "^3.0.0" + +"regenerator-runtime@^0.13.4": + "integrity" "sha512-a54FxoJDIr27pgf7IgeQGxmqUNYrcV338lf/6gH456HZ/PhX+5BcwHXG9ajESmwe6WRO0tAzRUrRmNONWgkrew==" + "resolved" "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.13.7.tgz" + "version" "0.13.7" + +"regex-cache@^0.4.2": + "integrity" "sha512-nVIZwtCjkC9YgvWkpM55B5rBhBYRZhAaJbgcFYXXsHnbZ9UZI9nnVWYZpBlCqv9ho2eZryPnWrZGsOdPwVWXWQ==" + "resolved" "https://registry.npmjs.org/regex-cache/-/regex-cache-0.4.4.tgz" + "version" "0.4.4" + dependencies: + "is-equal-shallow" "^0.1.3" + +"regex-not@^1.0.0", "regex-not@^1.0.2": + "integrity" "sha512-J6SDjUgDxQj5NusnOtdFxDwN/+HWykR8GELwctJ7mdqhcyy1xEc4SRFHUXvxTp661YaVKAjfRLZ9cCqS6tn32A==" + "resolved" "https://registry.npmjs.org/regex-not/-/regex-not-1.0.2.tgz" + "version" "1.0.2" + dependencies: + "extend-shallow" "^3.0.2" + "safe-regex" "^1.1.0" + +"remove-trailing-separator@^1.0.1": + "integrity" "sha1-wkvOKig62tW8P1jg1IJJuSN52O8=" + "resolved" "https://registry.npmjs.org/remove-trailing-separator/-/remove-trailing-separator-1.1.0.tgz" + "version" "1.1.0" + +"repeat-element@^1.1.2": + "integrity" "sha512-ahGq0ZnV5m5XtZLMb+vP76kcAM5nkLqk0lpqAuojSKGgQtn4eRi4ZZGm2olo2zKFH+sMsWaqOCW1dqAnOru72g==" + "resolved" "https://registry.npmjs.org/repeat-element/-/repeat-element-1.1.3.tgz" + "version" "1.1.3" + +"repeat-string@^1.5.2", "repeat-string@^1.6.1": + "integrity" "sha1-jcrkcOHIirwtYA//Sndihtp15jc=" + "resolved" "https://registry.npmjs.org/repeat-string/-/repeat-string-1.6.1.tgz" + "version" "1.6.1" + +"require-directory@^2.1.1": + "integrity" "sha1-jGStX9MNqxyXbiNE/+f3kqam30I=" + "resolved" "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz" + "version" "2.1.1" + +"require-from-string@^2.0.0": + "integrity" "sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==" + "resolved" "https://registry.npmjs.org/require-from-string/-/require-from-string-2.0.2.tgz" + "version" "2.0.2" + +"require-main-filename@^1.0.1": + "integrity" "sha1-l/cXtp1IeE9fUmpsWqj/3aBVpNE=" + "resolved" "https://registry.npmjs.org/require-main-filename/-/require-main-filename-1.0.1.tgz" + "version" "1.0.1" + +"require-main-filename@^2.0.0": + "integrity" "sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg==" + "resolved" "https://registry.npmjs.org/require-main-filename/-/require-main-filename-2.0.0.tgz" + "version" "2.0.0" + +"resolve-from@^4.0.0": + "integrity" "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==" + "resolved" "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz" + "version" "4.0.0" + +"resolve-from@^5.0.0", "resolve-from@5.0.0": + "integrity" "sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==" + "resolved" "https://registry.npmjs.org/resolve-from/-/resolve-from-5.0.0.tgz" + "version" "5.0.0" + +"resolve-global@^1.0.0", "resolve-global@1.0.0": + "integrity" "sha512-zFa12V4OLtT5XUX/Q4VLvTfBf+Ok0SPc1FNGM/z9ctUdiU618qwKpWnd0CHs3+RqROfyEg/DhuHbMWYqcgljEw==" + "resolved" "https://registry.npmjs.org/resolve-global/-/resolve-global-1.0.0.tgz" + "version" "1.0.0" + dependencies: + "global-dirs" "^0.1.1" + +"resolve-url@^0.2.1": + "integrity" "sha1-LGN/53yJOv0qZj/iGqkIAGjiBSo=" + "resolved" "https://registry.npmjs.org/resolve-url/-/resolve-url-0.2.1.tgz" + "version" "0.2.1" + +"resolve@^1.10.0", "resolve@^1.17.0": + "integrity" "sha512-rArEXAgsBG4UgRGcynxWIWKFvh/XZCcS8UJdHhwy91zwAvCZIbcs+vAbflgBnNjYMs/i/i+/Ux6IZhML1yPvxg==" + "resolved" "https://registry.npmjs.org/resolve/-/resolve-1.19.0.tgz" + "version" "1.19.0" + dependencies: + "is-core-module" "^2.1.0" + "path-parse" "^1.0.6" + +"resolve@1.17.0": + "integrity" "sha512-ic+7JYiV8Vi2yzQGFWOkiZD5Z9z7O2Zhm9XMaTxdJExKasieFCr+yXZ/WmXsckHiKl12ar0y6XiXDx3m4RHn1w==" + "resolved" "https://registry.npmjs.org/resolve/-/resolve-1.17.0.tgz" + "version" "1.17.0" + dependencies: + "path-parse" "^1.0.6" + +"ret@~0.1.10": + "integrity" "sha512-TTlYpa+OL+vMMNG24xSlQGEJ3B/RzEfUlLct7b5G/ytav+wPrplCpVMFuwzXbkecJrb6IYo1iFb0S9v37754mg==" + "resolved" "https://registry.npmjs.org/ret/-/ret-0.1.15.tgz" + "version" "0.1.15" + +"rimraf@^2.2.8": + "integrity" "sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w==" + "resolved" "https://registry.npmjs.org/rimraf/-/rimraf-2.7.1.tgz" + "version" "2.7.1" + dependencies: + "glob" "^7.1.3" + +"ripemd160@^2.0.0", "ripemd160@^2.0.1": + "integrity" "sha512-ii4iagi25WusVoiC4B4lq7pbXfAp3D9v5CwfkY33vffw2+pkDjY1D8GaN7spsxvCSx8dkPqOZCEZyfxcmJG2IA==" + "resolved" "https://registry.npmjs.org/ripemd160/-/ripemd160-2.0.2.tgz" + "version" "2.0.2" + dependencies: + "hash-base" "^3.0.0" + "inherits" "^2.0.1" + +"rlp@^2.2.3", "rlp@^2.2.4": + "integrity" "sha512-d5gdPmgQ0Z+AklL2NVXr/IoSjNZFfTVvQWzL/AM2AOcSzYP2xjlb0AC8YyCLc41MSNf6P6QVtjgPdmVtzb+4lQ==" + "resolved" "https://registry.npmjs.org/rlp/-/rlp-2.2.7.tgz" + "version" "2.2.7" + dependencies: + "bn.js" "^5.2.0" + +"rustbn.js@~0.2.0": + "integrity" "sha512-4VlvkRUuCJvr2J6Y0ImW7NvTCriMi7ErOAqWk1y69vAdoNIzCF3yPmgeNzx+RQTLEDFq5sHfscn1MwHxP9hNfA==" + "resolved" "https://registry.npmjs.org/rustbn.js/-/rustbn.js-0.2.0.tgz" + "version" "0.2.0" + +"safe-buffer@^5.0.1", "safe-buffer@^5.1.0", "safe-buffer@^5.1.1", "safe-buffer@^5.1.2", "safe-buffer@~5.1.0", "safe-buffer@~5.1.1": + "integrity" "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" + "resolved" "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz" + "version" "5.1.2" + +"safe-buffer@^5.2.0": + "integrity" "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==" + "resolved" "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz" + "version" "5.2.1" + +"safe-buffer@~5.2.0": + "integrity" "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==" + "resolved" "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz" + "version" "5.2.1" + +"safe-regex@^1.1.0": + "integrity" "sha1-QKNmnzsHfR6UPURinhV91IAjvy4=" + "resolved" "https://registry.npmjs.org/safe-regex/-/safe-regex-1.1.0.tgz" + "version" "1.1.0" dependencies: - ret "~0.1.10" + "ret" "~0.1.10" "safer-buffer@>= 2.1.2 < 3": - version "2.1.2" - resolved "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz" - integrity sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg== - -scrypt-js@^3.0.0: - version "3.0.1" - resolved "https://registry.npmjs.org/scrypt-js/-/scrypt-js-3.0.1.tgz" - integrity sha512-cdwTTnqPu0Hyvf5in5asVdZocVDTNRmR7XEcJuIzMjJeSHybHl7vpB66AzwTaIg6CLSbtjcxc8fqcySfnTkccA== - -secp256k1@^4.0.1: - version "4.0.2" - resolved "https://registry.npmjs.org/secp256k1/-/secp256k1-4.0.2.tgz" - integrity sha512-UDar4sKvWAksIlfX3xIaQReADn+WFnHvbVujpcbr+9Sf/69odMwy2MUsz5CKLQgX9nsIyrjuxL2imVyoNHa3fg== - dependencies: - elliptic "^6.5.2" - node-addon-api "^2.0.0" - node-gyp-build "^4.2.0" - -semaphore-async-await@^1.5.1: - version "1.5.1" - resolved "https://registry.npmjs.org/semaphore-async-await/-/semaphore-async-await-1.5.1.tgz" - integrity sha1-hXvvXjZEYBykuVcLh+nfXKEpdPo= - -semver-compare@^1.0.0: - version "1.0.0" - resolved "https://registry.npmjs.org/semver-compare/-/semver-compare-1.0.0.tgz" - integrity sha1-De4hahyUGrN+nvsXiPavxf9VN/w= - -semver-regex@^3.1.2: - version "3.1.2" - resolved "https://registry.npmjs.org/semver-regex/-/semver-regex-3.1.2.tgz" - integrity sha512-bXWyL6EAKOJa81XG1OZ/Yyuq+oT0b2YLlxx7c+mrdYPaPbnj6WgVULXhinMIeZGufuUBu/eVRqXEhiv4imfwxA== - -"semver@2 || 3 || 4 || 5", semver@^5.5.0, semver@^5.7.0: - version "5.7.1" - resolved "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz" - integrity sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ== - -semver@7.3.2: - version "7.3.2" - resolved "https://registry.npmjs.org/semver/-/semver-7.3.2.tgz" - integrity sha512-OrOb32TeeambH6UrhtShmF7CRDqhL6/5XpPNp2DuRH6+9QLw/orhp72j87v8Qa1ScDkvrrBNpZcDejAirJmfXQ== - -semver@^6.3.0: - version "6.3.0" - resolved "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz" - integrity sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw== - -semver@^7.3.2: - version "7.3.4" - resolved "https://registry.npmjs.org/semver/-/semver-7.3.4.tgz" - integrity sha512-tCfb2WLjqFAtXn4KEdxIhalnRtoKFN7nAwj0B3ZXCbQloV2tq5eDbcTmT68JJD3nRJq24/XgxtQKFIpQdtvmVw== - dependencies: - lru-cache "^6.0.0" - -set-blocking@^2.0.0: - version "2.0.0" - resolved "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz" - integrity sha1-BF+XgtARrppoA93TgrJDkrPYkPc= - -set-value@^2.0.0, set-value@^2.0.1: - version "2.0.1" - resolved "https://registry.npmjs.org/set-value/-/set-value-2.0.1.tgz" - integrity sha512-JxHc1weCN68wRY0fhCoXpyK55m/XPHafOmK4UWD7m2CI14GMcFypt4w/0+NV5f/ZMby2F6S2wwA7fgynh9gWSw== - dependencies: - extend-shallow "^2.0.1" - is-extendable "^0.1.1" - is-plain-object "^2.0.3" - split-string "^3.0.1" - -setimmediate@^1.0.5: - version "1.0.5" - resolved "https://registry.npmjs.org/setimmediate/-/setimmediate-1.0.5.tgz" - integrity sha1-KQy7Iy4waULX1+qbg3Mqt4VvgoU= - -setprototypeof@1.1.1: - version "1.1.1" - resolved "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.1.1.tgz" - integrity sha512-JvdAWfbXeIGaZ9cILp38HntZSFSo3mWg6xGcJJsd+d4aRMOqauag1C63dJfDw7OaMYwEbHMOxEZ1lqVRYP2OAw== - -sha.js@^2.4.0, sha.js@^2.4.8: - version "2.4.11" - resolved "https://registry.npmjs.org/sha.js/-/sha.js-2.4.11.tgz" - integrity sha512-QMEp5B7cftE7APOjk5Y6xgrbWu+WkLVQwk8JNjZ8nKRciZaByEW6MubieAiToS7+dwvrjGhH8jRXz3MVd0AYqQ== - dependencies: - inherits "^2.0.1" - safe-buffer "^5.0.1" - -shebang-command@^1.2.0: - version "1.2.0" - resolved "https://registry.npmjs.org/shebang-command/-/shebang-command-1.2.0.tgz" - integrity sha1-RKrGW2lbAzmJaMOfNj/uXer98eo= - dependencies: - shebang-regex "^1.0.0" - -shebang-command@^2.0.0: - version "2.0.0" - resolved "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz" - integrity sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA== - dependencies: - shebang-regex "^3.0.0" - -shebang-regex@^1.0.0: - version "1.0.0" - resolved "https://registry.npmjs.org/shebang-regex/-/shebang-regex-1.0.0.tgz" - integrity sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM= - -shebang-regex@^3.0.0: - version "3.0.0" - resolved "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz" - integrity sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A== - -side-channel@^1.0.4: - version "1.0.4" - resolved "https://registry.npmjs.org/side-channel/-/side-channel-1.0.4.tgz" - integrity sha512-q5XPytqFEIKHkGdiMIrY10mvLRvnQh42/+GoBlFW3b2LXLE2xxJpZFdm94we0BaoV3RwJyGqg5wS7epxTv0Zvw== - dependencies: - call-bind "^1.0.0" - get-intrinsic "^1.0.2" - object-inspect "^1.9.0" - -signal-exit@^3.0.0, signal-exit@^3.0.2: - version "3.0.3" - resolved "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.3.tgz" - integrity sha512-VUJ49FC8U1OxwZLxIbTTrDvLnf/6TDgxZcK8wxR8zs13xpx7xbG60ndBlhNrFi2EMuFRoeDoJO7wthSLq42EjA== - -slash@^3.0.0: - version "3.0.0" - resolved "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz" - integrity sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q== - -snapdragon-node@^2.0.1: - version "2.1.1" - resolved "https://registry.npmjs.org/snapdragon-node/-/snapdragon-node-2.1.1.tgz" - integrity sha512-O27l4xaMYt/RSQ5TR3vpWCAB5Kb/czIcqUFOM/C4fYcLnbZUc1PkjTAMjof2pBWaSTwOUd6qUHcFGVGj7aIwnw== - dependencies: - define-property "^1.0.0" - isobject "^3.0.0" - snapdragon-util "^3.0.1" - -snapdragon-util@^3.0.1: - version "3.0.1" - resolved "https://registry.npmjs.org/snapdragon-util/-/snapdragon-util-3.0.1.tgz" - integrity sha512-mbKkMdQKsjX4BAL4bRYTj21edOf8cN7XHdYUJEe+Zn99hVEYcMvKPct1IqNe7+AZPirn8BCDOQBHQZknqmKlZQ== - dependencies: - kind-of "^3.2.0" - -snapdragon@^0.8.1: - version "0.8.2" - resolved "https://registry.npmjs.org/snapdragon/-/snapdragon-0.8.2.tgz" - integrity sha512-FtyOnWN/wCHTVXOMwvSv26d+ko5vWlIDD6zoUJ7LW8vh+ZBC8QdljveRP+crNrtBwioEUWy/4dMtbBjA4ioNlg== - dependencies: - base "^0.11.1" - debug "^2.2.0" - define-property "^0.2.5" - extend-shallow "^2.0.1" - map-cache "^0.2.2" - source-map "^0.5.6" - source-map-resolve "^0.5.0" - use "^3.1.0" - -sol-digger@0.0.2: - version "0.0.2" - resolved "https://registry.npmjs.org/sol-digger/-/sol-digger-0.0.2.tgz" - integrity sha1-QGxKnTHiaef4jrHC6hATGOXgkCU= - -sol-explore@1.6.1: - version "1.6.1" - resolved "https://registry.npmjs.org/sol-explore/-/sol-explore-1.6.1.tgz" - integrity sha1-tZ8HPGn+MyVg1aEMMrqMp/KYbPs= - -solc@0.7.3: - version "0.7.3" - resolved "https://registry.npmjs.org/solc/-/solc-0.7.3.tgz" - integrity sha512-GAsWNAjGzIDg7VxzP6mPjdurby3IkGCjQcM8GFYZT6RyaoUZKmMU6Y7YwG+tFGhv7dwZ8rmR4iwFDrrD99JwqA== - dependencies: - command-exists "^1.2.8" - commander "3.0.2" - follow-redirects "^1.12.1" - fs-extra "^0.30.0" - js-sha3 "0.8.0" - memorystream "^0.3.1" - require-from-string "^2.0.0" - semver "^5.5.0" - tmp "0.0.33" - -solidity-comments-extractor@^0.0.4: - version "0.0.4" - resolved "https://registry.npmjs.org/solidity-comments-extractor/-/solidity-comments-extractor-0.0.4.tgz" - integrity sha512-58glBODwXIKMaQ7rfcJOrWtFQMMOK28tJ0/LcB5Xhu7WtAxk4UX2fpgKPuaL41XjMp/y0gAa1MTLqk018wuSzA== - -solium-plugin-security@0.1.1: - version "0.1.1" - resolved "https://registry.npmjs.org/solium-plugin-security/-/solium-plugin-security-0.1.1.tgz" - integrity sha512-kpLirBwIq4mhxk0Y/nn5cQ6qdJTI+U1LO3gpoNIcqNaW+sI058moXBe2UiHs+9wvF9IzYD49jcKhFTxcR9u9SQ== - -solparse@2.2.8: - version "2.2.8" - resolved "https://registry.npmjs.org/solparse/-/solparse-2.2.8.tgz" - integrity sha512-Tm6hdfG72DOxD40SD+T5ddbekWglNWjzDRSNq7ZDIOHVsyaJSeeunUuWNj4DE7uDrJK3tGQuX0ZTDZWNYsGPMA== - dependencies: - mocha "^4.0.1" - pegjs "^0.10.0" - yargs "^10.0.3" - -source-map-resolve@^0.5.0: - version "0.5.3" - resolved "https://registry.npmjs.org/source-map-resolve/-/source-map-resolve-0.5.3.tgz" - integrity sha512-Htz+RnsXWk5+P2slx5Jh3Q66vhQj1Cllm0zvnaY98+NFx+Dv2CF/f5O/t8x+KaNdrdIAsruNzoh/KpialbqAnw== - dependencies: - atob "^2.1.2" - decode-uri-component "^0.2.0" - resolve-url "^0.2.1" - source-map-url "^0.4.0" - urix "^0.1.0" - -source-map-support@^0.5.13: - version "0.5.20" - resolved "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.20.tgz" - integrity sha512-n1lZZ8Ve4ksRqizaBQgxXDgKwttHDhyfQjA6YZZn8+AroHbsIz+JjwxQDxbp+7y5OYCI8t1Yk7etjD9CRd2hIw== - dependencies: - buffer-from "^1.0.0" - source-map "^0.6.0" - -source-map-url@^0.4.0: - version "0.4.1" - resolved "https://registry.npmjs.org/source-map-url/-/source-map-url-0.4.1.tgz" - integrity sha512-cPiFOTLUKvJFIg4SKVScy4ilPPW6rFgMgfuZJPNoDuMs3nC1HbMUycBoJw77xFIp6z1UJQJOfx6C9GMH80DiTw== - -source-map@^0.5.6: - version "0.5.7" - resolved "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz" - integrity sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w= - -source-map@^0.6.0: - version "0.6.1" - resolved "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz" - integrity sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g== - -spdx-correct@^3.0.0: - version "3.1.1" - resolved "https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.1.1.tgz" - integrity sha512-cOYcUWwhCuHCXi49RhFRCyJEK3iPj1Ziz9DpViV3tbZOwXD49QzIN3MpOLJNxh2qwq2lJJZaKMVw9qNi4jTC0w== - dependencies: - spdx-expression-parse "^3.0.0" - spdx-license-ids "^3.0.0" - -spdx-exceptions@^2.1.0: - version "2.3.0" - resolved "https://registry.npmjs.org/spdx-exceptions/-/spdx-exceptions-2.3.0.tgz" - integrity sha512-/tTrYOC7PPI1nUAgx34hUpqXuyJG+DTHJTnIULG4rDygi4xu/tfgmq1e1cIRwRzwZgo4NLySi+ricLkZkw4i5A== - -spdx-expression-parse@^3.0.0: - version "3.0.1" - resolved "https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-3.0.1.tgz" - integrity sha512-cbqHunsQWnJNE6KhVSMsMeH5H/L9EpymbzqTQ3uLwNCLZ1Q481oWaofqH7nO6V07xlXwY6PhQdQ2IedWx/ZK4Q== - dependencies: - spdx-exceptions "^2.1.0" - spdx-license-ids "^3.0.0" - -spdx-license-ids@^3.0.0: - version "3.0.7" - resolved "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.7.tgz" - integrity sha512-U+MTEOO0AiDzxwFvoa4JVnMV6mZlJKk2sBLt90s7G0Gd0Mlknc7kxEn3nuDPNZRta7O2uy8oLcZLVT+4sqNZHQ== - -split-string@^3.0.1, split-string@^3.0.2: - version "3.1.0" - resolved "https://registry.npmjs.org/split-string/-/split-string-3.1.0.tgz" - integrity sha512-NzNVhJDYpwceVVii8/Hu6DKfD2G+NrQHlS/V/qgv763EYudVwEcMQNxd2lh+0VrUByXN/oJkl5grOhYWvQUYiw== - dependencies: - extend-shallow "^3.0.0" - -split2@^2.0.0: - version "2.2.0" - resolved "https://registry.npmjs.org/split2/-/split2-2.2.0.tgz" - integrity sha512-RAb22TG39LhI31MbreBgIuKiIKhVsawfTgEGqKHTK87aG+ul/PB8Sqoi3I7kVdRWiCfrKxK3uo4/YUkpNvhPbw== - dependencies: - through2 "^2.0.2" - -split2@^3.0.0: - version "3.2.2" - resolved "https://registry.npmjs.org/split2/-/split2-3.2.2.tgz" - integrity sha512-9NThjpgZnifTkJpzTZ7Eue85S49QwpNhZTq6GRJwObb6jnLFNGB7Qm73V5HewTROPyxD0C29xqmaI68bQtV+hg== - dependencies: - readable-stream "^3.0.0" - -sprintf-js@~1.0.2: - version "1.0.3" - resolved "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz" - integrity sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw= - -stacktrace-parser@^0.1.10: - version "0.1.10" - resolved "https://registry.npmjs.org/stacktrace-parser/-/stacktrace-parser-0.1.10.tgz" - integrity sha512-KJP1OCML99+8fhOHxwwzyWrlUuVX5GQ0ZpJTd1DFXhdkrvg1szxfHhawXUZ3g9TkXORQd4/WG68jMlQZ2p8wlg== + "integrity" "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==" + "resolved" "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz" + "version" "2.1.2" + +"scrypt-js@^3.0.0": + "integrity" "sha512-cdwTTnqPu0Hyvf5in5asVdZocVDTNRmR7XEcJuIzMjJeSHybHl7vpB66AzwTaIg6CLSbtjcxc8fqcySfnTkccA==" + "resolved" "https://registry.npmjs.org/scrypt-js/-/scrypt-js-3.0.1.tgz" + "version" "3.0.1" + +"secp256k1@^4.0.1": + "integrity" "sha512-NLZVf+ROMxwtEj3Xa562qgv2BK5e2WNmXPiOdVIPLgs6lyTzMvBq0aWTYMI5XCP9jZMVKOcqZLw/Wc4vDkuxhA==" + "resolved" "https://registry.npmjs.org/secp256k1/-/secp256k1-4.0.3.tgz" + "version" "4.0.3" + dependencies: + "elliptic" "^6.5.4" + "node-addon-api" "^2.0.0" + "node-gyp-build" "^4.2.0" + +"semaphore-async-await@^1.5.1": + "integrity" "sha1-hXvvXjZEYBykuVcLh+nfXKEpdPo=" + "resolved" "https://registry.npmjs.org/semaphore-async-await/-/semaphore-async-await-1.5.1.tgz" + "version" "1.5.1" + +"semver-compare@^1.0.0": + "integrity" "sha1-De4hahyUGrN+nvsXiPavxf9VN/w=" + "resolved" "https://registry.npmjs.org/semver-compare/-/semver-compare-1.0.0.tgz" + "version" "1.0.0" + +"semver-regex@^3.1.2": + "integrity" "sha512-bXWyL6EAKOJa81XG1OZ/Yyuq+oT0b2YLlxx7c+mrdYPaPbnj6WgVULXhinMIeZGufuUBu/eVRqXEhiv4imfwxA==" + "resolved" "https://registry.npmjs.org/semver-regex/-/semver-regex-3.1.2.tgz" + "version" "3.1.2" + +"semver@^5.5.0": + "integrity" "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==" + "resolved" "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz" + "version" "5.7.1" + +"semver@^6.3.0": + "integrity" "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==" + "resolved" "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz" + "version" "6.3.0" + +"semver@^7.3.2", "semver@^7.3.5": + "integrity" "sha512-QlYTucUYOews+WeEujDoEGziz4K6c47V/Bd+LjSSYcA94p+DmINdf7ncaUinThfvZyu13lN9OY1XDxt8C0Tw0g==" + "resolved" "https://registry.npmjs.org/semver/-/semver-7.3.7.tgz" + "version" "7.3.7" + dependencies: + "lru-cache" "^6.0.0" + +"semver@2 || 3 || 4 || 5": + "integrity" "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==" + "resolved" "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz" + "version" "5.7.1" + +"semver@7.3.2": + "integrity" "sha512-OrOb32TeeambH6UrhtShmF7CRDqhL6/5XpPNp2DuRH6+9QLw/orhp72j87v8Qa1ScDkvrrBNpZcDejAirJmfXQ==" + "resolved" "https://registry.npmjs.org/semver/-/semver-7.3.2.tgz" + "version" "7.3.2" + +"serialize-javascript@6.0.0": + "integrity" "sha512-Qr3TosvguFt8ePWqsvRfrKyQXIiW+nGbYpy8XK24NQHE83caxWt+mIymTT19DGFbNWNLfEwsrkSmN64lVWB9ag==" + "resolved" "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-6.0.0.tgz" + "version" "6.0.0" + dependencies: + "randombytes" "^2.1.0" + +"set-blocking@^2.0.0": + "integrity" "sha1-BF+XgtARrppoA93TgrJDkrPYkPc=" + "resolved" "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz" + "version" "2.0.0" + +"set-value@^2.0.0", "set-value@^2.0.1": + "integrity" "sha512-JxHc1weCN68wRY0fhCoXpyK55m/XPHafOmK4UWD7m2CI14GMcFypt4w/0+NV5f/ZMby2F6S2wwA7fgynh9gWSw==" + "resolved" "https://registry.npmjs.org/set-value/-/set-value-2.0.1.tgz" + "version" "2.0.1" + dependencies: + "extend-shallow" "^2.0.1" + "is-extendable" "^0.1.1" + "is-plain-object" "^2.0.3" + "split-string" "^3.0.1" + +"setimmediate@^1.0.5": + "integrity" "sha1-KQy7Iy4waULX1+qbg3Mqt4VvgoU=" + "resolved" "https://registry.npmjs.org/setimmediate/-/setimmediate-1.0.5.tgz" + "version" "1.0.5" + +"setprototypeof@1.1.1": + "integrity" "sha512-JvdAWfbXeIGaZ9cILp38HntZSFSo3mWg6xGcJJsd+d4aRMOqauag1C63dJfDw7OaMYwEbHMOxEZ1lqVRYP2OAw==" + "resolved" "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.1.1.tgz" + "version" "1.1.1" + +"sha.js@^2.4.0", "sha.js@^2.4.8": + "integrity" "sha512-QMEp5B7cftE7APOjk5Y6xgrbWu+WkLVQwk8JNjZ8nKRciZaByEW6MubieAiToS7+dwvrjGhH8jRXz3MVd0AYqQ==" + "resolved" "https://registry.npmjs.org/sha.js/-/sha.js-2.4.11.tgz" + "version" "2.4.11" + dependencies: + "inherits" "^2.0.1" + "safe-buffer" "^5.0.1" + +"shebang-command@^1.2.0": + "integrity" "sha1-RKrGW2lbAzmJaMOfNj/uXer98eo=" + "resolved" "https://registry.npmjs.org/shebang-command/-/shebang-command-1.2.0.tgz" + "version" "1.2.0" + dependencies: + "shebang-regex" "^1.0.0" + +"shebang-command@^2.0.0": + "integrity" "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==" + "resolved" "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz" + "version" "2.0.0" + dependencies: + "shebang-regex" "^3.0.0" + +"shebang-regex@^1.0.0": + "integrity" "sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM=" + "resolved" "https://registry.npmjs.org/shebang-regex/-/shebang-regex-1.0.0.tgz" + "version" "1.0.0" + +"shebang-regex@^3.0.0": + "integrity" "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==" + "resolved" "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz" + "version" "3.0.0" + +"side-channel@^1.0.4": + "integrity" "sha512-q5XPytqFEIKHkGdiMIrY10mvLRvnQh42/+GoBlFW3b2LXLE2xxJpZFdm94we0BaoV3RwJyGqg5wS7epxTv0Zvw==" + "resolved" "https://registry.npmjs.org/side-channel/-/side-channel-1.0.4.tgz" + "version" "1.0.4" + dependencies: + "call-bind" "^1.0.0" + "get-intrinsic" "^1.0.2" + "object-inspect" "^1.9.0" + +"signal-exit@^3.0.0", "signal-exit@^3.0.2": + "integrity" "sha512-VUJ49FC8U1OxwZLxIbTTrDvLnf/6TDgxZcK8wxR8zs13xpx7xbG60ndBlhNrFi2EMuFRoeDoJO7wthSLq42EjA==" + "resolved" "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.3.tgz" + "version" "3.0.3" + +"slash@^3.0.0": + "integrity" "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==" + "resolved" "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz" + "version" "3.0.0" + +"snapdragon-node@^2.0.1": + "integrity" "sha512-O27l4xaMYt/RSQ5TR3vpWCAB5Kb/czIcqUFOM/C4fYcLnbZUc1PkjTAMjof2pBWaSTwOUd6qUHcFGVGj7aIwnw==" + "resolved" "https://registry.npmjs.org/snapdragon-node/-/snapdragon-node-2.1.1.tgz" + "version" "2.1.1" + dependencies: + "define-property" "^1.0.0" + "isobject" "^3.0.0" + "snapdragon-util" "^3.0.1" + +"snapdragon-util@^3.0.1": + "integrity" "sha512-mbKkMdQKsjX4BAL4bRYTj21edOf8cN7XHdYUJEe+Zn99hVEYcMvKPct1IqNe7+AZPirn8BCDOQBHQZknqmKlZQ==" + "resolved" "https://registry.npmjs.org/snapdragon-util/-/snapdragon-util-3.0.1.tgz" + "version" "3.0.1" + dependencies: + "kind-of" "^3.2.0" + +"snapdragon@^0.8.1": + "integrity" "sha512-FtyOnWN/wCHTVXOMwvSv26d+ko5vWlIDD6zoUJ7LW8vh+ZBC8QdljveRP+crNrtBwioEUWy/4dMtbBjA4ioNlg==" + "resolved" "https://registry.npmjs.org/snapdragon/-/snapdragon-0.8.2.tgz" + "version" "0.8.2" + dependencies: + "base" "^0.11.1" + "debug" "^2.2.0" + "define-property" "^0.2.5" + "extend-shallow" "^2.0.1" + "map-cache" "^0.2.2" + "source-map" "^0.5.6" + "source-map-resolve" "^0.5.0" + "use" "^3.1.0" + +"sol-digger@0.0.2": + "integrity" "sha1-QGxKnTHiaef4jrHC6hATGOXgkCU=" + "resolved" "https://registry.npmjs.org/sol-digger/-/sol-digger-0.0.2.tgz" + "version" "0.0.2" + +"sol-explore@1.6.1": + "integrity" "sha1-tZ8HPGn+MyVg1aEMMrqMp/KYbPs=" + "resolved" "https://registry.npmjs.org/sol-explore/-/sol-explore-1.6.1.tgz" + "version" "1.6.1" + +"solc@0.7.3": + "integrity" "sha512-GAsWNAjGzIDg7VxzP6mPjdurby3IkGCjQcM8GFYZT6RyaoUZKmMU6Y7YwG+tFGhv7dwZ8rmR4iwFDrrD99JwqA==" + "resolved" "https://registry.npmjs.org/solc/-/solc-0.7.3.tgz" + "version" "0.7.3" + dependencies: + "command-exists" "^1.2.8" + "commander" "3.0.2" + "follow-redirects" "^1.12.1" + "fs-extra" "^0.30.0" + "js-sha3" "0.8.0" + "memorystream" "^0.3.1" + "require-from-string" "^2.0.0" + "semver" "^5.5.0" + "tmp" "0.0.33" + +"solidity-comments-extractor@^0.0.7": + "integrity" "sha512-wciNMLg/Irp8OKGrh3S2tfvZiZ0NEyILfcRCXCD4mp7SgK/i9gzLfhY2hY7VMCQJ3kH9UB9BzNdibIVMchzyYw==" + "resolved" "https://registry.npmjs.org/solidity-comments-extractor/-/solidity-comments-extractor-0.0.7.tgz" + "version" "0.0.7" + +"solium-plugin-security@0.1.1": + "integrity" "sha512-kpLirBwIq4mhxk0Y/nn5cQ6qdJTI+U1LO3gpoNIcqNaW+sI058moXBe2UiHs+9wvF9IzYD49jcKhFTxcR9u9SQ==" + "resolved" "https://registry.npmjs.org/solium-plugin-security/-/solium-plugin-security-0.1.1.tgz" + "version" "0.1.1" + +"solparse@2.2.8": + "integrity" "sha512-Tm6hdfG72DOxD40SD+T5ddbekWglNWjzDRSNq7ZDIOHVsyaJSeeunUuWNj4DE7uDrJK3tGQuX0ZTDZWNYsGPMA==" + "resolved" "https://registry.npmjs.org/solparse/-/solparse-2.2.8.tgz" + "version" "2.2.8" + dependencies: + "mocha" "^4.0.1" + "pegjs" "^0.10.0" + "yargs" "^10.0.3" + +"source-map-resolve@^0.5.0": + "integrity" "sha512-Htz+RnsXWk5+P2slx5Jh3Q66vhQj1Cllm0zvnaY98+NFx+Dv2CF/f5O/t8x+KaNdrdIAsruNzoh/KpialbqAnw==" + "resolved" "https://registry.npmjs.org/source-map-resolve/-/source-map-resolve-0.5.3.tgz" + "version" "0.5.3" + dependencies: + "atob" "^2.1.2" + "decode-uri-component" "^0.2.0" + "resolve-url" "^0.2.1" + "source-map-url" "^0.4.0" + "urix" "^0.1.0" + +"source-map-support@^0.5.13": + "integrity" "sha512-n1lZZ8Ve4ksRqizaBQgxXDgKwttHDhyfQjA6YZZn8+AroHbsIz+JjwxQDxbp+7y5OYCI8t1Yk7etjD9CRd2hIw==" + "resolved" "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.20.tgz" + "version" "0.5.20" + dependencies: + "buffer-from" "^1.0.0" + "source-map" "^0.6.0" + +"source-map-url@^0.4.0": + "integrity" "sha512-cPiFOTLUKvJFIg4SKVScy4ilPPW6rFgMgfuZJPNoDuMs3nC1HbMUycBoJw77xFIp6z1UJQJOfx6C9GMH80DiTw==" + "resolved" "https://registry.npmjs.org/source-map-url/-/source-map-url-0.4.1.tgz" + "version" "0.4.1" + +"source-map@^0.5.6": + "integrity" "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=" + "resolved" "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz" + "version" "0.5.7" + +"source-map@^0.6.0": + "integrity" "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==" + "resolved" "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz" + "version" "0.6.1" + +"spdx-correct@^3.0.0": + "integrity" "sha512-cOYcUWwhCuHCXi49RhFRCyJEK3iPj1Ziz9DpViV3tbZOwXD49QzIN3MpOLJNxh2qwq2lJJZaKMVw9qNi4jTC0w==" + "resolved" "https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.1.1.tgz" + "version" "3.1.1" + dependencies: + "spdx-expression-parse" "^3.0.0" + "spdx-license-ids" "^3.0.0" + +"spdx-exceptions@^2.1.0": + "integrity" "sha512-/tTrYOC7PPI1nUAgx34hUpqXuyJG+DTHJTnIULG4rDygi4xu/tfgmq1e1cIRwRzwZgo4NLySi+ricLkZkw4i5A==" + "resolved" "https://registry.npmjs.org/spdx-exceptions/-/spdx-exceptions-2.3.0.tgz" + "version" "2.3.0" + +"spdx-expression-parse@^3.0.0": + "integrity" "sha512-cbqHunsQWnJNE6KhVSMsMeH5H/L9EpymbzqTQ3uLwNCLZ1Q481oWaofqH7nO6V07xlXwY6PhQdQ2IedWx/ZK4Q==" + "resolved" "https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-3.0.1.tgz" + "version" "3.0.1" + dependencies: + "spdx-exceptions" "^2.1.0" + "spdx-license-ids" "^3.0.0" + +"spdx-license-ids@^3.0.0": + "integrity" "sha512-U+MTEOO0AiDzxwFvoa4JVnMV6mZlJKk2sBLt90s7G0Gd0Mlknc7kxEn3nuDPNZRta7O2uy8oLcZLVT+4sqNZHQ==" + "resolved" "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.7.tgz" + "version" "3.0.7" + +"split-string@^3.0.1", "split-string@^3.0.2": + "integrity" "sha512-NzNVhJDYpwceVVii8/Hu6DKfD2G+NrQHlS/V/qgv763EYudVwEcMQNxd2lh+0VrUByXN/oJkl5grOhYWvQUYiw==" + "resolved" "https://registry.npmjs.org/split-string/-/split-string-3.1.0.tgz" + "version" "3.1.0" + dependencies: + "extend-shallow" "^3.0.0" + +"split2@^2.0.0": + "integrity" "sha512-RAb22TG39LhI31MbreBgIuKiIKhVsawfTgEGqKHTK87aG+ul/PB8Sqoi3I7kVdRWiCfrKxK3uo4/YUkpNvhPbw==" + "resolved" "https://registry.npmjs.org/split2/-/split2-2.2.0.tgz" + "version" "2.2.0" + dependencies: + "through2" "^2.0.2" + +"split2@^3.0.0": + "integrity" "sha512-9NThjpgZnifTkJpzTZ7Eue85S49QwpNhZTq6GRJwObb6jnLFNGB7Qm73V5HewTROPyxD0C29xqmaI68bQtV+hg==" + "resolved" "https://registry.npmjs.org/split2/-/split2-3.2.2.tgz" + "version" "3.2.2" + dependencies: + "readable-stream" "^3.0.0" + +"stacktrace-parser@^0.1.10": + "integrity" "sha512-KJP1OCML99+8fhOHxwwzyWrlUuVX5GQ0ZpJTd1DFXhdkrvg1szxfHhawXUZ3g9TkXORQd4/WG68jMlQZ2p8wlg==" + "resolved" "https://registry.npmjs.org/stacktrace-parser/-/stacktrace-parser-0.1.10.tgz" + "version" "0.1.10" dependencies: - type-fest "^0.7.1" - -static-extend@^0.1.1: - version "0.1.2" - resolved "https://registry.npmjs.org/static-extend/-/static-extend-0.1.2.tgz" - integrity sha1-YICcOcv/VTNyJv1eC1IPNB8ftcY= - dependencies: - define-property "^0.2.5" - object-copy "^0.1.0" + "type-fest" "^0.7.1" + +"static-extend@^0.1.1": + "integrity" "sha1-YICcOcv/VTNyJv1eC1IPNB8ftcY=" + "resolved" "https://registry.npmjs.org/static-extend/-/static-extend-0.1.2.tgz" + "version" "0.1.2" + dependencies: + "define-property" "^0.2.5" + "object-copy" "^0.1.0" "statuses@>= 1.5.0 < 2": - version "1.5.0" - resolved "https://registry.npmjs.org/statuses/-/statuses-1.5.0.tgz" - integrity sha1-Fhx9rBd2Wf2YEfQ3cfqZOBR4Yow= - -string-width@^1.0.1: - version "1.0.2" - resolved "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz" - integrity sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M= - dependencies: - code-point-at "^1.0.0" - is-fullwidth-code-point "^1.0.0" - strip-ansi "^3.0.0" - -"string-width@^1.0.2 || 2", string-width@^2.0.0, string-width@^2.1.1: - version "2.1.1" - resolved "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz" - integrity sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw== - dependencies: - is-fullwidth-code-point "^2.0.0" - strip-ansi "^4.0.0" - -string-width@^3.0.0, string-width@^3.1.0: - version "3.1.0" - resolved "https://registry.npmjs.org/string-width/-/string-width-3.1.0.tgz" - integrity sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w== - dependencies: - emoji-regex "^7.0.1" - is-fullwidth-code-point "^2.0.0" - strip-ansi "^5.1.0" - -string-width@^4.1.0, string-width@^4.2.0: - version "4.2.0" - resolved "https://registry.npmjs.org/string-width/-/string-width-4.2.0.tgz" - integrity sha512-zUz5JD+tgqtuDjMhwIg5uFVV3dtqZ9yQJlZVfq4I01/K5Paj5UHj7VyrQOJvzawSVlKpObApbfD0Ed6yJc+1eg== - dependencies: - emoji-regex "^8.0.0" - is-fullwidth-code-point "^3.0.0" - strip-ansi "^6.0.0" + "integrity" "sha1-Fhx9rBd2Wf2YEfQ3cfqZOBR4Yow=" + "resolved" "https://registry.npmjs.org/statuses/-/statuses-1.5.0.tgz" + "version" "1.5.0" -string.prototype.trimend@^1.0.4: - version "1.0.4" - resolved "https://registry.npmjs.org/string.prototype.trimend/-/string.prototype.trimend-1.0.4.tgz" - integrity sha512-y9xCjw1P23Awk8EvTpcyL2NIr1j7wJ39f+k6lvRnSMz+mz9CGz9NYPelDk42kOz6+ql8xjfK8oYzy3jAP5QU5A== +"string_decoder@^1.1.1", "string_decoder@~1.1.1": + "integrity" "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==" + "resolved" "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz" + "version" "1.1.1" dependencies: - call-bind "^1.0.2" - define-properties "^1.1.3" + "safe-buffer" "~5.1.0" -string.prototype.trimstart@^1.0.4: - version "1.0.4" - resolved "https://registry.npmjs.org/string.prototype.trimstart/-/string.prototype.trimstart-1.0.4.tgz" - integrity sha512-jh6e984OBfvxS50tdY2nRZnoC5/mLFKOREQfw8t5yytkoUsJRNxvI/E39qu1sD0OtWI3OC0XgKSmcWwziwYuZw== +"string-width@^1.0.1": + "integrity" "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=" + "resolved" "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz" + "version" "1.0.2" dependencies: - call-bind "^1.0.2" - define-properties "^1.1.3" + "code-point-at" "^1.0.0" + "is-fullwidth-code-point" "^1.0.0" + "strip-ansi" "^3.0.0" -string_decoder@^1.1.1, string_decoder@~1.1.1: - version "1.1.1" - resolved "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz" - integrity sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg== +"string-width@^2.0.0", "string-width@^2.1.1": + "integrity" "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==" + "resolved" "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz" + "version" "2.1.1" dependencies: - safe-buffer "~5.1.0" + "is-fullwidth-code-point" "^2.0.0" + "strip-ansi" "^4.0.0" -strip-ansi@^3.0.0, strip-ansi@^3.0.1: - version "3.0.1" - resolved "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz" - integrity sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8= +"string-width@^4.1.0", "string-width@^4.2.0", "string-width@^4.2.3": + "integrity" "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==" + "resolved" "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz" + "version" "4.2.3" dependencies: - ansi-regex "^2.0.0" + "emoji-regex" "^8.0.0" + "is-fullwidth-code-point" "^3.0.0" + "strip-ansi" "^6.0.1" -strip-ansi@^4.0.0: - version "4.0.0" - resolved "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz" - integrity sha1-qEeQIusaw2iocTibY1JixQXuNo8= +"strip-ansi@^3.0.0", "strip-ansi@^3.0.1": + "integrity" "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=" + "resolved" "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz" + "version" "3.0.1" dependencies: - ansi-regex "^3.0.0" + "ansi-regex" "^2.0.0" -strip-ansi@^5.0.0, strip-ansi@^5.1.0, strip-ansi@^5.2.0: - version "5.2.0" - resolved "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz" - integrity sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA== +"strip-ansi@^4.0.0": + "integrity" "sha1-qEeQIusaw2iocTibY1JixQXuNo8=" + "resolved" "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz" + "version" "4.0.0" dependencies: - ansi-regex "^4.1.0" + "ansi-regex" "^3.0.0" -strip-ansi@^6.0.0: - version "6.0.0" - resolved "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.0.tgz" - integrity sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w== +"strip-ansi@^6.0.0", "strip-ansi@^6.0.1": + "integrity" "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==" + "resolved" "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz" + "version" "6.0.1" dependencies: - ansi-regex "^5.0.0" + "ansi-regex" "^5.0.1" -strip-eof@^1.0.0: - version "1.0.0" - resolved "https://registry.npmjs.org/strip-eof/-/strip-eof-1.0.0.tgz" - integrity sha1-u0P/VZim6wXYm1n80SnJgzE2Br8= +"strip-eof@^1.0.0": + "integrity" "sha1-u0P/VZim6wXYm1n80SnJgzE2Br8=" + "resolved" "https://registry.npmjs.org/strip-eof/-/strip-eof-1.0.0.tgz" + "version" "1.0.0" -strip-final-newline@^2.0.0: - version "2.0.0" - resolved "https://registry.npmjs.org/strip-final-newline/-/strip-final-newline-2.0.0.tgz" - integrity sha512-BrpvfNAE3dcvq7ll3xVumzjKjZQ5tI1sEUIKr3Uoks0XUl45St3FlatVqef9prk4jRDzhW6WZg+3bk93y6pLjA== +"strip-final-newline@^2.0.0": + "integrity" "sha512-BrpvfNAE3dcvq7ll3xVumzjKjZQ5tI1sEUIKr3Uoks0XUl45St3FlatVqef9prk4jRDzhW6WZg+3bk93y6pLjA==" + "resolved" "https://registry.npmjs.org/strip-final-newline/-/strip-final-newline-2.0.0.tgz" + "version" "2.0.0" -strip-hex-prefix@1.0.0: - version "1.0.0" - resolved "https://registry.npmjs.org/strip-hex-prefix/-/strip-hex-prefix-1.0.0.tgz" - integrity sha1-DF8VX+8RUTczd96du1iNoFUA428= +"strip-hex-prefix@1.0.0": + "integrity" "sha1-DF8VX+8RUTczd96du1iNoFUA428=" + "resolved" "https://registry.npmjs.org/strip-hex-prefix/-/strip-hex-prefix-1.0.0.tgz" + "version" "1.0.0" dependencies: - is-hex-prefixed "1.0.0" + "is-hex-prefixed" "1.0.0" -strip-indent@^3.0.0: - version "3.0.0" - resolved "https://registry.npmjs.org/strip-indent/-/strip-indent-3.0.0.tgz" - integrity sha512-laJTa3Jb+VQpaC6DseHhF7dXVqHTfJPCRDaEbid/drOhgitgYku/letMUqOXFoWV0zIIUbjpdH2t+tYj4bQMRQ== +"strip-indent@^3.0.0": + "integrity" "sha512-laJTa3Jb+VQpaC6DseHhF7dXVqHTfJPCRDaEbid/drOhgitgYku/letMUqOXFoWV0zIIUbjpdH2t+tYj4bQMRQ==" + "resolved" "https://registry.npmjs.org/strip-indent/-/strip-indent-3.0.0.tgz" + "version" "3.0.0" dependencies: - min-indent "^1.0.0" + "min-indent" "^1.0.0" -strip-json-comments@2.0.1: - version "2.0.1" - resolved "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz" - integrity sha1-PFMZQukIwml8DsNEhYwobHygpgo= +"strip-json-comments@3.1.1": + "integrity" "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==" + "resolved" "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz" + "version" "3.1.1" -supports-color@4.4.0: - version "4.4.0" - resolved "https://registry.npmjs.org/supports-color/-/supports-color-4.4.0.tgz" - integrity sha512-rKC3+DyXWgK0ZLKwmRsrkyHVZAjNkfzeehuFWdGGcqGDTZFH73+RH6S/RDAAxl9GusSjZSUWYLmT9N5pzXFOXQ== +"supports-color@^5.3.0": + "integrity" "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==" + "resolved" "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz" + "version" "5.5.0" dependencies: - has-flag "^2.0.0" + "has-flag" "^3.0.0" -supports-color@6.0.0: - version "6.0.0" - resolved "https://registry.npmjs.org/supports-color/-/supports-color-6.0.0.tgz" - integrity sha512-on9Kwidc1IUQo+bQdhi8+Tijpo0e1SS6RoGo2guUwn5vdaxw8RXOF9Vb2ws+ihWOmh4JnCJOvaziZWP1VABaLg== +"supports-color@^7.1.0": + "integrity" "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==" + "resolved" "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz" + "version" "7.2.0" dependencies: - has-flag "^3.0.0" + "has-flag" "^4.0.0" -supports-color@^5.3.0: - version "5.5.0" - resolved "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz" - integrity sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow== +"supports-color@4.4.0": + "integrity" "sha512-rKC3+DyXWgK0ZLKwmRsrkyHVZAjNkfzeehuFWdGGcqGDTZFH73+RH6S/RDAAxl9GusSjZSUWYLmT9N5pzXFOXQ==" + "resolved" "https://registry.npmjs.org/supports-color/-/supports-color-4.4.0.tgz" + "version" "4.4.0" dependencies: - has-flag "^3.0.0" + "has-flag" "^2.0.0" -supports-color@^7.1.0: - version "7.2.0" - resolved "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz" - integrity sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw== +"supports-color@8.1.1": + "integrity" "sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==" + "resolved" "https://registry.npmjs.org/supports-color/-/supports-color-8.1.1.tgz" + "version" "8.1.1" dependencies: - has-flag "^4.0.0" + "has-flag" "^4.0.0" -text-extensions@^1.0.0: - version "1.9.0" - resolved "https://registry.npmjs.org/text-extensions/-/text-extensions-1.9.0.tgz" - integrity sha512-wiBrwC1EhBelW12Zy26JeOUkQ5mRu+5o8rpsJk5+2t+Y5vE7e842qtZDQ2g1NpX/29HdyFeJ4nSIhI47ENSxlQ== +"text-extensions@^1.0.0": + "integrity" "sha512-wiBrwC1EhBelW12Zy26JeOUkQ5mRu+5o8rpsJk5+2t+Y5vE7e842qtZDQ2g1NpX/29HdyFeJ4nSIhI47ENSxlQ==" + "resolved" "https://registry.npmjs.org/text-extensions/-/text-extensions-1.9.0.tgz" + "version" "1.9.0" -text-table@^0.2.0: - version "0.2.0" - resolved "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz" - integrity sha1-f17oI66AUgfACvLfSoTsP8+lcLQ= +"text-table@^0.2.0": + "integrity" "sha1-f17oI66AUgfACvLfSoTsP8+lcLQ=" + "resolved" "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz" + "version" "0.2.0" -through2@^2.0.2: - version "2.0.5" - resolved "https://registry.npmjs.org/through2/-/through2-2.0.5.tgz" - integrity sha512-/mrRod8xqpA+IHSLyGCQ2s8SPHiCDEeQJSep1jqLYeEUClOFG2Qsh+4FU6G9VeqpZnGW/Su8LQGc4YKni5rYSQ== - dependencies: - readable-stream "~2.3.6" - xtend "~4.0.1" +"through@>=2.2.7 <3": + "integrity" "sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU=" + "resolved" "https://registry.npmjs.org/through/-/through-2.3.8.tgz" + "version" "2.3.8" -through2@^4.0.0: - version "4.0.2" - resolved "https://registry.npmjs.org/through2/-/through2-4.0.2.tgz" - integrity sha512-iOqSav00cVxEEICeD7TjLB1sueEL+81Wpzp2bY17uZjZN0pWZPuo4suZ/61VujxmqSGFfgOcNuTZ85QJwNZQpw== +"through2@^2.0.2": + "integrity" "sha512-/mrRod8xqpA+IHSLyGCQ2s8SPHiCDEeQJSep1jqLYeEUClOFG2Qsh+4FU6G9VeqpZnGW/Su8LQGc4YKni5rYSQ==" + "resolved" "https://registry.npmjs.org/through2/-/through2-2.0.5.tgz" + "version" "2.0.5" dependencies: - readable-stream "3" + "readable-stream" "~2.3.6" + "xtend" "~4.0.1" -"through@>=2.2.7 <3": - version "2.3.8" - resolved "https://registry.npmjs.org/through/-/through-2.3.8.tgz" - integrity sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU= - -tmp@0.0.33: - version "0.0.33" - resolved "https://registry.npmjs.org/tmp/-/tmp-0.0.33.tgz" - integrity sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw== +"through2@^4.0.0": + "integrity" "sha512-iOqSav00cVxEEICeD7TjLB1sueEL+81Wpzp2bY17uZjZN0pWZPuo4suZ/61VujxmqSGFfgOcNuTZ85QJwNZQpw==" + "resolved" "https://registry.npmjs.org/through2/-/through2-4.0.2.tgz" + "version" "4.0.2" dependencies: - os-tmpdir "~1.0.2" + "readable-stream" "3" -to-object-path@^0.3.0: - version "0.3.0" - resolved "https://registry.npmjs.org/to-object-path/-/to-object-path-0.3.0.tgz" - integrity sha1-KXWIt7Dn4KwI4E5nL4XB9JmeF68= +"tmp@0.0.33": + "integrity" "sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw==" + "resolved" "https://registry.npmjs.org/tmp/-/tmp-0.0.33.tgz" + "version" "0.0.33" dependencies: - kind-of "^3.0.2" + "os-tmpdir" "~1.0.2" -to-regex-range@^2.1.0: - version "2.1.1" - resolved "https://registry.npmjs.org/to-regex-range/-/to-regex-range-2.1.1.tgz" - integrity sha1-fIDBe53+vlmeJzZ+DU3VWQFB2zg= +"to-object-path@^0.3.0": + "integrity" "sha1-KXWIt7Dn4KwI4E5nL4XB9JmeF68=" + "resolved" "https://registry.npmjs.org/to-object-path/-/to-object-path-0.3.0.tgz" + "version" "0.3.0" dependencies: - is-number "^3.0.0" - repeat-string "^1.6.1" + "kind-of" "^3.0.2" -to-regex-range@^5.0.1: - version "5.0.1" - resolved "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz" - integrity sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ== +"to-regex-range@^2.1.0": + "integrity" "sha1-fIDBe53+vlmeJzZ+DU3VWQFB2zg=" + "resolved" "https://registry.npmjs.org/to-regex-range/-/to-regex-range-2.1.1.tgz" + "version" "2.1.1" dependencies: - is-number "^7.0.0" + "is-number" "^3.0.0" + "repeat-string" "^1.6.1" -to-regex@^3.0.1, to-regex@^3.0.2: - version "3.0.2" - resolved "https://registry.npmjs.org/to-regex/-/to-regex-3.0.2.tgz" - integrity sha512-FWtleNAtZ/Ki2qtqej2CXTOayOH9bHDQF+Q48VpWyDXjbYxA4Yz8iDB31zXOBUlOHHKidDbqGVrTUvQMPmBGBw== +"to-regex-range@^5.0.1": + "integrity" "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==" + "resolved" "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz" + "version" "5.0.1" dependencies: - define-property "^2.0.2" - extend-shallow "^3.0.2" - regex-not "^1.0.2" - safe-regex "^1.1.0" + "is-number" "^7.0.0" -toidentifier@1.0.0: - version "1.0.0" - resolved "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.0.tgz" - integrity sha512-yaOH/Pk/VEhBWWTlhI+qXxDFXlejDGcQipMlyxda9nthulaxLZUNcUqFxokp0vcYnvteJln5FNQDRrxj3YcbVw== +"to-regex@^3.0.1", "to-regex@^3.0.2": + "integrity" "sha512-FWtleNAtZ/Ki2qtqej2CXTOayOH9bHDQF+Q48VpWyDXjbYxA4Yz8iDB31zXOBUlOHHKidDbqGVrTUvQMPmBGBw==" + "resolved" "https://registry.npmjs.org/to-regex/-/to-regex-3.0.2.tgz" + "version" "3.0.2" + dependencies: + "define-property" "^2.0.2" + "extend-shallow" "^3.0.2" + "regex-not" "^1.0.2" + "safe-regex" "^1.1.0" -tr46@~0.0.3: - version "0.0.3" - resolved "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz" - integrity sha1-gYT9NH2snNwYWZLzpmIuFLnZq2o= +"toidentifier@1.0.0": + "integrity" "sha512-yaOH/Pk/VEhBWWTlhI+qXxDFXlejDGcQipMlyxda9nthulaxLZUNcUqFxokp0vcYnvteJln5FNQDRrxj3YcbVw==" + "resolved" "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.0.tgz" + "version" "1.0.0" -trim-newlines@^3.0.0: - version "3.0.0" - resolved "https://registry.npmjs.org/trim-newlines/-/trim-newlines-3.0.0.tgz" - integrity sha512-C4+gOpvmxaSMKuEf9Qc134F1ZuOHVXKRbtEflf4NTtuuJDEIJ9p5PXsalL8SkeRw+qit1Mo+yuvMPAKwWg/1hA== +"trim-newlines@^3.0.0": + "integrity" "sha512-C4+gOpvmxaSMKuEf9Qc134F1ZuOHVXKRbtEflf4NTtuuJDEIJ9p5PXsalL8SkeRw+qit1Mo+yuvMPAKwWg/1hA==" + "resolved" "https://registry.npmjs.org/trim-newlines/-/trim-newlines-3.0.0.tgz" + "version" "3.0.0" -trim-off-newlines@^1.0.0: - version "1.0.1" - resolved "https://registry.npmjs.org/trim-off-newlines/-/trim-off-newlines-1.0.1.tgz" - integrity sha1-n5up2e+odkw4dpi8v+sshI8RrbM= +"trim-off-newlines@^1.0.0": + "integrity" "sha1-n5up2e+odkw4dpi8v+sshI8RrbM=" + "resolved" "https://registry.npmjs.org/trim-off-newlines/-/trim-off-newlines-1.0.1.tgz" + "version" "1.0.1" "true-case-path@^2.2.1": - version "2.2.1" - resolved "https://registry.npmjs.org/true-case-path/-/true-case-path-2.2.1.tgz" - integrity sha512-0z3j8R7MCjy10kc/g+qg7Ln3alJTodw9aDuVWZa3uiWqfuBMKeAeP2ocWcxoyM3D73yz3Jt/Pu4qPr4wHSdB/Q== - -tslib@^1.9.3: - version "1.14.1" - resolved "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz" - integrity sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg== - -tsort@0.0.1: - version "0.0.1" - resolved "https://registry.npmjs.org/tsort/-/tsort-0.0.1.tgz" - integrity sha1-4igPXoF/i/QnVlf9D5rr1E9aJ4Y= - -tweetnacl-util@^0.15.0: - version "0.15.1" - resolved "https://registry.npmjs.org/tweetnacl-util/-/tweetnacl-util-0.15.1.tgz" - integrity sha512-RKJBIj8lySrShN4w6i/BonWp2Z/uxwC3h4y7xsRrpP59ZboCd0GpEVsOnMDYLMmKBpYhb5TgHzZXy7wTfYFBRw== - -tweetnacl@^1.0.3: - version "1.0.3" - resolved "https://registry.npmjs.org/tweetnacl/-/tweetnacl-1.0.3.tgz" - integrity sha512-6rt+RN7aOi1nGMyC4Xa5DdYiukl2UWCbcJft7YhxReBGQD7OAM8Pbxw6YMo4r2diNEA8FEmu32YOn9rhaiE5yw== - -type-fest@^0.18.0: - version "0.18.1" - resolved "https://registry.npmjs.org/type-fest/-/type-fest-0.18.1.tgz" - integrity sha512-OIAYXk8+ISY+qTOwkHtKqzAuxchoMiD9Udx+FSGQDuiRR+PJKJHc2NJAXlbhkGwTt/4/nKZxELY1w3ReWOL8mw== - -type-fest@^0.21.3: - version "0.21.3" - resolved "https://registry.npmjs.org/type-fest/-/type-fest-0.21.3.tgz" - integrity sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w== - -type-fest@^0.6.0: - version "0.6.0" - resolved "https://registry.npmjs.org/type-fest/-/type-fest-0.6.0.tgz" - integrity sha512-q+MB8nYR1KDLrgr4G5yemftpMC7/QLqVndBmEEdqzmNj5dcFOO4Oo8qlwZE3ULT3+Zim1F8Kq4cBnikNhlCMlg== - -type-fest@^0.7.1: - version "0.7.1" - resolved "https://registry.npmjs.org/type-fest/-/type-fest-0.7.1.tgz" - integrity sha512-Ne2YiiGN8bmrmJJEuTWTLJR32nh/JdL1+PSicowtNb0WFpn59GK8/lfD61bVtzguz7b3PBt74nxpv/Pw5po5Rg== - -type-fest@^0.8.1: - version "0.8.1" - resolved "https://registry.npmjs.org/type-fest/-/type-fest-0.8.1.tgz" - integrity sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA== - -unbox-primitive@^1.0.1: - version "1.0.1" - resolved "https://registry.npmjs.org/unbox-primitive/-/unbox-primitive-1.0.1.tgz" - integrity sha512-tZU/3NqK3dA5gpE1KtyiJUrEB0lxnGkMFHptJ7q6ewdZ8s12QrODwNbhIJStmJkd1QDXa1NRA8aF2A1zk/Ypyw== - dependencies: - function-bind "^1.1.1" - has-bigints "^1.0.1" - has-symbols "^1.0.2" - which-boxed-primitive "^1.0.2" - -union-value@^1.0.0: - version "1.0.1" - resolved "https://registry.npmjs.org/union-value/-/union-value-1.0.1.tgz" - integrity sha512-tJfXmxMeWYnczCVs7XAEvIV7ieppALdyepWMkHkwciRpZraG/xwT+s2JN8+pr1+8jCRf80FFzvr+MpQeeoF4Xg== - dependencies: - arr-union "^3.1.0" - get-value "^2.0.6" - is-extendable "^0.1.1" - set-value "^2.0.1" - -universalify@^0.1.0: - version "0.1.2" - resolved "https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz" - integrity sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg== - -universalify@^2.0.0: - version "2.0.0" - resolved "https://registry.npmjs.org/universalify/-/universalify-2.0.0.tgz" - integrity sha512-hAZsKq7Yy11Zu1DE0OzWjw7nnLZmJZYTDZZyEFHZdUhV8FkH5MCfoU1XMaxXovpyW5nq5scPqq0ZDP9Zyl04oQ== - -unpipe@1.0.0: - version "1.0.0" - resolved "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz" - integrity sha1-sr9O6FFKrmFltIF4KdIbLvSZBOw= - -unset-value@^1.0.0: - version "1.0.0" - resolved "https://registry.npmjs.org/unset-value/-/unset-value-1.0.0.tgz" - integrity sha1-g3aHP30jNRef+x5vw6jtDfyKtVk= - dependencies: - has-value "^0.3.1" - isobject "^3.0.0" - -urix@^0.1.0: - version "0.1.0" - resolved "https://registry.npmjs.org/urix/-/urix-0.1.0.tgz" - integrity sha1-2pN/emLiH+wf0Y1Js1wpNQZ6bHI= - -use@^3.1.0: - version "3.1.1" - resolved "https://registry.npmjs.org/use/-/use-3.1.1.tgz" - integrity sha512-cwESVXlO3url9YWlFW/TA9cshCEhtu7IKJ/p5soJ/gGpj7vbvFrAY/eIioQ6Dw23KjZhYgiIo8HOs1nQ2vr/oQ== - -util-deprecate@^1.0.1, util-deprecate@~1.0.1: - version "1.0.2" - resolved "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz" - integrity sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8= - -util.promisify@^1.0.1: - version "1.1.1" - resolved "https://registry.npmjs.org/util.promisify/-/util.promisify-1.1.1.tgz" - integrity sha512-/s3UsZUrIfa6xDhr7zZhnE9SLQ5RIXyYfiVnMMyMDzOc8WhWN4Nbh36H842OyurKbCDAesZOJaVyvmSl6fhGQw== - dependencies: - call-bind "^1.0.0" - define-properties "^1.1.3" - for-each "^0.3.3" - has-symbols "^1.0.1" - object.getownpropertydescriptors "^2.1.1" - -uuid@^3.3.2: - version "3.4.0" - resolved "https://registry.npmjs.org/uuid/-/uuid-3.4.0.tgz" - integrity sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A== - -validate-npm-package-license@^3.0.1: - version "3.0.4" - resolved "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz" - integrity sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew== - dependencies: - spdx-correct "^3.0.0" - spdx-expression-parse "^3.0.0" - -webidl-conversions@^3.0.0: - version "3.0.1" - resolved "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz" - integrity sha1-JFNCdeKnvGvnvIZhHMFq4KVlSHE= - -whatwg-url@^5.0.0: - version "5.0.0" - resolved "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz" - integrity sha1-lmRU6HZUYuN2RNNib2dCzotwll0= - dependencies: - tr46 "~0.0.3" - webidl-conversions "^3.0.0" - -which-boxed-primitive@^1.0.2: - version "1.0.2" - resolved "https://registry.npmjs.org/which-boxed-primitive/-/which-boxed-primitive-1.0.2.tgz" - integrity sha512-bwZdv0AKLpplFY2KZRX6TvyuN7ojjr7lwkg6ml0roIy9YeuSr7JS372qlNW18UQYzgYK9ziGcerWqZOmEn9VNg== - dependencies: - is-bigint "^1.0.1" - is-boolean-object "^1.1.0" - is-number-object "^1.0.4" - is-string "^1.0.5" - is-symbol "^1.0.3" - -which-module@^2.0.0: - version "2.0.0" - resolved "https://registry.npmjs.org/which-module/-/which-module-2.0.0.tgz" - integrity sha1-2e8H3Od7mQK4o6j6SzHD4/fm6Ho= - -which-pm-runs@^1.0.0: - version "1.0.0" - resolved "https://registry.npmjs.org/which-pm-runs/-/which-pm-runs-1.0.0.tgz" - integrity sha1-Zws6+8VS4LVd9rd4DKdGFfI60cs= - -which@1.3.1, which@^1.2.9: - version "1.3.1" - resolved "https://registry.npmjs.org/which/-/which-1.3.1.tgz" - integrity sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ== - dependencies: - isexe "^2.0.0" - -which@^2.0.1: - version "2.0.2" - resolved "https://registry.npmjs.org/which/-/which-2.0.2.tgz" - integrity sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA== - dependencies: - isexe "^2.0.0" - -wide-align@1.1.3: - version "1.1.3" - resolved "https://registry.npmjs.org/wide-align/-/wide-align-1.1.3.tgz" - integrity sha512-QGkOQc8XL6Bt5PwnsExKBPuMKBxnGxWWW3fU55Xt4feHozMUhdUMaBCk290qpm/wG5u/RSKzwdAC4i51YigihA== - dependencies: - string-width "^1.0.2 || 2" - -wrap-ansi@^2.0.0: - version "2.1.0" - resolved "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-2.1.0.tgz" - integrity sha1-2Pw9KE3QV5T+hJc8rs3Rz4JP3YU= - dependencies: - string-width "^1.0.1" - strip-ansi "^3.0.1" - -wrap-ansi@^5.1.0: - version "5.1.0" - resolved "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-5.1.0.tgz" - integrity sha512-QC1/iN/2/RPVJ5jYK8BGttj5z83LmSKmvbvrXPNCLZSEb32KKVDJDl/MOt2N01qU2H/FkzEa9PKto1BqDjtd7Q== - dependencies: - ansi-styles "^3.2.0" - string-width "^3.0.0" - strip-ansi "^5.0.0" - -wrap-ansi@^6.2.0: - version "6.2.0" - resolved "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-6.2.0.tgz" - integrity sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA== - dependencies: - ansi-styles "^4.0.0" - string-width "^4.1.0" - strip-ansi "^6.0.0" - -wrappy@1: - version "1.0.2" - resolved "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz" - integrity sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8= - -ws@^7.4.6: - version "7.5.5" - resolved "https://registry.npmjs.org/ws/-/ws-7.5.5.tgz" - integrity sha512-BAkMFcAzl8as1G/hArkxOxq3G7pjUqQ3gzYbLL0/5zNkph70e+lCoxBGnm6AW1+/aiNeV4fnKqZ8m4GZewmH2w== - -xtend@^4.0.1, xtend@^4.0.2, xtend@~4.0.0, xtend@~4.0.1: - version "4.0.2" - resolved "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz" - integrity sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ== - -y18n@^3.2.1: - version "3.2.2" - resolved "https://registry.npmjs.org/y18n/-/y18n-3.2.2.tgz" - integrity sha512-uGZHXkHnhF0XeeAPgnKfPv1bgKAYyVvmNL1xlKsPYZPaIHxGti2hHqvOCQv71XMsLxu1QjergkqogUnms5D3YQ== - -y18n@^4.0.0: - version "4.0.1" - resolved "https://registry.npmjs.org/y18n/-/y18n-4.0.1.tgz" - integrity sha512-wNcy4NvjMYL8gogWWYAO7ZFWFfHcbdbE57tZO8e4cbpj8tfUcwrwqSl3ad8HxpYWCdXcJUCeKKZS62Av1affwQ== - -yallist@^2.1.2: - version "2.1.2" - resolved "https://registry.npmjs.org/yallist/-/yallist-2.1.2.tgz" - integrity sha1-HBH5IY8HYImkfdUS+TxmmaaoHVI= - -yallist@^3.0.2: - version "3.1.1" - resolved "https://registry.npmjs.org/yallist/-/yallist-3.1.1.tgz" - integrity sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g== - -yallist@^4.0.0: - version "4.0.0" - resolved "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz" - integrity sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A== - -yaml@^1.10.0: - version "1.10.0" - resolved "https://registry.npmjs.org/yaml/-/yaml-1.10.0.tgz" - integrity sha512-yr2icI4glYaNG+KWONODapy2/jDdMSDnrONSjblABjD9B4Z5LgiircSt8m8sRZFNi08kG9Sm0uSHtEmP3zaEGg== - -yargs-parser@13.1.2, yargs-parser@^13.1.2: - version "13.1.2" - resolved "https://registry.npmjs.org/yargs-parser/-/yargs-parser-13.1.2.tgz" - integrity sha512-3lbsNRf/j+A4QuSZfDRA7HRSfWrzO0YjqTJd5kjAq37Zep1CEgaYmrH9Q3GwPiB9cHyd1Y1UwggGhJGoxipbzg== - dependencies: - camelcase "^5.0.0" - decamelize "^1.2.0" - -yargs-parser@^18.1.2: - version "18.1.3" - resolved "https://registry.npmjs.org/yargs-parser/-/yargs-parser-18.1.3.tgz" - integrity sha512-o50j0JeToy/4K6OZcaQmW6lyXXKhq7csREXcDwk2omFPJEwUNOVtJKvmDr9EI1fAJZUyZcRF7kxGBWmRXudrCQ== - dependencies: - camelcase "^5.0.0" - decamelize "^1.2.0" - -yargs-parser@^20.2.3: - version "20.2.4" - resolved "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.4.tgz" - integrity sha512-WOkpgNhPTlE73h4VFAFsOnomJVaovO8VqLDzy5saChRBFQFBoMYirowyW+Q9HB4HFF4Z7VZTiG3iSzJJA29yRA== - -yargs-parser@^8.1.0: - version "8.1.0" - resolved "https://registry.npmjs.org/yargs-parser/-/yargs-parser-8.1.0.tgz" - integrity sha512-yP+6QqN8BmrgW2ggLtTbdrOyBNSI7zBa4IykmiV5R1wl1JWNxQvWhMfMdmzIYtKU7oP3OOInY/tl2ov3BDjnJQ== - dependencies: - camelcase "^4.1.0" - -yargs-unparser@1.6.0: - version "1.6.0" - resolved "https://registry.npmjs.org/yargs-unparser/-/yargs-unparser-1.6.0.tgz" - integrity sha512-W9tKgmSn0DpSatfri0nx52Joq5hVXgeLiqR/5G0sZNDoLZFOr/xjBUDcShCOGNsBnEMNo1KAMBkTej1Hm62HTw== - dependencies: - flat "^4.1.0" - lodash "^4.17.15" - yargs "^13.3.0" - -yargs@13.3.2, yargs@^13.3.0: - version "13.3.2" - resolved "https://registry.npmjs.org/yargs/-/yargs-13.3.2.tgz" - integrity sha512-AX3Zw5iPruN5ie6xGRIDgqkT+ZhnRlZMLMHAs8tg7nRruy2Nb+i5o9bwghAogtM08q1dpr2LVoS8KSTMYpWXUw== - dependencies: - cliui "^5.0.0" - find-up "^3.0.0" - get-caller-file "^2.0.1" - require-directory "^2.1.1" - require-main-filename "^2.0.0" - set-blocking "^2.0.0" - string-width "^3.0.0" - which-module "^2.0.0" - y18n "^4.0.0" - yargs-parser "^13.1.2" - -yargs@^10.0.3: - version "10.1.2" - resolved "https://registry.npmjs.org/yargs/-/yargs-10.1.2.tgz" - integrity sha512-ivSoxqBGYOqQVruxD35+EyCFDYNEFL/Uo6FcOnz+9xZdZzK0Zzw4r4KhbrME1Oo2gOggwJod2MnsdamSG7H9ig== - dependencies: - cliui "^4.0.0" - decamelize "^1.1.1" - find-up "^2.1.0" - get-caller-file "^1.0.1" - os-locale "^2.0.0" - require-directory "^2.1.1" - require-main-filename "^1.0.1" - set-blocking "^2.0.0" - string-width "^2.0.0" - which-module "^2.0.0" - y18n "^3.2.1" - yargs-parser "^8.1.0" - -yargs@^15.1.0: - version "15.4.1" - resolved "https://registry.npmjs.org/yargs/-/yargs-15.4.1.tgz" - integrity sha512-aePbxDmcYW++PaqBsJ+HYUFwCdv4LVvdnhBy78E57PIor8/OVvhMrADFFEDh8DHDFRv/O9i3lPhsENjO7QX0+A== - dependencies: - cliui "^6.0.0" - decamelize "^1.2.0" - find-up "^4.1.0" - get-caller-file "^2.0.1" - require-directory "^2.1.1" - require-main-filename "^2.0.0" - set-blocking "^2.0.0" - string-width "^4.2.0" - which-module "^2.0.0" - y18n "^4.0.0" - yargs-parser "^18.1.2" - -yocto-queue@^0.1.0: - version "0.1.0" - resolved "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz" - integrity sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q== + "integrity" "sha512-0z3j8R7MCjy10kc/g+qg7Ln3alJTodw9aDuVWZa3uiWqfuBMKeAeP2ocWcxoyM3D73yz3Jt/Pu4qPr4wHSdB/Q==" + "resolved" "https://registry.npmjs.org/true-case-path/-/true-case-path-2.2.1.tgz" + "version" "2.2.1" + +"tslib@^1.9.3": + "integrity" "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==" + "resolved" "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz" + "version" "1.14.1" + +"tsort@0.0.1": + "integrity" "sha1-4igPXoF/i/QnVlf9D5rr1E9aJ4Y=" + "resolved" "https://registry.npmjs.org/tsort/-/tsort-0.0.1.tgz" + "version" "0.0.1" + +"tweetnacl-util@^0.15.1": + "integrity" "sha512-RKJBIj8lySrShN4w6i/BonWp2Z/uxwC3h4y7xsRrpP59ZboCd0GpEVsOnMDYLMmKBpYhb5TgHzZXy7wTfYFBRw==" + "resolved" "https://registry.npmjs.org/tweetnacl-util/-/tweetnacl-util-0.15.1.tgz" + "version" "0.15.1" + +"tweetnacl@^1.0.3": + "integrity" "sha512-6rt+RN7aOi1nGMyC4Xa5DdYiukl2UWCbcJft7YhxReBGQD7OAM8Pbxw6YMo4r2diNEA8FEmu32YOn9rhaiE5yw==" + "resolved" "https://registry.npmjs.org/tweetnacl/-/tweetnacl-1.0.3.tgz" + "version" "1.0.3" + +"type-fest@^0.18.0": + "integrity" "sha512-OIAYXk8+ISY+qTOwkHtKqzAuxchoMiD9Udx+FSGQDuiRR+PJKJHc2NJAXlbhkGwTt/4/nKZxELY1w3ReWOL8mw==" + "resolved" "https://registry.npmjs.org/type-fest/-/type-fest-0.18.1.tgz" + "version" "0.18.1" + +"type-fest@^0.21.3": + "integrity" "sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w==" + "resolved" "https://registry.npmjs.org/type-fest/-/type-fest-0.21.3.tgz" + "version" "0.21.3" + +"type-fest@^0.6.0": + "integrity" "sha512-q+MB8nYR1KDLrgr4G5yemftpMC7/QLqVndBmEEdqzmNj5dcFOO4Oo8qlwZE3ULT3+Zim1F8Kq4cBnikNhlCMlg==" + "resolved" "https://registry.npmjs.org/type-fest/-/type-fest-0.6.0.tgz" + "version" "0.6.0" + +"type-fest@^0.7.1": + "integrity" "sha512-Ne2YiiGN8bmrmJJEuTWTLJR32nh/JdL1+PSicowtNb0WFpn59GK8/lfD61bVtzguz7b3PBt74nxpv/Pw5po5Rg==" + "resolved" "https://registry.npmjs.org/type-fest/-/type-fest-0.7.1.tgz" + "version" "0.7.1" + +"type-fest@^0.8.1": + "integrity" "sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA==" + "resolved" "https://registry.npmjs.org/type-fest/-/type-fest-0.8.1.tgz" + "version" "0.8.1" + +"undici@^4.14.1": + "integrity" "sha512-tkZSECUYi+/T1i4u+4+lwZmQgLXd4BLGlrc7KZPcLIW7Jpq99+Xpc30ONv7nS6F5UNOxp/HBZSSL9MafUrvJbw==" + "resolved" "https://registry.npmjs.org/undici/-/undici-4.16.0.tgz" + "version" "4.16.0" + +"union-value@^1.0.0": + "integrity" "sha512-tJfXmxMeWYnczCVs7XAEvIV7ieppALdyepWMkHkwciRpZraG/xwT+s2JN8+pr1+8jCRf80FFzvr+MpQeeoF4Xg==" + "resolved" "https://registry.npmjs.org/union-value/-/union-value-1.0.1.tgz" + "version" "1.0.1" + dependencies: + "arr-union" "^3.1.0" + "get-value" "^2.0.6" + "is-extendable" "^0.1.1" + "set-value" "^2.0.1" + +"universalify@^0.1.0": + "integrity" "sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==" + "resolved" "https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz" + "version" "0.1.2" + +"universalify@^2.0.0": + "integrity" "sha512-hAZsKq7Yy11Zu1DE0OzWjw7nnLZmJZYTDZZyEFHZdUhV8FkH5MCfoU1XMaxXovpyW5nq5scPqq0ZDP9Zyl04oQ==" + "resolved" "https://registry.npmjs.org/universalify/-/universalify-2.0.0.tgz" + "version" "2.0.0" + +"unpipe@1.0.0": + "integrity" "sha1-sr9O6FFKrmFltIF4KdIbLvSZBOw=" + "resolved" "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz" + "version" "1.0.0" + +"unset-value@^1.0.0": + "integrity" "sha1-g3aHP30jNRef+x5vw6jtDfyKtVk=" + "resolved" "https://registry.npmjs.org/unset-value/-/unset-value-1.0.0.tgz" + "version" "1.0.0" + dependencies: + "has-value" "^0.3.1" + "isobject" "^3.0.0" + +"urix@^0.1.0": + "integrity" "sha1-2pN/emLiH+wf0Y1Js1wpNQZ6bHI=" + "resolved" "https://registry.npmjs.org/urix/-/urix-0.1.0.tgz" + "version" "0.1.0" + +"use@^3.1.0": + "integrity" "sha512-cwESVXlO3url9YWlFW/TA9cshCEhtu7IKJ/p5soJ/gGpj7vbvFrAY/eIioQ6Dw23KjZhYgiIo8HOs1nQ2vr/oQ==" + "resolved" "https://registry.npmjs.org/use/-/use-3.1.1.tgz" + "version" "3.1.1" + +"util-deprecate@^1.0.1", "util-deprecate@~1.0.1": + "integrity" "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=" + "resolved" "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz" + "version" "1.0.2" + +"uuid@^8.3.2": + "integrity" "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==" + "resolved" "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz" + "version" "8.3.2" + +"validate-npm-package-license@^3.0.1": + "integrity" "sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew==" + "resolved" "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz" + "version" "3.0.4" + dependencies: + "spdx-correct" "^3.0.0" + "spdx-expression-parse" "^3.0.0" + +"which-module@^2.0.0": + "integrity" "sha1-2e8H3Od7mQK4o6j6SzHD4/fm6Ho=" + "resolved" "https://registry.npmjs.org/which-module/-/which-module-2.0.0.tgz" + "version" "2.0.0" + +"which-pm-runs@^1.0.0": + "integrity" "sha1-Zws6+8VS4LVd9rd4DKdGFfI60cs=" + "resolved" "https://registry.npmjs.org/which-pm-runs/-/which-pm-runs-1.0.0.tgz" + "version" "1.0.0" + +"which@^1.2.9": + "integrity" "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==" + "resolved" "https://registry.npmjs.org/which/-/which-1.3.1.tgz" + "version" "1.3.1" + dependencies: + "isexe" "^2.0.0" + +"which@^2.0.1", "which@2.0.2": + "integrity" "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==" + "resolved" "https://registry.npmjs.org/which/-/which-2.0.2.tgz" + "version" "2.0.2" + dependencies: + "isexe" "^2.0.0" + +"workerpool@6.2.0": + "integrity" "sha512-Rsk5qQHJ9eowMH28Jwhe8HEbmdYDX4lwoMWshiCXugjtHqMD9ZbiqSDLxcsfdqsETPzVUtX5s1Z5kStiIM6l4A==" + "resolved" "https://registry.npmjs.org/workerpool/-/workerpool-6.2.0.tgz" + "version" "6.2.0" + +"wrap-ansi@^2.0.0": + "integrity" "sha1-2Pw9KE3QV5T+hJc8rs3Rz4JP3YU=" + "resolved" "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-2.1.0.tgz" + "version" "2.1.0" + dependencies: + "string-width" "^1.0.1" + "strip-ansi" "^3.0.1" + +"wrap-ansi@^6.2.0": + "integrity" "sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA==" + "resolved" "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-6.2.0.tgz" + "version" "6.2.0" + dependencies: + "ansi-styles" "^4.0.0" + "string-width" "^4.1.0" + "strip-ansi" "^6.0.0" + +"wrap-ansi@^7.0.0": + "integrity" "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==" + "resolved" "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz" + "version" "7.0.0" + dependencies: + "ansi-styles" "^4.0.0" + "string-width" "^4.1.0" + "strip-ansi" "^6.0.0" + +"wrappy@1": + "integrity" "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=" + "resolved" "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz" + "version" "1.0.2" + +"ws@^7.4.6": + "integrity" "sha512-BAkMFcAzl8as1G/hArkxOxq3G7pjUqQ3gzYbLL0/5zNkph70e+lCoxBGnm6AW1+/aiNeV4fnKqZ8m4GZewmH2w==" + "resolved" "https://registry.npmjs.org/ws/-/ws-7.5.5.tgz" + "version" "7.5.5" + +"xtend@^4.0.1", "xtend@^4.0.2", "xtend@~4.0.0", "xtend@~4.0.1": + "integrity" "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==" + "resolved" "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz" + "version" "4.0.2" + +"y18n@^3.2.1": + "integrity" "sha512-uGZHXkHnhF0XeeAPgnKfPv1bgKAYyVvmNL1xlKsPYZPaIHxGti2hHqvOCQv71XMsLxu1QjergkqogUnms5D3YQ==" + "resolved" "https://registry.npmjs.org/y18n/-/y18n-3.2.2.tgz" + "version" "3.2.2" + +"y18n@^4.0.0": + "integrity" "sha512-wNcy4NvjMYL8gogWWYAO7ZFWFfHcbdbE57tZO8e4cbpj8tfUcwrwqSl3ad8HxpYWCdXcJUCeKKZS62Av1affwQ==" + "resolved" "https://registry.npmjs.org/y18n/-/y18n-4.0.1.tgz" + "version" "4.0.1" + +"y18n@^5.0.5": + "integrity" "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==" + "resolved" "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz" + "version" "5.0.8" + +"yallist@^2.1.2": + "integrity" "sha1-HBH5IY8HYImkfdUS+TxmmaaoHVI=" + "resolved" "https://registry.npmjs.org/yallist/-/yallist-2.1.2.tgz" + "version" "2.1.2" + +"yallist@^3.0.2": + "integrity" "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==" + "resolved" "https://registry.npmjs.org/yallist/-/yallist-3.1.1.tgz" + "version" "3.1.1" + +"yallist@^4.0.0": + "integrity" "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==" + "resolved" "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz" + "version" "4.0.0" + +"yaml@^1.10.0": + "integrity" "sha512-yr2icI4glYaNG+KWONODapy2/jDdMSDnrONSjblABjD9B4Z5LgiircSt8m8sRZFNi08kG9Sm0uSHtEmP3zaEGg==" + "resolved" "https://registry.npmjs.org/yaml/-/yaml-1.10.0.tgz" + "version" "1.10.0" + +"yargs-parser@^18.1.2": + "integrity" "sha512-o50j0JeToy/4K6OZcaQmW6lyXXKhq7csREXcDwk2omFPJEwUNOVtJKvmDr9EI1fAJZUyZcRF7kxGBWmRXudrCQ==" + "resolved" "https://registry.npmjs.org/yargs-parser/-/yargs-parser-18.1.3.tgz" + "version" "18.1.3" + dependencies: + "camelcase" "^5.0.0" + "decamelize" "^1.2.0" + +"yargs-parser@^20.2.2", "yargs-parser@20.2.4": + "integrity" "sha512-WOkpgNhPTlE73h4VFAFsOnomJVaovO8VqLDzy5saChRBFQFBoMYirowyW+Q9HB4HFF4Z7VZTiG3iSzJJA29yRA==" + "resolved" "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.4.tgz" + "version" "20.2.4" + +"yargs-parser@^20.2.3": + "integrity" "sha512-WOkpgNhPTlE73h4VFAFsOnomJVaovO8VqLDzy5saChRBFQFBoMYirowyW+Q9HB4HFF4Z7VZTiG3iSzJJA29yRA==" + "resolved" "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.4.tgz" + "version" "20.2.4" + +"yargs-parser@^8.1.0": + "integrity" "sha512-yP+6QqN8BmrgW2ggLtTbdrOyBNSI7zBa4IykmiV5R1wl1JWNxQvWhMfMdmzIYtKU7oP3OOInY/tl2ov3BDjnJQ==" + "resolved" "https://registry.npmjs.org/yargs-parser/-/yargs-parser-8.1.0.tgz" + "version" "8.1.0" + dependencies: + "camelcase" "^4.1.0" + +"yargs-unparser@2.0.0": + "integrity" "sha512-7pRTIA9Qc1caZ0bZ6RYRGbHJthJWuakf+WmHK0rVeLkNrrGhfoabBNdue6kdINI6r4if7ocq9aD/n7xwKOdzOA==" + "resolved" "https://registry.npmjs.org/yargs-unparser/-/yargs-unparser-2.0.0.tgz" + "version" "2.0.0" + dependencies: + "camelcase" "^6.0.0" + "decamelize" "^4.0.0" + "flat" "^5.0.2" + "is-plain-obj" "^2.1.0" + +"yargs@^10.0.3": + "integrity" "sha512-ivSoxqBGYOqQVruxD35+EyCFDYNEFL/Uo6FcOnz+9xZdZzK0Zzw4r4KhbrME1Oo2gOggwJod2MnsdamSG7H9ig==" + "resolved" "https://registry.npmjs.org/yargs/-/yargs-10.1.2.tgz" + "version" "10.1.2" + dependencies: + "cliui" "^4.0.0" + "decamelize" "^1.1.1" + "find-up" "^2.1.0" + "get-caller-file" "^1.0.1" + "os-locale" "^2.0.0" + "require-directory" "^2.1.1" + "require-main-filename" "^1.0.1" + "set-blocking" "^2.0.0" + "string-width" "^2.0.0" + "which-module" "^2.0.0" + "y18n" "^3.2.1" + "yargs-parser" "^8.1.0" + +"yargs@^15.1.0": + "integrity" "sha512-aePbxDmcYW++PaqBsJ+HYUFwCdv4LVvdnhBy78E57PIor8/OVvhMrADFFEDh8DHDFRv/O9i3lPhsENjO7QX0+A==" + "resolved" "https://registry.npmjs.org/yargs/-/yargs-15.4.1.tgz" + "version" "15.4.1" + dependencies: + "cliui" "^6.0.0" + "decamelize" "^1.2.0" + "find-up" "^4.1.0" + "get-caller-file" "^2.0.1" + "require-directory" "^2.1.1" + "require-main-filename" "^2.0.0" + "set-blocking" "^2.0.0" + "string-width" "^4.2.0" + "which-module" "^2.0.0" + "y18n" "^4.0.0" + "yargs-parser" "^18.1.2" + +"yargs@16.2.0": + "integrity" "sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw==" + "resolved" "https://registry.npmjs.org/yargs/-/yargs-16.2.0.tgz" + "version" "16.2.0" + dependencies: + "cliui" "^7.0.2" + "escalade" "^3.1.1" + "get-caller-file" "^2.0.5" + "require-directory" "^2.1.1" + "string-width" "^4.2.0" + "y18n" "^5.0.5" + "yargs-parser" "^20.2.2" + +"yocto-queue@^0.1.0": + "integrity" "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==" + "resolved" "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz" + "version" "0.1.0"