From 852fdb81760958d2206aaf12cc4ae1a3b09b7e72 Mon Sep 17 00:00:00 2001 From: ztcrypto Date: Fri, 1 Oct 2021 09:10:07 -0700 Subject: [PATCH 1/2] added hypervisor interactive adaptor --- .../visor/VisorInteractiveAdapter.sol | 114 +++++ contracts/interfaces/IHypervisor.sol | 26 ++ package-lock.json | 418 +----------------- 3 files changed, 141 insertions(+), 417 deletions(-) create mode 100644 contracts/interactiveAdapters/visor/VisorInteractiveAdapter.sol create mode 100644 contracts/interfaces/IHypervisor.sol diff --git a/contracts/interactiveAdapters/visor/VisorInteractiveAdapter.sol b/contracts/interactiveAdapters/visor/VisorInteractiveAdapter.sol new file mode 100644 index 00000000..41cd9d93 --- /dev/null +++ b/contracts/interactiveAdapters/visor/VisorInteractiveAdapter.sol @@ -0,0 +1,114 @@ +// Copyright (C) 2020 Zerion Inc. +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// SPDX-License-Identifier: LGPL-3.0-only + +pragma solidity 0.7.3; +pragma experimental ABIEncoderV2; + +import { ERC20 } from "../../shared/ERC20.sol"; +import { SafeERC20 } from "../../shared/SafeERC20.sol"; +import { TokenAmount } from "../../shared/Structs.sol"; +import { ERC20ProtocolAdapter } from "../../adapters/ERC20ProtocolAdapter.sol"; +import { InteractiveAdapter } from "../InteractiveAdapter.sol"; +import { IHypervisor } from "../../interfaces/IHypervisor.sol"; + +/** + * @title Interactive adapter for Hypervisor protocol (fungible lp tokens on Uniswap v3). + * @dev Implementation of InteractiveAdapter abstract contract. + * @author ztony.eth + */ +contract VisorInteractiveAdapter is InteractiveAdapter, ERC20ProtocolAdapter { + using SafeERC20 for ERC20; + + /** + * @notice Deposits tokens to the Hypervisor position (on Uniswap V3 pair). + * @param tokenAmounts Array with two element - TokenAmount struct with + * underlying tokens addresses, underlying tokens amounts to be deposited, and amount types. + * @param data ABI-encoded additional parameters: + * - pair - pair address. + * @return tokensToBeWithdrawn Array with one element - Hypervisor-token (pair) address. + * @dev Implementation of InteractiveAdapter function. + */ + function deposit(TokenAmount[] calldata tokenAmounts, bytes calldata data) + external + payable + override + returns (address[] memory tokensToBeWithdrawn) + { + require(tokenAmounts.length == 2, "HVIA: should be 2 tokenAmounts"); + + address pair = abi.decode(data, (address)); + tokensToBeWithdrawn = new address[](1); + tokensToBeWithdrawn[0] = pair; + + uint256 amount0Max = getAbsoluteAmountDeposit(tokenAmounts[0]); + uint256 amount1Max = getAbsoluteAmountDeposit(tokenAmounts[1]); + + ERC20(tokenAmounts[0].token).safeApprove(pair, amount0Max, "HVIA[1]"); + ERC20(tokenAmounts[1].token).safeApprove(pair, amount1Max, "HVIA[2]"); + + // solhint-disable-next-line no-empty-blocks + try IHypervisor(pair).deposit(amount0Max, amount1Max, address(this)) returns ( + uint256 + ) {} catch Error(string memory reason) { + revert(reason); + } catch { + revert("HVIA: deposit fail"); + } + } + + /** + * @notice Withdraws tokens from the Uniswap pool. + * @param tokenAmounts Array with one element - TokenAmount struct with + * Hypervisor token address, Hypervisor token amount to be redeemed, and amount type. + * @return tokensToBeWithdrawn Array with ONE OR TWO elements - underlying tokens (that are non-zero). + * @dev Implementation of InteractiveAdapter function. + */ + function withdraw(TokenAmount[] calldata tokenAmounts, bytes calldata) + external + payable + override + returns (address[] memory tokensToBeWithdrawn) + { + require(tokenAmounts.length == 1, "HVIA: should be 1 tokenAmount"); + + address pair = tokenAmounts[0].token; + uint256 amount = getAbsoluteAmountWithdraw(tokenAmounts[0]); + + // solhint-disable-next-line no-empty-blocks + try IHypervisor(pair).withdraw(amount, address(this), address(this)) returns ( + uint256 amount0, + uint256 amount1, + ) { + require(amount0 > 0 || amount1 > 0, "HVIA: received 0 tokens on burn"); + if (amount0 > 0 && amount1 > 0) { + tokensToBeWithdrawn = new address[](2); + tokensToBeWithdrawn[0] = IHypervisor(pair).token0(); + tokensToBeWithdrawn[1] = IHypervisor(pair).token1(); + } else if (amount1 == 0) { + tokensToBeWithdrawn = new address[](1); + tokensToBeWithdrawn[0] = IHypervisor(pair).token0(); + } else { + tokensToBeWithdrawn = new address[](1); + tokensToBeWithdrawn[0] = IHypervisor(pair).token1(); + } + } catch Error(string memory reason) { + revert(reason); + } catch { + revert("HVIA: withdraw fail"); + } + } +} diff --git a/contracts/interfaces/IHypervisor.sol b/contracts/interfaces/IHypervisor.sol new file mode 100644 index 00000000..f2ad515e --- /dev/null +++ b/contracts/interfaces/IHypervisor.sol @@ -0,0 +1,26 @@ +// SPDX-License-Identifier: GPL-3.0 +pragma solidity 0.7.3; + +interface IHypervisor { + function token0() external view returns (address); + + function token1() external view returns (address); + + function pool() external view returns (address); + + function totalSupply() external view returns (uint256); + + function balanceOf(address account) external view returns (uint256); + + function deposit( + uint256 deposit0, + uint256 deposit1, + address to + ) external returns (uint256 shares); + + function withdraw( + uint256 shares, + address to, + address from + ) external returns (uint256 amount0, uint256 amount1); +} diff --git a/package-lock.json b/package-lock.json index 5d6c6c28..b779b7b2 100644 --- a/package-lock.json +++ b/package-lock.json @@ -4396,7 +4396,6 @@ "dependencies": { "anymatch": "~3.1.1", "braces": "~3.0.2", - "fsevents": "~2.1.2", "glob-parent": "~5.1.0", "is-binary-path": "~2.1.0", "is-glob": "~4.0.1", @@ -4542,7 +4541,6 @@ "integrity": "sha512-7Qg2Jrep1S/+Q3EceiZtQcDPWxhAvBw+ERf1162v4sikJrvojMHFqXt8QIVha8UlH9rgU0BeWPytZ9/TzYqlUw==", "dev": true, "dependencies": { - "colors": "^1.1.2", "object-assign": "^4.1.0", "string-width": "^2.1.1" }, @@ -5801,8 +5799,7 @@ "esprima": "^2.7.1", "estraverse": "^1.9.1", "esutils": "^2.0.2", - "optionator": "^0.8.1", - "source-map": "~0.2.0" + "optionator": "^0.8.1" }, "bin": { "escodegen": "bin/escodegen.js", @@ -7460,8 +7457,6 @@ }, "node_modules/ganache-cli/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, "inBundle": true, "license": "MIT", @@ -7471,16 +7466,12 @@ }, "node_modules/ganache-cli/node_modules/@types/node": { "version": "14.11.2", - "resolved": "https://registry.npmjs.org/@types/node/-/node-14.11.2.tgz", - "integrity": "sha512-jiE3QIxJ8JLNcb1Ps6rDbysDhN4xa8DJJvuC9prr6w+1tIh+QAbYyNF3tyiZNLDBIuBCf4KEcV2UvQm/V60xfA==", "dev": true, "inBundle": true, "license": "MIT" }, "node_modules/ganache-cli/node_modules/@types/pbkdf2": { "version": "3.1.0", - "resolved": "https://registry.npmjs.org/@types/pbkdf2/-/pbkdf2-3.1.0.tgz", - "integrity": "sha512-Cf63Rv7jCQ0LaL8tNXmEyqTHuIJxRdlS5vMh1mj5voN4+QFhVZnlZruezqpWYDiJ8UTzhP0VmeLXCmBk66YrMQ==", "dev": true, "inBundle": true, "license": "MIT", @@ -7490,8 +7481,6 @@ }, "node_modules/ganache-cli/node_modules/@types/secp256k1": { "version": "4.0.1", - "resolved": "https://registry.npmjs.org/@types/secp256k1/-/secp256k1-4.0.1.tgz", - "integrity": "sha512-+ZjSA8ELlOp8SlKi0YLB2tz9d5iPNEmOBd+8Rz21wTMdaXQIa9b6TEnD6l5qKOCypE7FSyPyck12qZJxSDNoog==", "dev": true, "inBundle": true, "license": "MIT", @@ -7501,8 +7490,6 @@ }, "node_modules/ganache-cli/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, "inBundle": true, "license": "MIT", @@ -7512,8 +7499,6 @@ }, "node_modules/ganache-cli/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, "inBundle": true, "license": "MIT", @@ -7526,8 +7511,6 @@ }, "node_modules/ganache-cli/node_modules/base-x": { "version": "3.0.8", - "resolved": "https://registry.npmjs.org/base-x/-/base-x-3.0.8.tgz", - "integrity": "sha512-Rl/1AWP4J/zRrk54hhlxH4drNxPJXYUaKffODVI53/dAsV4t9fBxyxYKAVPU1XBHxYwOWP9h9H0hM2MVw4YfJA==", "dev": true, "inBundle": true, "license": "MIT", @@ -7537,32 +7520,24 @@ }, "node_modules/ganache-cli/node_modules/blakejs": { "version": "1.1.0", - "resolved": "https://registry.npmjs.org/blakejs/-/blakejs-1.1.0.tgz", - "integrity": "sha1-ad+S75U6qIylGjLfarHFShVfx6U=", "dev": true, "inBundle": true, "license": "CC0-1.0" }, "node_modules/ganache-cli/node_modules/bn.js": { "version": "4.11.9", - "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.11.9.tgz", - "integrity": "sha512-E6QoYqCKZfgatHTdHzs1RRKP7ip4vvm+EyRUeE2RF0NblwVvb0p6jSVeNTOFxPn26QXN2o6SMfNxKp6kU8zQaw==", "dev": true, "inBundle": true, "license": "MIT" }, "node_modules/ganache-cli/node_modules/brorand": { "version": "1.1.0", - "resolved": "https://registry.npmjs.org/brorand/-/brorand-1.1.0.tgz", - "integrity": "sha1-EsJe/kCkXjwyPrhnWgoM5XsiNx8=", "dev": true, "inBundle": true, "license": "MIT" }, "node_modules/ganache-cli/node_modules/browserify-aes": { "version": "1.2.0", - "resolved": "https://registry.npmjs.org/browserify-aes/-/browserify-aes-1.2.0.tgz", - "integrity": "sha512-+7CHXqGuspUn/Sl5aO7Ea0xWGAtETPXNSAjHo48JfLdPWcMng33Xe4znFvQweqc/uzk5zSOI3H52CYnjCfb5hA==", "dev": true, "inBundle": true, "license": "MIT", @@ -7577,8 +7552,6 @@ }, "node_modules/ganache-cli/node_modules/bs58": { "version": "4.0.1", - "resolved": "https://registry.npmjs.org/bs58/-/bs58-4.0.1.tgz", - "integrity": "sha1-vhYedsNU9veIrkBx9j806MTwpCo=", "dev": true, "inBundle": true, "license": "MIT", @@ -7588,8 +7561,6 @@ }, "node_modules/ganache-cli/node_modules/bs58check": { "version": "2.1.2", - "resolved": "https://registry.npmjs.org/bs58check/-/bs58check-2.1.2.tgz", - "integrity": "sha512-0TS1jicxdU09dwJMNZtVAfzPi6Q6QeN0pM1Fkzrjn+XYHvzMKPU3pHVpva+769iNVSfIYWf7LJ6WR+BuuMf8cA==", "dev": true, "inBundle": true, "license": "MIT", @@ -7601,24 +7572,18 @@ }, "node_modules/ganache-cli/node_modules/buffer-from": { "version": "1.1.1", - "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.1.tgz", - "integrity": "sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A==", "dev": true, "inBundle": true, "license": "MIT" }, "node_modules/ganache-cli/node_modules/buffer-xor": { "version": "1.0.3", - "resolved": "https://registry.npmjs.org/buffer-xor/-/buffer-xor-1.0.3.tgz", - "integrity": "sha1-JuYe0UIvtw3ULm42cp7VHYVf6Nk=", "dev": true, "inBundle": true, "license": "MIT" }, "node_modules/ganache-cli/node_modules/camelcase": { "version": "5.3.1", - "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", - "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==", "dev": true, "inBundle": true, "license": "MIT", @@ -7628,8 +7593,6 @@ }, "node_modules/ganache-cli/node_modules/cipher-base": { "version": "1.0.4", - "resolved": "https://registry.npmjs.org/cipher-base/-/cipher-base-1.0.4.tgz", - "integrity": "sha512-Kkht5ye6ZGmwv40uUDZztayT2ThLQGfnj/T71N/XzeZeo3nf8foyW7zGTsPYkEya3m5f3cAypH+qe7YOrM1U2Q==", "dev": true, "inBundle": true, "license": "MIT", @@ -7640,8 +7603,6 @@ }, "node_modules/ganache-cli/node_modules/cliui": { "version": "5.0.0", - "resolved": "https://registry.npmjs.org/cliui/-/cliui-5.0.0.tgz", - "integrity": "sha512-PYeGSEmmHM6zvoef2w8TPzlrnNpXIjTipYK780YswmIP9vjxmd6Y2a3CB2Ks6/AU8NHjZugXvo8w3oWM2qnwXA==", "dev": true, "inBundle": true, "license": "ISC", @@ -7653,8 +7614,6 @@ }, "node_modules/ganache-cli/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, "inBundle": true, "license": "MIT", @@ -7664,16 +7623,12 @@ }, "node_modules/ganache-cli/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, "inBundle": true, "license": "MIT" }, "node_modules/ganache-cli/node_modules/create-hash": { "version": "1.2.0", - "resolved": "https://registry.npmjs.org/create-hash/-/create-hash-1.2.0.tgz", - "integrity": "sha512-z00bCGNHDG8mHAkP7CtT1qVu+bFQUPjYq/4Iv3C3kWjTFV10zIjfSoeqXo9Asws8gwSHDGj/hl2u4OGIjapeCg==", "dev": true, "inBundle": true, "license": "MIT", @@ -7687,8 +7642,6 @@ }, "node_modules/ganache-cli/node_modules/create-hmac": { "version": "1.1.7", - "resolved": "https://registry.npmjs.org/create-hmac/-/create-hmac-1.1.7.tgz", - "integrity": "sha512-MJG9liiZ+ogc4TzUwuvbER1JRdgvUFSB5+VR/g5h82fGaIRWMWddtKBHi7/sVhfjQZ6SehlyhvQYrcYkaUIpLg==", "dev": true, "inBundle": true, "license": "MIT", @@ -7703,8 +7656,6 @@ }, "node_modules/ganache-cli/node_modules/cross-spawn": { "version": "6.0.5", - "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-6.0.5.tgz", - "integrity": "sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ==", "dev": true, "inBundle": true, "license": "MIT", @@ -7721,8 +7672,6 @@ }, "node_modules/ganache-cli/node_modules/decamelize": { "version": "1.2.0", - "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz", - "integrity": "sha1-9lNNFRSCabIDUue+4m9QH5oZEpA=", "dev": true, "inBundle": true, "license": "MIT", @@ -7732,8 +7681,6 @@ }, "node_modules/ganache-cli/node_modules/elliptic": { "version": "6.5.3", - "resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.5.3.tgz", - "integrity": "sha512-IMqzv5wNQf+E6aHeIqATs0tOLeOTwj1QKbRcS3jBbYkl5oLAserA8yJTT7/VyHUYG91PRmPyeQDObKLPpeS4dw==", "dev": true, "inBundle": true, "license": "MIT", @@ -7749,16 +7696,12 @@ }, "node_modules/ganache-cli/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, "inBundle": true, "license": "MIT" }, "node_modules/ganache-cli/node_modules/end-of-stream": { "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==", "dev": true, "inBundle": true, "license": "MIT", @@ -7768,8 +7711,6 @@ }, "node_modules/ganache-cli/node_modules/ethereum-cryptography": { "version": "0.1.3", - "resolved": "https://registry.npmjs.org/ethereum-cryptography/-/ethereum-cryptography-0.1.3.tgz", - "integrity": "sha512-w8/4x1SGGzc+tO97TASLja6SLd3fRIK2tLVcV2Gx4IB21hE19atll5Cq9o3d0ZmAYC/8aw0ipieTSiekAea4SQ==", "dev": true, "inBundle": true, "license": "MIT", @@ -7793,8 +7734,6 @@ }, "node_modules/ganache-cli/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, "inBundle": true, "license": "MPL-2.0", @@ -7810,8 +7749,6 @@ }, "node_modules/ganache-cli/node_modules/ethjs-util": { "version": "0.1.6", - "resolved": "https://registry.npmjs.org/ethjs-util/-/ethjs-util-0.1.6.tgz", - "integrity": "sha512-CUnVOQq7gSpDHZVVrQW8ExxUETWrnrvXYvYz55wOU8Uj4VCgw56XC2B/fVqQN+f7gmrnRHSLVnFAwsCuNwji8w==", "dev": true, "inBundle": true, "license": "MIT", @@ -7826,8 +7763,6 @@ }, "node_modules/ganache-cli/node_modules/evp_bytestokey": { "version": "1.0.3", - "resolved": "https://registry.npmjs.org/evp_bytestokey/-/evp_bytestokey-1.0.3.tgz", - "integrity": "sha512-/f2Go4TognH/KvCISP7OUsHn85hT9nUkxxA9BEWxFn+Oj9o8ZNLm/40hdlgSLyuOimsrTKLUMEorQexp/aPQeA==", "dev": true, "inBundle": true, "license": "MIT", @@ -7838,8 +7773,6 @@ }, "node_modules/ganache-cli/node_modules/execa": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/execa/-/execa-1.0.0.tgz", - "integrity": "sha512-adbxcyWV46qiHyvSp50TKt05tB4tK3HcmF7/nxfAdhnox83seTDbwnaqKO4sXRy7roHAIFqJP/Rw/AuEbX61LA==", "dev": true, "inBundle": true, "license": "MIT", @@ -7858,8 +7791,6 @@ }, "node_modules/ganache-cli/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, "inBundle": true, "license": "MIT", @@ -7872,8 +7803,6 @@ }, "node_modules/ganache-cli/node_modules/get-caller-file": { "version": "2.0.5", - "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", - "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", "dev": true, "inBundle": true, "license": "ISC", @@ -7883,8 +7812,6 @@ }, "node_modules/ganache-cli/node_modules/get-stream": { "version": "4.1.0", - "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-4.1.0.tgz", - "integrity": "sha512-GMat4EJ5161kIy2HevLlr4luNjBgvmj413KaQA7jt4V8B4RDsfpHk7WQ9GVqfYyyx8OS/L66Kox+rJRNklLK7w==", "dev": true, "inBundle": true, "license": "MIT", @@ -7897,8 +7824,6 @@ }, "node_modules/ganache-cli/node_modules/hash-base": { "version": "3.1.0", - "resolved": "https://registry.npmjs.org/hash-base/-/hash-base-3.1.0.tgz", - "integrity": "sha512-1nmYp/rhMDiE7AYkDw+lLwlAzz0AntGIe51F3RfFfEqyQ3feY2eI/NcwC6umIQVOASPMsWJLJScWKSSvzL9IVA==", "dev": true, "inBundle": true, "license": "MIT", @@ -7913,8 +7838,6 @@ }, "node_modules/ganache-cli/node_modules/hash.js": { "version": "1.1.7", - "resolved": "https://registry.npmjs.org/hash.js/-/hash.js-1.1.7.tgz", - "integrity": "sha512-taOaskGt4z4SOANNseOviYDvjEJinIkRgmp7LbKP2YTTmVxWBl87s/uzK9r+44BclBSp2X7K1hqeNfz9JbBeXA==", "dev": true, "inBundle": true, "license": "MIT", @@ -7925,8 +7848,6 @@ }, "node_modules/ganache-cli/node_modules/hmac-drbg": { "version": "1.0.1", - "resolved": "https://registry.npmjs.org/hmac-drbg/-/hmac-drbg-1.0.1.tgz", - "integrity": "sha1-0nRXAQJabHdabFRXk+1QL8DGSaE=", "dev": true, "inBundle": true, "license": "MIT", @@ -7938,16 +7859,12 @@ }, "node_modules/ganache-cli/node_modules/inherits": { "version": "2.0.4", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", - "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", "dev": true, "inBundle": true, "license": "ISC" }, "node_modules/ganache-cli/node_modules/invert-kv": { "version": "2.0.0", - "resolved": "https://registry.npmjs.org/invert-kv/-/invert-kv-2.0.0.tgz", - "integrity": "sha512-wPVv/y/QQ/Uiirj/vh3oP+1Ww+AWehmi1g5fFWGPF6IpCBCDVrhgHRMvrLfdYcwDh3QJbGXDW4JAuzxElLSqKA==", "dev": true, "inBundle": true, "license": "MIT", @@ -7957,8 +7874,6 @@ }, "node_modules/ganache-cli/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, "inBundle": true, "license": "MIT", @@ -7968,8 +7883,6 @@ }, "node_modules/ganache-cli/node_modules/is-hex-prefixed": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-hex-prefixed/-/is-hex-prefixed-1.0.0.tgz", - "integrity": "sha1-fY035q135dEnFIkTxXPggtd39VQ=", "dev": true, "inBundle": true, "license": "MIT", @@ -7980,8 +7893,6 @@ }, "node_modules/ganache-cli/node_modules/is-stream": { "version": "1.1.0", - "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-1.1.0.tgz", - "integrity": "sha1-EtSj3U5o4Lec6428hBc66A2RykQ=", "dev": true, "inBundle": true, "license": "MIT", @@ -7991,16 +7902,12 @@ }, "node_modules/ganache-cli/node_modules/isexe": { "version": "2.0.0", - "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", - "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=", "dev": true, "inBundle": true, "license": "ISC" }, "node_modules/ganache-cli/node_modules/keccak": { "version": "3.0.1", - "resolved": "https://registry.npmjs.org/keccak/-/keccak-3.0.1.tgz", - "integrity": "sha512-epq90L9jlFWCW7+pQa6JOnKn2Xgl2mtI664seYR6MHskvI9agt7AnDqmAlp9TqU4/caMYbA08Hi5DMZAl5zdkA==", "dev": true, "hasInstallScript": true, "inBundle": true, @@ -8015,8 +7922,6 @@ }, "node_modules/ganache-cli/node_modules/lcid": { "version": "2.0.0", - "resolved": "https://registry.npmjs.org/lcid/-/lcid-2.0.0.tgz", - "integrity": "sha512-avPEb8P8EGnwXKClwsNUgryVjllcRqtMYa49NTsbQagYuT1DcXnl1915oxWjoyGrXR6zH/Y0Zc96xWsPcoDKeA==", "dev": true, "inBundle": true, "license": "MIT", @@ -8029,8 +7934,6 @@ }, "node_modules/ganache-cli/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==", "dev": true, "inBundle": true, "license": "MIT", @@ -8044,8 +7947,6 @@ }, "node_modules/ganache-cli/node_modules/map-age-cleaner": { "version": "0.1.3", - "resolved": "https://registry.npmjs.org/map-age-cleaner/-/map-age-cleaner-0.1.3.tgz", - "integrity": "sha512-bJzx6nMoP6PDLPBFmg7+xRKeFZvFboMrGlxmNj9ClvX53KrmvM5bXFXEWjbz4cz1AFn+jWJ9z/DJSz7hrs0w3w==", "dev": true, "inBundle": true, "license": "MIT", @@ -8058,8 +7959,6 @@ }, "node_modules/ganache-cli/node_modules/md5.js": { "version": "1.3.5", - "resolved": "https://registry.npmjs.org/md5.js/-/md5.js-1.3.5.tgz", - "integrity": "sha512-xitP+WxNPcTTOgnTJcrhM0xvdPepipPSf3I8EIpGKeFLjt3PlJLIDG3u8EX53ZIubkb+5U2+3rELYpEhHhzdkg==", "dev": true, "inBundle": true, "license": "MIT", @@ -8071,8 +7970,6 @@ }, "node_modules/ganache-cli/node_modules/mem": { "version": "4.3.0", - "resolved": "https://registry.npmjs.org/mem/-/mem-4.3.0.tgz", - "integrity": "sha512-qX2bG48pTqYRVmDB37rn/6PT7LcR8T7oAX3bf99u1Tt1nzxYfxkgqDwUwolPlXweM0XzBOBFzSx4kfp7KP1s/w==", "dev": true, "inBundle": true, "license": "MIT", @@ -8087,8 +7984,6 @@ }, "node_modules/ganache-cli/node_modules/mimic-fn": { "version": "2.1.0", - "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.1.0.tgz", - "integrity": "sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==", "dev": true, "inBundle": true, "license": "MIT", @@ -8098,40 +7993,30 @@ }, "node_modules/ganache-cli/node_modules/minimalistic-assert": { "version": "1.0.1", - "resolved": "https://registry.npmjs.org/minimalistic-assert/-/minimalistic-assert-1.0.1.tgz", - "integrity": "sha512-UtJcAD4yEaGtjPezWuO9wC4nwUnVH/8/Im3yEHQP4b67cXlD/Qr9hdITCU1xDbSEXg2XKNaP8jsReV7vQd00/A==", "dev": true, "inBundle": true, "license": "ISC" }, "node_modules/ganache-cli/node_modules/minimalistic-crypto-utils": { "version": "1.0.1", - "resolved": "https://registry.npmjs.org/minimalistic-crypto-utils/-/minimalistic-crypto-utils-1.0.1.tgz", - "integrity": "sha1-9sAMHAsIIkblxNmd+4x8CDsrWCo=", "dev": true, "inBundle": true, "license": "MIT" }, "node_modules/ganache-cli/node_modules/nice-try": { "version": "1.0.5", - "resolved": "https://registry.npmjs.org/nice-try/-/nice-try-1.0.5.tgz", - "integrity": "sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ==", "dev": true, "inBundle": true, "license": "MIT" }, "node_modules/ganache-cli/node_modules/node-addon-api": { "version": "2.0.2", - "resolved": "https://registry.npmjs.org/node-addon-api/-/node-addon-api-2.0.2.tgz", - "integrity": "sha512-Ntyt4AIXyaLIuMHF6IOoTakB3K+RWxwtsHNRxllEoA6vPwP9o4866g6YWDLUdnucilZhmkxiHwHr11gAENw+QA==", "dev": true, "inBundle": true, "license": "MIT" }, "node_modules/ganache-cli/node_modules/node-gyp-build": { "version": "4.2.3", - "resolved": "https://registry.npmjs.org/node-gyp-build/-/node-gyp-build-4.2.3.tgz", - "integrity": "sha512-MN6ZpzmfNCRM+3t57PTJHgHyw/h4OWnZ6mR8P5j/uZtqQr46RRuDE/P+g3n0YR/AiYXeWixZZzaip77gdICfRg==", "dev": true, "inBundle": true, "license": "MIT", @@ -8143,8 +8028,6 @@ }, "node_modules/ganache-cli/node_modules/npm-run-path": { "version": "2.0.2", - "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-2.0.2.tgz", - "integrity": "sha1-NakjLfo11wZ7TLLd8jV7GHFTbF8=", "dev": true, "inBundle": true, "license": "MIT", @@ -8157,8 +8040,6 @@ }, "node_modules/ganache-cli/node_modules/once": { "version": "1.4.0", - "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", - "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", "dev": true, "inBundle": true, "license": "ISC", @@ -8168,8 +8049,6 @@ }, "node_modules/ganache-cli/node_modules/os-locale": { "version": "3.1.0", - "resolved": "https://registry.npmjs.org/os-locale/-/os-locale-3.1.0.tgz", - "integrity": "sha512-Z8l3R4wYWM40/52Z+S265okfFj8Kt2cC2MKY+xNi3kFs+XGI7WXu/I309QQQYbRW4ijiZ+yxs9pqEhJh0DqW3Q==", "dev": true, "inBundle": true, "license": "MIT", @@ -8184,8 +8063,6 @@ }, "node_modules/ganache-cli/node_modules/p-defer": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/p-defer/-/p-defer-1.0.0.tgz", - "integrity": "sha1-n26xgvbJqozXQwBKfU+WsZaw+ww=", "dev": true, "inBundle": true, "license": "MIT", @@ -8195,8 +8072,6 @@ }, "node_modules/ganache-cli/node_modules/p-finally": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/p-finally/-/p-finally-1.0.0.tgz", - "integrity": "sha1-P7z7FbiZpEEjs0ttzBi3JDNqLK4=", "dev": true, "inBundle": true, "license": "MIT", @@ -8206,8 +8081,6 @@ }, "node_modules/ganache-cli/node_modules/p-is-promise": { "version": "2.1.0", - "resolved": "https://registry.npmjs.org/p-is-promise/-/p-is-promise-2.1.0.tgz", - "integrity": "sha512-Y3W0wlRPK8ZMRbNq97l4M5otioeA5lm1z7bkNkxCka8HSPjR0xRWmpCmc9utiaLP9Jb1eD8BgeIxTW4AIF45Pg==", "dev": true, "inBundle": true, "license": "MIT", @@ -8217,8 +8090,6 @@ }, "node_modules/ganache-cli/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==", "dev": true, "inBundle": true, "license": "MIT", @@ -8234,8 +8105,6 @@ }, "node_modules/ganache-cli/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==", "dev": true, "inBundle": true, "license": "MIT", @@ -8248,8 +8117,6 @@ }, "node_modules/ganache-cli/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, "inBundle": true, "license": "MIT", @@ -8259,8 +8126,6 @@ }, "node_modules/ganache-cli/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=", "dev": true, "inBundle": true, "license": "MIT", @@ -8270,8 +8135,6 @@ }, "node_modules/ganache-cli/node_modules/path-key": { "version": "2.0.1", - "resolved": "https://registry.npmjs.org/path-key/-/path-key-2.0.1.tgz", - "integrity": "sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A=", "dev": true, "inBundle": true, "license": "MIT", @@ -8281,8 +8144,6 @@ }, "node_modules/ganache-cli/node_modules/pbkdf2": { "version": "3.1.1", - "resolved": "https://registry.npmjs.org/pbkdf2/-/pbkdf2-3.1.1.tgz", - "integrity": "sha512-4Ejy1OPxi9f2tt1rRV7Go7zmfDQ+ZectEQz3VGUQhgq62HtIRPDyG/JtnwIxs6x3uNMwo2V7q1fMvKjb+Tnpqg==", "dev": true, "inBundle": true, "license": "MIT", @@ -8299,8 +8160,6 @@ }, "node_modules/ganache-cli/node_modules/pump": { "version": "3.0.0", - "resolved": "https://registry.npmjs.org/pump/-/pump-3.0.0.tgz", - "integrity": "sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww==", "dev": true, "inBundle": true, "license": "MIT", @@ -8311,8 +8170,6 @@ }, "node_modules/ganache-cli/node_modules/randombytes": { "version": "2.1.0", - "resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz", - "integrity": "sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ==", "dev": true, "inBundle": true, "license": "MIT", @@ -8322,8 +8179,6 @@ }, "node_modules/ganache-cli/node_modules/readable-stream": { "version": "3.6.0", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz", - "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==", "dev": true, "inBundle": true, "license": "MIT", @@ -8338,8 +8193,6 @@ }, "node_modules/ganache-cli/node_modules/require-directory": { "version": "2.1.1", - "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", - "integrity": "sha1-jGStX9MNqxyXbiNE/+f3kqam30I=", "dev": true, "inBundle": true, "license": "MIT", @@ -8349,16 +8202,12 @@ }, "node_modules/ganache-cli/node_modules/require-main-filename": { "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==", "dev": true, "inBundle": true, "license": "ISC" }, "node_modules/ganache-cli/node_modules/ripemd160": { "version": "2.0.2", - "resolved": "https://registry.npmjs.org/ripemd160/-/ripemd160-2.0.2.tgz", - "integrity": "sha512-ii4iagi25WusVoiC4B4lq7pbXfAp3D9v5CwfkY33vffw2+pkDjY1D8GaN7spsxvCSx8dkPqOZCEZyfxcmJG2IA==", "dev": true, "inBundle": true, "license": "MIT", @@ -8369,8 +8218,6 @@ }, "node_modules/ganache-cli/node_modules/rlp": { "version": "2.2.6", - "resolved": "https://registry.npmjs.org/rlp/-/rlp-2.2.6.tgz", - "integrity": "sha512-HAfAmL6SDYNWPUOJNrM500x4Thn4PZsEy5pijPh40U9WfNk0z15hUYzO9xVIMAdIHdFtD8CBDHd75Td1g36Mjg==", "dev": true, "inBundle": true, "license": "MPL-2.0", @@ -8383,8 +8230,6 @@ }, "node_modules/ganache-cli/node_modules/safe-buffer": { "version": "5.2.1", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", - "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", "dev": true, "funding": [ { @@ -8405,16 +8250,12 @@ }, "node_modules/ganache-cli/node_modules/scrypt-js": { "version": "3.0.1", - "resolved": "https://registry.npmjs.org/scrypt-js/-/scrypt-js-3.0.1.tgz", - "integrity": "sha512-cdwTTnqPu0Hyvf5in5asVdZocVDTNRmR7XEcJuIzMjJeSHybHl7vpB66AzwTaIg6CLSbtjcxc8fqcySfnTkccA==", "dev": true, "inBundle": true, "license": "MIT" }, "node_modules/ganache-cli/node_modules/secp256k1": { "version": "4.0.2", - "resolved": "https://registry.npmjs.org/secp256k1/-/secp256k1-4.0.2.tgz", - "integrity": "sha512-UDar4sKvWAksIlfX3xIaQReADn+WFnHvbVujpcbr+9Sf/69odMwy2MUsz5CKLQgX9nsIyrjuxL2imVyoNHa3fg==", "dev": true, "hasInstallScript": true, "inBundle": true, @@ -8430,8 +8271,6 @@ }, "node_modules/ganache-cli/node_modules/semver": { "version": "5.7.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", - "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", "dev": true, "inBundle": true, "license": "ISC", @@ -8441,24 +8280,18 @@ }, "node_modules/ganache-cli/node_modules/set-blocking": { "version": "2.0.0", - "resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz", - "integrity": "sha1-BF+XgtARrppoA93TgrJDkrPYkPc=", "dev": true, "inBundle": true, "license": "ISC" }, "node_modules/ganache-cli/node_modules/setimmediate": { "version": "1.0.5", - "resolved": "https://registry.npmjs.org/setimmediate/-/setimmediate-1.0.5.tgz", - "integrity": "sha1-KQy7Iy4waULX1+qbg3Mqt4VvgoU=", "dev": true, "inBundle": true, "license": "MIT" }, "node_modules/ganache-cli/node_modules/sha.js": { "version": "2.4.11", - "resolved": "https://registry.npmjs.org/sha.js/-/sha.js-2.4.11.tgz", - "integrity": "sha512-QMEp5B7cftE7APOjk5Y6xgrbWu+WkLVQwk8JNjZ8nKRciZaByEW6MubieAiToS7+dwvrjGhH8jRXz3MVd0AYqQ==", "dev": true, "inBundle": true, "license": "(MIT AND BSD-3-Clause)", @@ -8472,8 +8305,6 @@ }, "node_modules/ganache-cli/node_modules/shebang-command": { "version": "1.2.0", - "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-1.2.0.tgz", - "integrity": "sha1-RKrGW2lbAzmJaMOfNj/uXer98eo=", "dev": true, "inBundle": true, "license": "MIT", @@ -8486,8 +8317,6 @@ }, "node_modules/ganache-cli/node_modules/shebang-regex": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-1.0.0.tgz", - "integrity": "sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM=", "dev": true, "inBundle": true, "license": "MIT", @@ -8497,16 +8326,12 @@ }, "node_modules/ganache-cli/node_modules/signal-exit": { "version": "3.0.3", - "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.3.tgz", - "integrity": "sha512-VUJ49FC8U1OxwZLxIbTTrDvLnf/6TDgxZcK8wxR8zs13xpx7xbG60ndBlhNrFi2EMuFRoeDoJO7wthSLq42EjA==", "dev": true, "inBundle": true, "license": "ISC" }, "node_modules/ganache-cli/node_modules/source-map": { "version": "0.6.1", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", - "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", "dev": true, "inBundle": true, "license": "BSD-3-Clause", @@ -8516,8 +8341,6 @@ }, "node_modules/ganache-cli/node_modules/source-map-support": { "version": "0.5.12", - "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.12.tgz", - "integrity": "sha512-4h2Pbvyy15EE02G+JOZpUCmqWJuqrs+sEkzewTm++BPi7Hvn/HwcqLAcNxYAyI0x13CpPPn+kMjl+hplXMHITQ==", "dev": true, "inBundle": true, "license": "MIT", @@ -8528,8 +8351,6 @@ }, "node_modules/ganache-cli/node_modules/string_decoder": { "version": "1.3.0", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", - "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==", "dev": true, "inBundle": true, "license": "MIT", @@ -8539,8 +8360,6 @@ }, "node_modules/ganache-cli/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, "inBundle": true, "license": "MIT", @@ -8555,8 +8374,6 @@ }, "node_modules/ganache-cli/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, "inBundle": true, "license": "MIT", @@ -8569,8 +8386,6 @@ }, "node_modules/ganache-cli/node_modules/strip-eof": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/strip-eof/-/strip-eof-1.0.0.tgz", - "integrity": "sha1-u0P/VZim6wXYm1n80SnJgzE2Br8=", "dev": true, "inBundle": true, "license": "MIT", @@ -8580,8 +8395,6 @@ }, "node_modules/ganache-cli/node_modules/strip-hex-prefix": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/strip-hex-prefix/-/strip-hex-prefix-1.0.0.tgz", - "integrity": "sha1-DF8VX+8RUTczd96du1iNoFUA428=", "dev": true, "inBundle": true, "license": "MIT", @@ -8595,16 +8408,12 @@ }, "node_modules/ganache-cli/node_modules/util-deprecate": { "version": "1.0.2", - "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", - "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=", "dev": true, "inBundle": true, "license": "MIT" }, "node_modules/ganache-cli/node_modules/which": { "version": "1.3.1", - "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", - "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", "dev": true, "inBundle": true, "license": "ISC", @@ -8617,16 +8426,12 @@ }, "node_modules/ganache-cli/node_modules/which-module": { "version": "2.0.0", - "resolved": "https://registry.npmjs.org/which-module/-/which-module-2.0.0.tgz", - "integrity": "sha1-2e8H3Od7mQK4o6j6SzHD4/fm6Ho=", "dev": true, "inBundle": true, "license": "ISC" }, "node_modules/ganache-cli/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==", "dev": true, "inBundle": true, "license": "MIT", @@ -8641,24 +8446,18 @@ }, "node_modules/ganache-cli/node_modules/wrappy": { "version": "1.0.2", - "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", - "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", "dev": true, "inBundle": true, "license": "ISC" }, "node_modules/ganache-cli/node_modules/y18n": { "version": "4.0.0", - "resolved": "https://registry.npmjs.org/y18n/-/y18n-4.0.0.tgz", - "integrity": "sha512-r9S/ZyXu/Xu9q1tYlpsLIsa3EeLXXk0VwlxqTcFRfg9EhMW+17kbt9G0NrgCmhGb5vT2hyhJZLfDGx+7+5Uj/w==", "dev": true, "inBundle": true, "license": "ISC" }, "node_modules/ganache-cli/node_modules/yargs": { "version": "13.2.4", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-13.2.4.tgz", - "integrity": "sha512-HG/DWAJa1PAnHT9JAhNa8AbAv3FPaiLzioSjCcmuXXhP8MlpHO5vwls4g4j6n30Z74GVQj8Xa62dWVx1QCGklg==", "dev": true, "inBundle": true, "license": "MIT", @@ -8678,8 +8477,6 @@ }, "node_modules/ganache-cli/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, "inBundle": true, "license": "ISC", @@ -8943,7 +8740,6 @@ "minimist": "^1.2.5", "neo-async": "^2.6.0", "source-map": "^0.6.1", - "uglify-js": "^3.1.4", "wordwrap": "^1.0.0" }, "bin": { @@ -10157,9 +9953,6 @@ "version": "4.0.0", "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz", "integrity": "sha1-h3Gq4HmbZAdrdmQPygWPnBDjPss=", - "dependencies": { - "graceful-fs": "^4.1.6" - }, "optionalDependencies": { "graceful-fs": "^4.1.6" } @@ -10228,9 +10021,6 @@ "version": "1.3.1", "resolved": "https://registry.npmjs.org/klaw/-/klaw-1.3.1.tgz", "integrity": "sha1-QIhDO0azsbolnXh4XY6W9zugJDk=", - "dependencies": { - "graceful-fs": "^4.1.9" - }, "optionalDependencies": { "graceful-fs": "^4.1.9" } @@ -11373,7 +11163,6 @@ "dependencies": { "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", @@ -14422,9 +14211,6 @@ "version": "2.4.0", "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-2.4.0.tgz", "integrity": "sha1-NzaitCi4e72gzIO1P6PWM6NcKug=", - "dependencies": { - "graceful-fs": "^4.1.6" - }, "optionalDependencies": { "graceful-fs": "^4.1.6" } @@ -14448,7 +14234,6 @@ "ignore": "^4.0.6", "js-yaml": "^3.12.0", "lodash": "^4.17.11", - "prettier": "^1.14.3", "semver": "^6.3.0" }, "bin": { @@ -15764,7 +15549,6 @@ "dependencies": { "anymatch": "~3.1.1", "braces": "~3.0.2", - "fsevents": "~2.1.2", "glob-parent": "~5.1.0", "is-binary-path": "~2.1.0", "is-glob": "~4.0.1", @@ -23997,8 +23781,6 @@ "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==", "bundled": true, "dev": true, "requires": { @@ -24007,15 +23789,11 @@ }, "@types/node": { "version": "14.11.2", - "resolved": "https://registry.npmjs.org/@types/node/-/node-14.11.2.tgz", - "integrity": "sha512-jiE3QIxJ8JLNcb1Ps6rDbysDhN4xa8DJJvuC9prr6w+1tIh+QAbYyNF3tyiZNLDBIuBCf4KEcV2UvQm/V60xfA==", "bundled": true, "dev": true }, "@types/pbkdf2": { "version": "3.1.0", - "resolved": "https://registry.npmjs.org/@types/pbkdf2/-/pbkdf2-3.1.0.tgz", - "integrity": "sha512-Cf63Rv7jCQ0LaL8tNXmEyqTHuIJxRdlS5vMh1mj5voN4+QFhVZnlZruezqpWYDiJ8UTzhP0VmeLXCmBk66YrMQ==", "bundled": true, "dev": true, "requires": { @@ -24024,8 +23802,6 @@ }, "@types/secp256k1": { "version": "4.0.1", - "resolved": "https://registry.npmjs.org/@types/secp256k1/-/secp256k1-4.0.1.tgz", - "integrity": "sha512-+ZjSA8ELlOp8SlKi0YLB2tz9d5iPNEmOBd+8Rz21wTMdaXQIa9b6TEnD6l5qKOCypE7FSyPyck12qZJxSDNoog==", "bundled": true, "dev": true, "requires": { @@ -24034,15 +23810,11 @@ }, "ansi-regex": { "version": "4.1.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", - "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==", "bundled": true, "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==", "bundled": true, "dev": true, "requires": { @@ -24051,8 +23823,6 @@ }, "base-x": { "version": "3.0.8", - "resolved": "https://registry.npmjs.org/base-x/-/base-x-3.0.8.tgz", - "integrity": "sha512-Rl/1AWP4J/zRrk54hhlxH4drNxPJXYUaKffODVI53/dAsV4t9fBxyxYKAVPU1XBHxYwOWP9h9H0hM2MVw4YfJA==", "bundled": true, "dev": true, "requires": { @@ -24061,29 +23831,21 @@ }, "blakejs": { "version": "1.1.0", - "resolved": "https://registry.npmjs.org/blakejs/-/blakejs-1.1.0.tgz", - "integrity": "sha1-ad+S75U6qIylGjLfarHFShVfx6U=", "bundled": true, "dev": true }, "bn.js": { "version": "4.11.9", - "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.11.9.tgz", - "integrity": "sha512-E6QoYqCKZfgatHTdHzs1RRKP7ip4vvm+EyRUeE2RF0NblwVvb0p6jSVeNTOFxPn26QXN2o6SMfNxKp6kU8zQaw==", "bundled": true, "dev": true }, "brorand": { "version": "1.1.0", - "resolved": "https://registry.npmjs.org/brorand/-/brorand-1.1.0.tgz", - "integrity": "sha1-EsJe/kCkXjwyPrhnWgoM5XsiNx8=", "bundled": true, "dev": true }, "browserify-aes": { "version": "1.2.0", - "resolved": "https://registry.npmjs.org/browserify-aes/-/browserify-aes-1.2.0.tgz", - "integrity": "sha512-+7CHXqGuspUn/Sl5aO7Ea0xWGAtETPXNSAjHo48JfLdPWcMng33Xe4znFvQweqc/uzk5zSOI3H52CYnjCfb5hA==", "bundled": true, "dev": true, "requires": { @@ -24097,8 +23859,6 @@ }, "bs58": { "version": "4.0.1", - "resolved": "https://registry.npmjs.org/bs58/-/bs58-4.0.1.tgz", - "integrity": "sha1-vhYedsNU9veIrkBx9j806MTwpCo=", "bundled": true, "dev": true, "requires": { @@ -24107,8 +23867,6 @@ }, "bs58check": { "version": "2.1.2", - "resolved": "https://registry.npmjs.org/bs58check/-/bs58check-2.1.2.tgz", - "integrity": "sha512-0TS1jicxdU09dwJMNZtVAfzPi6Q6QeN0pM1Fkzrjn+XYHvzMKPU3pHVpva+769iNVSfIYWf7LJ6WR+BuuMf8cA==", "bundled": true, "dev": true, "requires": { @@ -24119,29 +23877,21 @@ }, "buffer-from": { "version": "1.1.1", - "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.1.tgz", - "integrity": "sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A==", "bundled": true, "dev": true }, "buffer-xor": { "version": "1.0.3", - "resolved": "https://registry.npmjs.org/buffer-xor/-/buffer-xor-1.0.3.tgz", - "integrity": "sha1-JuYe0UIvtw3ULm42cp7VHYVf6Nk=", "bundled": true, "dev": true }, "camelcase": { "version": "5.3.1", - "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", - "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==", "bundled": true, "dev": true }, "cipher-base": { "version": "1.0.4", - "resolved": "https://registry.npmjs.org/cipher-base/-/cipher-base-1.0.4.tgz", - "integrity": "sha512-Kkht5ye6ZGmwv40uUDZztayT2ThLQGfnj/T71N/XzeZeo3nf8foyW7zGTsPYkEya3m5f3cAypH+qe7YOrM1U2Q==", "bundled": true, "dev": true, "requires": { @@ -24151,8 +23901,6 @@ }, "cliui": { "version": "5.0.0", - "resolved": "https://registry.npmjs.org/cliui/-/cliui-5.0.0.tgz", - "integrity": "sha512-PYeGSEmmHM6zvoef2w8TPzlrnNpXIjTipYK780YswmIP9vjxmd6Y2a3CB2Ks6/AU8NHjZugXvo8w3oWM2qnwXA==", "bundled": true, "dev": true, "requires": { @@ -24163,8 +23911,6 @@ }, "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==", "bundled": true, "dev": true, "requires": { @@ -24173,15 +23919,11 @@ }, "color-name": { "version": "1.1.3", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", - "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", "bundled": true, "dev": true }, "create-hash": { "version": "1.2.0", - "resolved": "https://registry.npmjs.org/create-hash/-/create-hash-1.2.0.tgz", - "integrity": "sha512-z00bCGNHDG8mHAkP7CtT1qVu+bFQUPjYq/4Iv3C3kWjTFV10zIjfSoeqXo9Asws8gwSHDGj/hl2u4OGIjapeCg==", "bundled": true, "dev": true, "requires": { @@ -24194,8 +23936,6 @@ }, "create-hmac": { "version": "1.1.7", - "resolved": "https://registry.npmjs.org/create-hmac/-/create-hmac-1.1.7.tgz", - "integrity": "sha512-MJG9liiZ+ogc4TzUwuvbER1JRdgvUFSB5+VR/g5h82fGaIRWMWddtKBHi7/sVhfjQZ6SehlyhvQYrcYkaUIpLg==", "bundled": true, "dev": true, "requires": { @@ -24209,8 +23949,6 @@ }, "cross-spawn": { "version": "6.0.5", - "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-6.0.5.tgz", - "integrity": "sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ==", "bundled": true, "dev": true, "requires": { @@ -24223,15 +23961,11 @@ }, "decamelize": { "version": "1.2.0", - "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz", - "integrity": "sha1-9lNNFRSCabIDUue+4m9QH5oZEpA=", "bundled": true, "dev": true }, "elliptic": { "version": "6.5.3", - "resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.5.3.tgz", - "integrity": "sha512-IMqzv5wNQf+E6aHeIqATs0tOLeOTwj1QKbRcS3jBbYkl5oLAserA8yJTT7/VyHUYG91PRmPyeQDObKLPpeS4dw==", "bundled": true, "dev": true, "requires": { @@ -24246,15 +23980,11 @@ }, "emoji-regex": { "version": "7.0.3", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-7.0.3.tgz", - "integrity": "sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA==", "bundled": true, "dev": true }, "end-of-stream": { "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==", "bundled": true, "dev": true, "requires": { @@ -24263,8 +23993,6 @@ }, "ethereum-cryptography": { "version": "0.1.3", - "resolved": "https://registry.npmjs.org/ethereum-cryptography/-/ethereum-cryptography-0.1.3.tgz", - "integrity": "sha512-w8/4x1SGGzc+tO97TASLja6SLd3fRIK2tLVcV2Gx4IB21hE19atll5Cq9o3d0ZmAYC/8aw0ipieTSiekAea4SQ==", "bundled": true, "dev": true, "requires": { @@ -24287,8 +24015,6 @@ }, "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==", "bundled": true, "dev": true, "requires": { @@ -24303,8 +24029,6 @@ }, "ethjs-util": { "version": "0.1.6", - "resolved": "https://registry.npmjs.org/ethjs-util/-/ethjs-util-0.1.6.tgz", - "integrity": "sha512-CUnVOQq7gSpDHZVVrQW8ExxUETWrnrvXYvYz55wOU8Uj4VCgw56XC2B/fVqQN+f7gmrnRHSLVnFAwsCuNwji8w==", "bundled": true, "dev": true, "requires": { @@ -24314,8 +24038,6 @@ }, "evp_bytestokey": { "version": "1.0.3", - "resolved": "https://registry.npmjs.org/evp_bytestokey/-/evp_bytestokey-1.0.3.tgz", - "integrity": "sha512-/f2Go4TognH/KvCISP7OUsHn85hT9nUkxxA9BEWxFn+Oj9o8ZNLm/40hdlgSLyuOimsrTKLUMEorQexp/aPQeA==", "bundled": true, "dev": true, "requires": { @@ -24325,8 +24047,6 @@ }, "execa": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/execa/-/execa-1.0.0.tgz", - "integrity": "sha512-adbxcyWV46qiHyvSp50TKt05tB4tK3HcmF7/nxfAdhnox83seTDbwnaqKO4sXRy7roHAIFqJP/Rw/AuEbX61LA==", "bundled": true, "dev": true, "requires": { @@ -24341,8 +24061,6 @@ }, "find-up": { "version": "3.0.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-3.0.0.tgz", - "integrity": "sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg==", "bundled": true, "dev": true, "requires": { @@ -24351,15 +24069,11 @@ }, "get-caller-file": { "version": "2.0.5", - "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", - "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", "bundled": true, "dev": true }, "get-stream": { "version": "4.1.0", - "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-4.1.0.tgz", - "integrity": "sha512-GMat4EJ5161kIy2HevLlr4luNjBgvmj413KaQA7jt4V8B4RDsfpHk7WQ9GVqfYyyx8OS/L66Kox+rJRNklLK7w==", "bundled": true, "dev": true, "requires": { @@ -24368,8 +24082,6 @@ }, "hash-base": { "version": "3.1.0", - "resolved": "https://registry.npmjs.org/hash-base/-/hash-base-3.1.0.tgz", - "integrity": "sha512-1nmYp/rhMDiE7AYkDw+lLwlAzz0AntGIe51F3RfFfEqyQ3feY2eI/NcwC6umIQVOASPMsWJLJScWKSSvzL9IVA==", "bundled": true, "dev": true, "requires": { @@ -24380,8 +24092,6 @@ }, "hash.js": { "version": "1.1.7", - "resolved": "https://registry.npmjs.org/hash.js/-/hash.js-1.1.7.tgz", - "integrity": "sha512-taOaskGt4z4SOANNseOviYDvjEJinIkRgmp7LbKP2YTTmVxWBl87s/uzK9r+44BclBSp2X7K1hqeNfz9JbBeXA==", "bundled": true, "dev": true, "requires": { @@ -24391,8 +24101,6 @@ }, "hmac-drbg": { "version": "1.0.1", - "resolved": "https://registry.npmjs.org/hmac-drbg/-/hmac-drbg-1.0.1.tgz", - "integrity": "sha1-0nRXAQJabHdabFRXk+1QL8DGSaE=", "bundled": true, "dev": true, "requires": { @@ -24403,50 +24111,36 @@ }, "inherits": { "version": "2.0.4", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", - "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", "bundled": true, "dev": true }, "invert-kv": { "version": "2.0.0", - "resolved": "https://registry.npmjs.org/invert-kv/-/invert-kv-2.0.0.tgz", - "integrity": "sha512-wPVv/y/QQ/Uiirj/vh3oP+1Ww+AWehmi1g5fFWGPF6IpCBCDVrhgHRMvrLfdYcwDh3QJbGXDW4JAuzxElLSqKA==", "bundled": true, "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=", "bundled": true, "dev": true }, "is-hex-prefixed": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-hex-prefixed/-/is-hex-prefixed-1.0.0.tgz", - "integrity": "sha1-fY035q135dEnFIkTxXPggtd39VQ=", "bundled": true, "dev": true }, "is-stream": { "version": "1.1.0", - "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-1.1.0.tgz", - "integrity": "sha1-EtSj3U5o4Lec6428hBc66A2RykQ=", "bundled": true, "dev": true }, "isexe": { "version": "2.0.0", - "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", - "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=", "bundled": true, "dev": true }, "keccak": { "version": "3.0.1", - "resolved": "https://registry.npmjs.org/keccak/-/keccak-3.0.1.tgz", - "integrity": "sha512-epq90L9jlFWCW7+pQa6JOnKn2Xgl2mtI664seYR6MHskvI9agt7AnDqmAlp9TqU4/caMYbA08Hi5DMZAl5zdkA==", "bundled": true, "dev": true, "requires": { @@ -24456,8 +24150,6 @@ }, "lcid": { "version": "2.0.0", - "resolved": "https://registry.npmjs.org/lcid/-/lcid-2.0.0.tgz", - "integrity": "sha512-avPEb8P8EGnwXKClwsNUgryVjllcRqtMYa49NTsbQagYuT1DcXnl1915oxWjoyGrXR6zH/Y0Zc96xWsPcoDKeA==", "bundled": true, "dev": true, "requires": { @@ -24466,8 +24158,6 @@ }, "locate-path": { "version": "3.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-3.0.0.tgz", - "integrity": "sha512-7AO748wWnIhNqAuaty2ZWHkQHRSNfPVIsPIfwEOWO22AmaoVrWavlOcMR5nzTLNYvp36X220/maaRsrec1G65A==", "bundled": true, "dev": true, "requires": { @@ -24477,8 +24167,6 @@ }, "map-age-cleaner": { "version": "0.1.3", - "resolved": "https://registry.npmjs.org/map-age-cleaner/-/map-age-cleaner-0.1.3.tgz", - "integrity": "sha512-bJzx6nMoP6PDLPBFmg7+xRKeFZvFboMrGlxmNj9ClvX53KrmvM5bXFXEWjbz4cz1AFn+jWJ9z/DJSz7hrs0w3w==", "bundled": true, "dev": true, "requires": { @@ -24487,8 +24175,6 @@ }, "md5.js": { "version": "1.3.5", - "resolved": "https://registry.npmjs.org/md5.js/-/md5.js-1.3.5.tgz", - "integrity": "sha512-xitP+WxNPcTTOgnTJcrhM0xvdPepipPSf3I8EIpGKeFLjt3PlJLIDG3u8EX53ZIubkb+5U2+3rELYpEhHhzdkg==", "bundled": true, "dev": true, "requires": { @@ -24499,8 +24185,6 @@ }, "mem": { "version": "4.3.0", - "resolved": "https://registry.npmjs.org/mem/-/mem-4.3.0.tgz", - "integrity": "sha512-qX2bG48pTqYRVmDB37rn/6PT7LcR8T7oAX3bf99u1Tt1nzxYfxkgqDwUwolPlXweM0XzBOBFzSx4kfp7KP1s/w==", "bundled": true, "dev": true, "requires": { @@ -24511,50 +24195,36 @@ }, "mimic-fn": { "version": "2.1.0", - "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.1.0.tgz", - "integrity": "sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==", "bundled": true, "dev": true }, "minimalistic-assert": { "version": "1.0.1", - "resolved": "https://registry.npmjs.org/minimalistic-assert/-/minimalistic-assert-1.0.1.tgz", - "integrity": "sha512-UtJcAD4yEaGtjPezWuO9wC4nwUnVH/8/Im3yEHQP4b67cXlD/Qr9hdITCU1xDbSEXg2XKNaP8jsReV7vQd00/A==", "bundled": true, "dev": true }, "minimalistic-crypto-utils": { "version": "1.0.1", - "resolved": "https://registry.npmjs.org/minimalistic-crypto-utils/-/minimalistic-crypto-utils-1.0.1.tgz", - "integrity": "sha1-9sAMHAsIIkblxNmd+4x8CDsrWCo=", "bundled": true, "dev": true }, "nice-try": { "version": "1.0.5", - "resolved": "https://registry.npmjs.org/nice-try/-/nice-try-1.0.5.tgz", - "integrity": "sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ==", "bundled": true, "dev": true }, "node-addon-api": { "version": "2.0.2", - "resolved": "https://registry.npmjs.org/node-addon-api/-/node-addon-api-2.0.2.tgz", - "integrity": "sha512-Ntyt4AIXyaLIuMHF6IOoTakB3K+RWxwtsHNRxllEoA6vPwP9o4866g6YWDLUdnucilZhmkxiHwHr11gAENw+QA==", "bundled": true, "dev": true }, "node-gyp-build": { "version": "4.2.3", - "resolved": "https://registry.npmjs.org/node-gyp-build/-/node-gyp-build-4.2.3.tgz", - "integrity": "sha512-MN6ZpzmfNCRM+3t57PTJHgHyw/h4OWnZ6mR8P5j/uZtqQr46RRuDE/P+g3n0YR/AiYXeWixZZzaip77gdICfRg==", "bundled": true, "dev": true }, "npm-run-path": { "version": "2.0.2", - "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-2.0.2.tgz", - "integrity": "sha1-NakjLfo11wZ7TLLd8jV7GHFTbF8=", "bundled": true, "dev": true, "requires": { @@ -24563,8 +24233,6 @@ }, "once": { "version": "1.4.0", - "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", - "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", "bundled": true, "dev": true, "requires": { @@ -24573,8 +24241,6 @@ }, "os-locale": { "version": "3.1.0", - "resolved": "https://registry.npmjs.org/os-locale/-/os-locale-3.1.0.tgz", - "integrity": "sha512-Z8l3R4wYWM40/52Z+S265okfFj8Kt2cC2MKY+xNi3kFs+XGI7WXu/I309QQQYbRW4ijiZ+yxs9pqEhJh0DqW3Q==", "bundled": true, "dev": true, "requires": { @@ -24585,29 +24251,21 @@ }, "p-defer": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/p-defer/-/p-defer-1.0.0.tgz", - "integrity": "sha1-n26xgvbJqozXQwBKfU+WsZaw+ww=", "bundled": true, "dev": true }, "p-finally": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/p-finally/-/p-finally-1.0.0.tgz", - "integrity": "sha1-P7z7FbiZpEEjs0ttzBi3JDNqLK4=", "bundled": true, "dev": true }, "p-is-promise": { "version": "2.1.0", - "resolved": "https://registry.npmjs.org/p-is-promise/-/p-is-promise-2.1.0.tgz", - "integrity": "sha512-Y3W0wlRPK8ZMRbNq97l4M5otioeA5lm1z7bkNkxCka8HSPjR0xRWmpCmc9utiaLP9Jb1eD8BgeIxTW4AIF45Pg==", "bundled": true, "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==", "bundled": true, "dev": true, "requires": { @@ -24616,8 +24274,6 @@ }, "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==", "bundled": true, "dev": true, "requires": { @@ -24626,29 +24282,21 @@ }, "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==", "bundled": true, "dev": true }, "path-exists": { "version": "3.0.0", - "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz", - "integrity": "sha1-zg6+ql94yxiSXqfYENe1mwEP1RU=", "bundled": true, "dev": true }, "path-key": { "version": "2.0.1", - "resolved": "https://registry.npmjs.org/path-key/-/path-key-2.0.1.tgz", - "integrity": "sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A=", "bundled": true, "dev": true }, "pbkdf2": { "version": "3.1.1", - "resolved": "https://registry.npmjs.org/pbkdf2/-/pbkdf2-3.1.1.tgz", - "integrity": "sha512-4Ejy1OPxi9f2tt1rRV7Go7zmfDQ+ZectEQz3VGUQhgq62HtIRPDyG/JtnwIxs6x3uNMwo2V7q1fMvKjb+Tnpqg==", "bundled": true, "dev": true, "requires": { @@ -24661,8 +24309,6 @@ }, "pump": { "version": "3.0.0", - "resolved": "https://registry.npmjs.org/pump/-/pump-3.0.0.tgz", - "integrity": "sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww==", "bundled": true, "dev": true, "requires": { @@ -24672,8 +24318,6 @@ }, "randombytes": { "version": "2.1.0", - "resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz", - "integrity": "sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ==", "bundled": true, "dev": true, "requires": { @@ -24682,8 +24326,6 @@ }, "readable-stream": { "version": "3.6.0", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz", - "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==", "bundled": true, "dev": true, "requires": { @@ -24694,22 +24336,16 @@ }, "require-directory": { "version": "2.1.1", - "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", - "integrity": "sha1-jGStX9MNqxyXbiNE/+f3kqam30I=", "bundled": true, "dev": true }, "require-main-filename": { "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==", "bundled": true, "dev": true }, "ripemd160": { "version": "2.0.2", - "resolved": "https://registry.npmjs.org/ripemd160/-/ripemd160-2.0.2.tgz", - "integrity": "sha512-ii4iagi25WusVoiC4B4lq7pbXfAp3D9v5CwfkY33vffw2+pkDjY1D8GaN7spsxvCSx8dkPqOZCEZyfxcmJG2IA==", "bundled": true, "dev": true, "requires": { @@ -24719,8 +24355,6 @@ }, "rlp": { "version": "2.2.6", - "resolved": "https://registry.npmjs.org/rlp/-/rlp-2.2.6.tgz", - "integrity": "sha512-HAfAmL6SDYNWPUOJNrM500x4Thn4PZsEy5pijPh40U9WfNk0z15hUYzO9xVIMAdIHdFtD8CBDHd75Td1g36Mjg==", "bundled": true, "dev": true, "requires": { @@ -24729,22 +24363,16 @@ }, "safe-buffer": { "version": "5.2.1", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", - "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", "bundled": true, "dev": true }, "scrypt-js": { "version": "3.0.1", - "resolved": "https://registry.npmjs.org/scrypt-js/-/scrypt-js-3.0.1.tgz", - "integrity": "sha512-cdwTTnqPu0Hyvf5in5asVdZocVDTNRmR7XEcJuIzMjJeSHybHl7vpB66AzwTaIg6CLSbtjcxc8fqcySfnTkccA==", "bundled": true, "dev": true }, "secp256k1": { "version": "4.0.2", - "resolved": "https://registry.npmjs.org/secp256k1/-/secp256k1-4.0.2.tgz", - "integrity": "sha512-UDar4sKvWAksIlfX3xIaQReADn+WFnHvbVujpcbr+9Sf/69odMwy2MUsz5CKLQgX9nsIyrjuxL2imVyoNHa3fg==", "bundled": true, "dev": true, "requires": { @@ -24755,29 +24383,21 @@ }, "semver": { "version": "5.7.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", - "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", "bundled": true, "dev": true }, "set-blocking": { "version": "2.0.0", - "resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz", - "integrity": "sha1-BF+XgtARrppoA93TgrJDkrPYkPc=", "bundled": true, "dev": true }, "setimmediate": { "version": "1.0.5", - "resolved": "https://registry.npmjs.org/setimmediate/-/setimmediate-1.0.5.tgz", - "integrity": "sha1-KQy7Iy4waULX1+qbg3Mqt4VvgoU=", "bundled": true, "dev": true }, "sha.js": { "version": "2.4.11", - "resolved": "https://registry.npmjs.org/sha.js/-/sha.js-2.4.11.tgz", - "integrity": "sha512-QMEp5B7cftE7APOjk5Y6xgrbWu+WkLVQwk8JNjZ8nKRciZaByEW6MubieAiToS7+dwvrjGhH8jRXz3MVd0AYqQ==", "bundled": true, "dev": true, "requires": { @@ -24787,8 +24407,6 @@ }, "shebang-command": { "version": "1.2.0", - "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-1.2.0.tgz", - "integrity": "sha1-RKrGW2lbAzmJaMOfNj/uXer98eo=", "bundled": true, "dev": true, "requires": { @@ -24797,29 +24415,21 @@ }, "shebang-regex": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-1.0.0.tgz", - "integrity": "sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM=", "bundled": true, "dev": true }, "signal-exit": { "version": "3.0.3", - "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.3.tgz", - "integrity": "sha512-VUJ49FC8U1OxwZLxIbTTrDvLnf/6TDgxZcK8wxR8zs13xpx7xbG60ndBlhNrFi2EMuFRoeDoJO7wthSLq42EjA==", "bundled": true, "dev": true }, "source-map": { "version": "0.6.1", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", - "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", "bundled": true, "dev": true }, "source-map-support": { "version": "0.5.12", - "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.12.tgz", - "integrity": "sha512-4h2Pbvyy15EE02G+JOZpUCmqWJuqrs+sEkzewTm++BPi7Hvn/HwcqLAcNxYAyI0x13CpPPn+kMjl+hplXMHITQ==", "bundled": true, "dev": true, "requires": { @@ -24829,8 +24439,6 @@ }, "string_decoder": { "version": "1.3.0", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", - "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==", "bundled": true, "dev": true, "requires": { @@ -24839,8 +24447,6 @@ }, "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==", "bundled": true, "dev": true, "requires": { @@ -24851,8 +24457,6 @@ }, "strip-ansi": { "version": "5.2.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", - "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", "bundled": true, "dev": true, "requires": { @@ -24861,15 +24465,11 @@ }, "strip-eof": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/strip-eof/-/strip-eof-1.0.0.tgz", - "integrity": "sha1-u0P/VZim6wXYm1n80SnJgzE2Br8=", "bundled": true, "dev": true }, "strip-hex-prefix": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/strip-hex-prefix/-/strip-hex-prefix-1.0.0.tgz", - "integrity": "sha1-DF8VX+8RUTczd96du1iNoFUA428=", "bundled": true, "dev": true, "requires": { @@ -24878,15 +24478,11 @@ }, "util-deprecate": { "version": "1.0.2", - "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", - "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=", "bundled": true, "dev": true }, "which": { "version": "1.3.1", - "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", - "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", "bundled": true, "dev": true, "requires": { @@ -24895,15 +24491,11 @@ }, "which-module": { "version": "2.0.0", - "resolved": "https://registry.npmjs.org/which-module/-/which-module-2.0.0.tgz", - "integrity": "sha1-2e8H3Od7mQK4o6j6SzHD4/fm6Ho=", "bundled": true, "dev": true }, "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==", "bundled": true, "dev": true, "requires": { @@ -24914,22 +24506,16 @@ }, "wrappy": { "version": "1.0.2", - "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", - "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", "bundled": true, "dev": true }, "y18n": { "version": "4.0.0", - "resolved": "https://registry.npmjs.org/y18n/-/y18n-4.0.0.tgz", - "integrity": "sha512-r9S/ZyXu/Xu9q1tYlpsLIsa3EeLXXk0VwlxqTcFRfg9EhMW+17kbt9G0NrgCmhGb5vT2hyhJZLfDGx+7+5Uj/w==", "bundled": true, "dev": true }, "yargs": { "version": "13.2.4", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-13.2.4.tgz", - "integrity": "sha512-HG/DWAJa1PAnHT9JAhNa8AbAv3FPaiLzioSjCcmuXXhP8MlpHO5vwls4g4j6n30Z74GVQj8Xa62dWVx1QCGklg==", "bundled": true, "dev": true, "requires": { @@ -24948,8 +24534,6 @@ }, "yargs-parser": { "version": "13.1.2", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-13.1.2.tgz", - "integrity": "sha512-3lbsNRf/j+A4QuSZfDRA7HRSfWrzO0YjqTJd5kjAq37Zep1CEgaYmrH9Q3GwPiB9cHyd1Y1UwggGhJGoxipbzg==", "bundled": true, "dev": true, "requires": { From 6f5b440891960197e02897a1f10329a789dd84e8 Mon Sep 17 00:00:00 2001 From: ztcrypto Date: Mon, 18 Oct 2021 06:57:55 -0700 Subject: [PATCH 2/2] fixed the issue and added relevant tests --- .../visor/VisorInteractiveAdapter.sol | 2 +- .../HypervisorInteractiveAdapter.js | 409 ++++++++++++++++++ 2 files changed, 410 insertions(+), 1 deletion(-) create mode 100644 test/interactiveAdapters/HypervisorInteractiveAdapter.js diff --git a/contracts/interactiveAdapters/visor/VisorInteractiveAdapter.sol b/contracts/interactiveAdapters/visor/VisorInteractiveAdapter.sol index 41cd9d93..3928c6ce 100644 --- a/contracts/interactiveAdapters/visor/VisorInteractiveAdapter.sol +++ b/contracts/interactiveAdapters/visor/VisorInteractiveAdapter.sol @@ -91,7 +91,7 @@ contract VisorInteractiveAdapter is InteractiveAdapter, ERC20ProtocolAdapter { // solhint-disable-next-line no-empty-blocks try IHypervisor(pair).withdraw(amount, address(this), address(this)) returns ( uint256 amount0, - uint256 amount1, + uint256 amount1 ) { require(amount0 > 0 || amount1 > 0, "HVIA: received 0 tokens on burn"); if (amount0 > 0 && amount1 > 0) { diff --git a/test/interactiveAdapters/HypervisorInteractiveAdapter.js b/test/interactiveAdapters/HypervisorInteractiveAdapter.js new file mode 100644 index 00000000..76e2d46f --- /dev/null +++ b/test/interactiveAdapters/HypervisorInteractiveAdapter.js @@ -0,0 +1,409 @@ +// import displayToken from '../helpers/displayToken'; +import convertToShare from '../helpers/convertToShare'; +import expectRevert from '../helpers/expectRevert'; + +const HYPERVISOR_ADAPTER = web3.eth.abi.encodeParameter( + 'bytes32', + web3.utils.toHex('HVIA'), +).slice(0, -2); +const UNISWAP_V2_ADAPTER = web3.eth.abi.encodeParameter( + 'bytes32', + web3.utils.toHex('Uniswap V2'), +).slice(0, -2); +const WETH_ADAPTER = web3.eth.abi.encodeParameter( + 'bytes32', + web3.utils.toHex('Weth'), +).slice(0, -2); +const ASSET_ADAPTER = '01'; +const EXCHANGE_ADAPTER = '03'; +const HYPERVISOR_ASSET_ADAPTER = `${HYPERVISOR_ADAPTER}${ASSET_ADAPTER}`; +const UNISWAP_V2_EXCHANGE_ADAPTER = `${UNISWAP_V2_ADAPTER}${EXCHANGE_ADAPTER}`; +const WETH_ASSET_ADAPTER = `${WETH_ADAPTER}${ASSET_ADAPTER}`; + +const ACTION_DEPOSIT = 1; +const ACTION_WITHDRAW = 2; +const AMOUNT_RELATIVE = 1; +const AMOUNT_ABSOLUTE = 2; +const EMPTY_BYTES = '0x'; + +const ZERO = '0x0000000000000000000000000000000000000000'; + +const ProtocolAdapterRegistry = artifacts.require('./ProtocolAdapterRegistry'); +const HypervisorAdapter = artifacts.require('./VisorInteractiveAdapter'); +const UniswapV2ExchangeAdapter = artifacts.require('./UniswapV2ExchangeInteractiveAdapter'); +const WethAdapter = artifacts.require('./WethInteractiveAdapter'); +const Core = artifacts.require('./Core'); +const Router = artifacts.require('./Router'); +const ERC20 = artifacts.require('./ERC20'); + +contract.only('VisorInteractiveAdapter', () => { + const usdcAddress = '0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48'; + const usdcWethAddress = '0x716bd8A7f8A44B010969A1825ae5658e7a18630D'; + const ethAddress = '0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE'; + const wethAddress = '0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2'; + + let accounts; + let core; + let router; + let protocolAdapterRegistry; + let protocolAdapterAddress; + let uniswapAdapterAddress; + let wethAdapterAddress; + let WETH; + let USDC; + let USDCWETH; + + beforeEach(async () => { + accounts = await web3.eth.getAccounts(); + await HypervisorAdapter.new({ from: accounts[0] }) + .then((result) => { + protocolAdapterAddress = result.address; + }); + await UniswapV2ExchangeAdapter.new({ from: accounts[0] }) + .then((result) => { + uniswapAdapterAddress = result.address; + }); + await WethAdapter.new({ from: accounts[0] }) + .then((result) => { + wethAdapterAddress = result.address; + }); + await ProtocolAdapterRegistry.new({ from: accounts[0] }) + .then((result) => { + protocolAdapterRegistry = result.contract; + }); + await protocolAdapterRegistry.methods.addProtocolAdapters( + [ + HYPERVISOR_ASSET_ADAPTER, + UNISWAP_V2_EXCHANGE_ADAPTER, + WETH_ASSET_ADAPTER, + ], + [ + protocolAdapterAddress, + uniswapAdapterAddress, + wethAdapterAddress, + ], + [ + [usdcWethAddress], + [], + [], + ], + ) + .send({ + from: accounts[0], + gas: '1000000', + }); + await Core.new( + protocolAdapterRegistry.options.address, + { from: accounts[0] }, + ) + .then((result) => { + core = result.contract; + }); + await Router.new( + core.options.address, + { from: accounts[0] }, + ) + .then((result) => { + router = result.contract; + }); + await ERC20.at(usdcAddress) + .then((result) => { + USDC = result.contract; + }); + await ERC20.at(wethAddress) + .then((result) => { + WETH = result.contract; + }); + await ERC20.at(usdcWethAddress) + .then((result) => { + USDCWETH = result.contract; + }); + await router.methods.execute( + // actions + [ + [ + WETH_ASSET_ADAPTER, + ACTION_DEPOSIT, + [ + [ethAddress, web3.utils.toWei('1', 'ether'), AMOUNT_ABSOLUTE], + ], + EMPTY_BYTES, + ], + ], + // inputs + [], + // fee + [0, ZERO], + // outputs + [], + ) + .send({ + from: accounts[0], + gas: 10000000, + value: web3.utils.toWei('1', 'ether'), + }); + }); + + describe('Hypervisor asset tests', () => { + it('should prepare for tests by buying usdc and weth', async () => { + await WETH.methods.approve(router.options.address, web3.utils.toWei('0.3', 'ether')) + .send({ + from: accounts[0], + gas: 1000000, + }); + await router.methods.execute( + // actions + [ + [ + UNISWAP_V2_EXCHANGE_ADAPTER, + ACTION_DEPOSIT, + [ + [wethAddress, web3.utils.toWei('0.3', 'ether'), AMOUNT_ABSOLUTE], + ], + web3.eth.abi.encodeParameter('address[]', [wethAddress, usdcAddress]), + ], + ], + // inputs + [ + [wethAddress, web3.utils.toWei('0.3', 'ether'), AMOUNT_ABSOLUTE], + ], + // fee + [0, ZERO], + // outputs + [], + ) + .send({ + gas: 10000000, + from: accounts[0], + }); + }); + + it('should not buy USDC-WETH Visor with existing USDC and WETH with wrong tokens', async () => { + let usdcAmount; + await USDC.methods['balanceOf(address)'](accounts[0]) + .call() + .then((result) => { + usdcAmount = result; + }); + await USDC.methods.approve(router.options.address, usdcAmount.toString()) + .send({ + from: accounts[0], + gas: 1000000, + }); + + let wethAmount; + await WETH.methods['balanceOf(address)'](accounts[0]) + .call() + .then((result) => { + wethAmount = result; + }); + await WETH.methods.approve(router.options.address, wethAmount.toString()) + .send({ + from: accounts[0], + gas: 1000000, + }); + + await expectRevert(router.methods.execute( + [ + [ + HYPERVISOR_ASSET_ADAPTER, + ACTION_DEPOSIT, + [ + [usdcAddress, convertToShare(1), AMOUNT_RELATIVE], + [usdcAddress, convertToShare(1), AMOUNT_RELATIVE], + ], + web3.eth.abi.encodeParameters( + ['address'], + [usdcWethAddress], + ), + ], + ], + [ + [usdcAddress, convertToShare(50), AMOUNT_ABSOLUTE], + [wethAddress, convertToShare(50), AMOUNT_ABSOLUTE], + ], + [0, ZERO], + [ + [usdcWethAddress, 0], + ], + ) + .send({ + from: accounts[0], + gas: 1000000, + })); + }); + + it('should buy USDC-WETH Visor with existing USDC and WETH', async () => { + let usdcAmount; + await USDC.methods['balanceOf(address)'](accounts[0]) + .call() + .then((result) => { + console.log(`USDC amount before is ${web3.utils.fromWei(result, 'ether')}`); + usdcAmount = result; + }); + await USDC.methods.approve(router.options.address, usdcAmount.toString()) + .send({ + from: accounts[0], + gas: 1000000, + }); + + let wethAmount; + await WETH.methods['balanceOf(address)'](accounts[0]) + .call() + .then((result) => { + console.log(`WETH amount before is ${web3.utils.fromWei(result, 'ether')}`); + wethAmount = result; + }); + await WETH.methods.approve(router.options.address, wethAmount.toString()) + .send({ + from: accounts[0], + gas: 1000000, + }); + await USDCWETH.methods['balanceOf(address)'](accounts[0]) + .call() + .then((result) => { + console.log(`USDCWETH Hypervisor amount before is ${web3.utils.fromWei(result, 'ether')}`); + }); + await router.methods.execute( + [ + [ + HYPERVISOR_ASSET_ADAPTER, + ACTION_DEPOSIT, + [ + [usdcAddress, convertToShare(1), AMOUNT_RELATIVE], + [wethAddress, convertToShare(1), AMOUNT_RELATIVE], + ], + web3.eth.abi.encodeParameters( + ['address'], + [usdcWethAddress], + ), + ], + ], + [ + [usdcAddress, convertToShare(0.5), AMOUNT_RELATIVE], + [wethAddress, convertToShare(0.5), AMOUNT_RELATIVE], + ], + [0, ZERO], + [ + [usdcWethAddress, 0], + ], + ) + .send({ + from: accounts[0], + gas: 1000000, + }) + .then((receipt) => { + console.log(`called router for ${receipt.cumulativeGasUsed} gas`); + }); + await USDC.methods['balanceOf(address)'](accounts[0]) + .call() + .then((result) => { + console.log(`USDC amount after is ${web3.utils.fromWei(result, 'ether')}`); + }); + await WETH.methods['balanceOf(address)'](accounts[0]) + .call() + .then((result) => { + console.log(`WETH amount after is ${web3.utils.fromWei(result, 'ether')}`); + }); + await USDCWETH.methods['balanceOf(address)'](accounts[0]) + .call() + .then((result) => { + console.log(`USDCWETH Hypervisor amount after is ${web3.utils.fromWei(result, 'ether')}`); + }); + await USDC.methods['balanceOf(address)'](core.options.address) + .call() + .then((result) => { + assert.equal(result, 0); + }); + await WETH.methods['balanceOf(address)'](core.options.address) + .call() + .then((result) => { + assert.equal(result, 0); + }); + await USDCWETH.methods['balanceOf(address)'](core.options.address) + .call() + .then((result) => { + assert.equal(result, 0); + }); + }); + + it('should sell 100% USDC-WETH Visor', async () => { + let usdcWethAmount; + await USDC.methods['balanceOf(address)'](accounts[0]) + .call() + .then((result) => { + console.log(` USDC amount before is ${web3.utils.fromWei(result, 'ether')}`); + }); + await WETH.methods['balanceOf(address)'](accounts[0]) + .call() + .then((result) => { + console.log(` WETH amount before is ${web3.utils.fromWei(result, 'ether')}`); + }); + await USDCWETH.methods['balanceOf(address)'](accounts[0]) + .call() + .then(async (result) => { + console.log(`USDCWETH amount before is ${web3.utils.fromWei(result, 'ether')}`); + usdcWethAmount = result; + }); + await USDCWETH.methods.approve(router.options.address, usdcWethAmount.toString()) + .send({ + from: accounts[0], + gas: 1000000, + }); + await router.methods.execute( + [ + [ + HYPERVISOR_ASSET_ADAPTER, + ACTION_WITHDRAW, + [ + [usdcWethAddress, convertToShare(1), AMOUNT_RELATIVE], + ], + web3.eth.abi.encodeParameter('address', usdcAddress), + ], + ], + [ + [usdcWethAddress, convertToShare(1), AMOUNT_RELATIVE], + ], + [0, ZERO], + [], + ) + .send({ + from: accounts[0], + gas: 1000000, + }) + .then((receipt) => { + console.log(`called router for ${receipt.cumulativeGasUsed} gas`); + }); + await USDC.methods['balanceOf(address)'](accounts[0]) + .call() + .then((result) => { + console.log(`USDC amount after is ${web3.utils.fromWei(result, 'ether')}`); + }); + await WETH.methods['balanceOf(address)'](accounts[0]) + .call() + .then((result) => { + console.log(`WETH amount after is ${web3.utils.fromWei(result, 'ether')}`); + }); + await USDCWETH.methods['balanceOf(address)'](accounts[0]) + .call() + .then((result) => { + console.log(`USDCWETHamount after is ${web3.utils.fromWei(result, 'ether')}`); + }); + await USDC.methods['balanceOf(address)'](core.options.address) + .call() + .then((result) => { + assert.equal(result, 0); + }); + await WETH.methods['balanceOf(address)'](core.options.address) + .call() + .then((result) => { + assert.equal(result, 0); + }); + await USDCWETH.methods['balanceOf(address)'](core.options.address) + .call() + .then((result) => { + assert.equal(result, 0); + }); + }); + }); +});