From d745b0cf95d818dc64a7586e7d4085156ff7fafd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9?= Date: Thu, 7 Jul 2022 08:40:16 -0400 Subject: [PATCH] Harmony Bridge (#51) * Interface for bridgeToken method * bridge token function * bridge function progress * progress on bridge function * add wallet fix * Removing optional sign * first test passing * Validations for params * deposit and approve * burn token * lint * test moved to hrc721 tests * progress with approval step * progress with approval step * approve progress * skip estimateGas * burn step not working * burn step not working * burn step not working * burn step not working * rollback deposit change * stopped usign hmy sdk to create contract objects * removed harcoded txOptions * cleaning code * adding some tests * adding some tests * refactor: remove bridge-sdk lib * enable ChainType.Ethereum * enable ChainType.Ethereum * testing * bridge refactor * bridge contracts for e2e * bridge contracts for e2e * managers * change testnet to devnet * add helpers * fix helpers * add contract name enum * fix helpers * add ethers * use tx options * contracts fixes * e2e helper fixes * refactor * progress on erc721 e2e * progress on erc721 e2e * progress on erc721 e2e * progress with lock for hrc721 * hrc20 e2e * compile contracts before run test * e2e passing for hrc20 hrc721 and gameitems * e2e 1155 first commit * e2e 1155 passing * bridge token * bridge token fixes for 1155 * cleaning code for hrc1155 * move bridge-token test to e2e * adding unit test for hrc721 * unit test for hrc721 hmyToEth not working * increasing cov - unit tests * adding some utils test * hmyToEth hrc721 unit test passing * unit test hrc20 bridge * unit test hrc1155 * more unit test hrc1155 * more unit test hrc1155 * Add BridgeHRC20Token * Fix bridgeHrc20Token * bridge token * bridge token * bridge token * bridge token * bridge token * Fix bridge * Fix bridge test * Fix build Co-authored-by: Ana Riera Co-authored-by: Fernando Sirni --- .circleci/config.yml | 3 + .env.sample | 5 +- .gitignore | 4 +- .nvmrc | 2 +- .nycrc | 4 +- .vscode/settings.json | 3 + hardhat.config.js | 16 + package-lock.json | 6505 ++++++++++++++--- package.json | 29 +- src/base-token.spec.ts | 198 - src/base-token.ts | 148 - src/bridge/bridgeHrc1155Token.ts | 157 + src/bridge/bridgeHrc20Token.ts | 141 + src/bridge/bridgeHrc721Token.ts | 137 + src/bridge/bridgeToken.ts | 78 + src/bridge/bridgedHrc1155Token/abi.ts | 809 ++ src/bridge/bridgedHrc1155Token/index.ts | 95 + src/bridge/bridgedHrc20Token/abi.ts | 468 ++ src/bridge/bridgedHrc20Token/index.ts | 53 + src/bridge/bridgedHrc721Token/abi.ts | 740 ++ src/bridge/bridgedHrc721Token/index.ts | 45 + .../HRC1155 => bridge/hrc1155}/abi.ts | 239 +- src/bridge/hrc1155EthManager/abi.ts | 414 ++ src/bridge/hrc1155EthManager/index.ts | 79 + src/bridge/hrc1155HmyManager/abi.ts | 451 ++ src/bridge/hrc1155HmyManager/index.ts | 57 + src/bridge/hrc1155TokenManager/abi.ts | 248 + src/bridge/hrc1155TokenManager/index.ts | 46 + src/bridge/hrc20/abi.ts | 448 ++ src/bridge/hrc20EthManager/abi.ts | 243 + src/bridge/hrc20EthManager/index.ts | 54 + src/bridge/hrc20HmyManager/abi.ts | 257 + src/bridge/hrc20HmyManager/index.ts | 53 + src/bridge/hrc20TokenManager/abi.ts | 248 + src/bridge/hrc20TokenManager/index.ts | 46 + src/bridge/hrc721/abi.ts | 626 ++ .../HRC721 => bridge/hrc721EthManager}/abi.ts | 275 +- src/bridge/hrc721EthManager/index.ts | 73 + src/bridge/hrc721HmyManager/abi.ts | 481 ++ src/bridge/hrc721HmyManager/index.ts | 88 + src/bridge/hrc721TokenManager/abi.ts | 248 + src/bridge/hrc721TokenManager/index.ts | 46 + src/bridge/index.ts | 14 + src/constants.ts | 103 +- src/contracts/baseContract.ts | 110 + src/contracts/baseToken.ts | 21 + src/contracts/ethBaseContract.ts | 64 + src/contracts/hrc1155.ts | 121 + src/contracts/hrc20.ts | 59 + src/{ => contracts}/hrc721.ts | 67 +- src/contracts/index.ts | 6 + src/game-item.ts | 29 - src/hrc1155.ts | 69 - src/index.ts | 10 +- src/interfaces.ts | 42 +- src/tests/{contracts => abi}/GameItems/abi.ts | 0 src/tests/{contracts => abi}/TestToken/abi.ts | 0 src/tests/base-contract.spec.ts | 128 + src/tests/base-token.spec.ts | 79 + src/tests/constants.ts | 140 +- src/tests/contracts/BlockcodersHRC1155.sol | 55 + src/tests/contracts/BlockcodersHRC20.sol | 13 + src/tests/contracts/BlockcodersHRC721.sol | 15 + src/tests/contracts/BridgedHRC1155Token.sol | 201 + src/tests/contracts/BridgedHRC20Token.sol | 17 + src/tests/contracts/BridgedHRC721Token.sol | 42 + src/tests/contracts/ERC1155.sol | 259 + src/tests/contracts/ERC1155Holder.sol | 35 + src/tests/contracts/ERC1155Metadata.sol | 108 + src/tests/contracts/ERC1155MintBurn.sol | 110 + src/tests/contracts/ERC721FullCustom.sol | 18 + src/tests/contracts/ERC721MetadataCustom.sol | 134 + src/tests/contracts/GameItems.sol | 20 + .../contracts/HRC1155/BlockcodersHRC1155.sol | 31 - src/tests/contracts/HRC1155EthManager.sol | 189 + src/tests/contracts/HRC1155HmyManager.sol | 155 + src/tests/contracts/HRC1155TokenManager.sol | 111 + src/tests/contracts/HRC20EthManager.sol | 115 + src/tests/contracts/HRC20HmyManager.sol | 152 + src/tests/contracts/HRC20TokenManager.sol | 108 + .../contracts/HRC721/BlockcodersHRC721.sol | 12 - src/tests/contracts/HRC721EthManager.sol | 161 + src/tests/contracts/HRC721HmyManager.sol | 186 + src/tests/contracts/HRC721TokenManager.sol | 110 + src/tests/contracts/IERC1155.sol | 105 + src/tests/contracts/IERC1155TokenReceiver.sol | 47 + src/tests/contracts/StringsV2.sol | 77 + src/tests/e2e/bridge-hrc1155.e2e-spec.ts | 254 + src/tests/e2e/bridge-hrc20.e2e-spec.ts | 213 + src/tests/e2e/bridge-hrc721.e2e-spec.ts | 214 + src/tests/e2e/bridge-token.e2e-spec.ts | 331 + .../e2e/game-item.e2e-spec.ts} | 81 +- src/{ => tests}/hd-key.spec.ts | 17 +- src/tests/helpers.ts | 76 + src/{ => tests}/hrc1155.spec.ts | 174 +- src/tests/hrc20.spec.ts | 203 + src/{ => tests}/hrc721.spec.ts | 240 +- src/{ => tests}/key.spec.ts | 22 +- src/{ => tests}/mnemonic-key.spec.ts | 19 +- src/{ => tests}/private-key.spec.ts | 13 +- src/{ => tests}/utils.spec.ts | 2 +- src/utils.ts | 24 + src/{ => wallets}/hd-key.ts | 6 +- src/wallets/index.ts | 4 + src/{ => wallets}/key.ts | 7 +- src/{ => wallets}/mnemonic-key.ts | 8 +- src/{ => wallets}/private-key.ts | 8 +- 107 files changed, 17923 insertions(+), 2001 deletions(-) create mode 100644 .vscode/settings.json create mode 100644 hardhat.config.js delete mode 100644 src/base-token.spec.ts delete mode 100644 src/base-token.ts create mode 100644 src/bridge/bridgeHrc1155Token.ts create mode 100644 src/bridge/bridgeHrc20Token.ts create mode 100644 src/bridge/bridgeHrc721Token.ts create mode 100644 src/bridge/bridgeToken.ts create mode 100644 src/bridge/bridgedHrc1155Token/abi.ts create mode 100644 src/bridge/bridgedHrc1155Token/index.ts create mode 100644 src/bridge/bridgedHrc20Token/abi.ts create mode 100644 src/bridge/bridgedHrc20Token/index.ts create mode 100644 src/bridge/bridgedHrc721Token/abi.ts create mode 100644 src/bridge/bridgedHrc721Token/index.ts rename src/{tests/contracts/HRC1155 => bridge/hrc1155}/abi.ts (56%) create mode 100644 src/bridge/hrc1155EthManager/abi.ts create mode 100644 src/bridge/hrc1155EthManager/index.ts create mode 100644 src/bridge/hrc1155HmyManager/abi.ts create mode 100644 src/bridge/hrc1155HmyManager/index.ts create mode 100644 src/bridge/hrc1155TokenManager/abi.ts create mode 100644 src/bridge/hrc1155TokenManager/index.ts create mode 100644 src/bridge/hrc20/abi.ts create mode 100644 src/bridge/hrc20EthManager/abi.ts create mode 100644 src/bridge/hrc20EthManager/index.ts create mode 100644 src/bridge/hrc20HmyManager/abi.ts create mode 100644 src/bridge/hrc20HmyManager/index.ts create mode 100644 src/bridge/hrc20TokenManager/abi.ts create mode 100644 src/bridge/hrc20TokenManager/index.ts create mode 100644 src/bridge/hrc721/abi.ts rename src/{tests/contracts/HRC721 => bridge/hrc721EthManager}/abi.ts (64%) create mode 100644 src/bridge/hrc721EthManager/index.ts create mode 100644 src/bridge/hrc721HmyManager/abi.ts create mode 100644 src/bridge/hrc721HmyManager/index.ts create mode 100644 src/bridge/hrc721TokenManager/abi.ts create mode 100644 src/bridge/hrc721TokenManager/index.ts create mode 100644 src/bridge/index.ts create mode 100644 src/contracts/baseContract.ts create mode 100644 src/contracts/baseToken.ts create mode 100644 src/contracts/ethBaseContract.ts create mode 100644 src/contracts/hrc1155.ts create mode 100644 src/contracts/hrc20.ts rename src/{ => contracts}/hrc721.ts (51%) create mode 100644 src/contracts/index.ts delete mode 100644 src/game-item.ts delete mode 100644 src/hrc1155.ts rename src/tests/{contracts => abi}/GameItems/abi.ts (100%) rename src/tests/{contracts => abi}/TestToken/abi.ts (100%) create mode 100644 src/tests/base-contract.spec.ts create mode 100644 src/tests/base-token.spec.ts create mode 100644 src/tests/contracts/BlockcodersHRC1155.sol create mode 100644 src/tests/contracts/BlockcodersHRC20.sol create mode 100644 src/tests/contracts/BlockcodersHRC721.sol create mode 100644 src/tests/contracts/BridgedHRC1155Token.sol create mode 100644 src/tests/contracts/BridgedHRC20Token.sol create mode 100644 src/tests/contracts/BridgedHRC721Token.sol create mode 100644 src/tests/contracts/ERC1155.sol create mode 100644 src/tests/contracts/ERC1155Holder.sol create mode 100644 src/tests/contracts/ERC1155Metadata.sol create mode 100644 src/tests/contracts/ERC1155MintBurn.sol create mode 100644 src/tests/contracts/ERC721FullCustom.sol create mode 100644 src/tests/contracts/ERC721MetadataCustom.sol create mode 100644 src/tests/contracts/GameItems.sol delete mode 100644 src/tests/contracts/HRC1155/BlockcodersHRC1155.sol create mode 100644 src/tests/contracts/HRC1155EthManager.sol create mode 100644 src/tests/contracts/HRC1155HmyManager.sol create mode 100644 src/tests/contracts/HRC1155TokenManager.sol create mode 100644 src/tests/contracts/HRC20EthManager.sol create mode 100644 src/tests/contracts/HRC20HmyManager.sol create mode 100644 src/tests/contracts/HRC20TokenManager.sol delete mode 100644 src/tests/contracts/HRC721/BlockcodersHRC721.sol create mode 100644 src/tests/contracts/HRC721EthManager.sol create mode 100644 src/tests/contracts/HRC721HmyManager.sol create mode 100644 src/tests/contracts/HRC721TokenManager.sol create mode 100644 src/tests/contracts/IERC1155.sol create mode 100644 src/tests/contracts/IERC1155TokenReceiver.sol create mode 100644 src/tests/contracts/StringsV2.sol create mode 100644 src/tests/e2e/bridge-hrc1155.e2e-spec.ts create mode 100644 src/tests/e2e/bridge-hrc20.e2e-spec.ts create mode 100644 src/tests/e2e/bridge-hrc721.e2e-spec.ts create mode 100644 src/tests/e2e/bridge-token.e2e-spec.ts rename src/{game-item.spec.ts => tests/e2e/game-item.e2e-spec.ts} (58%) rename src/{ => tests}/hd-key.spec.ts (92%) create mode 100644 src/tests/helpers.ts rename src/{ => tests}/hrc1155.spec.ts (59%) create mode 100644 src/tests/hrc20.spec.ts rename src/{ => tests}/hrc721.spec.ts (55%) rename src/{ => tests}/key.spec.ts (71%) rename src/{ => tests}/mnemonic-key.spec.ts (71%) rename src/{ => tests}/private-key.spec.ts (66%) rename src/{ => tests}/utils.spec.ts (97%) rename src/{ => wallets}/hd-key.ts (93%) create mode 100644 src/wallets/index.ts rename src/{ => wallets}/key.ts (90%) rename src/{ => wallets}/mnemonic-key.ts (66%) rename src/{ => wallets}/private-key.ts (57%) diff --git a/.circleci/config.yml b/.circleci/config.yml index 853b391..c2ae63c 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -37,6 +37,9 @@ jobs: - run: name: Run Tests command: npm run test:cov + # - run: + # name: Run E2E Tests + # command: npm run test:e2e - run: name: Run Build command: npm run build diff --git a/.env.sample b/.env.sample index a11137c..b63d872 100644 --- a/.env.sample +++ b/.env.sample @@ -1,3 +1,6 @@ +API_KEY= TEST_PK_1= TEST_PK_2= -TEST_SEED= \ No newline at end of file +MASTER_PRIVATE_KEY= +OWNER_PRIVATE_KEY= +TEST_SEED="pablo diego jose francisco de paula juan nepomuceno maria ruiz y picasso" \ No newline at end of file diff --git a/.gitignore b/.gitignore index af1499b..0abd853 100644 --- a/.gitignore +++ b/.gitignore @@ -133,4 +133,6 @@ dist # Builds lib.esm/ lib.esnext/ -lib/ \ No newline at end of file +lib/ +src/tests/artifacts/ +src/tests/cache/ \ No newline at end of file diff --git a/.nvmrc b/.nvmrc index b3dc644..112a2ea 100644 --- a/.nvmrc +++ b/.nvmrc @@ -1 +1 @@ -v16.13 \ No newline at end of file +lts/gallium \ No newline at end of file diff --git a/.nycrc b/.nycrc index 4cbf870..3bd5016 100644 --- a/.nycrc +++ b/.nycrc @@ -14,7 +14,9 @@ "**/*.test.ts", "**/*.spec.ts", "src/tests/**/*", - "src/index.ts" + "src/bridge/**/*", + "src/index.ts", + "src/contracts/ethBaseContract.ts" ], "sourceMap": true, "reporter": [ diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..8906fb7 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,3 @@ +{ + "solidity.compileUsingRemoteVersion": "v0.5.17+commit.d19bba13" +} \ No newline at end of file diff --git a/hardhat.config.js b/hardhat.config.js new file mode 100644 index 0000000..3b7b5b3 --- /dev/null +++ b/hardhat.config.js @@ -0,0 +1,16 @@ +module.exports = { + solidity: { + version: '0.5.17', + settings: { + optimizer: { + enabled: true, + runs: 200, + }, + }, + }, + paths: { + sources: './src/tests/contracts', + cache: './src/tests/cache', + artifacts: './src/tests/artifacts', + }, +} diff --git a/package-lock.json b/package-lock.json index 9defaf3..23c07b5 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,13 +9,19 @@ "version": "0.1.0-beta.3", "license": "MIT", "dependencies": { + "@ethersproject/abstract-signer": "^5.6.2", + "@ethersproject/bignumber": "^5.6.2", + "@ethersproject/contracts": "^5.6.2", + "@ethersproject/providers": "^5.6.8", + "@ethersproject/units": "^5.6.1", + "@ethersproject/wallet": "^5.6.2", "@harmony-js/contract": "^0.1.56", "@harmony-js/core": "^0.1.57", - "@harmony-js/transaction": "^0.1.56", - "@types/bip39": "^2.4.2" + "@harmony-js/transaction": "^0.1.56" }, "devDependencies": { - "@openzeppelin/contracts": "^4.5.0", + "@openzeppelin/contracts": "^2.5.1", + "@types/bip39": "^2.4.2", "@types/chai": "^4.3.0", "@types/chai-as-promised": "^7.1.5", "@types/hdkey": "^2.0.1", @@ -32,6 +38,7 @@ "eslint-config-prettier": "^8.5.0", "eslint-plugin-import": "^2.25.4", "eslint-plugin-prettier": "^4.0.0", + "hardhat": "^2.9.9", "mocha": "^9.2.2", "nyc": "^15.1.0", "pre-commit": "^1.2.2", @@ -54,58 +61,59 @@ } }, "node_modules/@ampproject/remapping": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/@ampproject/remapping/-/remapping-2.1.2.tgz", - "integrity": "sha512-hoyByceqwKirw7w3Z7gnIIZC3Wx3J484Y3L/cMpXFbr7d9ZQj2mODrirNzcJa+SM3UlpWXYvKV4RlRpFXlWgXg==", + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/@ampproject/remapping/-/remapping-2.2.0.tgz", + "integrity": "sha512-qRmjj8nj9qmLTQXXmaR1cck3UXSRMPrbsLJAasZpF+t3riI71BXed5ebIOYwQntykeZuhjsdweEc9BxH5Jc26w==", "dev": true, "dependencies": { - "@jridgewell/trace-mapping": "^0.3.0" + "@jridgewell/gen-mapping": "^0.1.0", + "@jridgewell/trace-mapping": "^0.3.9" }, "engines": { "node": ">=6.0.0" } }, "node_modules/@babel/code-frame": { - "version": "7.16.7", - "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.16.7.tgz", - "integrity": "sha512-iAXqUn8IIeBTNd72xsFlgaXHkMBMt6y4HJp1tIaK465CWLT/fG1aqB7ykr95gHHmlBdGbFeWWfyB4NJJ0nmeIg==", + "version": "7.18.6", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.18.6.tgz", + "integrity": "sha512-TDCmlK5eOvH+eH7cdAFlNXeVJqWIQ7gW9tY1GJIpUtFb6CmjVyq2VM3u71bOyR8CRihcCgMUYoDNyLXao3+70Q==", "dev": true, "dependencies": { - "@babel/highlight": "^7.16.7" + "@babel/highlight": "^7.18.6" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/compat-data": { - "version": "7.17.7", - "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.17.7.tgz", - "integrity": "sha512-p8pdE6j0a29TNGebNm7NzYZWB3xVZJBZ7XGs42uAKzQo8VQ3F0By/cQCtUEABwIqw5zo6WA4NbmxsfzADzMKnQ==", + "version": "7.18.6", + "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.18.6.tgz", + "integrity": "sha512-tzulrgDT0QD6U7BJ4TKVk2SDDg7wlP39P9yAx1RfLy7vP/7rsDRlWVfbWxElslu56+r7QOhB2NSDsabYYruoZQ==", "dev": true, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/core": { - "version": "7.17.8", - "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.17.8.tgz", - "integrity": "sha512-OdQDV/7cRBtJHLSOBqqbYNkOcydOgnX59TZx4puf41fzcVtN3e/4yqY8lMQsK+5X2lJtAdmA+6OHqsj1hBJ4IQ==", + "version": "7.18.6", + "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.18.6.tgz", + "integrity": "sha512-cQbWBpxcbbs/IUredIPkHiAGULLV8iwgNRMFzvbhEXISp4f3rUUXE5+TIw6KwUWUR3DwyI6gmBRnmAtYaWehwQ==", "dev": true, "dependencies": { "@ampproject/remapping": "^2.1.0", - "@babel/code-frame": "^7.16.7", - "@babel/generator": "^7.17.7", - "@babel/helper-compilation-targets": "^7.17.7", - "@babel/helper-module-transforms": "^7.17.7", - "@babel/helpers": "^7.17.8", - "@babel/parser": "^7.17.8", - "@babel/template": "^7.16.7", - "@babel/traverse": "^7.17.3", - "@babel/types": "^7.17.0", + "@babel/code-frame": "^7.18.6", + "@babel/generator": "^7.18.6", + "@babel/helper-compilation-targets": "^7.18.6", + "@babel/helper-module-transforms": "^7.18.6", + "@babel/helpers": "^7.18.6", + "@babel/parser": "^7.18.6", + "@babel/template": "^7.18.6", + "@babel/traverse": "^7.18.6", + "@babel/types": "^7.18.6", "convert-source-map": "^1.7.0", "debug": "^4.1.0", "gensync": "^1.0.0-beta.2", - "json5": "^2.1.2", + "json5": "^2.2.1", "semver": "^6.3.0" }, "engines": { @@ -126,28 +134,42 @@ } }, "node_modules/@babel/generator": { - "version": "7.17.7", - "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.17.7.tgz", - "integrity": "sha512-oLcVCTeIFadUoArDTwpluncplrYBmTCCZZgXCbgNGvOBBiSDDK3eWO4b/+eOTli5tKv1lg+a5/NAXg+nTcei1w==", + "version": "7.18.7", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.18.7.tgz", + "integrity": "sha512-shck+7VLlY72a2w9c3zYWuE1pwOKEiQHV7GTUbSnhyl5eu3i04t30tBY82ZRWrDfo3gkakCFtevExnxbkf2a3A==", "dev": true, "dependencies": { - "@babel/types": "^7.17.0", - "jsesc": "^2.5.1", - "source-map": "^0.5.0" + "@babel/types": "^7.18.7", + "@jridgewell/gen-mapping": "^0.3.2", + "jsesc": "^2.5.1" }, "engines": { "node": ">=6.9.0" } }, + "node_modules/@babel/generator/node_modules/@jridgewell/gen-mapping": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.2.tgz", + "integrity": "sha512-mh65xKQAzI6iBcFzwv28KVWSmCkdRBWoOh+bYQGW3+6OZvbbN3TqMGo5hqYxQniRcH9F2VZIoJCm4pa3BPDK/A==", + "dev": true, + "dependencies": { + "@jridgewell/set-array": "^1.0.1", + "@jridgewell/sourcemap-codec": "^1.4.10", + "@jridgewell/trace-mapping": "^0.3.9" + }, + "engines": { + "node": ">=6.0.0" + } + }, "node_modules/@babel/helper-compilation-targets": { - "version": "7.17.7", - "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.17.7.tgz", - "integrity": "sha512-UFzlz2jjd8kroj0hmCFV5zr+tQPi1dpC2cRsDV/3IEW8bJfCPrPpmcSN6ZS8RqIq4LXcmpipCQFPddyFA5Yc7w==", + "version": "7.18.6", + "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.18.6.tgz", + "integrity": "sha512-vFjbfhNCzqdeAtZflUFrG5YIFqGTqsctrtkZ1D/NB0mDW9TwW3GmmUepYY4G9wCET5rY5ugz4OGTcLd614IzQg==", "dev": true, "dependencies": { - "@babel/compat-data": "^7.17.7", - "@babel/helper-validator-option": "^7.16.7", - "browserslist": "^4.17.5", + "@babel/compat-data": "^7.18.6", + "@babel/helper-validator-option": "^7.18.6", + "browserslist": "^4.20.2", "semver": "^6.3.0" }, "engines": { @@ -167,149 +189,133 @@ } }, "node_modules/@babel/helper-environment-visitor": { - "version": "7.16.7", - "resolved": "https://registry.npmjs.org/@babel/helper-environment-visitor/-/helper-environment-visitor-7.16.7.tgz", - "integrity": "sha512-SLLb0AAn6PkUeAfKJCCOl9e1R53pQlGAfc4y4XuMRZfqeMYLE0dM1LMhqbGAlGQY0lfw5/ohoYWAe9V1yibRag==", + "version": "7.18.6", + "resolved": "https://registry.npmjs.org/@babel/helper-environment-visitor/-/helper-environment-visitor-7.18.6.tgz", + "integrity": "sha512-8n6gSfn2baOY+qlp+VSzsosjCVGFqWKmDF0cCWOybh52Dw3SEyoWR1KrhMJASjLwIEkkAufZ0xvr+SxLHSpy2Q==", "dev": true, - "dependencies": { - "@babel/types": "^7.16.7" - }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helper-function-name": { - "version": "7.16.7", - "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.16.7.tgz", - "integrity": "sha512-QfDfEnIUyyBSR3HtrtGECuZ6DAyCkYFp7GHl75vFtTnn6pjKeK0T1DB5lLkFvBea8MdaiUABx3osbgLyInoejA==", - "dev": true, - "dependencies": { - "@babel/helper-get-function-arity": "^7.16.7", - "@babel/template": "^7.16.7", - "@babel/types": "^7.16.7" - }, - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@babel/helper-get-function-arity": { - "version": "7.16.7", - "resolved": "https://registry.npmjs.org/@babel/helper-get-function-arity/-/helper-get-function-arity-7.16.7.tgz", - "integrity": "sha512-flc+RLSOBXzNzVhcLu6ujeHUrD6tANAOU5ojrRx/as+tbzf8+stUCj7+IfRRoAbEZqj/ahXEMsjhOhgeZsrnTw==", + "version": "7.18.6", + "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.18.6.tgz", + "integrity": "sha512-0mWMxV1aC97dhjCah5U5Ua7668r5ZmSC2DLfH2EZnf9c3/dHZKiFa5pRLMH5tjSl471tY6496ZWk/kjNONBxhw==", "dev": true, "dependencies": { - "@babel/types": "^7.16.7" + "@babel/template": "^7.18.6", + "@babel/types": "^7.18.6" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helper-hoist-variables": { - "version": "7.16.7", - "resolved": "https://registry.npmjs.org/@babel/helper-hoist-variables/-/helper-hoist-variables-7.16.7.tgz", - "integrity": "sha512-m04d/0Op34H5v7pbZw6pSKP7weA6lsMvfiIAMeIvkY/R4xQtBSMFEigu9QTZ2qB/9l22vsxtM8a+Q8CzD255fg==", + "version": "7.18.6", + "resolved": "https://registry.npmjs.org/@babel/helper-hoist-variables/-/helper-hoist-variables-7.18.6.tgz", + "integrity": "sha512-UlJQPkFqFULIcyW5sbzgbkxn2FKRgwWiRexcuaR8RNJRy8+LLveqPjwZV/bwrLZCN0eUHD/x8D0heK1ozuoo6Q==", "dev": true, "dependencies": { - "@babel/types": "^7.16.7" + "@babel/types": "^7.18.6" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helper-module-imports": { - "version": "7.16.7", - "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.16.7.tgz", - "integrity": "sha512-LVtS6TqjJHFc+nYeITRo6VLXve70xmq7wPhWTqDJusJEgGmkAACWwMiTNrvfoQo6hEhFwAIixNkvB0jPXDL8Wg==", + "version": "7.18.6", + "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.18.6.tgz", + "integrity": "sha512-0NFvs3VkuSYbFi1x2Vd6tKrywq+z/cLeYC/RJNFrIX/30Bf5aiGYbtvGXolEktzJH8o5E5KJ3tT+nkxuuZFVlA==", "dev": true, "dependencies": { - "@babel/types": "^7.16.7" + "@babel/types": "^7.18.6" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helper-module-transforms": { - "version": "7.17.7", - "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.17.7.tgz", - "integrity": "sha512-VmZD99F3gNTYB7fJRDTi+u6l/zxY0BE6OIxPSU7a50s6ZUQkHwSDmV92FfM+oCG0pZRVojGYhkR8I0OGeCVREw==", + "version": "7.18.6", + "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.18.6.tgz", + "integrity": "sha512-L//phhB4al5uucwzlimruukHB3jRd5JGClwRMD/ROrVjXfLqovYnvQrK/JK36WYyVwGGO7OD3kMyVTjx+WVPhw==", "dev": true, "dependencies": { - "@babel/helper-environment-visitor": "^7.16.7", - "@babel/helper-module-imports": "^7.16.7", - "@babel/helper-simple-access": "^7.17.7", - "@babel/helper-split-export-declaration": "^7.16.7", - "@babel/helper-validator-identifier": "^7.16.7", - "@babel/template": "^7.16.7", - "@babel/traverse": "^7.17.3", - "@babel/types": "^7.17.0" + "@babel/helper-environment-visitor": "^7.18.6", + "@babel/helper-module-imports": "^7.18.6", + "@babel/helper-simple-access": "^7.18.6", + "@babel/helper-split-export-declaration": "^7.18.6", + "@babel/helper-validator-identifier": "^7.18.6", + "@babel/template": "^7.18.6", + "@babel/traverse": "^7.18.6", + "@babel/types": "^7.18.6" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helper-simple-access": { - "version": "7.17.7", - "resolved": "https://registry.npmjs.org/@babel/helper-simple-access/-/helper-simple-access-7.17.7.tgz", - "integrity": "sha512-txyMCGroZ96i+Pxr3Je3lzEJjqwaRC9buMUgtomcrLe5Nd0+fk1h0LLA+ixUF5OW7AhHuQ7Es1WcQJZmZsz2XA==", + "version": "7.18.6", + "resolved": "https://registry.npmjs.org/@babel/helper-simple-access/-/helper-simple-access-7.18.6.tgz", + "integrity": "sha512-iNpIgTgyAvDQpDj76POqg+YEt8fPxx3yaNBg3S30dxNKm2SWfYhD0TGrK/Eu9wHpUW63VQU894TsTg+GLbUa1g==", "dev": true, "dependencies": { - "@babel/types": "^7.17.0" + "@babel/types": "^7.18.6" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helper-split-export-declaration": { - "version": "7.16.7", - "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.16.7.tgz", - "integrity": "sha512-xbWoy/PFoxSWazIToT9Sif+jJTlrMcndIsaOKvTA6u7QEo7ilkRZpjew18/W3c7nm8fXdUDXh02VXTbZ0pGDNw==", + "version": "7.18.6", + "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.18.6.tgz", + "integrity": "sha512-bde1etTx6ZyTmobl9LLMMQsaizFVZrquTEHOqKeQESMKo4PlObf+8+JA25ZsIpZhT/WEd39+vOdLXAFG/nELpA==", "dev": true, "dependencies": { - "@babel/types": "^7.16.7" + "@babel/types": "^7.18.6" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helper-validator-identifier": { - "version": "7.16.7", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.16.7.tgz", - "integrity": "sha512-hsEnFemeiW4D08A5gUAZxLBTXpZ39P+a+DGDsHw1yxqyQ/jzFEnxf5uTEGp+3bzAbNOxU1paTgYS4ECU/IgfDw==", + "version": "7.18.6", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.18.6.tgz", + "integrity": "sha512-MmetCkz9ej86nJQV+sFCxoGGrUbU3q02kgLciwkrt9QqEB7cP39oKEY0PakknEO0Gu20SskMRi+AYZ3b1TpN9g==", "dev": true, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helper-validator-option": { - "version": "7.16.7", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-option/-/helper-validator-option-7.16.7.tgz", - "integrity": "sha512-TRtenOuRUVo9oIQGPC5G9DgK4743cdxvtOw0weQNpZXaS16SCBi5MNjZF8vba3ETURjZpTbVn7Vvcf2eAwFozQ==", + "version": "7.18.6", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-option/-/helper-validator-option-7.18.6.tgz", + "integrity": "sha512-XO7gESt5ouv/LRJdrVjkShckw6STTaB7l9BrpBaAHDeF5YZT+01PCwmR0SJHnkW6i8OwW/EVWRShfi4j2x+KQw==", "dev": true, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helpers": { - "version": "7.17.8", - "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.17.8.tgz", - "integrity": "sha512-QcL86FGxpfSJwGtAvv4iG93UL6bmqBdmoVY0CMCU2g+oD2ezQse3PT5Pa+jiD6LJndBQi0EDlpzOWNlLuhz5gw==", + "version": "7.18.6", + "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.18.6.tgz", + "integrity": "sha512-vzSiiqbQOghPngUYt/zWGvK3LAsPhz55vc9XNN0xAl2gV4ieShI2OQli5duxWHD+72PZPTKAcfcZDE1Cwc5zsQ==", "dev": true, "dependencies": { - "@babel/template": "^7.16.7", - "@babel/traverse": "^7.17.3", - "@babel/types": "^7.17.0" + "@babel/template": "^7.18.6", + "@babel/traverse": "^7.18.6", + "@babel/types": "^7.18.6" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/highlight": { - "version": "7.16.10", - "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.16.10.tgz", - "integrity": "sha512-5FnTQLSLswEj6IkgVw5KusNUUFY9ZGqe/TRFnP/BKYHYgfh7tc+C7mwiy95/yNP7Dh9x580Vv8r7u7ZfTBFxdw==", + "version": "7.18.6", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.18.6.tgz", + "integrity": "sha512-u7stbOuYjaPezCuLj29hNW1v64M2Md2qupEKP1fHc7WdOA3DgLh37suiSrZYY7haUB7iBeQZ9P1uiRF359do3g==", "dev": true, "dependencies": { - "@babel/helper-validator-identifier": "^7.16.7", + "@babel/helper-validator-identifier": "^7.18.6", "chalk": "^2.0.0", "js-tokens": "^4.0.0" }, @@ -355,13 +361,13 @@ "node_modules/@babel/highlight/node_modules/color-name": { "version": "1.1.3", "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", - "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", + "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==", "dev": true }, "node_modules/@babel/highlight/node_modules/escape-string-regexp": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", - "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=", + "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", "dev": true, "engines": { "node": ">=0.8.0" @@ -370,7 +376,7 @@ "node_modules/@babel/highlight/node_modules/has-flag": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", - "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", + "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", "dev": true, "engines": { "node": ">=4" @@ -389,9 +395,9 @@ } }, "node_modules/@babel/parser": { - "version": "7.17.8", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.17.8.tgz", - "integrity": "sha512-BoHhDJrJXqcg+ZL16Xv39H9n+AqJ4pcDrQBGZN+wHxIysrLZ3/ECwCBUch/1zUNhnsXULcONU3Ei5Hmkfk6kiQ==", + "version": "7.18.6", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.18.6.tgz", + "integrity": "sha512-uQVSa9jJUe/G/304lXspfWVpKpK4euFLgGiMQFOCpM/bgcAdeoHwi/OQz23O9GK2osz26ZiXRRV9aV+Yl1O8tw==", "dev": true, "bin": { "parser": "bin/babel-parser.js" @@ -401,33 +407,33 @@ } }, "node_modules/@babel/template": { - "version": "7.16.7", - "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.16.7.tgz", - "integrity": "sha512-I8j/x8kHUrbYRTUxXrrMbfCa7jxkE7tZre39x3kjr9hvI82cK1FfqLygotcWN5kdPGWcLdWMHpSBavse5tWw3w==", + "version": "7.18.6", + "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.18.6.tgz", + "integrity": "sha512-JoDWzPe+wgBsTTgdnIma3iHNFC7YVJoPssVBDjiHfNlyt4YcunDtcDOUmfVDfCK5MfdsaIoX9PkijPhjH3nYUw==", "dev": true, "dependencies": { - "@babel/code-frame": "^7.16.7", - "@babel/parser": "^7.16.7", - "@babel/types": "^7.16.7" + "@babel/code-frame": "^7.18.6", + "@babel/parser": "^7.18.6", + "@babel/types": "^7.18.6" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/traverse": { - "version": "7.17.3", - "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.17.3.tgz", - "integrity": "sha512-5irClVky7TxRWIRtxlh2WPUUOLhcPN06AGgaQSB8AEwuyEBgJVuJ5imdHm5zxk8w0QS5T+tDfnDxAlhWjpb7cw==", - "dev": true, - "dependencies": { - "@babel/code-frame": "^7.16.7", - "@babel/generator": "^7.17.3", - "@babel/helper-environment-visitor": "^7.16.7", - "@babel/helper-function-name": "^7.16.7", - "@babel/helper-hoist-variables": "^7.16.7", - "@babel/helper-split-export-declaration": "^7.16.7", - "@babel/parser": "^7.17.3", - "@babel/types": "^7.17.0", + "version": "7.18.6", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.18.6.tgz", + "integrity": "sha512-zS/OKyqmD7lslOtFqbscH6gMLFYOfG1YPqCKfAW5KrTeolKqvB8UelR49Fpr6y93kYkW2Ik00mT1LOGiAGvizw==", + "dev": true, + "dependencies": { + "@babel/code-frame": "^7.18.6", + "@babel/generator": "^7.18.6", + "@babel/helper-environment-visitor": "^7.18.6", + "@babel/helper-function-name": "^7.18.6", + "@babel/helper-hoist-variables": "^7.18.6", + "@babel/helper-split-export-declaration": "^7.18.6", + "@babel/parser": "^7.18.6", + "@babel/types": "^7.18.6", "debug": "^4.1.0", "globals": "^11.1.0" }, @@ -445,59 +451,798 @@ } }, "node_modules/@babel/types": { - "version": "7.17.0", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.17.0.tgz", - "integrity": "sha512-TmKSNO4D5rzhL5bjWFcVHHLETzfQ/AmbKpKPOSjlP0WoHZ6L911fgoOKY4Alp/emzG4cHJdyN49zpgkbXFEHHw==", + "version": "7.18.7", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.18.7.tgz", + "integrity": "sha512-QG3yxTcTIBoAcQmkCs+wAPYZhu7Dk9rXKacINfNbdJDNERTbLQbHGyVG8q/YGMPeCJRIhSY0+fTc5+xuh6WPSQ==", "dev": true, "dependencies": { - "@babel/helper-validator-identifier": "^7.16.7", + "@babel/helper-validator-identifier": "^7.18.6", "to-fast-properties": "^2.0.0" }, "engines": { "node": ">=6.9.0" } }, - "node_modules/@cspotcode/source-map-consumer": { - "version": "0.8.0", - "resolved": "https://registry.npmjs.org/@cspotcode/source-map-consumer/-/source-map-consumer-0.8.0.tgz", - "integrity": "sha512-41qniHzTU8yAGbCp04ohlmSrZf8bkf/iJsl3V0dRGsQN/5GFfx+LbCSsCpp2gqrqjTVg/K6O8ycoV35JIwAzAg==", - "dev": true, - "engines": { - "node": ">= 12" - } - }, "node_modules/@cspotcode/source-map-support": { - "version": "0.7.0", - "resolved": "https://registry.npmjs.org/@cspotcode/source-map-support/-/source-map-support-0.7.0.tgz", - "integrity": "sha512-X4xqRHqN8ACt2aHVe51OxeA2HjbcL4MqFqXkrmQszJ1NOUuUu5u6Vqx/0lZSVNku7velL5FC/s5uEAj1lsBMhA==", + "version": "0.8.1", + "resolved": "https://registry.npmjs.org/@cspotcode/source-map-support/-/source-map-support-0.8.1.tgz", + "integrity": "sha512-IchNf6dN4tHoMFIn/7OE8LWZ19Y6q/67Bmf6vnGREv8RSbBVb9LPJxEcnwrcwX6ixSvaiGoomAUvu4YSxXrVgw==", "dev": true, "dependencies": { - "@cspotcode/source-map-consumer": "0.8.0" + "@jridgewell/trace-mapping": "0.3.9" }, "engines": { "node": ">=12" } }, + "node_modules/@cspotcode/source-map-support/node_modules/@jridgewell/trace-mapping": { + "version": "0.3.9", + "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.9.tgz", + "integrity": "sha512-3Belt6tdc8bPgAtbcmdtNJlirVoTmEb5e2gC94PnkwEW9jI6CAHUeoG85tjWP5WquqfavoMtMwiG4P926ZKKuQ==", + "dev": true, + "dependencies": { + "@jridgewell/resolve-uri": "^3.0.3", + "@jridgewell/sourcemap-codec": "^1.4.10" + } + }, "node_modules/@eslint/eslintrc": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-1.2.1.tgz", - "integrity": "sha512-bxvbYnBPN1Gibwyp6NrpnFzA3YtRL3BBAyEAFVIpNTm2Rn4Vy87GA5M4aSn3InRrlsbX5N0GW7XIx+U4SAEKdQ==", + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-1.3.0.tgz", + "integrity": "sha512-UWW0TMTmk2d7hLcWD1/e2g5HDM/HQ3csaLSqXCfqwh4uNDuNqlaKWXmEsL4Cs41Z0KnILNvwbHAah3C2yt06kw==", "dev": true, "dependencies": { "ajv": "^6.12.4", "debug": "^4.3.2", - "espree": "^9.3.1", - "globals": "^13.9.0", + "espree": "^9.3.2", + "globals": "^13.15.0", "ignore": "^5.2.0", "import-fresh": "^3.2.1", "js-yaml": "^4.1.0", - "minimatch": "^3.0.4", + "minimatch": "^3.1.2", "strip-json-comments": "^3.1.1" }, "engines": { "node": "^12.22.0 || ^14.17.0 || >=16.0.0" } }, + "node_modules/@ethereumjs/block": { + "version": "3.6.3", + "resolved": "https://registry.npmjs.org/@ethereumjs/block/-/block-3.6.3.tgz", + "integrity": "sha512-CegDeryc2DVKnDkg5COQrE0bJfw/p0v3GBk2W5/Dj5dOVfEmb50Ux0GLnSPypooLnfqjwFaorGuT9FokWB3GRg==", + "dev": true, + "dependencies": { + "@ethereumjs/common": "^2.6.5", + "@ethereumjs/tx": "^3.5.2", + "ethereumjs-util": "^7.1.5", + "merkle-patricia-tree": "^4.2.4" + } + }, + "node_modules/@ethereumjs/blockchain": { + "version": "5.5.3", + "resolved": "https://registry.npmjs.org/@ethereumjs/blockchain/-/blockchain-5.5.3.tgz", + "integrity": "sha512-bi0wuNJ1gw4ByNCV56H0Z4Q7D+SxUbwyG12Wxzbvqc89PXLRNR20LBcSUZRKpN0+YCPo6m0XZL/JLio3B52LTw==", + "dev": true, + "dependencies": { + "@ethereumjs/block": "^3.6.2", + "@ethereumjs/common": "^2.6.4", + "@ethereumjs/ethash": "^1.1.0", + "debug": "^4.3.3", + "ethereumjs-util": "^7.1.5", + "level-mem": "^5.0.1", + "lru-cache": "^5.1.1", + "semaphore-async-await": "^1.5.1" + } + }, + "node_modules/@ethereumjs/common": { + "version": "2.6.5", + "resolved": "https://registry.npmjs.org/@ethereumjs/common/-/common-2.6.5.tgz", + "integrity": "sha512-lRyVQOeCDaIVtgfbowla32pzeDv2Obr8oR8Put5RdUBNRGr1VGPGQNGP6elWIpgK3YdpzqTOh4GyUGOureVeeA==", + "dev": true, + "dependencies": { + "crc-32": "^1.2.0", + "ethereumjs-util": "^7.1.5" + } + }, + "node_modules/@ethereumjs/ethash": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@ethereumjs/ethash/-/ethash-1.1.0.tgz", + "integrity": "sha512-/U7UOKW6BzpA+Vt+kISAoeDie1vAvY4Zy2KF5JJb+So7+1yKmJeJEHOGSnQIj330e9Zyl3L5Nae6VZyh2TJnAA==", + "dev": true, + "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" + } + }, + "node_modules/@ethereumjs/tx": { + "version": "3.5.2", + "resolved": "https://registry.npmjs.org/@ethereumjs/tx/-/tx-3.5.2.tgz", + "integrity": "sha512-gQDNJWKrSDGu2w7w0PzVXVBNMzb7wwdDOmOqczmhNjqFxFuIbhVJDwiGEnxFNC2/b8ifcZzY7MLcluizohRzNw==", + "dev": true, + "dependencies": { + "@ethereumjs/common": "^2.6.4", + "ethereumjs-util": "^7.1.5" + } + }, + "node_modules/@ethereumjs/vm": { + "version": "5.9.3", + "resolved": "https://registry.npmjs.org/@ethereumjs/vm/-/vm-5.9.3.tgz", + "integrity": "sha512-Ha04TeF8goEglr8eL7hkkYyjhzdZS0PsoRURzYlTF6I0VVId5KjKb0N7MrA8GMgheN+UeTncfTgYx52D/WhEmg==", + "dev": true, + "dependencies": { + "@ethereumjs/block": "^3.6.3", + "@ethereumjs/blockchain": "^5.5.3", + "@ethereumjs/common": "^2.6.5", + "@ethereumjs/tx": "^3.5.2", + "async-eventemitter": "^0.2.4", + "core-js-pure": "^3.0.1", + "debug": "^4.3.3", + "ethereumjs-util": "^7.1.5", + "functional-red-black-tree": "^1.0.1", + "mcl-wasm": "^0.7.1", + "merkle-patricia-tree": "^4.2.4", + "rustbn.js": "~0.2.0" + } + }, + "node_modules/@ethersproject/abi": { + "version": "5.6.4", + "resolved": "https://registry.npmjs.org/@ethersproject/abi/-/abi-5.6.4.tgz", + "integrity": "sha512-TTeZUlCeIHG6527/2goZA6gW5F8Emoc7MrZDC7hhP84aRGvW3TEdTnZR08Ls88YXM1m2SuK42Osw/jSi3uO8gg==", + "funding": [ + { + "type": "individual", + "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" + }, + { + "type": "individual", + "url": "https://www.buymeacoffee.com/ricmoo" + } + ], + "dependencies": { + "@ethersproject/address": "^5.6.1", + "@ethersproject/bignumber": "^5.6.2", + "@ethersproject/bytes": "^5.6.1", + "@ethersproject/constants": "^5.6.1", + "@ethersproject/hash": "^5.6.1", + "@ethersproject/keccak256": "^5.6.1", + "@ethersproject/logger": "^5.6.0", + "@ethersproject/properties": "^5.6.0", + "@ethersproject/strings": "^5.6.1" + } + }, + "node_modules/@ethersproject/abstract-provider": { + "version": "5.6.1", + "resolved": "https://registry.npmjs.org/@ethersproject/abstract-provider/-/abstract-provider-5.6.1.tgz", + "integrity": "sha512-BxlIgogYJtp1FS8Muvj8YfdClk3unZH0vRMVX791Z9INBNT/kuACZ9GzaY1Y4yFq+YSy6/w4gzj3HCRKrK9hsQ==", + "funding": [ + { + "type": "individual", + "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" + }, + { + "type": "individual", + "url": "https://www.buymeacoffee.com/ricmoo" + } + ], + "dependencies": { + "@ethersproject/bignumber": "^5.6.2", + "@ethersproject/bytes": "^5.6.1", + "@ethersproject/logger": "^5.6.0", + "@ethersproject/networks": "^5.6.3", + "@ethersproject/properties": "^5.6.0", + "@ethersproject/transactions": "^5.6.2", + "@ethersproject/web": "^5.6.1" + } + }, + "node_modules/@ethersproject/abstract-signer": { + "version": "5.6.2", + "resolved": "https://registry.npmjs.org/@ethersproject/abstract-signer/-/abstract-signer-5.6.2.tgz", + "integrity": "sha512-n1r6lttFBG0t2vNiI3HoWaS/KdOt8xyDjzlP2cuevlWLG6EX0OwcKLyG/Kp/cuwNxdy/ous+R/DEMdTUwWQIjQ==", + "funding": [ + { + "type": "individual", + "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" + }, + { + "type": "individual", + "url": "https://www.buymeacoffee.com/ricmoo" + } + ], + "dependencies": { + "@ethersproject/abstract-provider": "^5.6.1", + "@ethersproject/bignumber": "^5.6.2", + "@ethersproject/bytes": "^5.6.1", + "@ethersproject/logger": "^5.6.0", + "@ethersproject/properties": "^5.6.0" + } + }, + "node_modules/@ethersproject/address": { + "version": "5.6.1", + "resolved": "https://registry.npmjs.org/@ethersproject/address/-/address-5.6.1.tgz", + "integrity": "sha512-uOgF0kS5MJv9ZvCz7x6T2EXJSzotiybApn4XlOgoTX0xdtyVIJ7pF+6cGPxiEq/dpBiTfMiw7Yc81JcwhSYA0Q==", + "funding": [ + { + "type": "individual", + "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" + }, + { + "type": "individual", + "url": "https://www.buymeacoffee.com/ricmoo" + } + ], + "dependencies": { + "@ethersproject/bignumber": "^5.6.2", + "@ethersproject/bytes": "^5.6.1", + "@ethersproject/keccak256": "^5.6.1", + "@ethersproject/logger": "^5.6.0", + "@ethersproject/rlp": "^5.6.1" + } + }, + "node_modules/@ethersproject/base64": { + "version": "5.6.1", + "resolved": "https://registry.npmjs.org/@ethersproject/base64/-/base64-5.6.1.tgz", + "integrity": "sha512-qB76rjop6a0RIYYMiB4Eh/8n+Hxu2NIZm8S/Q7kNo5pmZfXhHGHmS4MinUainiBC54SCyRnwzL+KZjj8zbsSsw==", + "funding": [ + { + "type": "individual", + "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" + }, + { + "type": "individual", + "url": "https://www.buymeacoffee.com/ricmoo" + } + ], + "dependencies": { + "@ethersproject/bytes": "^5.6.1" + } + }, + "node_modules/@ethersproject/basex": { + "version": "5.6.1", + "resolved": "https://registry.npmjs.org/@ethersproject/basex/-/basex-5.6.1.tgz", + "integrity": "sha512-a52MkVz4vuBXR06nvflPMotld1FJWSj2QT0985v7P/emPZO00PucFAkbcmq2vpVU7Ts7umKiSI6SppiLykVWsA==", + "funding": [ + { + "type": "individual", + "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" + }, + { + "type": "individual", + "url": "https://www.buymeacoffee.com/ricmoo" + } + ], + "dependencies": { + "@ethersproject/bytes": "^5.6.1", + "@ethersproject/properties": "^5.6.0" + } + }, + "node_modules/@ethersproject/bignumber": { + "version": "5.6.2", + "resolved": "https://registry.npmjs.org/@ethersproject/bignumber/-/bignumber-5.6.2.tgz", + "integrity": "sha512-v7+EEUbhGqT3XJ9LMPsKvXYHFc8eHxTowFCG/HgJErmq4XHJ2WR7aeyICg3uTOAQ7Icn0GFHAohXEhxQHq4Ubw==", + "funding": [ + { + "type": "individual", + "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" + }, + { + "type": "individual", + "url": "https://www.buymeacoffee.com/ricmoo" + } + ], + "dependencies": { + "@ethersproject/bytes": "^5.6.1", + "@ethersproject/logger": "^5.6.0", + "bn.js": "^5.2.1" + } + }, + "node_modules/@ethersproject/bignumber/node_modules/bn.js": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-5.2.1.tgz", + "integrity": "sha512-eXRvHzWyYPBuB4NBy0cmYQjGitUrtqwbvlzP3G6VFnNRbsZQIxQ10PbKKHt8gZ/HW/D/747aDl+QkDqg3KQLMQ==" + }, + "node_modules/@ethersproject/bytes": { + "version": "5.6.1", + "resolved": "https://registry.npmjs.org/@ethersproject/bytes/-/bytes-5.6.1.tgz", + "integrity": "sha512-NwQt7cKn5+ZE4uDn+X5RAXLp46E1chXoaMmrxAyA0rblpxz8t58lVkrHXoRIn0lz1joQElQ8410GqhTqMOwc6g==", + "funding": [ + { + "type": "individual", + "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" + }, + { + "type": "individual", + "url": "https://www.buymeacoffee.com/ricmoo" + } + ], + "dependencies": { + "@ethersproject/logger": "^5.6.0" + } + }, + "node_modules/@ethersproject/constants": { + "version": "5.6.1", + "resolved": "https://registry.npmjs.org/@ethersproject/constants/-/constants-5.6.1.tgz", + "integrity": "sha512-QSq9WVnZbxXYFftrjSjZDUshp6/eKp6qrtdBtUCm0QxCV5z1fG/w3kdlcsjMCQuQHUnAclKoK7XpXMezhRDOLg==", + "funding": [ + { + "type": "individual", + "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" + }, + { + "type": "individual", + "url": "https://www.buymeacoffee.com/ricmoo" + } + ], + "dependencies": { + "@ethersproject/bignumber": "^5.6.2" + } + }, + "node_modules/@ethersproject/contracts": { + "version": "5.6.2", + "resolved": "https://registry.npmjs.org/@ethersproject/contracts/-/contracts-5.6.2.tgz", + "integrity": "sha512-hguUA57BIKi6WY0kHvZp6PwPlWF87MCeB4B7Z7AbUpTxfFXFdn/3b0GmjZPagIHS+3yhcBJDnuEfU4Xz+Ks/8g==", + "funding": [ + { + "type": "individual", + "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" + }, + { + "type": "individual", + "url": "https://www.buymeacoffee.com/ricmoo" + } + ], + "dependencies": { + "@ethersproject/abi": "^5.6.3", + "@ethersproject/abstract-provider": "^5.6.1", + "@ethersproject/abstract-signer": "^5.6.2", + "@ethersproject/address": "^5.6.1", + "@ethersproject/bignumber": "^5.6.2", + "@ethersproject/bytes": "^5.6.1", + "@ethersproject/constants": "^5.6.1", + "@ethersproject/logger": "^5.6.0", + "@ethersproject/properties": "^5.6.0", + "@ethersproject/transactions": "^5.6.2" + } + }, + "node_modules/@ethersproject/hash": { + "version": "5.6.1", + "resolved": "https://registry.npmjs.org/@ethersproject/hash/-/hash-5.6.1.tgz", + "integrity": "sha512-L1xAHurbaxG8VVul4ankNX5HgQ8PNCTrnVXEiFnE9xoRnaUcgfD12tZINtDinSllxPLCtGwguQxJ5E6keE84pA==", + "funding": [ + { + "type": "individual", + "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" + }, + { + "type": "individual", + "url": "https://www.buymeacoffee.com/ricmoo" + } + ], + "dependencies": { + "@ethersproject/abstract-signer": "^5.6.2", + "@ethersproject/address": "^5.6.1", + "@ethersproject/bignumber": "^5.6.2", + "@ethersproject/bytes": "^5.6.1", + "@ethersproject/keccak256": "^5.6.1", + "@ethersproject/logger": "^5.6.0", + "@ethersproject/properties": "^5.6.0", + "@ethersproject/strings": "^5.6.1" + } + }, + "node_modules/@ethersproject/hdnode": { + "version": "5.6.2", + "resolved": "https://registry.npmjs.org/@ethersproject/hdnode/-/hdnode-5.6.2.tgz", + "integrity": "sha512-tERxW8Ccf9CxW2db3WsN01Qao3wFeRsfYY9TCuhmG0xNpl2IO8wgXU3HtWIZ49gUWPggRy4Yg5axU0ACaEKf1Q==", + "funding": [ + { + "type": "individual", + "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" + }, + { + "type": "individual", + "url": "https://www.buymeacoffee.com/ricmoo" + } + ], + "dependencies": { + "@ethersproject/abstract-signer": "^5.6.2", + "@ethersproject/basex": "^5.6.1", + "@ethersproject/bignumber": "^5.6.2", + "@ethersproject/bytes": "^5.6.1", + "@ethersproject/logger": "^5.6.0", + "@ethersproject/pbkdf2": "^5.6.1", + "@ethersproject/properties": "^5.6.0", + "@ethersproject/sha2": "^5.6.1", + "@ethersproject/signing-key": "^5.6.2", + "@ethersproject/strings": "^5.6.1", + "@ethersproject/transactions": "^5.6.2", + "@ethersproject/wordlists": "^5.6.1" + } + }, + "node_modules/@ethersproject/json-wallets": { + "version": "5.6.1", + "resolved": "https://registry.npmjs.org/@ethersproject/json-wallets/-/json-wallets-5.6.1.tgz", + "integrity": "sha512-KfyJ6Zwz3kGeX25nLihPwZYlDqamO6pfGKNnVMWWfEVVp42lTfCZVXXy5Ie8IZTN0HKwAngpIPi7gk4IJzgmqQ==", + "funding": [ + { + "type": "individual", + "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" + }, + { + "type": "individual", + "url": "https://www.buymeacoffee.com/ricmoo" + } + ], + "dependencies": { + "@ethersproject/abstract-signer": "^5.6.2", + "@ethersproject/address": "^5.6.1", + "@ethersproject/bytes": "^5.6.1", + "@ethersproject/hdnode": "^5.6.2", + "@ethersproject/keccak256": "^5.6.1", + "@ethersproject/logger": "^5.6.0", + "@ethersproject/pbkdf2": "^5.6.1", + "@ethersproject/properties": "^5.6.0", + "@ethersproject/random": "^5.6.1", + "@ethersproject/strings": "^5.6.1", + "@ethersproject/transactions": "^5.6.2", + "aes-js": "3.0.0", + "scrypt-js": "3.0.1" + } + }, + "node_modules/@ethersproject/keccak256": { + "version": "5.6.1", + "resolved": "https://registry.npmjs.org/@ethersproject/keccak256/-/keccak256-5.6.1.tgz", + "integrity": "sha512-bB7DQHCTRDooZZdL3lk9wpL0+XuG3XLGHLh3cePnybsO3V0rdCAOQGpn/0R3aODmnTOOkCATJiD2hnL+5bwthA==", + "funding": [ + { + "type": "individual", + "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" + }, + { + "type": "individual", + "url": "https://www.buymeacoffee.com/ricmoo" + } + ], + "dependencies": { + "@ethersproject/bytes": "^5.6.1", + "js-sha3": "0.8.0" + } + }, + "node_modules/@ethersproject/logger": { + "version": "5.6.0", + "resolved": "https://registry.npmjs.org/@ethersproject/logger/-/logger-5.6.0.tgz", + "integrity": "sha512-BiBWllUROH9w+P21RzoxJKzqoqpkyM1pRnEKG69bulE9TSQD8SAIvTQqIMZmmCO8pUNkgLP1wndX1gKghSpBmg==", + "funding": [ + { + "type": "individual", + "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" + }, + { + "type": "individual", + "url": "https://www.buymeacoffee.com/ricmoo" + } + ] + }, + "node_modules/@ethersproject/networks": { + "version": "5.6.4", + "resolved": "https://registry.npmjs.org/@ethersproject/networks/-/networks-5.6.4.tgz", + "integrity": "sha512-KShHeHPahHI2UlWdtDMn2lJETcbtaJge4k7XSjDR9h79QTd6yQJmv6Cp2ZA4JdqWnhszAOLSuJEd9C0PRw7hSQ==", + "funding": [ + { + "type": "individual", + "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" + }, + { + "type": "individual", + "url": "https://www.buymeacoffee.com/ricmoo" + } + ], + "dependencies": { + "@ethersproject/logger": "^5.6.0" + } + }, + "node_modules/@ethersproject/pbkdf2": { + "version": "5.6.1", + "resolved": "https://registry.npmjs.org/@ethersproject/pbkdf2/-/pbkdf2-5.6.1.tgz", + "integrity": "sha512-k4gRQ+D93zDRPNUfmduNKq065uadC2YjMP/CqwwX5qG6R05f47boq6pLZtV/RnC4NZAYOPH1Cyo54q0c9sshRQ==", + "funding": [ + { + "type": "individual", + "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" + }, + { + "type": "individual", + "url": "https://www.buymeacoffee.com/ricmoo" + } + ], + "dependencies": { + "@ethersproject/bytes": "^5.6.1", + "@ethersproject/sha2": "^5.6.1" + } + }, + "node_modules/@ethersproject/properties": { + "version": "5.6.0", + "resolved": "https://registry.npmjs.org/@ethersproject/properties/-/properties-5.6.0.tgz", + "integrity": "sha512-szoOkHskajKePTJSZ46uHUWWkbv7TzP2ypdEK6jGMqJaEt2sb0jCgfBo0gH0m2HBpRixMuJ6TBRaQCF7a9DoCg==", + "funding": [ + { + "type": "individual", + "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" + }, + { + "type": "individual", + "url": "https://www.buymeacoffee.com/ricmoo" + } + ], + "dependencies": { + "@ethersproject/logger": "^5.6.0" + } + }, + "node_modules/@ethersproject/providers": { + "version": "5.6.8", + "resolved": "https://registry.npmjs.org/@ethersproject/providers/-/providers-5.6.8.tgz", + "integrity": "sha512-Wf+CseT/iOJjrGtAOf3ck9zS7AgPmr2fZ3N97r4+YXN3mBePTG2/bJ8DApl9mVwYL+RpYbNxMEkEp4mPGdwG/w==", + "funding": [ + { + "type": "individual", + "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" + }, + { + "type": "individual", + "url": "https://www.buymeacoffee.com/ricmoo" + } + ], + "dependencies": { + "@ethersproject/abstract-provider": "^5.6.1", + "@ethersproject/abstract-signer": "^5.6.2", + "@ethersproject/address": "^5.6.1", + "@ethersproject/base64": "^5.6.1", + "@ethersproject/basex": "^5.6.1", + "@ethersproject/bignumber": "^5.6.2", + "@ethersproject/bytes": "^5.6.1", + "@ethersproject/constants": "^5.6.1", + "@ethersproject/hash": "^5.6.1", + "@ethersproject/logger": "^5.6.0", + "@ethersproject/networks": "^5.6.3", + "@ethersproject/properties": "^5.6.0", + "@ethersproject/random": "^5.6.1", + "@ethersproject/rlp": "^5.6.1", + "@ethersproject/sha2": "^5.6.1", + "@ethersproject/strings": "^5.6.1", + "@ethersproject/transactions": "^5.6.2", + "@ethersproject/web": "^5.6.1", + "bech32": "1.1.4", + "ws": "7.4.6" + } + }, + "node_modules/@ethersproject/random": { + "version": "5.6.1", + "resolved": "https://registry.npmjs.org/@ethersproject/random/-/random-5.6.1.tgz", + "integrity": "sha512-/wtPNHwbmng+5yi3fkipA8YBT59DdkGRoC2vWk09Dci/q5DlgnMkhIycjHlavrvrjJBkFjO/ueLyT+aUDfc4lA==", + "funding": [ + { + "type": "individual", + "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" + }, + { + "type": "individual", + "url": "https://www.buymeacoffee.com/ricmoo" + } + ], + "dependencies": { + "@ethersproject/bytes": "^5.6.1", + "@ethersproject/logger": "^5.6.0" + } + }, + "node_modules/@ethersproject/rlp": { + "version": "5.6.1", + "resolved": "https://registry.npmjs.org/@ethersproject/rlp/-/rlp-5.6.1.tgz", + "integrity": "sha512-uYjmcZx+DKlFUk7a5/W9aQVaoEC7+1MOBgNtvNg13+RnuUwT4F0zTovC0tmay5SmRslb29V1B7Y5KCri46WhuQ==", + "funding": [ + { + "type": "individual", + "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" + }, + { + "type": "individual", + "url": "https://www.buymeacoffee.com/ricmoo" + } + ], + "dependencies": { + "@ethersproject/bytes": "^5.6.1", + "@ethersproject/logger": "^5.6.0" + } + }, + "node_modules/@ethersproject/sha2": { + "version": "5.6.1", + "resolved": "https://registry.npmjs.org/@ethersproject/sha2/-/sha2-5.6.1.tgz", + "integrity": "sha512-5K2GyqcW7G4Yo3uenHegbXRPDgARpWUiXc6RiF7b6i/HXUoWlb7uCARh7BAHg7/qT/Q5ydofNwiZcim9qpjB6g==", + "funding": [ + { + "type": "individual", + "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" + }, + { + "type": "individual", + "url": "https://www.buymeacoffee.com/ricmoo" + } + ], + "dependencies": { + "@ethersproject/bytes": "^5.6.1", + "@ethersproject/logger": "^5.6.0", + "hash.js": "1.1.7" + } + }, + "node_modules/@ethersproject/signing-key": { + "version": "5.6.2", + "resolved": "https://registry.npmjs.org/@ethersproject/signing-key/-/signing-key-5.6.2.tgz", + "integrity": "sha512-jVbu0RuP7EFpw82vHcL+GP35+KaNruVAZM90GxgQnGqB6crhBqW/ozBfFvdeImtmb4qPko0uxXjn8l9jpn0cwQ==", + "funding": [ + { + "type": "individual", + "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" + }, + { + "type": "individual", + "url": "https://www.buymeacoffee.com/ricmoo" + } + ], + "dependencies": { + "@ethersproject/bytes": "^5.6.1", + "@ethersproject/logger": "^5.6.0", + "@ethersproject/properties": "^5.6.0", + "bn.js": "^5.2.1", + "elliptic": "6.5.4", + "hash.js": "1.1.7" + } + }, + "node_modules/@ethersproject/signing-key/node_modules/bn.js": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-5.2.1.tgz", + "integrity": "sha512-eXRvHzWyYPBuB4NBy0cmYQjGitUrtqwbvlzP3G6VFnNRbsZQIxQ10PbKKHt8gZ/HW/D/747aDl+QkDqg3KQLMQ==" + }, + "node_modules/@ethersproject/strings": { + "version": "5.6.1", + "resolved": "https://registry.npmjs.org/@ethersproject/strings/-/strings-5.6.1.tgz", + "integrity": "sha512-2X1Lgk6Jyfg26MUnsHiT456U9ijxKUybz8IM1Vih+NJxYtXhmvKBcHOmvGqpFSVJ0nQ4ZCoIViR8XlRw1v/+Cw==", + "funding": [ + { + "type": "individual", + "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" + }, + { + "type": "individual", + "url": "https://www.buymeacoffee.com/ricmoo" + } + ], + "dependencies": { + "@ethersproject/bytes": "^5.6.1", + "@ethersproject/constants": "^5.6.1", + "@ethersproject/logger": "^5.6.0" + } + }, + "node_modules/@ethersproject/transactions": { + "version": "5.6.2", + "resolved": "https://registry.npmjs.org/@ethersproject/transactions/-/transactions-5.6.2.tgz", + "integrity": "sha512-BuV63IRPHmJvthNkkt9G70Ullx6AcM+SDc+a8Aw/8Yew6YwT51TcBKEp1P4oOQ/bP25I18JJr7rcFRgFtU9B2Q==", + "funding": [ + { + "type": "individual", + "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" + }, + { + "type": "individual", + "url": "https://www.buymeacoffee.com/ricmoo" + } + ], + "dependencies": { + "@ethersproject/address": "^5.6.1", + "@ethersproject/bignumber": "^5.6.2", + "@ethersproject/bytes": "^5.6.1", + "@ethersproject/constants": "^5.6.1", + "@ethersproject/keccak256": "^5.6.1", + "@ethersproject/logger": "^5.6.0", + "@ethersproject/properties": "^5.6.0", + "@ethersproject/rlp": "^5.6.1", + "@ethersproject/signing-key": "^5.6.2" + } + }, + "node_modules/@ethersproject/units": { + "version": "5.6.1", + "resolved": "https://registry.npmjs.org/@ethersproject/units/-/units-5.6.1.tgz", + "integrity": "sha512-rEfSEvMQ7obcx3KWD5EWWx77gqv54K6BKiZzKxkQJqtpriVsICrktIQmKl8ReNToPeIYPnFHpXvKpi068YFZXw==", + "funding": [ + { + "type": "individual", + "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" + }, + { + "type": "individual", + "url": "https://www.buymeacoffee.com/ricmoo" + } + ], + "dependencies": { + "@ethersproject/bignumber": "^5.6.2", + "@ethersproject/constants": "^5.6.1", + "@ethersproject/logger": "^5.6.0" + } + }, + "node_modules/@ethersproject/wallet": { + "version": "5.6.2", + "resolved": "https://registry.npmjs.org/@ethersproject/wallet/-/wallet-5.6.2.tgz", + "integrity": "sha512-lrgh0FDQPuOnHcF80Q3gHYsSUODp6aJLAdDmDV0xKCN/T7D99ta1jGVhulg3PY8wiXEngD0DfM0I2XKXlrqJfg==", + "funding": [ + { + "type": "individual", + "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" + }, + { + "type": "individual", + "url": "https://www.buymeacoffee.com/ricmoo" + } + ], + "dependencies": { + "@ethersproject/abstract-provider": "^5.6.1", + "@ethersproject/abstract-signer": "^5.6.2", + "@ethersproject/address": "^5.6.1", + "@ethersproject/bignumber": "^5.6.2", + "@ethersproject/bytes": "^5.6.1", + "@ethersproject/hash": "^5.6.1", + "@ethersproject/hdnode": "^5.6.2", + "@ethersproject/json-wallets": "^5.6.1", + "@ethersproject/keccak256": "^5.6.1", + "@ethersproject/logger": "^5.6.0", + "@ethersproject/properties": "^5.6.0", + "@ethersproject/random": "^5.6.1", + "@ethersproject/signing-key": "^5.6.2", + "@ethersproject/transactions": "^5.6.2", + "@ethersproject/wordlists": "^5.6.1" + } + }, + "node_modules/@ethersproject/web": { + "version": "5.6.1", + "resolved": "https://registry.npmjs.org/@ethersproject/web/-/web-5.6.1.tgz", + "integrity": "sha512-/vSyzaQlNXkO1WV+RneYKqCJwualcUdx/Z3gseVovZP0wIlOFcCE1hkRhKBH8ImKbGQbMl9EAAyJFrJu7V0aqA==", + "funding": [ + { + "type": "individual", + "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" + }, + { + "type": "individual", + "url": "https://www.buymeacoffee.com/ricmoo" + } + ], + "dependencies": { + "@ethersproject/base64": "^5.6.1", + "@ethersproject/bytes": "^5.6.1", + "@ethersproject/logger": "^5.6.0", + "@ethersproject/properties": "^5.6.0", + "@ethersproject/strings": "^5.6.1" + } + }, + "node_modules/@ethersproject/wordlists": { + "version": "5.6.1", + "resolved": "https://registry.npmjs.org/@ethersproject/wordlists/-/wordlists-5.6.1.tgz", + "integrity": "sha512-wiPRgBpNbNwCQFoCr8bcWO8o5I810cqO6mkdtKfLKFlLxeCWcnzDi4Alu8iyNzlhYuS9npCwivMbRWF19dyblw==", + "funding": [ + { + "type": "individual", + "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" + }, + { + "type": "individual", + "url": "https://www.buymeacoffee.com/ricmoo" + } + ], + "dependencies": { + "@ethersproject/bytes": "^5.6.1", + "@ethersproject/hash": "^5.6.1", + "@ethersproject/logger": "^5.6.0", + "@ethersproject/properties": "^5.6.0", + "@ethersproject/strings": "^5.6.1" + } + }, "node_modules/@harmony-js/account": { "version": "0.1.56", "resolved": "https://registry.npmjs.org/@harmony-js/account/-/account-0.1.56.tgz", @@ -582,6 +1327,11 @@ "uuid": "^3.3.2" } }, + "node_modules/@harmony-js/crypto/node_modules/aes-js": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/aes-js/-/aes-js-3.1.2.tgz", + "integrity": "sha512-e5pEa2kBnBOgR4Y/p20pskXI74UEz7de8ZGVo58asOtvSVG5YAbJeELPZxOmt+Bnz3rX753YKhfIn4X4l1PPRQ==" + }, "node_modules/@harmony-js/network": { "version": "0.1.56", "resolved": "https://registry.npmjs.org/@harmony-js/network/-/network-0.1.56.tgz", @@ -770,72 +1520,227 @@ "node": ">=8" } }, + "node_modules/@jridgewell/gen-mapping": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.1.1.tgz", + "integrity": "sha512-sQXCasFk+U8lWYEe66WxRDOE9PjVz4vSM51fTu3Hw+ClTpUSQb718772vH3pyS5pShp6lvQM7SxgIDXXXmOX7w==", + "dev": true, + "dependencies": { + "@jridgewell/set-array": "^1.0.0", + "@jridgewell/sourcemap-codec": "^1.4.10" + }, + "engines": { + "node": ">=6.0.0" + } + }, "node_modules/@jridgewell/resolve-uri": { - "version": "3.0.5", - "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.0.5.tgz", - "integrity": "sha512-VPeQ7+wH0itvQxnG+lIzWgkysKIr3L9sslimFW55rHMdGu/qCQ5z5h9zq4gI8uBtqkpHhsF4Z/OwExufUCThew==", + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.0.tgz", + "integrity": "sha512-F2msla3tad+Mfht5cJq7LSXcdudKTWCVYUgw6pLFOOHSTtZlj6SWNYAp+AhuqLmWdBO2X5hPrLcu8cVP8fy28w==", "dev": true, "engines": { "node": ">=6.0.0" } }, - "node_modules/@jridgewell/sourcemap-codec": { - "version": "1.4.11", - "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.11.tgz", - "integrity": "sha512-Fg32GrJo61m+VqYSdRSjRXMjQ06j8YIYfcTqndLYVAaHmroZHLJZCydsWBOTDqXS2v+mjxohBWEMfg97GXmYQg==", - "dev": true - }, - "node_modules/@jridgewell/trace-mapping": { - "version": "0.3.4", - "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.4.tgz", - "integrity": "sha512-vFv9ttIedivx0ux3QSjhgtCVjPZd5l46ZOMDSCwnH1yUO2e964gO8LZGyv2QkqcgR6TnBU1v+1IFqmeoG+0UJQ==", + "node_modules/@jridgewell/set-array": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@jridgewell/set-array/-/set-array-1.1.2.tgz", + "integrity": "sha512-xnkseuNADM0gt2bs+BvhO0p78Mk762YnZdsuzFV018NoG1Sj1SCQvpSqa7XUaTam5vAGasABV9qXASMKnFMwMw==", + "dev": true, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@jridgewell/sourcemap-codec": { + "version": "1.4.14", + "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.14.tgz", + "integrity": "sha512-XPSJHWmi394fuUuzDnGz1wiKqWfo1yXecHQMRf2l6hztTO+nPru658AyDngaBe7isIxEkRsPR3FZh+s7iVa4Uw==", + "dev": true + }, + "node_modules/@jridgewell/trace-mapping": { + "version": "0.3.14", + "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.14.tgz", + "integrity": "sha512-bJWEfQ9lPTvm3SneWwRFVLzrh6nhjwqw7TUFFBEMzwvg7t7PCDenf2lDwqo4NQXzdpgBXyFgDWnQA+2vkruksQ==", + "dev": true, + "dependencies": { + "@jridgewell/resolve-uri": "^3.0.3", + "@jridgewell/sourcemap-codec": "^1.4.10" + } + }, + "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/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/@nodelib/fs.scandir": { + "version": "2.1.5", + "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", + "integrity": "sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==", + "dev": true, + "dependencies": { + "@nodelib/fs.stat": "2.0.5", + "run-parallel": "^1.1.9" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/@nodelib/fs.stat": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz", + "integrity": "sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==", + "dev": true, + "engines": { + "node": ">= 8" + } + }, + "node_modules/@nodelib/fs.walk": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz", + "integrity": "sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==", + "dev": true, + "dependencies": { + "@nodelib/fs.scandir": "2.1.5", + "fastq": "^1.6.0" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/@openzeppelin/contracts": { + "version": "2.5.1", + "resolved": "https://registry.npmjs.org/@openzeppelin/contracts/-/contracts-2.5.1.tgz", + "integrity": "sha512-qIy6tLx8rtybEsIOAlrM4J/85s2q2nPkDqj/Rx46VakBZ0LwtFhXIVub96LXHczQX0vaqmAueDqNPXtbSXSaYQ==", + "dev": true + }, + "node_modules/@sentry/core": { + "version": "5.30.0", + "resolved": "https://registry.npmjs.org/@sentry/core/-/core-5.30.0.tgz", + "integrity": "sha512-TmfrII8w1PQZSZgPpUESqjB+jC6MvZJZdLtE/0hZ+SrnKhW3x5WlYLvTXZpcWePYBku7rl2wn1RZu6uT0qCTeg==", + "dev": true, + "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" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/@sentry/hub": { + "version": "5.30.0", + "resolved": "https://registry.npmjs.org/@sentry/hub/-/hub-5.30.0.tgz", + "integrity": "sha512-2tYrGnzb1gKz2EkMDQcfLrDTvmGcQPuWxLnJKXJvYTQDGLlEvi2tWz1VIHjunmOvJrB5aIQLhm+dcMRwFZDCqQ==", + "dev": true, + "dependencies": { + "@sentry/types": "5.30.0", + "@sentry/utils": "5.30.0", + "tslib": "^1.9.3" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/@sentry/minimal": { + "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==", + "dev": true, + "dependencies": { + "@sentry/hub": "5.30.0", + "@sentry/types": "5.30.0", + "tslib": "^1.9.3" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/@sentry/node": { + "version": "5.30.0", + "resolved": "https://registry.npmjs.org/@sentry/node/-/node-5.30.0.tgz", + "integrity": "sha512-Br5oyVBF0fZo6ZS9bxbJZG4ApAjRqAnqFFurMVJJdunNb80brh7a5Qva2kjhm+U6r9NJAB5OmDyPkA1Qnt+QVg==", "dev": true, "dependencies": { - "@jridgewell/resolve-uri": "^3.0.3", - "@jridgewell/sourcemap-codec": "^1.4.10" + "@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" + }, + "engines": { + "node": ">=6" } }, - "node_modules/@nodelib/fs.scandir": { - "version": "2.1.5", - "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", - "integrity": "sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==", + "node_modules/@sentry/tracing": { + "version": "5.30.0", + "resolved": "https://registry.npmjs.org/@sentry/tracing/-/tracing-5.30.0.tgz", + "integrity": "sha512-dUFowCr0AIMwiLD7Fs314Mdzcug+gBVo/+NCMyDw8tFxJkwWAKl7Qa2OZxLQ0ZHjakcj1hNKfCQJ9rhyfOl4Aw==", "dev": true, "dependencies": { - "@nodelib/fs.stat": "2.0.5", - "run-parallel": "^1.1.9" + "@sentry/hub": "5.30.0", + "@sentry/minimal": "5.30.0", + "@sentry/types": "5.30.0", + "@sentry/utils": "5.30.0", + "tslib": "^1.9.3" }, "engines": { - "node": ">= 8" + "node": ">=6" } }, - "node_modules/@nodelib/fs.stat": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz", - "integrity": "sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==", + "node_modules/@sentry/types": { + "version": "5.30.0", + "resolved": "https://registry.npmjs.org/@sentry/types/-/types-5.30.0.tgz", + "integrity": "sha512-R8xOqlSTZ+htqrfteCWU5Nk0CDN5ApUTvrlvBuiH1DyP6czDZ4ktbZB0hAgBlVcK0U+qpD3ag3Tqqpa5Q67rPw==", "dev": true, "engines": { - "node": ">= 8" + "node": ">=6" } }, - "node_modules/@nodelib/fs.walk": { - "version": "1.2.8", - "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz", - "integrity": "sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==", + "node_modules/@sentry/utils": { + "version": "5.30.0", + "resolved": "https://registry.npmjs.org/@sentry/utils/-/utils-5.30.0.tgz", + "integrity": "sha512-zaYmoH0NWWtvnJjC9/CBseXMtKHm/tm40sz3YfJRxeQjyzRqNQPgivpd9R/oDJCYj999mzdW382p/qi2ypjLww==", "dev": true, "dependencies": { - "@nodelib/fs.scandir": "2.1.5", - "fastq": "^1.6.0" + "@sentry/types": "5.30.0", + "tslib": "^1.9.3" }, "engines": { - "node": ">= 8" + "node": ">=6" } }, - "node_modules/@openzeppelin/contracts": { - "version": "4.5.0", - "resolved": "https://registry.npmjs.org/@openzeppelin/contracts/-/contracts-4.5.0.tgz", - "integrity": "sha512-fdkzKPYMjrRiPK6K4y64e6GzULR7R7RwxSigHS8DDp7aWDeoReqsQI+cxHV1UuhAqX69L1lAaWDxenfP+xiqzA==", - "dev": true - }, "node_modules/@sinonjs/commons": { "version": "1.8.3", "resolved": "https://registry.npmjs.org/@sinonjs/commons/-/commons-1.8.3.tgz", @@ -846,9 +1751,9 @@ } }, "node_modules/@sinonjs/fake-timers": { - "version": "9.1.1", - "resolved": "https://registry.npmjs.org/@sinonjs/fake-timers/-/fake-timers-9.1.1.tgz", - "integrity": "sha512-Wp5vwlZ0lOqpSYGKqr53INws9HLkt6JDc/pDZcPf7bchQnrXJMXPns8CXx0hFikMSGSWfvtvvpb2gtMVfkWagA==", + "version": "9.1.2", + "resolved": "https://registry.npmjs.org/@sinonjs/fake-timers/-/fake-timers-9.1.2.tgz", + "integrity": "sha512-BPS4ynJW/o92PUR4wgriz2Ud5gpST5vz6GQfMixEDK0Z8ZCUv2M7SkBLykH56T++Xs+8ln9zTGbOvNGIe02/jw==", "dev": true, "dependencies": { "@sinonjs/commons": "^1.7.0" @@ -871,34 +1776,50 @@ "integrity": "sha512-+iTbntw2IZPb/anVDbypzfQa+ay64MW0Zo8aJ8gZPWMMK6/OubMVb6lUPMagqjOPnmtauXnFCACVl3O7ogjeqQ==", "dev": true }, + "node_modules/@solidity-parser/parser": { + "version": "0.14.2", + "resolved": "https://registry.npmjs.org/@solidity-parser/parser/-/parser-0.14.2.tgz", + "integrity": "sha512-10cr0s+MtRtqjEw0WFJrm2rwULN30xx7btd/v9cmqME2617/2M5MbHDkFIGIGTa7lwNw4bN9mVGfhlLzrYw8pA==", + "dev": true, + "dependencies": { + "antlr4ts": "^0.5.0-alpha.4" + } + }, "node_modules/@tsconfig/node10": { - "version": "1.0.8", - "resolved": "https://registry.npmjs.org/@tsconfig/node10/-/node10-1.0.8.tgz", - "integrity": "sha512-6XFfSQmMgq0CFLY1MslA/CPUfhIL919M1rMsa5lP2P097N2Wd1sSX0tx1u4olM16fLNhtHZpRhedZJphNJqmZg==", + "version": "1.0.9", + "resolved": "https://registry.npmjs.org/@tsconfig/node10/-/node10-1.0.9.tgz", + "integrity": "sha512-jNsYVVxU8v5g43Erja32laIDHXeoNvFEpX33OK4d6hljo3jDhCBDhx5dhCCTMWUojscpAagGiRkBKxpdl9fxqA==", "dev": true }, "node_modules/@tsconfig/node12": { - "version": "1.0.9", - "resolved": "https://registry.npmjs.org/@tsconfig/node12/-/node12-1.0.9.tgz", - "integrity": "sha512-/yBMcem+fbvhSREH+s14YJi18sp7J9jpuhYByADT2rypfajMZZN4WQ6zBGgBKp53NKmqI36wFYDb3yaMPurITw==", + "version": "1.0.11", + "resolved": "https://registry.npmjs.org/@tsconfig/node12/-/node12-1.0.11.tgz", + "integrity": "sha512-cqefuRsh12pWyGsIoBKJA9luFu3mRxCA+ORZvA4ktLSzIuCUtWVxGIuXigEwO5/ywWFMZ2QEGKWvkZG1zDMTag==", "dev": true }, "node_modules/@tsconfig/node14": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/@tsconfig/node14/-/node14-1.0.1.tgz", - "integrity": "sha512-509r2+yARFfHHE7T6Puu2jjkoycftovhXRqW328PDXTVGKihlb1P8Z9mMZH04ebyajfRY7dedfGynlrFHJUQCg==", + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/@tsconfig/node14/-/node14-1.0.3.tgz", + "integrity": "sha512-ysT8mhdixWK6Hw3i1V2AeRqZ5WfXg1G43mqoYlM2nc6388Fq5jcXyr5mRsqViLx/GJYdoL0bfXD8nmF+Zn/Iow==", "dev": true }, "node_modules/@tsconfig/node16": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/@tsconfig/node16/-/node16-1.0.2.tgz", - "integrity": "sha512-eZxlbI8GZscaGS7kkc/trHTT5xgrjH3/1n2JDwusC9iahPKWMRvRjJSAN5mCXviuTGQ/lHnhvv8Q1YTpnfz9gA==", + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/@tsconfig/node16/-/node16-1.0.3.tgz", + "integrity": "sha512-yOlFc+7UtL/89t2ZhjPvvB/DeAr3r+Dq58IgzsFkOAvVC6NMJXmCGjbptdXdR9qsX7pKcTL+s87FtYREi2dEEQ==", + "dev": true + }, + "node_modules/@types/abstract-leveldown": { + "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/bip39": { "version": "2.4.2", "resolved": "https://registry.npmjs.org/@types/bip39/-/bip39-2.4.2.tgz", "integrity": "sha512-Vo9lqOIRq8uoIzEVrV87ZvcIM0PN9t0K3oYZ/CS61fIYKCBdOIM7mlWzXuRvSXrDtVa1uUO2w1cdfufxTC0bzg==", + "dev": true, "dependencies": { "@types/node": "*" } @@ -912,9 +1833,9 @@ } }, "node_modules/@types/chai": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/@types/chai/-/chai-4.3.0.tgz", - "integrity": "sha512-/ceqdqeRraGolFTcfoXNiqjyQhZzbINDngeoAq9GoHa8PPK1yNzTaxWjA6BFWp5Ua9JpXEMSS4s5i9tS0hOJtw==", + "version": "4.3.1", + "resolved": "https://registry.npmjs.org/@types/chai/-/chai-4.3.1.tgz", + "integrity": "sha512-/zPMqDkzSZ8t3VtxOa4KPq7uzzW978M9Tvh+j7GHKuo6k6GTLxPJ4J5gE5cjfJ26pnXst0N5Hax8Sr0T2Mi9zQ==", "dev": true }, "node_modules/@types/chai-as-promised": { @@ -936,32 +1857,73 @@ } }, "node_modules/@types/json-schema": { - "version": "7.0.10", - "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.10.tgz", - "integrity": "sha512-BLO9bBq59vW3fxCpD4o0N4U+DXsvwvIcl+jofw0frQo/GrBFC+/jRZj1E7kgp6dvTyNmA4y6JCV5Id/r3mNP5A==", + "version": "7.0.11", + "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.11.tgz", + "integrity": "sha512-wOuvG1SN4Us4rez+tylwwwCV1psiNVOkJeM3AUWUNWg/jDQY2+HE/444y5gc+jBmRqASOm2Oeh5c1axHobwRKQ==", "dev": true }, "node_modules/@types/json5": { "version": "0.0.29", "resolved": "https://registry.npmjs.org/@types/json5/-/json5-0.0.29.tgz", - "integrity": "sha1-7ihweulOEdK4J7y+UnC86n8+ce4=", + "integrity": "sha512-dRLjCWHYg4oaA77cxO64oO+7JwCwnIzkZPdrrC71jQmQtlhM556pwKo5bUzqvZndkVbeFLIIi+9TC40JNF5hNQ==", + "dev": true + }, + "node_modules/@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==", + "dev": true + }, + "node_modules/@types/levelup": { + "version": "4.3.3", + "resolved": "https://registry.npmjs.org/@types/levelup/-/levelup-4.3.3.tgz", + "integrity": "sha512-K+OTIjJcZHVlZQN1HmU64VtrC0jC3dXWQozuEIR9zVvltIk90zaGPM2AgT+fIkChpzHhFE3YnvFLCbLtzAmexA==", + "dev": true, + "dependencies": { + "@types/abstract-leveldown": "*", + "@types/level-errors": "*", + "@types/node": "*" + } + }, + "node_modules/@types/lru-cache": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/@types/lru-cache/-/lru-cache-5.1.1.tgz", + "integrity": "sha512-ssE3Vlrys7sdIzs5LOxCzTVMsU7i9oa/IaW92wF32JFb3CVczqOkru2xspuKczHEbG3nvmPY7IFqVmGGHdNbYw==", "dev": true }, "node_modules/@types/mocha": { - "version": "9.1.0", - "resolved": "https://registry.npmjs.org/@types/mocha/-/mocha-9.1.0.tgz", - "integrity": "sha512-QCWHkbMv4Y5U9oW10Uxbr45qMMSzl4OzijsozynUAgx3kEHUdXB00udx2dWDQ7f2TU2a2uuiFaRZjCe3unPpeg==", + "version": "9.1.1", + "resolved": "https://registry.npmjs.org/@types/mocha/-/mocha-9.1.1.tgz", + "integrity": "sha512-Z61JK7DKDtdKTWwLeElSEBcWGRLY8g95ic5FoQqI9CMx0ns/Ghep3B4DfcEimiKMvtamNVULVNKEsiwV3aQmXw==", "dev": true }, "node_modules/@types/node": { - "version": "16.11.26", - "resolved": "https://registry.npmjs.org/@types/node/-/node-16.11.26.tgz", - "integrity": "sha512-GZ7bu5A6+4DtG7q9GsoHXy3ALcgeIHP4NnL0Vv2wu0uUB/yQex26v0tf6/na1mm0+bS9Uw+0DFex7aaKr2qawQ==" + "version": "16.11.43", + "resolved": "https://registry.npmjs.org/@types/node/-/node-16.11.43.tgz", + "integrity": "sha512-GqWykok+3uocgfAJM8imbozrqLnPyTrpFlrryURQlw1EesPUCx5XxTiucWDSFF9/NUEXDuD4bnvHm8xfVGWTpQ==" + }, + "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, + "dependencies": { + "@types/node": "*" + } + }, + "node_modules/@types/secp256k1": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/@types/secp256k1/-/secp256k1-4.0.3.tgz", + "integrity": "sha512-Da66lEIFeIz9ltsdMZcpQvmrmmoqrfju8pm1BH8WbYjZSwUgCwXLb9C+9XYogwBITnbsSaMdVPb2ekf7TV+03w==", + "dev": true, + "dependencies": { + "@types/node": "*" + } }, "node_modules/@types/sinon": { - "version": "10.0.11", - "resolved": "https://registry.npmjs.org/@types/sinon/-/sinon-10.0.11.tgz", - "integrity": "sha512-dmZsHlBsKUtBpHriNjlK0ndlvEh8dcb9uV9Afsbt89QIyydpC7NcR+nWlAhASfy3GHnxTl4FX/aKE7XZUt/B4g==", + "version": "10.0.12", + "resolved": "https://registry.npmjs.org/@types/sinon/-/sinon-10.0.12.tgz", + "integrity": "sha512-uWf4QJ4oky/GckJ1MYQxU52cgVDcXwBhDkpvLbi4EKoLPqLE4MOH6T/ttM33l3hi0oZ882G6oIzWv/oupRYSxQ==", "dev": true, "dependencies": { "@types/sinonjs__fake-timers": "*" @@ -983,19 +1945,19 @@ } }, "node_modules/@typescript-eslint/eslint-plugin": { - "version": "5.16.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.16.0.tgz", - "integrity": "sha512-SJoba1edXvQRMmNI505Uo4XmGbxCK9ARQpkvOd00anxzri9RNQk0DDCxD+LIl+jYhkzOJiOMMKYEHnHEODjdCw==", + "version": "5.30.5", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.30.5.tgz", + "integrity": "sha512-lftkqRoBvc28VFXEoRgyZuztyVUQ04JvUnATSPtIRFAccbXTWL6DEtXGYMcbg998kXw1NLUJm7rTQ9eUt+q6Ig==", "dev": true, "dependencies": { - "@typescript-eslint/scope-manager": "5.16.0", - "@typescript-eslint/type-utils": "5.16.0", - "@typescript-eslint/utils": "5.16.0", - "debug": "^4.3.2", + "@typescript-eslint/scope-manager": "5.30.5", + "@typescript-eslint/type-utils": "5.30.5", + "@typescript-eslint/utils": "5.30.5", + "debug": "^4.3.4", "functional-red-black-tree": "^1.0.1", - "ignore": "^5.1.8", + "ignore": "^5.2.0", "regexpp": "^3.2.0", - "semver": "^7.3.5", + "semver": "^7.3.7", "tsutils": "^3.21.0" }, "engines": { @@ -1016,15 +1978,15 @@ } }, "node_modules/@typescript-eslint/parser": { - "version": "5.16.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-5.16.0.tgz", - "integrity": "sha512-fkDq86F0zl8FicnJtdXakFs4lnuebH6ZADDw6CYQv0UZeIjHvmEw87m9/29nk2Dv5Lmdp0zQ3zDQhiMWQf/GbA==", + "version": "5.30.5", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-5.30.5.tgz", + "integrity": "sha512-zj251pcPXI8GO9NDKWWmygP6+UjwWmrdf9qMW/L/uQJBM/0XbU2inxe5io/234y/RCvwpKEYjZ6c1YrXERkK4Q==", "dev": true, "dependencies": { - "@typescript-eslint/scope-manager": "5.16.0", - "@typescript-eslint/types": "5.16.0", - "@typescript-eslint/typescript-estree": "5.16.0", - "debug": "^4.3.2" + "@typescript-eslint/scope-manager": "5.30.5", + "@typescript-eslint/types": "5.30.5", + "@typescript-eslint/typescript-estree": "5.30.5", + "debug": "^4.3.4" }, "engines": { "node": "^12.22.0 || ^14.17.0 || >=16.0.0" @@ -1043,13 +2005,13 @@ } }, "node_modules/@typescript-eslint/scope-manager": { - "version": "5.16.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-5.16.0.tgz", - "integrity": "sha512-P+Yab2Hovg8NekLIR/mOElCDPyGgFZKhGoZA901Yax6WR6HVeGLbsqJkZ+Cvk5nts/dAlFKm8PfL43UZnWdpIQ==", + "version": "5.30.5", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-5.30.5.tgz", + "integrity": "sha512-NJ6F+YHHFT/30isRe2UTmIGGAiXKckCyMnIV58cE3JkHmaD6e5zyEYm5hBDv0Wbin+IC0T1FWJpD3YqHUG/Ydg==", "dev": true, "dependencies": { - "@typescript-eslint/types": "5.16.0", - "@typescript-eslint/visitor-keys": "5.16.0" + "@typescript-eslint/types": "5.30.5", + "@typescript-eslint/visitor-keys": "5.30.5" }, "engines": { "node": "^12.22.0 || ^14.17.0 || >=16.0.0" @@ -1060,13 +2022,13 @@ } }, "node_modules/@typescript-eslint/type-utils": { - "version": "5.16.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-5.16.0.tgz", - "integrity": "sha512-SKygICv54CCRl1Vq5ewwQUJV/8padIWvPgCxlWPGO/OgQLCijY9G7lDu6H+mqfQtbzDNlVjzVWQmeqbLMBLEwQ==", + "version": "5.30.5", + "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-5.30.5.tgz", + "integrity": "sha512-k9+ejlv1GgwN1nN7XjVtyCgE0BTzhzT1YsQF0rv4Vfj2U9xnslBgMYYvcEYAFVdvhuEscELJsB7lDkN7WusErw==", "dev": true, "dependencies": { - "@typescript-eslint/utils": "5.16.0", - "debug": "^4.3.2", + "@typescript-eslint/utils": "5.30.5", + "debug": "^4.3.4", "tsutils": "^3.21.0" }, "engines": { @@ -1086,9 +2048,9 @@ } }, "node_modules/@typescript-eslint/types": { - "version": "5.16.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-5.16.0.tgz", - "integrity": "sha512-oUorOwLj/3/3p/HFwrp6m/J2VfbLC8gjW5X3awpQJ/bSG+YRGFS4dpsvtQ8T2VNveV+LflQHjlLvB6v0R87z4g==", + "version": "5.30.5", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-5.30.5.tgz", + "integrity": "sha512-kZ80w/M2AvsbRvOr3PjaNh6qEW1LFqs2pLdo2s5R38B2HYXG8Z0PP48/4+j1QHJFL3ssHIbJ4odPRS8PlHrFfw==", "dev": true, "engines": { "node": "^12.22.0 || ^14.17.0 || >=16.0.0" @@ -1099,17 +2061,17 @@ } }, "node_modules/@typescript-eslint/typescript-estree": { - "version": "5.16.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-5.16.0.tgz", - "integrity": "sha512-SE4VfbLWUZl9MR+ngLSARptUv2E8brY0luCdgmUevU6arZRY/KxYoLI/3V/yxaURR8tLRN7bmZtJdgmzLHI6pQ==", + "version": "5.30.5", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-5.30.5.tgz", + "integrity": "sha512-qGTc7QZC801kbYjAr4AgdOfnokpwStqyhSbiQvqGBLixniAKyH+ib2qXIVo4P9NgGzwyfD9I0nlJN7D91E1VpQ==", "dev": true, "dependencies": { - "@typescript-eslint/types": "5.16.0", - "@typescript-eslint/visitor-keys": "5.16.0", - "debug": "^4.3.2", - "globby": "^11.0.4", + "@typescript-eslint/types": "5.30.5", + "@typescript-eslint/visitor-keys": "5.30.5", + "debug": "^4.3.4", + "globby": "^11.1.0", "is-glob": "^4.0.3", - "semver": "^7.3.5", + "semver": "^7.3.7", "tsutils": "^3.21.0" }, "engines": { @@ -1126,15 +2088,15 @@ } }, "node_modules/@typescript-eslint/utils": { - "version": "5.16.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-5.16.0.tgz", - "integrity": "sha512-iYej2ER6AwmejLWMWzJIHy3nPJeGDuCqf8Jnb+jAQVoPpmWzwQOfa9hWVB8GIQE5gsCv/rfN4T+AYb/V06WseQ==", + "version": "5.30.5", + "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-5.30.5.tgz", + "integrity": "sha512-o4SSUH9IkuA7AYIfAvatldovurqTAHrfzPApOZvdUq01hHojZojCFXx06D/aFpKCgWbMPRdJBWAC3sWp3itwTA==", "dev": true, "dependencies": { "@types/json-schema": "^7.0.9", - "@typescript-eslint/scope-manager": "5.16.0", - "@typescript-eslint/types": "5.16.0", - "@typescript-eslint/typescript-estree": "5.16.0", + "@typescript-eslint/scope-manager": "5.30.5", + "@typescript-eslint/types": "5.30.5", + "@typescript-eslint/typescript-estree": "5.30.5", "eslint-scope": "^5.1.1", "eslint-utils": "^3.0.0" }, @@ -1150,13 +2112,13 @@ } }, "node_modules/@typescript-eslint/visitor-keys": { - "version": "5.16.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-5.16.0.tgz", - "integrity": "sha512-jqxO8msp5vZDhikTwq9ubyMHqZ67UIvawohr4qF3KhlpL7gzSjOd+8471H3nh5LyABkaI85laEKKU8SnGUK5/g==", + "version": "5.30.5", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-5.30.5.tgz", + "integrity": "sha512-D+xtGo9HUMELzWIUqcQc0p2PO4NyvTrgIOK/VnSH083+8sq0tiLozNRKuLarwHYGRuA6TVBQSuuLwJUDWd3aaA==", "dev": true, "dependencies": { - "@typescript-eslint/types": "5.16.0", - "eslint-visitor-keys": "^3.0.0" + "@typescript-eslint/types": "5.30.5", + "eslint-visitor-keys": "^3.3.0" }, "engines": { "node": "^12.22.0 || ^14.17.0 || >=16.0.0" @@ -1172,10 +2134,38 @@ "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", + "integrity": "sha512-h8lQ8tacZYnR3vNQTgibj+tODHI5/+l06Au2Pcriv/Gmet0eaj4TwWH41sO9wnHDiQsEj19q0drzdWdeAHtweg==", + "dev": true, + "dependencies": { + "event-target-shim": "^5.0.0" + }, + "engines": { + "node": ">=6.5" + } + }, + "node_modules/abstract-leveldown": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/abstract-leveldown/-/abstract-leveldown-6.3.0.tgz", + "integrity": "sha512-TU5nlYgta8YrBMNpc9FwQzRbiXsj49gsALsXadbGHt9CROPzX5fB0rWDR5mtdpOOKa5XqRFpbj1QroPAoPzVjQ==", + "dev": true, + "dependencies": { + "buffer": "^5.5.0", + "immediate": "^3.2.3", + "level-concat-iterator": "~2.0.0", + "level-supports": "~1.0.0", + "xtend": "~4.0.0" + }, + "engines": { + "node": ">=6" + } + }, "node_modules/acorn": { - "version": "8.7.0", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.7.0.tgz", - "integrity": "sha512-V/LGr1APy+PXIwKebEWrkZPwoeoF+w1jiOBUmuxuiUIaOHtob8Qc9BTrYo7VuI5fR8tqsy+buA2WFooR5olqvQ==", + "version": "8.7.1", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.7.1.tgz", + "integrity": "sha512-Xx54uLJQZ19lKygFXOWsscKUbsBZW0CPykPhVQdhIeIwrbPmJzqeASDInc8nKBnp/JT6igTs82qPXz069H8I/A==", "dev": true, "bin": { "acorn": "bin/acorn" @@ -1202,10 +2192,31 @@ "node": ">=0.4.0" } }, + "node_modules/adm-zip": { + "version": "0.4.16", + "resolved": "https://registry.npmjs.org/adm-zip/-/adm-zip-0.4.16.tgz", + "integrity": "sha512-TFi4HBKSGfIKsK5YCkKaaFG2m4PEDyViZmEwof3MTIgzimHLto6muaHVpbrljdIvIrFZzEq/p4nafOeLcYegrg==", + "dev": true, + "engines": { + "node": ">=0.3.0" + } + }, "node_modules/aes-js": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/aes-js/-/aes-js-3.1.2.tgz", - "integrity": "sha512-e5pEa2kBnBOgR4Y/p20pskXI74UEz7de8ZGVo58asOtvSVG5YAbJeELPZxOmt+Bnz3rX753YKhfIn4X4l1PPRQ==" + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/aes-js/-/aes-js-3.0.0.tgz", + "integrity": "sha512-H7wUZRn8WpTq9jocdxQ2c8x2sKo9ZVmzfRE13GiNJXfp7NcKYEdvl3vspKjXox6RIG2VtaRe4JFvxG4rqp2Zuw==" + }, + "node_modules/agent-base": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-6.0.2.tgz", + "integrity": "sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ==", + "dev": true, + "dependencies": { + "debug": "4" + }, + "engines": { + "node": ">= 6.0.0" + } }, "node_modules/aggregate-error": { "version": "3.1.0", @@ -1237,14 +2248,41 @@ } }, "node_modules/ansi-colors": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-4.1.1.tgz", - "integrity": "sha512-JoX0apGbHaUJBNl6yF+p6JAFYZ666/hhCGKN5t9QFjbJQKUU/g8MNbFDbvfrgKXvI1QpZplPOnwIo99lX/AAmA==", + "version": "4.1.3", + "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-4.1.3.tgz", + "integrity": "sha512-/6w/C21Pm1A7aZitlI5Ni/2J6FFQN8i1Cvz3kHABAAbw93v/NlvKdVOqz7CCWz/3iv/JplRSEEZ83XION15ovw==", "dev": true, "engines": { "node": ">=6" } }, + "node_modules/ansi-escapes": { + "version": "4.3.2", + "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-4.3.2.tgz", + "integrity": "sha512-gKXj5ALrKWQLsYG9jlTRmR/xKluxHV+Z9QEwNIgCfM1/uwPMCuzVVnh5mwTd+OuBZcwSIMbqssNWRm1lE51QaQ==", + "dev": true, + "dependencies": { + "type-fest": "^0.21.3" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/ansi-escapes/node_modules/type-fest": { + "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==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/ansi-regex": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", @@ -1269,6 +2307,12 @@ "url": "https://github.com/chalk/ansi-styles?sponsor=1" } }, + "node_modules/antlr4ts": { + "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==", + "dev": true + }, "node_modules/anymatch": { "version": "3.1.2", "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.2.tgz", @@ -1297,7 +2341,7 @@ "node_modules/archy": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/archy/-/archy-1.0.0.tgz", - "integrity": "sha1-+cjBN1fMHde8N5rHeyxipcKGjEA=", + "integrity": "sha512-Xg+9RwCg/0p32teKdGMPTPnVXKD0w3DfHnFTficozsAgsvq2XenPJq/MYpzzQ/v8zrOyJn6Ds39VA4JIDwFfqw==", "dev": true }, "node_modules/arg": { @@ -1313,14 +2357,14 @@ "dev": true }, "node_modules/array-includes": { - "version": "3.1.4", - "resolved": "https://registry.npmjs.org/array-includes/-/array-includes-3.1.4.tgz", - "integrity": "sha512-ZTNSQkmWumEbiHO2GF4GmWxYVTiQyJy2XOTa15sdQSrvKn7l+180egQMqlrMOUMCyLMD7pmyQe4mMDUT6Behrw==", + "version": "3.1.5", + "resolved": "https://registry.npmjs.org/array-includes/-/array-includes-3.1.5.tgz", + "integrity": "sha512-iSDYZMMyTPkiFasVqfuAQnWAYcvO/SeBSCGKePoEthjp4LEMTe4uLc7b025o4jAZpHhihh8xPo99TNWUWWkGDQ==", "dev": true, "dependencies": { "call-bind": "^1.0.2", - "define-properties": "^1.1.3", - "es-abstract": "^1.19.1", + "define-properties": "^1.1.4", + "es-abstract": "^1.19.5", "get-intrinsic": "^1.1.1", "is-string": "^1.0.7" }, @@ -1341,14 +2385,15 @@ } }, "node_modules/array.prototype.flat": { - "version": "1.2.5", - "resolved": "https://registry.npmjs.org/array.prototype.flat/-/array.prototype.flat-1.2.5.tgz", - "integrity": "sha512-KaYU+S+ndVqyUnignHftkwc58o3uVU1jzczILJ1tN2YaIZpFIKBiP/x/j97E5MVPsaCloPbqWLB/8qCTVvT2qg==", + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/array.prototype.flat/-/array.prototype.flat-1.3.0.tgz", + "integrity": "sha512-12IUEkHsAhA4DY5s0FPgNXIdc8VRSqD9Zp78a5au9abH/SOBrsp082JOWFNTjkMozh8mqcdiKuaLGhPeYztxSw==", "dev": true, "dependencies": { "call-bind": "^1.0.2", "define-properties": "^1.1.3", - "es-abstract": "^1.19.0" + "es-abstract": "^1.19.2", + "es-shim-unscopables": "^1.0.0" }, "engines": { "node": ">= 0.4" @@ -1366,6 +2411,24 @@ "node": "*" } }, + "node_modules/async": { + "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" + } + }, + "node_modules/async-eventemitter": { + "version": "0.2.4", + "resolved": "https://registry.npmjs.org/async-eventemitter/-/async-eventemitter-0.2.4.tgz", + "integrity": "sha512-pd20BwL7Yt1zwDFy+8MX8F1+WCT8aQeKj0kQnTrH9WaeRETlRamVhD0JtRPmrV4GfOJ2F9CvdQkZeZhnh2TuHw==", + "dev": true, + "dependencies": { + "async": "^2.4.0" + } + }, "node_modules/balanced-match": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", @@ -1380,6 +2443,31 @@ "safe-buffer": "^5.0.1" } }, + "node_modules/base64-js": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz", + "integrity": "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==", + "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" + } + ] + }, + "node_modules/bech32": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/bech32/-/bech32-1.1.4.tgz", + "integrity": "sha512-s0IrSOzLlbvX7yp4WBfPITzpAU8sqQcpsmwXDiKwrG4r491vwCO/XpejasRNl0piBMe/DvP4Tz0mIS/X1DPJBQ==" + }, "node_modules/binary-extensions": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.2.0.tgz", @@ -1412,11 +2500,17 @@ "node_modules/bip66": { "version": "1.1.5", "resolved": "https://registry.npmjs.org/bip66/-/bip66-1.1.5.tgz", - "integrity": "sha1-AfqHSHhcpwlV1QESF9GzE5lpyiI=", + "integrity": "sha512-nemMHz95EmS38a26XbbdxIYj5csHd3RMP3H5bwQknX0WYHF01qhpufP42mLOwVICuH2JmhIhXiWs89MfUGL7Xw==", "dependencies": { "safe-buffer": "^5.0.1" } }, + "node_modules/blakejs": { + "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": { "version": "4.12.0", "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.0.tgz", @@ -1447,7 +2541,7 @@ "node_modules/brorand": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/brorand/-/brorand-1.1.0.tgz", - "integrity": "sha1-EsJe/kCkXjwyPrhnWgoM5XsiNx8=" + "integrity": "sha512-cKV8tMCEpQs4hK/ik71d6LrPOnpkpGBR0wzxqr68g2m/LB2GxVYQroAjMJZRVM1Y4BCjCKc3vAamxSzOY2RP+w==" }, "node_modules/browser-stdout": { "version": "1.3.1", @@ -1468,10 +2562,15 @@ "safe-buffer": "^5.0.1" } }, + "node_modules/browserify-aes/node_modules/buffer-xor": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/buffer-xor/-/buffer-xor-1.0.3.tgz", + "integrity": "sha512-571s0T7nZWK6vB67HI5dyUF7wXiNcfaPPPTl6zYCNApANjIvYJTg7hlud/+cJpdAhS7dVzqMLmfhfHR3rAcOjQ==" + }, "node_modules/browserslist": { - "version": "4.20.2", - "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.20.2.tgz", - "integrity": "sha512-CQOBCqp/9pDvDbx3xfMi+86pr4KXIf2FDkTTdeuYw8OxS9t898LA1Khq57gtufFILXpfgsSx5woNgsBgvGjpsA==", + "version": "4.21.1", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.21.1.tgz", + "integrity": "sha512-Nq8MFCSrnJXSc88yliwlzQe3qNe3VntIjhsArW9IJOEPSHNx23FalwApUVbzAWABLhYJJ7y8AynWI/XM8OdfjQ==", "dev": true, "funding": [ { @@ -1484,11 +2583,10 @@ } ], "dependencies": { - "caniuse-lite": "^1.0.30001317", - "electron-to-chromium": "^1.4.84", - "escalade": "^3.1.1", - "node-releases": "^2.0.2", - "picocolors": "^1.0.0" + "caniuse-lite": "^1.0.30001359", + "electron-to-chromium": "^1.4.172", + "node-releases": "^2.0.5", + "update-browserslist-db": "^1.0.4" }, "bin": { "browserslist": "cli.js" @@ -1500,7 +2598,7 @@ "node_modules/bs58": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/bs58/-/bs58-4.0.1.tgz", - "integrity": "sha1-vhYedsNU9veIrkBx9j806MTwpCo=", + "integrity": "sha512-Ok3Wdf5vOIlBrgCvTq96gBkJw+JUEzdBgyaza5HLtPm7yTHkjRy8+JzNyHF7BHa0bNWOQIp3m5YF0nnFcOIKLw==", "dependencies": { "base-x": "^3.0.2" } @@ -1515,6 +2613,30 @@ "safe-buffer": "^5.1.2" } }, + "node_modules/buffer": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/buffer/-/buffer-5.7.1.tgz", + "integrity": "sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ==", + "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" + } + ], + "dependencies": { + "base64-js": "^1.3.1", + "ieee754": "^1.1.13" + } + }, "node_modules/buffer-from": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.2.tgz", @@ -1522,9 +2644,13 @@ "dev": true }, "node_modules/buffer-xor": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/buffer-xor/-/buffer-xor-1.0.3.tgz", - "integrity": "sha1-JuYe0UIvtw3ULm42cp7VHYVf6Nk=" + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/buffer-xor/-/buffer-xor-2.0.2.tgz", + "integrity": "sha512-eHslX0bin3GB+Lx2p7lEYRShRewuNZL3fUl4qlVJGGiwoPGftmt8JQgk2Y9Ji5/01TnVDo33E5b5O3vUB1HdqQ==", + "dev": true, + "dependencies": { + "safe-buffer": "^5.1.1" + } }, "node_modules/bufferutil": { "version": "4.0.6", @@ -1538,6 +2664,15 @@ "node": ">=6.14.2" } }, + "node_modules/bytes": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.2.tgz", + "integrity": "sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg==", + "dev": true, + "engines": { + "node": ">= 0.8" + } + }, "node_modules/caching-transform": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/caching-transform/-/caching-transform-4.0.0.tgz", @@ -1585,9 +2720,9 @@ } }, "node_modules/caniuse-lite": { - "version": "1.0.30001320", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001320.tgz", - "integrity": "sha512-MWPzG54AGdo3nWx7zHZTefseM5Y1ccM7hlQKHRqJkPozUaw3hNbBTMmLn16GG2FUzjR13Cr3NPfhIieX5PzXDA==", + "version": "1.0.30001363", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001363.tgz", + "integrity": "sha512-HpQhpzTGGPVMnCjIomjt+jvyUu8vNFo3TaDiZ/RcoTrlOq/5+tC8zHdsbgFB6MxmaY+jCpsH09aD80Bb4Ow3Sg==", "dev": true, "funding": [ { @@ -1649,7 +2784,7 @@ "node_modules/check-error": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/check-error/-/check-error-1.0.2.tgz", - "integrity": "sha1-V00xLt2Iu13YkS6Sht1sCu1KrII=", + "integrity": "sha512-BrgHpW9NURQgzoNyjfq0Wu6VFO6D7IZEmJNdtgNqpzGG8RuNFHt2jQxWlAs4HMe119chBnv+34syEZtc6IhLtA==", "dev": true, "engines": { "node": "*" @@ -1694,6 +2829,12 @@ "node": ">= 6" } }, + "node_modules/ci-info": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-2.0.0.tgz", + "integrity": "sha512-5tK7EtrZ0N+OLFMthtqOj4fI2Jeb88C4CAZPu25LDVUgXJ0A3Js4PMGqrn0JU1W0Mh1/Z8wZzYPxqUrXeBboCQ==", + "dev": true + }, "node_modules/cipher-base": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/cipher-base/-/cipher-base-1.0.4.tgz", @@ -1741,16 +2882,28 @@ "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", "dev": true }, + "node_modules/command-exists": { + "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==", + "dev": true + }, + "node_modules/commander": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/commander/-/commander-3.0.2.tgz", + "integrity": "sha512-Gar0ASD4BDyKC4hl4DwHqDrmvjoxWKZigVnAbn5H1owvm4CxCPdb0HQDehwNYMJpla5+M2tPmPARzhtYuwpHow==", + "dev": true + }, "node_modules/commondir": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/commondir/-/commondir-1.0.1.tgz", - "integrity": "sha1-3dgA2gxmEnOTzKWVDqloo6rxJTs=", + "integrity": "sha512-W9pAhw0ja1Edb5GVdIF1mjZw/ASI0AlShXM83UUGe2DVr5TdAPEA1OA8m/g8zWp9x6On7gqufY+FatDbC3MDQg==", "dev": true }, "node_modules/concat-map": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", - "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", + "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==", "dev": true }, "node_modules/concat-stream": { @@ -1771,7 +2924,7 @@ "node_modules/concat-stream/node_modules/isarray": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", + "integrity": "sha512-VLghIWNM6ELQzo7zwmcg0NmTVyWKYjvIeM83yjp0wRDTmUnrM678fQbcKBo6n2CJEF0szoG//ytg+TKla89ALQ==", "dev": true }, "node_modules/concat-stream/node_modules/readable-stream": { @@ -1819,12 +2972,44 @@ "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", "dev": true }, + "node_modules/cookie": { + "version": "0.4.2", + "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.4.2.tgz", + "integrity": "sha512-aSWTXFzaKWkvHO1Ny/s+ePFpvKsPnjc551iI41v3ny/ow6tBG5Vd+FuqGNhh1LxOmVzOlGUriIlOaokOvhaStA==", + "dev": true, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/core-js-pure": { + "version": "3.23.3", + "resolved": "https://registry.npmjs.org/core-js-pure/-/core-js-pure-3.23.3.tgz", + "integrity": "sha512-XpoouuqIj4P+GWtdyV8ZO3/u4KftkeDVMfvp+308eGMhCrA3lVDSmAxO0c6GGOcmgVlaKDrgWVMo49h2ab/TDA==", + "dev": true, + "hasInstallScript": true, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/core-js" + } + }, "node_modules/core-util-is": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.3.tgz", "integrity": "sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==", "dev": true }, + "node_modules/crc-32": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/crc-32/-/crc-32-1.2.2.tgz", + "integrity": "sha512-ROmzCKrTnOwybPcJApAA6WBWij23HVfGVNKqqrZpuyZOHqK2CwHSvpGuyt/UNNvaIjEd8X5IFGp4Mh+Ie1IHJQ==", + "dev": true, + "bin": { + "crc32": "bin/crc32.njs" + }, + "engines": { + "node": ">=0.8" + } + }, "node_modules/create-hash": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/create-hash/-/create-hash-1.2.0.tgz", @@ -1907,7 +3092,7 @@ "node_modules/decamelize": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz", - "integrity": "sha1-9lNNFRSCabIDUue+4m9QH5oZEpA=", + "integrity": "sha512-z2S+W9X73hAUUki+N+9Za2lBlun89zigOyGrsax+KUQ6wKW4ZoWpEYBkGhQjwAjjDCkWxhY0VKEhk8wzY7F5cA==", "dev": true, "engines": { "node": ">=0.10.0" @@ -1943,16 +3128,58 @@ "node": ">=8" } }, + "node_modules/deferred-leveldown": { + "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==", + "dev": true, + "dependencies": { + "abstract-leveldown": "~6.2.1", + "inherits": "^2.0.3" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/deferred-leveldown/node_modules/abstract-leveldown": { + "version": "6.2.3", + "resolved": "https://registry.npmjs.org/abstract-leveldown/-/abstract-leveldown-6.2.3.tgz", + "integrity": "sha512-BsLm5vFMRUrrLeCcRc+G0t2qOaTzpoJQLOubq2XM72eNpjF5UdU5o/5NvlNhx95XHcAvcl8OMXr4mlg/fRgUXQ==", + "dev": true, + "dependencies": { + "buffer": "^5.5.0", + "immediate": "^3.2.3", + "level-concat-iterator": "~2.0.0", + "level-supports": "~1.0.0", + "xtend": "~4.0.0" + }, + "engines": { + "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==", + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.1.4.tgz", + "integrity": "sha512-uckOqKcfaVvtBdsVkdPv3XjveQJsNQqmhXgRi8uhvWWuPYZCNlzT8qAyblUgNoXdHdjMTzAqeGjAoli8f+bzPA==", + "dev": true, + "dependencies": { + "has-property-descriptors": "^1.0.0", + "object-keys": "^1.1.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/depd": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/depd/-/depd-2.0.0.tgz", + "integrity": "sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==", "dev": true, - "dependencies": { - "object-keys": "^1.0.12" - }, "engines": { - "node": ">= 0.4" + "node": ">= 0.8" } }, "node_modules/diff": { @@ -1989,9 +3216,9 @@ } }, "node_modules/dotenv": { - "version": "16.0.0", - "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-16.0.0.tgz", - "integrity": "sha512-qD9WU0MPM4SWLPJy/r2Be+2WgQj8plChsyrCNQzW/0WjvcJQiKQJ9mH3ZgB3fxbUUxgc/11ZJ0Fi5KiimWGz2Q==", + "version": "16.0.1", + "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-16.0.1.tgz", + "integrity": "sha512-1K6hR6wtk2FviQ4kEiSjFiH5rpzEVi8WW0x96aztHVMhEspNpc4DVOUTEHtEva5VThQ8IaBX1Pe4gSzpVVUsKQ==", "dev": true, "engines": { "node": ">=12" @@ -2000,7 +3227,7 @@ "node_modules/drbg.js": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/drbg.js/-/drbg.js-1.0.1.tgz", - "integrity": "sha1-Pja2xCs3BDgjzbwzLVjzHiRFSAs=", + "integrity": "sha512-F4wZ06PvqxYLFEZKkFxTDcns9oFNk34hvmJSEwdzsxVQ8YI5YaxtACgQatkYgv2VI2CFkUd2Y+xosPQnHv809g==", "dependencies": { "browserify-aes": "^1.0.6", "create-hash": "^1.1.2", @@ -2011,9 +3238,9 @@ } }, "node_modules/electron-to-chromium": { - "version": "1.4.92", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.92.tgz", - "integrity": "sha512-YAVbvQIcDE/IJ/vzDMjD484/hsRbFPW2qXJPaYTfOhtligmfYEYOep+5QojpaEU9kq6bMvNeC2aG7arYvTHYsA==", + "version": "1.4.182", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.182.tgz", + "integrity": "sha512-OpEjTADzGoXABjqobGhpy0D2YsTncAax7IkER68ycc4adaq0dqEG9//9aenKPy7BGA90bqQdLac0dPp6uMkcSg==", "dev": true }, "node_modules/elliptic": { @@ -2036,32 +3263,83 @@ "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", "dev": true }, + "node_modules/encoding-down": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/encoding-down/-/encoding-down-6.3.0.tgz", + "integrity": "sha512-QKrV0iKR6MZVJV08QY0wp1e7vF6QbhnbQhb07bwpEyuz4uZiZgPlEGdkCROuFkUwdxlFaiPIhjyarH1ee/3vhw==", + "dev": true, + "dependencies": { + "abstract-leveldown": "^6.2.1", + "inherits": "^2.0.3", + "level-codec": "^9.0.0", + "level-errors": "^2.0.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/enquirer": { + "version": "2.3.6", + "resolved": "https://registry.npmjs.org/enquirer/-/enquirer-2.3.6.tgz", + "integrity": "sha512-yjNnPr315/FjS4zIsUxYguYUPP2e1NK4d7E7ZOLiyYCcbFBiTMyID+2wvm2w6+pZ/odMA7cRkjhsPbltwBOrLg==", + "dev": true, + "dependencies": { + "ansi-colors": "^4.1.1" + }, + "engines": { + "node": ">=8.6" + } + }, + "node_modules/env-paths": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/env-paths/-/env-paths-2.2.1.tgz", + "integrity": "sha512-+h1lkLKhZMTYjog1VEpJNG7NZJWcuc2DDk/qsqSTRRCOXiLjeQ1d1/udrUGhqMxUgAlwKNZ0cf2uqan5GLuS2A==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/errno": { + "version": "0.1.8", + "resolved": "https://registry.npmjs.org/errno/-/errno-0.1.8.tgz", + "integrity": "sha512-dJ6oBr5SQ1VSd9qkk7ByRgb/1SH4JZjCHSW/mr63/QcXO9zLVxvJ6Oy13nio03rxpSnVDDjFor75SjVeZWPW/A==", + "dev": true, + "dependencies": { + "prr": "~1.0.1" + }, + "bin": { + "errno": "cli.js" + } + }, "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==", + "version": "1.20.1", + "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.20.1.tgz", + "integrity": "sha512-WEm2oBhfoI2sImeM4OF2zE2V3BYdSF+KnSi9Sidz51fQHd7+JuF8Xgcj9/0o+OWeIeIS/MiuNnlruQrJf16GQA==", "dev": true, "dependencies": { "call-bind": "^1.0.2", "es-to-primitive": "^1.2.1", "function-bind": "^1.1.1", + "function.prototype.name": "^1.1.5", "get-intrinsic": "^1.1.1", "get-symbol-description": "^1.0.0", "has": "^1.0.3", - "has-symbols": "^1.0.2", + "has-property-descriptors": "^1.0.0", + "has-symbols": "^1.0.3", "internal-slot": "^1.0.3", "is-callable": "^1.2.4", - "is-negative-zero": "^2.0.1", + "is-negative-zero": "^2.0.2", "is-regex": "^1.1.4", - "is-shared-array-buffer": "^1.0.1", + "is-shared-array-buffer": "^1.0.2", "is-string": "^1.0.7", - "is-weakref": "^1.0.1", - "object-inspect": "^1.11.0", + "is-weakref": "^1.0.2", + "object-inspect": "^1.12.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" + "regexp.prototype.flags": "^1.4.3", + "string.prototype.trimend": "^1.0.5", + "string.prototype.trimstart": "^1.0.5", + "unbox-primitive": "^1.0.2" }, "engines": { "node": ">= 0.4" @@ -2070,6 +3348,15 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/es-shim-unscopables": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/es-shim-unscopables/-/es-shim-unscopables-1.0.0.tgz", + "integrity": "sha512-Jm6GPcCdC30eMLbZ2x8z2WuRwAws3zTBBKuusffYVUrNj/GVSUAZ+xKMaUpfNDR5IbyNA5LJbaecoUVbmUcB1w==", + "dev": true, + "dependencies": { + "has": "^1.0.3" + } + }, "node_modules/es-to-primitive": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/es-to-primitive/-/es-to-primitive-1.2.1.tgz", @@ -2088,9 +3375,9 @@ } }, "node_modules/es5-ext": { - "version": "0.10.59", - "resolved": "https://registry.npmjs.org/es5-ext/-/es5-ext-0.10.59.tgz", - "integrity": "sha512-cOgyhW0tIJyQY1Kfw6Kr0viu9ZlUctVchRMZ7R0HiH3dxTSp5zJDLecwxUqPUrGKMsgBI1wd1FL+d9Jxfi4cLw==", + "version": "0.10.61", + "resolved": "https://registry.npmjs.org/es5-ext/-/es5-ext-0.10.61.tgz", + "integrity": "sha512-yFhIqQAzu2Ca2I4SE2Au3rxVfmohU9Y7wqGR+s7+H7krk26NXhIRAZDgqd6xqjCEFUomDEA3/Bo/7fKmIkW1kA==", "hasInstallScript": true, "dependencies": { "es6-iterator": "^2.0.3", @@ -2110,7 +3397,7 @@ "node_modules/es6-iterator": { "version": "2.0.3", "resolved": "https://registry.npmjs.org/es6-iterator/-/es6-iterator-2.0.3.tgz", - "integrity": "sha1-p96IkUGgWpSwhUQDstCg+/qY87c=", + "integrity": "sha512-zw4SRzoUkd+cl+ZoE15A9o1oQd920Bb0iOJMQkQhl3jNc03YqVjAhG7scf9C5KWRU/R13Orf588uCC6525o02g==", "dependencies": { "d": "1", "es5-ext": "^0.10.35", @@ -2148,12 +3435,12 @@ } }, "node_modules/eslint": { - "version": "8.11.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.11.0.tgz", - "integrity": "sha512-/KRpd9mIRg2raGxHRGwW9ZywYNAClZrHjdueHcrVDuO3a6bj83eoTirCCk0M0yPwOjWYKHwRVRid+xK4F/GHgA==", + "version": "8.19.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.19.0.tgz", + "integrity": "sha512-SXOPj3x9VKvPe81TjjUJCYlV4oJjQw68Uek+AM0X4p+33dj2HY5bpTZOgnQHcG2eAm1mtCU9uNMnJi7exU/kYw==", "dev": true, "dependencies": { - "@eslint/eslintrc": "^1.2.1", + "@eslint/eslintrc": "^1.3.0", "@humanwhocodes/config-array": "^0.9.2", "ajv": "^6.10.0", "chalk": "^4.0.0", @@ -2164,14 +3451,14 @@ "eslint-scope": "^7.1.1", "eslint-utils": "^3.0.0", "eslint-visitor-keys": "^3.3.0", - "espree": "^9.3.1", + "espree": "^9.3.2", "esquery": "^1.4.0", "esutils": "^2.0.2", "fast-deep-equal": "^3.1.3", "file-entry-cache": "^6.0.1", "functional-red-black-tree": "^1.0.1", "glob-parent": "^6.0.1", - "globals": "^13.6.0", + "globals": "^13.15.0", "ignore": "^5.2.0", "import-fresh": "^3.0.0", "imurmurhash": "^0.1.4", @@ -2180,7 +3467,7 @@ "json-stable-stringify-without-jsonify": "^1.0.1", "levn": "^0.4.1", "lodash.merge": "^4.6.2", - "minimatch": "^3.0.4", + "minimatch": "^3.1.2", "natural-compare": "^1.4.0", "optionator": "^0.9.1", "regexpp": "^3.2.0", @@ -2253,9 +3540,9 @@ } }, "node_modules/eslint-plugin-import": { - "version": "2.25.4", - "resolved": "https://registry.npmjs.org/eslint-plugin-import/-/eslint-plugin-import-2.25.4.tgz", - "integrity": "sha512-/KJBASVFxpu0xg1kIBn9AUa8hQVnszpwgE7Ld0lKAlx7Ie87yzEzCgSkekt+le/YVhiaosO4Y14GDAOc41nfxA==", + "version": "2.26.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-import/-/eslint-plugin-import-2.26.0.tgz", + "integrity": "sha512-hYfi3FXaM8WPLf4S1cikh/r4IxnO6zrhZbEGz2b660EJRbuxgpDS5gkCuYgGWg2xxh2rBuIr4Pvhve/7c31koA==", "dev": true, "dependencies": { "array-includes": "^3.1.4", @@ -2263,14 +3550,14 @@ "debug": "^2.6.9", "doctrine": "^2.1.0", "eslint-import-resolver-node": "^0.3.6", - "eslint-module-utils": "^2.7.2", + "eslint-module-utils": "^2.7.3", "has": "^1.0.3", - "is-core-module": "^2.8.0", + "is-core-module": "^2.8.1", "is-glob": "^4.0.3", - "minimatch": "^3.0.4", + "minimatch": "^3.1.2", "object.values": "^1.1.5", - "resolve": "^1.20.0", - "tsconfig-paths": "^3.12.0" + "resolve": "^1.22.0", + "tsconfig-paths": "^3.14.1" }, "engines": { "node": ">=4" @@ -2303,19 +3590,19 @@ "node_modules/eslint-plugin-import/node_modules/ms": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", + "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==", "dev": true }, "node_modules/eslint-plugin-prettier": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/eslint-plugin-prettier/-/eslint-plugin-prettier-4.0.0.tgz", - "integrity": "sha512-98MqmCJ7vJodoQK359bqQWaxOE0CS8paAz/GgjaZLyex4TTk3g9HugoO89EqWCrFiOqn9EVvcoo7gZzONCWVwQ==", + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/eslint-plugin-prettier/-/eslint-plugin-prettier-4.2.1.tgz", + "integrity": "sha512-f/0rXLXUt0oFYs8ra4w49wYZBG5GKZpAYsJSm6rnYL5uVDjd+zowwMwVZHnAjf4edNrKpCDYfXDgmRE/Ak7QyQ==", "dev": true, "dependencies": { "prettier-linter-helpers": "^1.0.0" }, "engines": { - "node": ">=6.0.0" + "node": ">=12.0.0" }, "peerDependencies": { "eslint": ">=7.28.0", @@ -2399,13 +3686,13 @@ } }, "node_modules/espree": { - "version": "9.3.1", - "resolved": "https://registry.npmjs.org/espree/-/espree-9.3.1.tgz", - "integrity": "sha512-bvdyLmJMfwkV3NCRl5ZhJf22zBFo1y8bYh3VYb+bfzqNB4Je68P2sSuXyuFquzWLebHpNd2/d5uv7yoP9ISnGQ==", + "version": "9.3.2", + "resolved": "https://registry.npmjs.org/espree/-/espree-9.3.2.tgz", + "integrity": "sha512-D211tC7ZwouTIuY5x9XnS0E9sWNChB7IYKX/Xp5eQj3nFXhqmiUDB9q27y76oFl8jTg3pXcQx/bpxMfs3CIZbA==", "dev": true, "dependencies": { - "acorn": "^8.7.0", - "acorn-jsx": "^5.3.1", + "acorn": "^8.7.1", + "acorn-jsx": "^5.3.2", "eslint-visitor-keys": "^3.3.0" }, "engines": { @@ -2485,6 +3772,108 @@ "node": ">=0.10.0" } }, + "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, + "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" + } + }, + "node_modules/ethereumjs-abi": { + "version": "0.6.8", + "resolved": "https://registry.npmjs.org/ethereumjs-abi/-/ethereumjs-abi-0.6.8.tgz", + "integrity": "sha512-Tx0r/iXI6r+lRsdvkFDlut0N08jWMnKRZ6Gkq+Nmw75lZe4e6o3EkSnkaBP5NF6+m5PTGAr9JP43N3LyeoglsA==", + "dev": true, + "dependencies": { + "bn.js": "^4.11.8", + "ethereumjs-util": "^6.0.0" + } + }, + "node_modules/ethereumjs-abi/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/ethereumjs-util": { + "version": "7.1.5", + "resolved": "https://registry.npmjs.org/ethereumjs-util/-/ethereumjs-util-7.1.5.tgz", + "integrity": "sha512-SDl5kKrQAudFBUe5OJM9Ac6WmMyYmXX/6sTmLZ3ffG2eY6ZIGBes3pEDxNN6V72WyOw4CPD5RomKdsa8DAAwLg==", + "dev": true, + "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" + }, + "engines": { + "node": ">=10.0.0" + } + }, + "node_modules/ethereumjs-util/node_modules/@types/bn.js": { + "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==", + "dev": true, + "dependencies": { + "@types/node": "*" + } + }, + "node_modules/ethereumjs-util/node_modules/bn.js": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-5.2.1.tgz", + "integrity": "sha512-eXRvHzWyYPBuB4NBy0cmYQjGitUrtqwbvlzP3G6VFnNRbsZQIxQ10PbKKHt8gZ/HW/D/747aDl+QkDqg3KQLMQ==", + "dev": true + }, + "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, + "dependencies": { + "is-hex-prefixed": "1.0.0", + "strip-hex-prefix": "1.0.0" + }, + "engines": { + "node": ">=6.5.0", + "npm": ">=3" + } + }, + "node_modules/event-target-shim": { + "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==", + "dev": true, + "engines": { + "node": ">=6" + } + }, "node_modules/evp_bytestokey": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/evp_bytestokey/-/evp_bytestokey-1.0.3.tgz", @@ -2556,7 +3945,7 @@ "node_modules/fast-levenshtein": { "version": "2.0.6", "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", - "integrity": "sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc=", + "integrity": "sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==", "dev": true }, "node_modules/fastq": { @@ -2617,7 +4006,7 @@ "node_modules/find-up": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/find-up/-/find-up-2.1.0.tgz", - "integrity": "sha1-RdG35QbHF93UgndaK3eSCjwMV6c=", + "integrity": "sha512-NWzkk0jSJtTt08+FBFMvXoeZnOJD+jTtsRmBYbAIzJdX6l7dLgR7CTubCM5/eDdPUBvLCeVasP1brfVR/9/EZQ==", "dev": true, "dependencies": { "locate-path": "^2.0.0" @@ -2649,11 +4038,31 @@ } }, "node_modules/flatted": { - "version": "3.2.5", - "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.2.5.tgz", - "integrity": "sha512-WIWGi2L3DyTUvUrwRKgGi9TwxQMUEqPOPQBVi71R96jZXJdFskXEmf54BoZaS1kknGODoIGASGEzBUYdyMCBJg==", + "version": "3.2.6", + "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.2.6.tgz", + "integrity": "sha512-0sQoMh9s0BYsm+12Huy/rkKxVu4R1+r96YX5cG44rHV0pQ6iC3Q+mkoMFaGWObMFYQxCVT+ssG1ksneA2MI9KQ==", "dev": true }, + "node_modules/follow-redirects": { + "version": "1.15.1", + "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.1.tgz", + "integrity": "sha512-yLAMQs+k0b2m7cVxpS1VKJVvoz7SS9Td1zss3XRwXj+ZDH00RJgnuLx7E44wx02kQLrdM3aOOy+FpzS7+8OizA==", + "dev": true, + "funding": [ + { + "type": "individual", + "url": "https://github.com/sponsors/RubenVerborgh" + } + ], + "engines": { + "node": ">=4.0" + }, + "peerDependenciesMeta": { + "debug": { + "optional": true + } + } + }, "node_modules/foreground-child": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/foreground-child/-/foreground-child-2.0.0.tgz", @@ -2667,6 +4076,12 @@ "node": ">=8.0.0" } }, + "node_modules/fp-ts": { + "version": "1.19.3", + "resolved": "https://registry.npmjs.org/fp-ts/-/fp-ts-1.19.3.tgz", + "integrity": "sha512-H5KQDspykdHuztLTg+ajGN0Z2qUjcEf3Ybxc6hLt0k7/zPkn29XnKnxlBPyW2XIddWrGaJBzBl4VLYOtk39yZg==", + "dev": true + }, "node_modules/fromentries": { "version": "1.3.2", "resolved": "https://registry.npmjs.org/fromentries/-/fromentries-1.3.2.tgz", @@ -2687,10 +4102,24 @@ } ] }, + "node_modules/fs-extra": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-7.0.1.tgz", + "integrity": "sha512-YJDaCJZEnBmcbw13fvdAM9AwNOJwOzrE4pqMqBq5nFiEqXUqHwlK4B+3pUw6JNvfSPtX05xFHtYy/1ni01eGCw==", + "dev": true, + "dependencies": { + "graceful-fs": "^4.1.2", + "jsonfile": "^4.0.0", + "universalify": "^0.1.0" + }, + "engines": { + "node": ">=6 <7 || >=8" + } + }, "node_modules/fs.realpath": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", - "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", + "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==", "dev": true }, "node_modules/fsevents": { @@ -2713,12 +4142,39 @@ "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==", "dev": true }, + "node_modules/function.prototype.name": { + "version": "1.1.5", + "resolved": "https://registry.npmjs.org/function.prototype.name/-/function.prototype.name-1.1.5.tgz", + "integrity": "sha512-uN7m/BzVKQnCUF/iW8jYea67v++2u7m5UgENbHRtdDVclOUP+FMPlCNdmk0h/ysGyo2tavMJEDqJAkJdRa1vMA==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.2", + "define-properties": "^1.1.3", + "es-abstract": "^1.19.0", + "functions-have-names": "^1.2.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/functional-red-black-tree": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz", - "integrity": "sha1-GwqzvVU7Kg1jmdKcDj6gslIHgyc=", + "integrity": "sha512-dsKNQNdj6xA3T+QlADDA7mOSlX0qiMINjn0cgr+eGHGsbSHzTabcIogz2+p/iqP1Xs6EP/sS2SbqH+brGTbq0g==", "dev": true }, + "node_modules/functions-have-names": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/functions-have-names/-/functions-have-names-1.2.3.tgz", + "integrity": "sha512-xckBUXyTIqT97tq2x2AMb+g163b5JFysYk0x4qxNFwbfQkmNZoiRHb6sPzI9/QV33WeuvVYBUIiD4NzNIyqaRQ==", + "dev": true, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/gensync": { "version": "1.0.0-beta.2", "resolved": "https://registry.npmjs.org/gensync/-/gensync-1.0.0-beta.2.tgz", @@ -2740,21 +4196,21 @@ "node_modules/get-func-name": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/get-func-name/-/get-func-name-2.0.0.tgz", - "integrity": "sha1-6td0q+5y4gQJQzoGY2YCPdaIekE=", + "integrity": "sha512-Hm0ixYtaSZ/V7C8FJrtZIuBBI+iSgL+1Aq82zSu8VQNB4S3Gk8e7Qs3VwBDJAhmRZcFqkl3tQu36g/Foh5I5ig==", "dev": true, "engines": { "node": "*" } }, "node_modules/get-intrinsic": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.1.1.tgz", - "integrity": "sha512-kWZrnVM42QCiEA2Ig1bG8zjoIMOgxWwYCEeNdwY6Tv/cOSeGpcoX4pXHfKUxNKVoArnrEr2e9srnAxxGIraS9Q==", + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.1.2.tgz", + "integrity": "sha512-Jfm3OyCxHh9DJyc28qGk+JmfkpO41A4XkneDSujN9MDXrm4oDKdHvndhZ2dN94+ERNfkYJWDclW6k2L/ZGHjXA==", "dev": true, "dependencies": { "function-bind": "^1.1.1", "has": "^1.0.3", - "has-symbols": "^1.0.1" + "has-symbols": "^1.0.3" }, "funding": { "url": "https://github.com/sponsors/ljharb" @@ -2810,61 +4266,245 @@ "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-6.0.2.tgz", "integrity": "sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==", "dev": true, - "dependencies": { - "is-glob": "^4.0.3" - }, + "dependencies": { + "is-glob": "^4.0.3" + }, + "engines": { + "node": ">=10.13.0" + } + }, + "node_modules/globals": { + "version": "13.16.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-13.16.0.tgz", + "integrity": "sha512-A1lrQfpNF+McdPOnnFqY3kSN0AFTy485bTi1bkLk4mVPODIUEcSfhHgRqA+QdXPksrSTTztYXx37NFV+GpGk3Q==", + "dev": true, + "dependencies": { + "type-fest": "^0.20.2" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/globby": { + "version": "11.1.0", + "resolved": "https://registry.npmjs.org/globby/-/globby-11.1.0.tgz", + "integrity": "sha512-jhIXaOzy1sb8IyocaruWSn1TjmnBVs8Ayhcy83rmxNJ8q2uWKCAj3CnJY+KpGSXCueAPc0i05kVvVKtP1t9S3g==", + "dev": true, + "dependencies": { + "array-union": "^2.1.0", + "dir-glob": "^3.0.1", + "fast-glob": "^3.2.9", + "ignore": "^5.2.0", + "merge2": "^1.4.1", + "slash": "^3.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/graceful-fs": { + "version": "4.2.10", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.10.tgz", + "integrity": "sha512-9ByhssR2fPVsNZj478qUUbKfmL0+t5BDVyjShtyZZLiK7ZDAArFFfopyOTj0M05wE2tJPisA4iTnnXl2YoPvOA==", + "dev": true + }, + "node_modules/growl": { + "version": "1.10.5", + "resolved": "https://registry.npmjs.org/growl/-/growl-1.10.5.tgz", + "integrity": "sha512-qBr4OuELkhPenW6goKVXiv47US3clb3/IbuWF9KNKEijAy9oeHxU9IgzjvJhHkUzhaj7rOUD7+YGWqUjLp5oSA==", + "dev": true, + "engines": { + "node": ">=4.x" + } + }, + "node_modules/hardhat": { + "version": "2.9.9", + "resolved": "https://registry.npmjs.org/hardhat/-/hardhat-2.9.9.tgz", + "integrity": "sha512-Qv7SXnRc0zq1kGXruNnSKpP3eFccXMR5Qv6GVX9hBIJ5efN0PflKPq92aQ5Cv3jrjJeRevLznWZVz7bttXhVfw==", + "dev": true, + "dependencies": { + "@ethereumjs/block": "^3.6.2", + "@ethereumjs/blockchain": "^5.5.2", + "@ethereumjs/common": "^2.6.4", + "@ethereumjs/tx": "^3.5.1", + "@ethereumjs/vm": "^5.9.0", + "@ethersproject/abi": "^5.1.2", + "@metamask/eth-sig-util": "^4.0.0", + "@sentry/node": "^5.18.1", + "@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", + "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.4", + "find-up": "^2.1.0", + "fp-ts": "1.19.3", + "fs-extra": "^7.0.1", + "glob": "7.2.0", + "immutable": "^4.0.0-rc.12", + "io-ts": "1.10.4", + "lodash": "^4.17.11", + "merkle-patricia-tree": "^4.2.4", + "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", + "undici": "^5.4.0", + "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" + }, + "peerDependencies": { + "ts-node": "*", + "typescript": "*" + }, + "peerDependenciesMeta": { + "ts-node": { + "optional": true + }, + "typescript": { + "optional": true + } + } + }, + "node_modules/hardhat/node_modules/@types/bn.js": { + "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==", + "dev": true, + "dependencies": { + "@types/node": "*" + } + }, + "node_modules/hardhat/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/hardhat/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==", + "dev": true, + "dependencies": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/hardhat/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/hardhat/node_modules/color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==", + "dev": true + }, + "node_modules/hardhat/node_modules/escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", + "dev": true, + "engines": { + "node": ">=0.8.0" + } + }, + "node_modules/hardhat/node_modules/has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", + "dev": true, "engines": { - "node": ">=10.13.0" + "node": ">=4" } }, - "node_modules/globals": { - "version": "13.13.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-13.13.0.tgz", - "integrity": "sha512-EQ7Q18AJlPwp3vUDL4mKA0KXrXyNIQyWon6T6XQiBQF0XHvRsiCSrWmmeATpUzdJN2HhWZU6Pdl0a9zdep5p6A==", + "node_modules/hardhat/node_modules/resolve": { + "version": "1.17.0", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.17.0.tgz", + "integrity": "sha512-ic+7JYiV8Vi2yzQGFWOkiZD5Z9z7O2Zhm9XMaTxdJExKasieFCr+yXZ/WmXsckHiKl12ar0y6XiXDx3m4RHn1w==", "dev": true, "dependencies": { - "type-fest": "^0.20.2" - }, - "engines": { - "node": ">=8" + "path-parse": "^1.0.6" }, "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/globby": { - "version": "11.1.0", - "resolved": "https://registry.npmjs.org/globby/-/globby-11.1.0.tgz", - "integrity": "sha512-jhIXaOzy1sb8IyocaruWSn1TjmnBVs8Ayhcy83rmxNJ8q2uWKCAj3CnJY+KpGSXCueAPc0i05kVvVKtP1t9S3g==", + "node_modules/hardhat/node_modules/semver": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "dev": true, + "bin": { + "semver": "bin/semver.js" + } + }, + "node_modules/hardhat/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": { - "array-union": "^2.1.0", - "dir-glob": "^3.0.1", - "fast-glob": "^3.2.9", - "ignore": "^5.2.0", - "merge2": "^1.4.1", - "slash": "^3.0.0" + "has-flag": "^3.0.0" }, "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "node": ">=4" } }, - "node_modules/graceful-fs": { - "version": "4.2.9", - "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.9.tgz", - "integrity": "sha512-NtNxqUcXgpW2iMrfqSfR73Glt39K+BLwWsPs94yR63v45T0Wbej7eRmL5cWfwEgqXnmjQp3zaJTshdRW/qC2ZQ==", - "dev": true - }, - "node_modules/growl": { - "version": "1.10.5", - "resolved": "https://registry.npmjs.org/growl/-/growl-1.10.5.tgz", - "integrity": "sha512-qBr4OuELkhPenW6goKVXiv47US3clb3/IbuWF9KNKEijAy9oeHxU9IgzjvJhHkUzhaj7rOUD7+YGWqUjLp5oSA==", + "node_modules/hardhat/node_modules/uuid": { + "version": "8.3.2", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz", + "integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==", "dev": true, - "engines": { - "node": ">=4.x" + "bin": { + "uuid": "dist/bin/uuid" } }, "node_modules/has": { @@ -2880,9 +4520,9 @@ } }, "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==", + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/has-bigints/-/has-bigints-1.0.2.tgz", + "integrity": "sha512-tSvCKtBr9lkF0Ex0aQiP9N+OpV4zi2r/Nee5VkRDbaqv35RLYMzbwQfFSZZH0kR+Rd6302UJZ2p/bJCEoR3VoQ==", "dev": true, "funding": { "url": "https://github.com/sponsors/ljharb" @@ -2897,6 +4537,18 @@ "node": ">=8" } }, + "node_modules/has-property-descriptors": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/has-property-descriptors/-/has-property-descriptors-1.0.0.tgz", + "integrity": "sha512-62DVLZGoiEBDHQyqG4w9xCuZ7eJEwNmJRWw2VY84Oedb7WFcA27fiEVe8oUQx9hAUJ4ekurquucTGwsyO1XGdQ==", + "dev": true, + "dependencies": { + "get-intrinsic": "^1.1.1" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/has-symbols": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.3.tgz", @@ -2981,6 +4633,25 @@ "secp256k1": "^3.0.1" } }, + "node_modules/hdkey/node_modules/secp256k1": { + "version": "3.8.0", + "resolved": "https://registry.npmjs.org/secp256k1/-/secp256k1-3.8.0.tgz", + "integrity": "sha512-k5ke5avRZbtl9Tqx/SA7CbY3NF6Ro+Sj9cZxezFzuBlLDmyqPiL8hJJ+EmzD8Ig4LUDByHJ3/iPOVoRixs/hmw==", + "hasInstallScript": true, + "dependencies": { + "bindings": "^1.5.0", + "bip66": "^1.1.5", + "bn.js": "^4.11.8", + "create-hash": "^1.2.0", + "drbg.js": "^1.0.1", + "elliptic": "^6.5.2", + "nan": "^2.14.0", + "safe-buffer": "^5.1.2" + }, + "engines": { + "node": ">=4.0.0" + } + }, "node_modules/he": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/he/-/he-1.2.0.tgz", @@ -2993,7 +4664,7 @@ "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=", + "integrity": "sha512-Tti3gMqLdZfhOQY1Mzf/AanLiqh1WTiJgEj26ZuYQ9fbkLomzGchCws4FyrSd4VkpBfiNhaE1On+lOz894jvXg==", "dependencies": { "hash.js": "^1.0.3", "minimalistic-assert": "^1.0.0", @@ -3006,6 +4677,67 @@ "integrity": "sha512-H2iMtd0I4Mt5eYiapRdIDjp+XzelXQ0tFE4JS7YFwFevXXMmOp9myNrUvCg0D6ws8iqkRPBfKHgbwig1SmlLfg==", "dev": true }, + "node_modules/http-errors": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-2.0.0.tgz", + "integrity": "sha512-FtwrG/euBzaEjYeRqOgly7G0qviiXoJWnvEH2Z1plBdXgbyjv34pHTSb9zoeHMyDy33+DWy5Wt9Wo+TURtOYSQ==", + "dev": true, + "dependencies": { + "depd": "2.0.0", + "inherits": "2.0.4", + "setprototypeof": "1.2.0", + "statuses": "2.0.1", + "toidentifier": "1.0.1" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/https-proxy-agent": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-5.0.1.tgz", + "integrity": "sha512-dFcAjpTQFgoLMzC2VwU+C/CbS7uRL0lWmxDITmqm7C+7F0Odmj6s9l6alZc6AELXhrnggM2CeWSXHGOdX2YtwA==", + "dev": true, + "dependencies": { + "agent-base": "6", + "debug": "4" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/iconv-lite": { + "version": "0.4.24", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", + "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", + "dev": true, + "dependencies": { + "safer-buffer": ">= 2.1.2 < 3" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/ieee754": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.2.1.tgz", + "integrity": "sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==", + "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" + } + ] + }, "node_modules/ignore": { "version": "5.2.0", "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.2.0.tgz", @@ -3015,6 +4747,18 @@ "node": ">= 4" } }, + "node_modules/immediate": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/immediate/-/immediate-3.3.0.tgz", + "integrity": "sha512-HR7EVodfFUdQCTIeySw+WDRFJlPcLOJbXfwwZ7Oom6tjsvZ3bOkCDJHehQC3nxJrv7+f9XecwazynjU8e4Vw3Q==", + "dev": true + }, + "node_modules/immutable": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/immutable/-/immutable-4.1.0.tgz", + "integrity": "sha512-oNkuqVTA8jqG1Q6c+UglTOD1xhC1BtjKI7XkCXRkZHrN5m18/XsnUp8Q89GkQO/z+0WjonSvl0FLhDYftp46nQ==", + "dev": true + }, "node_modules/import-fresh": { "version": "3.3.0", "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.0.tgz", @@ -3034,7 +4778,7 @@ "node_modules/imurmurhash": { "version": "0.1.4", "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", - "integrity": "sha1-khi5srkoojixPcT7a21XbyMUU+o=", + "integrity": "sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==", "dev": true, "engines": { "node": ">=0.8.19" @@ -3052,7 +4796,7 @@ "node_modules/inflight": { "version": "1.0.6", "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", - "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", + "integrity": "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==", "dev": true, "dependencies": { "once": "^1.3.0", @@ -3078,6 +4822,15 @@ "node": ">= 0.4" } }, + "node_modules/io-ts": { + "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==", + "dev": true, + "dependencies": { + "fp-ts": "^1.0.0" + } + }, "node_modules/is-bigint": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/is-bigint/-/is-bigint-1.0.4.tgz", @@ -3131,9 +4884,9 @@ } }, "node_modules/is-core-module": { - "version": "2.8.1", - "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.8.1.tgz", - "integrity": "sha512-SdNCUs284hr40hFTFP6l0IfZ/RSrMXF3qgoRHd3/79unUTvrFO/JoXwkGm+5J/Oe3E/b5GsnG330uUNgRpu1PA==", + "version": "2.9.0", + "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.9.0.tgz", + "integrity": "sha512-+5FPy5PnwmO3lvfMb0AsoPaBG+5KHUI0wYFXOtYPnVVVspTFUuMZNfNaNVRt3FZadstu2c8x23vykRW/NBoU6A==", "dev": true, "dependencies": { "has": "^1.0.3" @@ -3160,7 +4913,7 @@ "node_modules/is-extglob": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", - "integrity": "sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=", + "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==", "dev": true, "engines": { "node": ">=0.10.0" @@ -3187,6 +4940,16 @@ "node": ">=0.10.0" } }, + "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": "sha512-WvtOiug1VFrE9v1Cydwm+FnXd3+w9GaeVUss5W4v/SLy3UW00vP+6iNF2SdnfiBoLy4bTqVdkftNGTUeOFVsbA==", + "dev": true, + "engines": { + "node": ">=6.5.0", + "npm": ">=3" + } + }, "node_modules/is-negative-zero": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/is-negative-zero/-/is-negative-zero-2.0.2.tgz", @@ -3209,9 +4972,9 @@ } }, "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==", + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/is-number-object/-/is-number-object-1.0.7.tgz", + "integrity": "sha512-k1U0IRzLMo7ZlYIfzRu23Oh6MiIFasgpb9X76eqfFZAqwH44UI4KTBvBYIZ1dSL9ZzChTB9ShHfLkR4pdW5krQ==", "dev": true, "dependencies": { "has-tostringtag": "^1.0.0" @@ -3249,10 +5012,13 @@ } }, "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==", + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-shared-array-buffer/-/is-shared-array-buffer-1.0.2.tgz", + "integrity": "sha512-sqN2UDu1/0y6uvXyStCOzyhAjCSlHceFoMKJW8W9EU9cvic/QdsZ0kEU93HEy3IUEFZIiH/3w+AH/UQbPHNdhA==", "dev": true, + "dependencies": { + "call-bind": "^1.0.2" + }, "funding": { "url": "https://github.com/sponsors/ljharb" } @@ -3302,7 +5068,7 @@ "node_modules/is-typedarray": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz", - "integrity": "sha1-5HnICFjfDBsR3dppQPlgEfzaSpo=" + "integrity": "sha512-cyA56iCMHAh5CdzjJIa4aohJyeO1YbwLi3Jc35MmRU6poroFjIGZzUzupGiRPOjgHg9TLu43xbpwXk523fMxKA==" }, "node_modules/is-unicode-supported": { "version": "0.1.0", @@ -3340,13 +5106,13 @@ "node_modules/isarray": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", - "integrity": "sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8=", + "integrity": "sha512-D2S+3GLxWH+uhrNEcoh/fnmYeP8E8/zHl644d/jdA0g2uyXvy3sb0qxotE+ne0LtccHknQzWwZEzhak7oJ0COQ==", "dev": true }, "node_modules/isexe": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", - "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=", + "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", "dev": true }, "node_modules/istanbul-lib-coverage": { @@ -3395,23 +5161,43 @@ } }, "node_modules/istanbul-lib-processinfo": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/istanbul-lib-processinfo/-/istanbul-lib-processinfo-2.0.2.tgz", - "integrity": "sha512-kOwpa7z9hme+IBPZMzQ5vdQj8srYgAtaRqeI48NGmAQ+/5yKiHLV0QbYqQpxsdEF0+w14SoB8YbnHKcXE2KnYw==", + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/istanbul-lib-processinfo/-/istanbul-lib-processinfo-2.0.3.tgz", + "integrity": "sha512-NkwHbo3E00oybX6NGJi6ar0B29vxyvNwoC7eJ4G4Yq28UfY758Hgn/heV8VRFhevPED4LXfFz0DQ8z/0kw9zMg==", "dev": true, "dependencies": { "archy": "^1.0.0", - "cross-spawn": "^7.0.0", - "istanbul-lib-coverage": "^3.0.0-alpha.1", - "make-dir": "^3.0.0", + "cross-spawn": "^7.0.3", + "istanbul-lib-coverage": "^3.2.0", "p-map": "^3.0.0", "rimraf": "^3.0.0", - "uuid": "^3.3.3" + "uuid": "^8.3.2" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/istanbul-lib-processinfo/node_modules/p-map": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/p-map/-/p-map-3.0.0.tgz", + "integrity": "sha512-d3qXVTF/s+W+CdJ5A29wywV2n8CQQYahlgz2bFiA+4eVNJbHJodPZ+/gXwPGh0bOqA+j8S+6+ckmvLGPk1QpxQ==", + "dev": true, + "dependencies": { + "aggregate-error": "^3.0.0" }, "engines": { "node": ">=8" } }, + "node_modules/istanbul-lib-processinfo/node_modules/uuid": { + "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": "dist/bin/uuid" + } + }, "node_modules/istanbul-lib-report": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/istanbul-lib-report/-/istanbul-lib-report-3.0.0.tgz", @@ -3440,15 +5226,6 @@ "node": ">=10" } }, - "node_modules/istanbul-lib-source-maps/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, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/istanbul-reports": { "version": "3.1.4", "resolved": "https://registry.npmjs.org/istanbul-reports/-/istanbul-reports-3.1.4.tgz", @@ -3506,26 +5283,174 @@ "node_modules/json-stable-stringify-without-jsonify": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz", - "integrity": "sha1-nbe1lJatPzz+8wp1FC0tkwrXJlE=", + "integrity": "sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw==", + "dev": true + }, + "node_modules/json5": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.1.tgz", + "integrity": "sha512-1hqLFMSrGHRHxav9q9gNjJ5EXznIxGVO09xQRrwplcS8qs28pZ8s8hupZAmqDwZUmVZ2Qb2jnyPOWcDH8m8dlA==", + "dev": true, + "bin": { + "json5": "lib/cli.js" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/jsonfile": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz", + "integrity": "sha512-m6F1R3z8jjlf2imQHS2Qez5sjKWQzbuuhuJ/FKYFRZvPE3PuHcSMVZzfsLhGVOkfd20obL5SWEBew5ShlquNxg==", + "dev": true, + "optionalDependencies": { + "graceful-fs": "^4.1.6" + } + }, + "node_modules/just-extend": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/just-extend/-/just-extend-4.2.1.tgz", + "integrity": "sha512-g3UB796vUFIY90VIv/WX3L2c8CS2MdWUww3CNrYmqza1Fg0DURc2K/O4YrnklBdQarSJ/y8JnJYDGc+1iumQjg==", "dev": true }, - "node_modules/json5": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.1.tgz", - "integrity": "sha512-1hqLFMSrGHRHxav9q9gNjJ5EXznIxGVO09xQRrwplcS8qs28pZ8s8hupZAmqDwZUmVZ2Qb2jnyPOWcDH8m8dlA==", + "node_modules/keccak": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/keccak/-/keccak-3.0.2.tgz", + "integrity": "sha512-PyKKjkH53wDMLGrvmRGSNWgmSxZOUqbnXwKL9tmgbFYA1iAYqW21kfR7mZXV0MlESiefxQQE9X9fTa3X+2MPDQ==", + "dev": true, + "hasInstallScript": true, + "dependencies": { + "node-addon-api": "^2.0.0", + "node-gyp-build": "^4.2.0", + "readable-stream": "^3.6.0" + }, + "engines": { + "node": ">=10.0.0" + } + }, + "node_modules/klaw": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/klaw/-/klaw-1.3.1.tgz", + "integrity": "sha512-TED5xi9gGQjGpNnvRWknrwAB1eL5GciPfVFOt3Vk1OJCVDQbzuSfrF3hkUQKlsgKrG1F+0t5W0m+Fje1jIt8rw==", + "dev": true, + "optionalDependencies": { + "graceful-fs": "^4.1.9" + } + }, + "node_modules/level-codec": { + "version": "9.0.2", + "resolved": "https://registry.npmjs.org/level-codec/-/level-codec-9.0.2.tgz", + "integrity": "sha512-UyIwNb1lJBChJnGfjmO0OR+ezh2iVu1Kas3nvBS/BzGnx79dv6g7unpKIDNPMhfdTEGoc7mC8uAu51XEtX+FHQ==", + "dev": true, + "dependencies": { + "buffer": "^5.6.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/level-concat-iterator": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/level-concat-iterator/-/level-concat-iterator-2.0.1.tgz", + "integrity": "sha512-OTKKOqeav2QWcERMJR7IS9CUo1sHnke2C0gkSmcR7QuEtFNLLzHQAvnMw8ykvEcv0Qtkg0p7FOwP1v9e5Smdcw==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/level-errors": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/level-errors/-/level-errors-2.0.1.tgz", + "integrity": "sha512-UVprBJXite4gPS+3VznfgDSU8PTRuVX0NXwoWW50KLxd2yw4Y1t2JUR5In1itQnudZqRMT9DlAM3Q//9NCjCFw==", + "dev": true, + "dependencies": { + "errno": "~0.1.1" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/level-iterator-stream": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/level-iterator-stream/-/level-iterator-stream-4.0.2.tgz", + "integrity": "sha512-ZSthfEqzGSOMWoUGhTXdX9jv26d32XJuHz/5YnuHZzH6wldfWMOVwI9TBtKcya4BKTyTt3XVA0A3cF3q5CY30Q==", + "dev": true, + "dependencies": { + "inherits": "^2.0.4", + "readable-stream": "^3.4.0", + "xtend": "^4.0.2" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/level-mem": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/level-mem/-/level-mem-5.0.1.tgz", + "integrity": "sha512-qd+qUJHXsGSFoHTziptAKXoLX87QjR7v2KMbqncDXPxQuCdsQlzmyX+gwrEHhlzn08vkf8TyipYyMmiC6Gobzg==", + "dev": true, + "dependencies": { + "level-packager": "^5.0.3", + "memdown": "^5.0.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/level-packager": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/level-packager/-/level-packager-5.1.1.tgz", + "integrity": "sha512-HMwMaQPlTC1IlcwT3+swhqf/NUO+ZhXVz6TY1zZIIZlIR0YSn8GtAAWmIvKjNY16ZkEg/JcpAuQskxsXqC0yOQ==", + "dev": true, + "dependencies": { + "encoding-down": "^6.3.0", + "levelup": "^4.3.2" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/level-supports": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/level-supports/-/level-supports-1.0.1.tgz", + "integrity": "sha512-rXM7GYnW8gsl1vedTJIbzOrRv85c/2uCMpiiCzO2fndd06U/kUXEEU9evYn4zFggBOg36IsBW8LzqIpETwwQzg==", + "dev": true, + "dependencies": { + "xtend": "^4.0.2" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/level-ws": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/level-ws/-/level-ws-2.0.0.tgz", + "integrity": "sha512-1iv7VXx0G9ec1isqQZ7y5LmoZo/ewAsyDHNA8EFDW5hqH2Kqovm33nSFkSdnLLAK+I5FlT+lo5Cw9itGe+CpQA==", "dev": true, - "bin": { - "json5": "lib/cli.js" + "dependencies": { + "inherits": "^2.0.3", + "readable-stream": "^3.1.0", + "xtend": "^4.0.1" }, "engines": { "node": ">=6" } }, - "node_modules/just-extend": { - "version": "4.2.1", - "resolved": "https://registry.npmjs.org/just-extend/-/just-extend-4.2.1.tgz", - "integrity": "sha512-g3UB796vUFIY90VIv/WX3L2c8CS2MdWUww3CNrYmqza1Fg0DURc2K/O4YrnklBdQarSJ/y8JnJYDGc+1iumQjg==", - "dev": true + "node_modules/levelup": { + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/levelup/-/levelup-4.4.0.tgz", + "integrity": "sha512-94++VFO3qN95cM/d6eBXvd894oJE0w3cInq9USsyQzzoJxmiYzPAocNcuGCPGGjoXqDVJcr3C1jzt1TSjyaiLQ==", + "dev": true, + "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" + }, + "engines": { + "node": ">=6" + } }, "node_modules/levn": { "version": "0.4.1", @@ -3543,7 +5468,7 @@ "node_modules/locate-path": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-2.0.0.tgz", - "integrity": "sha1-K1aLJl7slExtnA3pw9u7ygNUzY4=", + "integrity": "sha512-NCI2kiDkyR7VeEKm27Kda/iQHyKJe1Bu0FlTbYp3CqJu+9IFe9bLyAjMxf5ZDDbEg+iMPzB5zYyUTSm8wVTKmA==", "dev": true, "dependencies": { "p-locate": "^2.0.0", @@ -3553,16 +5478,22 @@ "node": ">=4" } }, + "node_modules/lodash": { + "version": "4.17.21", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", + "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==", + "dev": true + }, "node_modules/lodash.flattendeep": { "version": "4.4.0", "resolved": "https://registry.npmjs.org/lodash.flattendeep/-/lodash.flattendeep-4.4.0.tgz", - "integrity": "sha1-+wMJF/hqMTTlvJvsDWngAT3f7bI=", + "integrity": "sha512-uHaJFihxmJcEX3kT4I23ABqKKalJ/zDrDg0lsFtc1h+3uw49SIJ5beyhx5ExVRti3AvKoOJngIj7xz3oylPdWQ==", "dev": true }, "node_modules/lodash.get": { "version": "4.4.2", "resolved": "https://registry.npmjs.org/lodash.get/-/lodash.get-4.4.2.tgz", - "integrity": "sha1-LRd/ZS+jHpObRDjVNBSZ36OCXpk=", + "integrity": "sha512-z+Uw/vLuy6gQe8cfaFWD7p0wVv8fJl3mbzXh33RS+0oW2wvUqiRXiQ69gLWSLpgB5/6sU+r6BlQR0MBILadqTQ==", "dev": true }, "node_modules/lodash.merge": { @@ -3596,18 +5527,27 @@ "get-func-name": "^2.0.0" } }, + "node_modules/lru_map": { + "version": "0.3.3", + "resolved": "https://registry.npmjs.org/lru_map/-/lru_map-0.3.3.tgz", + "integrity": "sha512-Pn9cox5CsMYngeDbmChANltQl+5pi6XmTrraMSzhPmMBbmgcxmqWry0U3PGapCU1yB4/LqCcom7qhHZiF/jGfQ==", + "dev": true + }, "node_modules/lru-cache": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", - "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-5.1.1.tgz", + "integrity": "sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==", "dev": true, "dependencies": { - "yallist": "^4.0.0" - }, - "engines": { - "node": ">=10" + "yallist": "^3.0.2" } }, + "node_modules/ltgt": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/ltgt/-/ltgt-2.2.1.tgz", + "integrity": "sha512-AI2r85+4MquTw9ZYqabu4nMwy9Oftlfa/e/52t9IjtfG+mGBbTNdAoZ3RQKLHR6r0wQnwZnPIEh/Ya6XTWAKNA==", + "dev": true + }, "node_modules/make-dir": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-3.1.0.tgz", @@ -3638,6 +5578,15 @@ "integrity": "sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw==", "dev": true }, + "node_modules/mcl-wasm": { + "version": "0.7.9", + "resolved": "https://registry.npmjs.org/mcl-wasm/-/mcl-wasm-0.7.9.tgz", + "integrity": "sha512-iJIUcQWA88IJB/5L15GnJVnSQJmf/YaxxV6zRavv83HILHaJQb6y0iFyDMdDO0gN8X37tdxmAOrH/P8B6RB8sQ==", + "dev": true, + "engines": { + "node": ">=8.9.0" + } + }, "node_modules/md5.js": { "version": "1.3.5", "resolved": "https://registry.npmjs.org/md5.js/-/md5.js-1.3.5.tgz", @@ -3648,6 +5597,54 @@ "safe-buffer": "^5.1.2" } }, + "node_modules/memdown": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/memdown/-/memdown-5.1.0.tgz", + "integrity": "sha512-B3J+UizMRAlEArDjWHTMmadet+UKwHd3UjMgGBkZcKAxAYVPS9o0Yeiha4qvz7iGiL2Sb3igUft6p7nbFWctpw==", + "dev": true, + "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" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/memdown/node_modules/abstract-leveldown": { + "version": "6.2.3", + "resolved": "https://registry.npmjs.org/abstract-leveldown/-/abstract-leveldown-6.2.3.tgz", + "integrity": "sha512-BsLm5vFMRUrrLeCcRc+G0t2qOaTzpoJQLOubq2XM72eNpjF5UdU5o/5NvlNhx95XHcAvcl8OMXr4mlg/fRgUXQ==", + "dev": true, + "dependencies": { + "buffer": "^5.5.0", + "immediate": "^3.2.3", + "level-concat-iterator": "~2.0.0", + "level-supports": "~1.0.0", + "xtend": "~4.0.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/memdown/node_modules/immediate": { + "version": "3.2.3", + "resolved": "https://registry.npmjs.org/immediate/-/immediate-3.2.3.tgz", + "integrity": "sha512-RrGCXRm/fRVqMIhqXrGEX9rRADavPiDFSoMb/k64i9XMk8uH4r/Omi5Ctierj6XzNecwDbO4WuFbDD1zmpl3Tg==", + "dev": true + }, + "node_modules/memorystream": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/memorystream/-/memorystream-0.3.1.tgz", + "integrity": "sha512-S3UwM3yj5mtUSEfP41UZmt/0SCoVYUcU1rkXv+BQ5Ig8ndL4sPoJNBUJERafdPb5jjHJGuMgytgKvKIf58XNBw==", + "dev": true, + "engines": { + "node": ">= 0.10.0" + } + }, "node_modules/merge2": { "version": "1.4.1", "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz", @@ -3657,19 +5654,46 @@ "node": ">= 8" } }, + "node_modules/merkle-patricia-tree": { + "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.4", + "level-mem": "^5.0.1", + "level-ws": "^2.0.0", + "readable-stream": "^3.6.0", + "semaphore-async-await": "^1.5.1" + } + }, "node_modules/micromatch": { - "version": "4.0.4", - "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.4.tgz", - "integrity": "sha512-pRmzw/XUcwXGpD9aI9q/0XOwLNygjETJ8y0ao0wdqprrzDa4YnxLcz7fQRZr8voh8V10kGhABbNcHVk5wHgWwg==", + "version": "4.0.5", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.5.tgz", + "integrity": "sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA==", "dev": true, "dependencies": { - "braces": "^3.0.1", - "picomatch": "^2.2.3" + "braces": "^3.0.2", + "picomatch": "^2.3.1" }, "engines": { "node": ">=8.6" } }, + "node_modules/miller-rabin": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/miller-rabin/-/miller-rabin-4.0.1.tgz", + "integrity": "sha512-115fLhvZVqWwHPbClyntxEVfVDfl9DLLTuJvq3g2O/Oxi8AiNouAHvDSzHS0viUJc+V5vm3eq91Xwqn9dp4jRA==", + "dev": true, + "dependencies": { + "bn.js": "^4.0.0", + "brorand": "^1.0.1" + }, + "bin": { + "miller-rabin": "bin/miller-rabin" + } + }, "node_modules/minimalistic-assert": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/minimalistic-assert/-/minimalistic-assert-1.0.1.tgz", @@ -3678,7 +5702,7 @@ "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=" + "integrity": "sha512-JIYlbt6g8i5jKfJ3xz7rF0LXmv2TkDxBLUkiBeZ7bAx4GnnNMr8xFpGnOxn6GhTEHx3SjRrZEoU+j04prX1ktg==" }, "node_modules/minimatch": { "version": "3.1.2", @@ -3703,6 +5727,15 @@ "resolved": "https://registry.npmjs.org/mitt/-/mitt-1.2.0.tgz", "integrity": "sha512-r6lj77KlwqLhIUku9UWYes7KJtsczvolZkzp8hbaDPPaE24OmWl5s539Mytlj22siEQKosZ26qCBgda2PKwoJw==" }, + "node_modules/mnemonist": { + "version": "0.38.5", + "resolved": "https://registry.npmjs.org/mnemonist/-/mnemonist-0.38.5.tgz", + "integrity": "sha512-bZTFT5rrPKtPJxj8KSV0WkPyNxl72vQepqqVUAW2ARUpUSF2qXMB6jZj7hW5/k7C1rtpzqbD/IIbJwLXUjCHeg==", + "dev": true, + "dependencies": { + "obliterator": "^2.0.0" + } + }, "node_modules/mocha": { "version": "9.2.2", "resolved": "https://registry.npmjs.org/mocha/-/mocha-9.2.2.tgz", @@ -3746,6 +5779,15 @@ "url": "https://opencollective.com/mochajs" } }, + "node_modules/mocha/node_modules/ansi-colors": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-4.1.1.tgz", + "integrity": "sha512-JoX0apGbHaUJBNl6yF+p6JAFYZ666/hhCGKN5t9QFjbJQKUU/g8MNbFDbvfrgKXvI1QpZplPOnwIo99lX/AAmA==", + "dev": true, + "engines": { + "node": ">=6" + } + }, "node_modules/mocha/node_modules/debug": { "version": "4.3.3", "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.3.tgz", @@ -3879,9 +5921,9 @@ "dev": true }, "node_modules/nan": { - "version": "2.15.0", - "resolved": "https://registry.npmjs.org/nan/-/nan-2.15.0.tgz", - "integrity": "sha512-8ZtvEnA2c5aYCZYd1cvgdnU6cqwixRoYg70xPLWUws5ORTa/lnw+u4amixRS/Ac5U5mQVgp9pnlSUnbNWFaWZQ==" + "version": "2.16.0", + "resolved": "https://registry.npmjs.org/nan/-/nan-2.16.0.tgz", + "integrity": "sha512-UdAqHyFngu7TfQKsCBgAA6pWDkT8MAO7d0jyOecVhN5354xbLqdn8mV9Tat9gepAupm0bt2DbeaSC8vS52MuFA==" }, "node_modules/nanoid": { "version": "3.3.1", @@ -3898,7 +5940,7 @@ "node_modules/natural-compare": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", - "integrity": "sha1-Sr6/7tdUHywnrPspvbvRXI1bpPc=", + "integrity": "sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==", "dev": true }, "node_modules/next-tick": { @@ -3919,6 +5961,12 @@ "path-to-regexp": "^1.7.0" } }, + "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 + }, "node_modules/node-fetch": { "version": "2.6.7", "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.7.tgz", @@ -3939,9 +5987,9 @@ } }, "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.5.0", + "resolved": "https://registry.npmjs.org/node-gyp-build/-/node-gyp-build-4.5.0.tgz", + "integrity": "sha512-2iGbaQBV+ITgCz76ZEjmhUKAKVf7xfY1sRl4UiKQspfZMH2h06SyhNsnSVy50cwkFQDGLyif6m/6uFXHkOZ6rg==", "bin": { "node-gyp-build": "bin.js", "node-gyp-build-optional": "optional.js", @@ -3961,9 +6009,9 @@ } }, "node_modules/node-releases": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.2.tgz", - "integrity": "sha512-XxYDdcQ6eKqp/YjI+tb2C5WM2LgjnZrfYg4vgQt49EK268b6gYCHsBLrK2qvJo4FmCtqmKezb0WZFK4fkrZNsg==", + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.5.tgz", + "integrity": "sha512-U9h1NLROZTq9uE1SNffn6WuPDg8icmi3ns4rEl/oTfIle4iLjTliCzgTsbaIFMq/Xn078/lfY/BL0GWZ+psK4Q==", "dev": true }, "node_modules/normalize-path": { @@ -4079,6 +6127,18 @@ "node": ">=8" } }, + "node_modules/nyc/node_modules/p-map": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/p-map/-/p-map-3.0.0.tgz", + "integrity": "sha512-d3qXVTF/s+W+CdJ5A29wywV2n8CQQYahlgz2bFiA+4eVNJbHJodPZ+/gXwPGh0bOqA+j8S+6+ckmvLGPk1QpxQ==", + "dev": true, + "dependencies": { + "aggregate-error": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, "node_modules/nyc/node_modules/p-try": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", @@ -4162,9 +6222,9 @@ } }, "node_modules/object-inspect": { - "version": "1.12.0", - "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.12.0.tgz", - "integrity": "sha512-Ho2z80bVIvJloH+YzRmpZVQe87+qASmBUKZDWgx9cu+KDrX2ZDH/3tMy+gXbZETVGs2M8YdxObOh7XAtim9Y0g==", + "version": "1.12.2", + "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.12.2.tgz", + "integrity": "sha512-z+cPxW0QGUp0mcqcsgQyLVRDoXFQbXOwBaqyF7VIgI4TWNQsDHrBpUQslRmIfAoYWdYzs6UlKJtB2XJpTaNSpQ==", "dev": true, "funding": { "url": "https://github.com/sponsors/ljharb" @@ -4214,10 +6274,16 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/obliterator": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/obliterator/-/obliterator-2.0.4.tgz", + "integrity": "sha512-lgHwxlxV1qIg1Eap7LgIeoBWIMFibOjbrYPIPJZcI1mmGAI2m3lNYpK12Y+GBdPQ0U1hRwSord7GIaawz962qQ==", + "dev": true + }, "node_modules/once": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", - "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", + "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", "dev": true, "dependencies": { "wrappy": "1" @@ -4243,12 +6309,21 @@ "node_modules/os-shim": { "version": "0.1.3", "resolved": "https://registry.npmjs.org/os-shim/-/os-shim-0.1.3.tgz", - "integrity": "sha1-a2LDeRz3kJ6jXtRuF2WLtBfLORc=", + "integrity": "sha512-jd0cvB8qQ5uVt0lvCIexBaROw1KyKm5sbulg2fWOHjETisuCzWyt+eTZKEMs8v6HwzoGs8xik26jg7eCM6pS+A==", "dev": true, "engines": { "node": ">= 0.4.0" } }, + "node_modules/os-tmpdir": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz", + "integrity": "sha512-D2FR03Vir7FIu45XBY20mTb+/ZSWB00sjU9jdQXt83gDrI4Ztz5Fs7/yy74g2N5SVQY4xY1qDr4rNddwYRVX0g==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/p-limit": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-1.3.0.tgz", @@ -4264,7 +6339,7 @@ "node_modules/p-locate": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-2.0.0.tgz", - "integrity": "sha1-IKAQOyIqcMj9OcwuWAaA893l7EM=", + "integrity": "sha512-nQja7m7gSKuewoVRen45CtVfODR3crN3goVQ0DDZ9N3yHxgpkuBhZqsaiotSQRrADUrne346peY7kT3TSACykg==", "dev": true, "dependencies": { "p-limit": "^1.1.0" @@ -4274,21 +6349,24 @@ } }, "node_modules/p-map": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/p-map/-/p-map-3.0.0.tgz", - "integrity": "sha512-d3qXVTF/s+W+CdJ5A29wywV2n8CQQYahlgz2bFiA+4eVNJbHJodPZ+/gXwPGh0bOqA+j8S+6+ckmvLGPk1QpxQ==", + "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": ">=8" + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/p-try": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/p-try/-/p-try-1.0.0.tgz", - "integrity": "sha1-y8ec26+P1CKOE/Yh8rGiN8GyB7M=", + "integrity": "sha512-U1etNYuMJoIz3ZXSrrySFjsXQTWOx2/jdi86L+2pRvph/qMKL6sbcCYdH23fqsbm8TH2Gn0OybpT4eSFlCVHww==", "dev": true, "engines": { "node": ">=4" @@ -4324,7 +6402,7 @@ "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=", + "integrity": "sha512-bpC7GYwiDYQ4wYLe+FA8lhRjhQCMcQGuSgGGqDkg/QerRWw9CmGRT0iSOVRSZJ29NMLZgIzqaljJ63oaL4NIJQ==", "dev": true, "engines": { "node": ">=4" @@ -4333,7 +6411,7 @@ "node_modules/path-is-absolute": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", - "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", + "integrity": "sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==", "dev": true, "engines": { "node": ">=0.10.0" @@ -4499,7 +6577,7 @@ "node_modules/pre-commit": { "version": "1.2.2", "resolved": "https://registry.npmjs.org/pre-commit/-/pre-commit-1.2.2.tgz", - "integrity": "sha1-287g7p3nI15X95xW186UZBpp7sY=", + "integrity": "sha512-qokTiqxD6GjODy5ETAIgzsRgnBWWQHQH2ghy86PU7mIn/wuWeTwF3otyNQZxWBwVn8XNr8Tdzj/QfUXpH+gRZA==", "dev": true, "hasInstallScript": true, "dependencies": { @@ -4511,7 +6589,7 @@ "node_modules/pre-commit/node_modules/cross-spawn": { "version": "5.1.0", "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-5.1.0.tgz", - "integrity": "sha1-6L0O/uWPz/b4+UUQoKVUu/ojVEk=", + "integrity": "sha512-pTgQJ5KC0d2hcY8eyL1IzlBPYjTkyH72XRZPnLyKus2mBfNjQs3klqbJU2VILqZryAZUt9JOb3h/mWMy23/f5A==", "dev": true, "dependencies": { "lru-cache": "^4.0.1", @@ -4532,7 +6610,7 @@ "node_modules/pre-commit/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=", + "integrity": "sha512-EV3L1+UQWGor21OmnvojK36mhg+TyIKDh3iFBKBohr5xeXIhNBcx8oWdgkTEEQ+BEFFYdLRuqMfd5L84N1V5Vg==", "dev": true, "dependencies": { "shebang-regex": "^1.0.0" @@ -4544,7 +6622,7 @@ "node_modules/pre-commit/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=", + "integrity": "sha512-wpoSFAxys6b2a2wHZ1XpDSgD7N9iVjg29Ph9uV/uaP9Ex/KXlkTZTeddxDPSYQpgvzKLGJke2UU0AzoGCjNIvQ==", "dev": true, "engines": { "node": ">=0.10.0" @@ -4553,7 +6631,7 @@ "node_modules/pre-commit/node_modules/which": { "version": "1.2.14", "resolved": "https://registry.npmjs.org/which/-/which-1.2.14.tgz", - "integrity": "sha1-mofEN48D6CfOyvGs31bHNsAcFOU=", + "integrity": "sha512-16uPglFkRPzgiUXYMi1Jf8Z5EzN1iB4V0ZtMXcHZnwsBtQhhHeCqoWw7tsUY42hJGNDWtUsVLTjakIa5BgAxCw==", "dev": true, "dependencies": { "isexe": "^2.0.0" @@ -4565,7 +6643,7 @@ "node_modules/pre-commit/node_modules/yallist": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/yallist/-/yallist-2.1.2.tgz", - "integrity": "sha1-HBH5IY8HYImkfdUS+TxmmaaoHVI=", + "integrity": "sha512-ncTzHV7NvsQZkYe1DW7cbDLm0YpzHmZF5r/iyP3ZnQtMiJ+pjzisCiMNI+Sj+xQF5pXhSHxSB3uDbsBTzY/c2A==", "dev": true }, "node_modules/prelude-ls": { @@ -4578,9 +6656,9 @@ } }, "node_modules/prettier": { - "version": "2.6.0", - "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.6.0.tgz", - "integrity": "sha512-m2FgJibYrBGGgQXNzfd0PuDGShJgRavjUoRCw1mZERIWVSXF0iLzLm+aOqTAbLnC3n6JzUhAA8uZnFVghHJ86A==", + "version": "2.7.1", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.7.1.tgz", + "integrity": "sha512-ujppO+MkdPqoVINuDFDRLClm7D78qbDt0/NR+wp5FqEZOoTNAjPHWj17QRhu7geIHJfcNhRk1XVQmF8Bp3ye+g==", "dev": true, "bin": { "prettier": "bin-prettier.js" @@ -4622,10 +6700,16 @@ "node": ">=8" } }, + "node_modules/prr": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/prr/-/prr-1.0.1.tgz", + "integrity": "sha512-yPw4Sng1gWghHQWj0B3ZggWUm4qVbPwPFcRG8KyxiU7J2OHFSoEHKS+EZ3fv5l1t9CyCiop6l/ZYeWbrgoQejw==", + "dev": true + }, "node_modules/pseudomap": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/pseudomap/-/pseudomap-1.0.2.tgz", - "integrity": "sha1-8FKijacOYYkX7wqKw0wa5aaChrM=", + "integrity": "sha512-b/YwNhb8lk1Zz2+bXXpS/LK9OisiZZ1SNsSLxN1x2OXVEhW2Ckr/7mWE5vrC1ZTiJlD9g19jWszTmJsB+oEpFQ==", "dev": true }, "node_modules/punycode": { @@ -4637,6 +6721,21 @@ "node": ">=6" } }, + "node_modules/qs": { + "version": "6.11.0", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.11.0.tgz", + "integrity": "sha512-MvjoMCJwEarSbUYk5O+nmoSzSutSsTwF85zcHPQ9OrlFoZOYIjaqBAJIqIXjptyD5vThxGq52Xu/MaJzRkIk4Q==", + "dev": true, + "dependencies": { + "side-channel": "^1.0.4" + }, + "engines": { + "node": ">=0.6" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/queue-microtask": { "version": "1.2.3", "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", @@ -4665,6 +6764,21 @@ "safe-buffer": "^5.1.0" } }, + "node_modules/raw-body": { + "version": "2.5.1", + "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.5.1.tgz", + "integrity": "sha512-qqJBtEyVgS0ZmPGdCFPWJ3FreoqvG4MVQln/kCgF7Olq95IbOp0/BWyMwbdtn4VTvkM8Y7khCQ2Xgk/tcrCXig==", + "dev": true, + "dependencies": { + "bytes": "3.1.2", + "http-errors": "2.0.0", + "iconv-lite": "0.4.24", + "unpipe": "1.0.0" + }, + "engines": { + "node": ">= 0.8" + } + }, "node_modules/readable-stream": { "version": "3.6.0", "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz", @@ -4690,6 +6804,23 @@ "node": ">=8.10.0" } }, + "node_modules/regexp.prototype.flags": { + "version": "1.4.3", + "resolved": "https://registry.npmjs.org/regexp.prototype.flags/-/regexp.prototype.flags-1.4.3.tgz", + "integrity": "sha512-fjggEOO3slI6Wvgjwflkc4NFRCTZAu5CnNfBd5qOMYhWdn67nJBBu34/TkD++eeFmd8C9r9jfXJ27+nSiRkSUA==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.2", + "define-properties": "^1.1.3", + "functions-have-names": "^1.2.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/regexpp": { "version": "3.2.0", "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-3.2.0.tgz", @@ -4705,7 +6836,7 @@ "node_modules/release-zalgo": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/release-zalgo/-/release-zalgo-1.0.0.tgz", - "integrity": "sha1-CXALflB0Mpc5Mw5TXFqQ+2eFFzA=", + "integrity": "sha512-gUAyHVHPPC5wdqX/LG4LWtRYtgjxyX78oanFNTMMyFEfOqdC54s3eE82imuWKbOeqYht2CrNf64Qb8vgmmtZGA==", "dev": true, "dependencies": { "es6-error": "^4.0.1" @@ -4717,7 +6848,16 @@ "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=", + "integrity": "sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/require-from-string": { + "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==", "dev": true, "engines": { "node": ">=0.10.0" @@ -4730,12 +6870,12 @@ "dev": true }, "node_modules/resolve": { - "version": "1.22.0", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.0.tgz", - "integrity": "sha512-Hhtrw0nLeSrFQ7phPp4OOcVjLPIeMnRlr5mcnVuMe7M/7eBn98A3hmFRLoFo3DLZkivSYwhRUJTyPyWAk56WLw==", + "version": "1.22.1", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.1.tgz", + "integrity": "sha512-nBpuuYuY5jFsli/JIs1oldw6fOQCBioohqWZg/2hiaOybXOft4lonv85uDOKXdf8rhyK159cxU5cDcK/NKk8zw==", "dev": true, "dependencies": { - "is-core-module": "^2.8.1", + "is-core-module": "^2.9.0", "path-parse": "^1.0.7", "supports-preserve-symlinks-flag": "^1.0.0" }, @@ -4789,6 +6929,24 @@ "inherits": "^2.0.1" } }, + "node_modules/rlp": { + "version": "2.2.7", + "resolved": "https://registry.npmjs.org/rlp/-/rlp-2.2.7.tgz", + "integrity": "sha512-d5gdPmgQ0Z+AklL2NVXr/IoSjNZFfTVvQWzL/AM2AOcSzYP2xjlb0AC8YyCLc41MSNf6P6QVtjgPdmVtzb+4lQ==", + "dev": true, + "dependencies": { + "bn.js": "^5.2.0" + }, + "bin": { + "rlp": "bin/rlp" + } + }, + "node_modules/rlp/node_modules/bn.js": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-5.2.1.tgz", + "integrity": "sha512-eXRvHzWyYPBuB4NBy0cmYQjGitUrtqwbvlzP3G6VFnNRbsZQIxQ10PbKKHt8gZ/HW/D/747aDl+QkDqg3KQLMQ==", + "dev": true + }, "node_modules/run-parallel": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz", @@ -4812,6 +6970,12 @@ "queue-microtask": "^1.2.2" } }, + "node_modules/rustbn.js": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/rustbn.js/-/rustbn.js-0.2.0.tgz", + "integrity": "sha512-4VlvkRUuCJvr2J6Y0ImW7NvTCriMi7ErOAqWk1y69vAdoNIzCF3yPmgeNzx+RQTLEDFq5sHfscn1MwHxP9hNfA==", + "dev": true + }, "node_modules/safe-buffer": { "version": "5.2.1", "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", @@ -4831,6 +6995,17 @@ } ] }, + "node_modules/safer-buffer": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", + "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", + "dev": true + }, + "node_modules/scrypt-js": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/scrypt-js/-/scrypt-js-3.0.1.tgz", + "integrity": "sha512-cdwTTnqPu0Hyvf5in5asVdZocVDTNRmR7XEcJuIzMjJeSHybHl7vpB66AzwTaIg6CLSbtjcxc8fqcySfnTkccA==" + }, "node_modules/scrypt-shim": { "name": "@web3-js/scrypt-shim", "version": "0.1.0", @@ -4856,28 +7031,33 @@ "integrity": "sha512-1CdSqHQowJBnMAFyPEBRfqag/YP9OF394FV+4YREIJX4ljD7OxvQRDayyoyyCk+senRjSkP6VnUNQmVQqB6g7w==" }, "node_modules/secp256k1": { - "version": "3.8.0", - "resolved": "https://registry.npmjs.org/secp256k1/-/secp256k1-3.8.0.tgz", - "integrity": "sha512-k5ke5avRZbtl9Tqx/SA7CbY3NF6Ro+Sj9cZxezFzuBlLDmyqPiL8hJJ+EmzD8Ig4LUDByHJ3/iPOVoRixs/hmw==", + "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": { - "bindings": "^1.5.0", - "bip66": "^1.1.5", - "bn.js": "^4.11.8", - "create-hash": "^1.2.0", - "drbg.js": "^1.0.1", - "elliptic": "^6.5.2", - "nan": "^2.14.0", - "safe-buffer": "^5.1.2" + "elliptic": "^6.5.4", + "node-addon-api": "^2.0.0", + "node-gyp-build": "^4.2.0" }, "engines": { - "node": ">=4.0.0" + "node": ">=10.0.0" + } + }, + "node_modules/semaphore-async-await": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/semaphore-async-await/-/semaphore-async-await-1.5.1.tgz", + "integrity": "sha512-b/ptP11hETwYWpeilHXXQiV5UJNJl7ZWWooKRE5eBIYWoom6dZ0SluCIdCtKycsMtZgKWE01/qAw6jblw1YVhg==", + "dev": true, + "engines": { + "node": ">=4.1" } }, "node_modules/semver": { - "version": "7.3.5", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.5.tgz", - "integrity": "sha512-PoeGJYh8HK4BTO/a9Tf6ZG3veo/A7ZVsYrSA6J8ny9nb3B1VrpkuN+z9OE5wfE5p6H4LchYZsegiQgbJD94ZFQ==", + "version": "7.3.7", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.7.tgz", + "integrity": "sha512-QlYTucUYOews+WeEujDoEGziz4K6c47V/Bd+LjSSYcA94p+DmINdf7ncaUinThfvZyu13lN9OY1XDxt8C0Tw0g==", "dev": true, "dependencies": { "lru-cache": "^6.0.0" @@ -4889,6 +7069,24 @@ "node": ">=10" } }, + "node_modules/semver/node_modules/lru-cache": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", + "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", + "dev": true, + "dependencies": { + "yallist": "^4.0.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/semver/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 + }, "node_modules/serialize-javascript": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-6.0.0.tgz", @@ -4901,7 +7099,19 @@ "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=", + "integrity": "sha512-KiKBS8AnWGEyLzofFfmvKwpdPzqiy16LvQfK3yv/fVH7Bj13/wl3JSR1J+rfgRE9q7xUJK4qvgS8raSOeLUehw==", + "dev": true + }, + "node_modules/setimmediate": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/setimmediate/-/setimmediate-1.0.5.tgz", + "integrity": "sha512-MATJdZp8sLqDl/68LfQmbP8zKPLQNV6BIZoIgrscFDQ+RsvK/BxeDQOgyxKKoh0y/8h3BqVFnCqQ/gd+reiIXA==", + "dev": true + }, + "node_modules/setprototypeof": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.2.0.tgz", + "integrity": "sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw==", "dev": true }, "node_modules/sha.js": { @@ -4957,46 +7167,122 @@ "integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==", "dev": true }, - "node_modules/sinon": { - "version": "13.0.1", - "resolved": "https://registry.npmjs.org/sinon/-/sinon-13.0.1.tgz", - "integrity": "sha512-8yx2wIvkBjIq/MGY1D9h1LMraYW+z1X0mb648KZnKSdvLasvDu7maa0dFaNYdTDczFgbjNw2tOmWdTk9saVfwQ==", + "node_modules/sinon": { + "version": "13.0.2", + "resolved": "https://registry.npmjs.org/sinon/-/sinon-13.0.2.tgz", + "integrity": "sha512-KvOrztAVqzSJWMDoxM4vM+GPys1df2VBoXm+YciyB/OLMamfS3VXh3oGh5WtrAGSzrgczNWFFY22oKb7Fi5eeA==", + "dev": true, + "dependencies": { + "@sinonjs/commons": "^1.8.3", + "@sinonjs/fake-timers": "^9.1.2", + "@sinonjs/samsam": "^6.1.1", + "diff": "^5.0.0", + "nise": "^5.1.1", + "supports-color": "^7.2.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/sinon" + } + }, + "node_modules/slash": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz", + "integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/solc": { + "version": "0.7.3", + "resolved": "https://registry.npmjs.org/solc/-/solc-0.7.3.tgz", + "integrity": "sha512-GAsWNAjGzIDg7VxzP6mPjdurby3IkGCjQcM8GFYZT6RyaoUZKmMU6Y7YwG+tFGhv7dwZ8rmR4iwFDrrD99JwqA==", + "dev": true, + "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" + }, + "bin": { + "solcjs": "solcjs" + }, + "engines": { + "node": ">=8.0.0" + } + }, + "node_modules/solc/node_modules/fs-extra": { + "version": "0.30.0", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-0.30.0.tgz", + "integrity": "sha512-UvSPKyhMn6LEd/WpUaV9C9t3zATuqoqfWc3QdPhPLb58prN9tqYPlPWi8Krxi44loBoUzlobqZ3+8tGpxxSzwA==", + "dev": true, + "dependencies": { + "graceful-fs": "^4.1.2", + "jsonfile": "^2.1.0", + "klaw": "^1.0.0", + "path-is-absolute": "^1.0.0", + "rimraf": "^2.2.8" + } + }, + "node_modules/solc/node_modules/jsonfile": { + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-2.4.0.tgz", + "integrity": "sha512-PKllAqbgLgxHaj8TElYymKCAgrASebJrWpTnEkOaTowt23VKXXN0sUeriJ+eh7y6ufb/CC5ap11pz71/cM0hUw==", + "dev": true, + "optionalDependencies": { + "graceful-fs": "^4.1.6" + } + }, + "node_modules/solc/node_modules/rimraf": { + "version": "2.7.1", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.7.1.tgz", + "integrity": "sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w==", "dev": true, "dependencies": { - "@sinonjs/commons": "^1.8.3", - "@sinonjs/fake-timers": "^9.0.0", - "@sinonjs/samsam": "^6.1.1", - "diff": "^5.0.0", - "nise": "^5.1.1", - "supports-color": "^7.2.0" + "glob": "^7.1.3" }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/sinon" + "bin": { + "rimraf": "bin.js" } }, - "node_modules/slash": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz", - "integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==", + "node_modules/solc/node_modules/semver": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", + "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", "dev": true, - "engines": { - "node": ">=8" + "bin": { + "semver": "bin/semver" } }, "node_modules/source-map": { - "version": "0.5.7", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", - "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=", + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", "dev": true, "engines": { "node": ">=0.10.0" } }, + "node_modules/source-map-support": { + "version": "0.5.21", + "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.21.tgz", + "integrity": "sha512-uBHU3L3czsIyYXKX88fdrGovxdSCoTGDRZ6SYXtSRxLZUzHg5P/66Ht6uoUlHu9EZod+inXhKo3qQgwXUT/y1w==", + "dev": true, + "dependencies": { + "buffer-from": "^1.0.0", + "source-map": "^0.6.0" + } + }, "node_modules/spawn-sync": { "version": "1.0.15", "resolved": "https://registry.npmjs.org/spawn-sync/-/spawn-sync-1.0.15.tgz", - "integrity": "sha1-sAeZVX63+wyDdsKdROih6mfldHY=", + "integrity": "sha512-9DWBgrgYZzNghseho0JOuh+5fg9u6QWhAWa51QC7+U5rCheZ/j1DrEZnyE0RBBRqZ9uEXGPgSSM0nky6burpVw==", "dev": true, "hasInstallScript": true, "dependencies": { @@ -5024,9 +7310,39 @@ "node_modules/sprintf-js": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", - "integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=", + "integrity": "sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g==", "dev": true }, + "node_modules/stacktrace-parser": { + "version": "0.1.10", + "resolved": "https://registry.npmjs.org/stacktrace-parser/-/stacktrace-parser-0.1.10.tgz", + "integrity": "sha512-KJP1OCML99+8fhOHxwwzyWrlUuVX5GQ0ZpJTd1DFXhdkrvg1szxfHhawXUZ3g9TkXORQd4/WG68jMlQZ2p8wlg==", + "dev": true, + "dependencies": { + "type-fest": "^0.7.1" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/stacktrace-parser/node_modules/type-fest": { + "version": "0.7.1", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.7.1.tgz", + "integrity": "sha512-Ne2YiiGN8bmrmJJEuTWTLJR32nh/JdL1+PSicowtNb0WFpn59GK8/lfD61bVtzguz7b3PBt74nxpv/Pw5po5Rg==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/statuses": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/statuses/-/statuses-2.0.1.tgz", + "integrity": "sha512-RwNA9Z/7PrK06rYLIzFMlaF+l73iwpzsqRIFgbMLbTcLD6cOao82TaWefPXQvB2fOC4AjuYSEndS7N/mTCbkdQ==", + "dev": true, + "engines": { + "node": ">= 0.8" + } + }, "node_modules/string_decoder": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", @@ -5050,26 +7366,28 @@ } }, "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==", + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/string.prototype.trimend/-/string.prototype.trimend-1.0.5.tgz", + "integrity": "sha512-I7RGvmjV4pJ7O3kdf+LXFpVfdNOxtCW/2C8f6jNiW4+PQchwxkCDzlk1/7p+Wl4bqFIZeF47qAHXLuHHWKAxog==", "dev": true, "dependencies": { "call-bind": "^1.0.2", - "define-properties": "^1.1.3" + "define-properties": "^1.1.4", + "es-abstract": "^1.19.5" }, "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==", + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/string.prototype.trimstart/-/string.prototype.trimstart-1.0.5.tgz", + "integrity": "sha512-THx16TJCGlsN0o6dl2o6ncWUsdgnLRSA23rRE5pyGBw/mLr3Ej/R2LaqCtgP8VNMGZsvMWnf9ooZPyY2bHvUFg==", "dev": true, "dependencies": { "call-bind": "^1.0.2", - "define-properties": "^1.1.3" + "define-properties": "^1.1.4", + "es-abstract": "^1.19.5" }, "funding": { "url": "https://github.com/sponsors/ljharb" @@ -5096,6 +7414,19 @@ "node": ">=8" } }, + "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": "sha512-q8d4ue7JGEiVcypji1bALTos+0pWtyGlivAWyPuTkHzuTCJqrK9sWxYQZUq6Nq3cuyv3bm734IhHvHtGGURU6A==", + "dev": true, + "dependencies": { + "is-hex-prefixed": "1.0.0" + }, + "engines": { + "node": ">=6.5.0", + "npm": ">=3" + } + }, "node_modules/strip-json-comments": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", @@ -5155,13 +7486,25 @@ "node_modules/text-table": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", - "integrity": "sha1-f17oI66AUgfACvLfSoTsP8+lcLQ=", + "integrity": "sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw==", "dev": true }, + "node_modules/tmp": { + "version": "0.0.33", + "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.0.33.tgz", + "integrity": "sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw==", + "dev": true, + "dependencies": { + "os-tmpdir": "~1.0.2" + }, + "engines": { + "node": ">=0.6.0" + } + }, "node_modules/to-fast-properties": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-2.0.0.tgz", - "integrity": "sha1-3F5pjL0HkmW8c+A3doGk5Og/YW4=", + "integrity": "sha512-/OaKK0xYrs3DmxRYqL/yDc+FxFUVYhDlXMhRmv3z915w2HF1tnN1omB354j8VUGO/hbRzyD6Y3sA7v7GS/ceog==", "dev": true, "engines": { "node": ">=4" @@ -5179,18 +7522,33 @@ "node": ">=8.0" } }, + "node_modules/toidentifier": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.1.tgz", + "integrity": "sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA==", + "dev": true, + "engines": { + "node": ">=0.6" + } + }, "node_modules/tr46": { "version": "0.0.3", "resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz", - "integrity": "sha1-gYT9NH2snNwYWZLzpmIuFLnZq2o=" + "integrity": "sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==" + }, + "node_modules/true-case-path": { + "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==", + "dev": true }, "node_modules/ts-node": { - "version": "10.7.0", - "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-10.7.0.tgz", - "integrity": "sha512-TbIGS4xgJoX2i3do417KSaep1uRAW/Lu+WAL2doDHC0D6ummjirVOXU5/7aiZotbQ5p1Zp9tP7U6cYhA0O7M8A==", + "version": "10.8.2", + "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-10.8.2.tgz", + "integrity": "sha512-LYdGnoGddf1D6v8REPtIH+5iq/gTDuZqv2/UJUU7tKjuEU8xVZorBM+buCGNjj+pGEud+sOoM4CX3/YzINpENA==", "dev": true, "dependencies": { - "@cspotcode/source-map-support": "0.7.0", + "@cspotcode/source-map-support": "^0.8.0", "@tsconfig/node10": "^1.0.7", "@tsconfig/node12": "^1.0.7", "@tsconfig/node14": "^1.0.0", @@ -5201,7 +7559,7 @@ "create-require": "^1.1.0", "diff": "^4.0.1", "make-error": "^1.1.1", - "v8-compile-cache-lib": "^3.0.0", + "v8-compile-cache-lib": "^3.0.1", "yn": "3.1.1" }, "bin": { @@ -5263,7 +7621,7 @@ "node_modules/tsconfig-paths/node_modules/strip-bom": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz", - "integrity": "sha1-IzTBjpx1n3vdVv3vfprj1YjmjtM=", + "integrity": "sha512-vavAMRXOgBVNF6nyEEmL3DBK19iRpDcoIwW+swQ+CbGiu7lju6t+JklA1MHweoWtadgt4ISVUsXLyDq34ddcwA==", "dev": true, "engines": { "node": ">=4" @@ -5275,6 +7633,12 @@ "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==", "dev": true }, + "node_modules/tsort": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/tsort/-/tsort-0.0.1.tgz", + "integrity": "sha512-Tyrf5mxF8Ofs1tNoxA13lFeZ2Zrbd6cKbuH3V+MQ5sb6DtBj5FjrXVsRWT8YvNAQTqNoz66dz1WsbigI22aEnw==", + "dev": true + }, "node_modules/tsutils": { "version": "3.21.0", "resolved": "https://registry.npmjs.org/tsutils/-/tsutils-3.21.0.tgz", @@ -5290,6 +7654,18 @@ "typescript": ">=2.8.0 || >= 3.2.0-dev || >= 3.3.0-dev || >= 3.4.0-dev || >= 3.5.0-dev || >= 3.6.0-dev || >= 3.6.0-beta || >= 3.7.0-dev || >= 3.7.0-beta" } }, + "node_modules/tweetnacl": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-1.0.3.tgz", + "integrity": "sha512-6rt+RN7aOi1nGMyC4Xa5DdYiukl2UWCbcJft7YhxReBGQD7OAM8Pbxw6YMo4r2diNEA8FEmu32YOn9rhaiE5yw==", + "dev": true + }, + "node_modules/tweetnacl-util": { + "version": "0.15.1", + "resolved": "https://registry.npmjs.org/tweetnacl-util/-/tweetnacl-util-0.15.1.tgz", + "integrity": "sha512-RKJBIj8lySrShN4w6i/BonWp2Z/uxwC3h4y7xsRrpP59ZboCd0GpEVsOnMDYLMmKBpYhb5TgHzZXy7wTfYFBRw==", + "dev": true + }, "node_modules/type": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/type/-/type-1.2.0.tgz", @@ -5331,7 +7707,7 @@ "node_modules/typedarray": { "version": "0.0.6", "resolved": "https://registry.npmjs.org/typedarray/-/typedarray-0.0.6.tgz", - "integrity": "sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c=", + "integrity": "sha512-/aCDEGatGvZ2BIk+HmLf4ifCJFwvKFNb9/JeZPMulfgFracn9QFcAf5GO8B/mweUjSoblS5In0cWhqpfs/5PQA==", "dev": true }, "node_modules/typedarray-to-buffer": { @@ -5356,20 +7732,38 @@ } }, "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==", + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/unbox-primitive/-/unbox-primitive-1.0.2.tgz", + "integrity": "sha512-61pPlCD9h51VoreyJ0BReideM3MDKMKnh6+V9L08331ipq6Q8OFXZYiqP6n/tbHx4s5I9uRhcye6BrbkizkBDw==", "dev": true, "dependencies": { - "function-bind": "^1.1.1", - "has-bigints": "^1.0.1", - "has-symbols": "^1.0.2", + "call-bind": "^1.0.2", + "has-bigints": "^1.0.2", + "has-symbols": "^1.0.3", "which-boxed-primitive": "^1.0.2" }, "funding": { "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/undici": { + "version": "5.6.0", + "resolved": "https://registry.npmjs.org/undici/-/undici-5.6.0.tgz", + "integrity": "sha512-mc+8SY1fXubTrdx4CXDkeFFGV8lI3Tq4I/70U1V8Z6g4iscGII0uLO7CPnDt56bXEbvaKwo2T2+VrteWbZiXiQ==", + "dev": true, + "engines": { + "node": ">=12.18" + } + }, + "node_modules/universalify": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz", + "integrity": "sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==", + "dev": true, + "engines": { + "node": ">= 4.0.0" + } + }, "node_modules/unorm": { "version": "1.6.0", "resolved": "https://registry.npmjs.org/unorm/-/unorm-1.6.0.tgz", @@ -5378,6 +7772,41 @@ "node": ">= 0.4.0" } }, + "node_modules/unpipe": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz", + "integrity": "sha512-pjy2bYhSsufwWlKwPc+l3cN7+wuJlK6uz0YdJEOlQDbl6jo/YlPi4mb8agUkVC8BF7V8NuzeyPNqRksA3hztKQ==", + "dev": true, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/update-browserslist-db": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.0.4.tgz", + "integrity": "sha512-jnmO2BEGUjsMOe/Fg9u0oczOe/ppIDZPebzccl1yDWGLFP16Pa1/RM5wEoKYPG2zstNcDuAStejyxsOuKINdGA==", + "dev": true, + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/browserslist" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/browserslist" + } + ], + "dependencies": { + "escalade": "^3.1.1", + "picocolors": "^1.0.0" + }, + "bin": { + "browserslist-lint": "cli.js" + }, + "peerDependencies": { + "browserslist": ">= 4.21.0" + } + }, "node_modules/uri-js": { "version": "4.4.1", "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", @@ -5402,7 +7831,7 @@ "node_modules/util-deprecate": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", - "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=" + "integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==" }, "node_modules/uuid": { "version": "3.4.0", @@ -5420,15 +7849,15 @@ "dev": true }, "node_modules/v8-compile-cache-lib": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/v8-compile-cache-lib/-/v8-compile-cache-lib-3.0.0.tgz", - "integrity": "sha512-mpSYqfsFvASnSn5qMiwrr4VKfumbPyONLCOPmsR3A6pTY/r0+tSaVbgPWSAIuzbk3lCTa+FForeTiO+wBQGkjA==", + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/v8-compile-cache-lib/-/v8-compile-cache-lib-3.0.1.tgz", + "integrity": "sha512-wa7YjyUGfNZngI/vtK0UHAN+lgDCxBPCylVXGp0zu59Fz5aiGtNXaq3DhIov063MorB+VfufLh3JlF2KdTK3xg==", "dev": true }, "node_modules/webidl-conversions": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz", - "integrity": "sha1-JFNCdeKnvGvnvIZhHMFq4KVlSHE=" + "integrity": "sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==" }, "node_modules/websocket": { "version": "1.0.34", @@ -5457,12 +7886,12 @@ "node_modules/websocket/node_modules/ms": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=" + "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==" }, "node_modules/whatwg-url": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz", - "integrity": "sha1-lmRU6HZUYuN2RNNib2dCzotwll0=", + "integrity": "sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==", "dependencies": { "tr46": "~0.0.3", "webidl-conversions": "^3.0.0" @@ -5502,7 +7931,7 @@ "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=", + "integrity": "sha512-B+enWhmw6cjfVC7kS8Pj9pCrKSc5txArRyaYGe088shv/FGWH+0Rjx/xPgtsWfsUtS27FkP697E4DDhgrgoc0Q==", "dev": true }, "node_modules/word-wrap": { @@ -5540,7 +7969,7 @@ "node_modules/wrappy": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", - "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", + "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==", "dev": true }, "node_modules/write-file-atomic": { @@ -5555,6 +7984,35 @@ "typedarray-to-buffer": "^3.1.5" } }, + "node_modules/ws": { + "version": "7.4.6", + "resolved": "https://registry.npmjs.org/ws/-/ws-7.4.6.tgz", + "integrity": "sha512-YmhHDO4MzaDLB+M9ym/mDA5z0naX8j7SIlT8f8z+I0VtzsRbekxEutHSme7NPS2qE8StCYQNUnfWdXta/Yu85A==", + "engines": { + "node": ">=8.3.0" + }, + "peerDependencies": { + "bufferutil": "^4.0.1", + "utf-8-validate": "^5.0.2" + }, + "peerDependenciesMeta": { + "bufferutil": { + "optional": true + }, + "utf-8-validate": { + "optional": true + } + } + }, + "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, + "engines": { + "node": ">=0.4" + } + }, "node_modules/y18n": { "version": "5.0.8", "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz", @@ -5567,15 +8025,15 @@ "node_modules/yaeti": { "version": "0.0.6", "resolved": "https://registry.npmjs.org/yaeti/-/yaeti-0.0.6.tgz", - "integrity": "sha1-8m9ITXJoTPQr7ft2lwqhYI+/lXc=", + "integrity": "sha512-MvQa//+KcZCUkBTIC9blM+CU9J2GzuTytsOUwf2lidtvkx/6gnEp1QvJv34t9vdjhFmha/mUiNDbN0D0mJWdug==", "engines": { "node": ">=0.10.32" } }, "node_modules/yallist": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", - "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.1.1.tgz", + "integrity": "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==", "dev": true }, "node_modules/yargs": { @@ -5668,49 +8126,50 @@ }, "dependencies": { "@ampproject/remapping": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/@ampproject/remapping/-/remapping-2.1.2.tgz", - "integrity": "sha512-hoyByceqwKirw7w3Z7gnIIZC3Wx3J484Y3L/cMpXFbr7d9ZQj2mODrirNzcJa+SM3UlpWXYvKV4RlRpFXlWgXg==", + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/@ampproject/remapping/-/remapping-2.2.0.tgz", + "integrity": "sha512-qRmjj8nj9qmLTQXXmaR1cck3UXSRMPrbsLJAasZpF+t3riI71BXed5ebIOYwQntykeZuhjsdweEc9BxH5Jc26w==", "dev": true, "requires": { - "@jridgewell/trace-mapping": "^0.3.0" + "@jridgewell/gen-mapping": "^0.1.0", + "@jridgewell/trace-mapping": "^0.3.9" } }, "@babel/code-frame": { - "version": "7.16.7", - "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.16.7.tgz", - "integrity": "sha512-iAXqUn8IIeBTNd72xsFlgaXHkMBMt6y4HJp1tIaK465CWLT/fG1aqB7ykr95gHHmlBdGbFeWWfyB4NJJ0nmeIg==", + "version": "7.18.6", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.18.6.tgz", + "integrity": "sha512-TDCmlK5eOvH+eH7cdAFlNXeVJqWIQ7gW9tY1GJIpUtFb6CmjVyq2VM3u71bOyR8CRihcCgMUYoDNyLXao3+70Q==", "dev": true, "requires": { - "@babel/highlight": "^7.16.7" + "@babel/highlight": "^7.18.6" } }, "@babel/compat-data": { - "version": "7.17.7", - "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.17.7.tgz", - "integrity": "sha512-p8pdE6j0a29TNGebNm7NzYZWB3xVZJBZ7XGs42uAKzQo8VQ3F0By/cQCtUEABwIqw5zo6WA4NbmxsfzADzMKnQ==", + "version": "7.18.6", + "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.18.6.tgz", + "integrity": "sha512-tzulrgDT0QD6U7BJ4TKVk2SDDg7wlP39P9yAx1RfLy7vP/7rsDRlWVfbWxElslu56+r7QOhB2NSDsabYYruoZQ==", "dev": true }, "@babel/core": { - "version": "7.17.8", - "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.17.8.tgz", - "integrity": "sha512-OdQDV/7cRBtJHLSOBqqbYNkOcydOgnX59TZx4puf41fzcVtN3e/4yqY8lMQsK+5X2lJtAdmA+6OHqsj1hBJ4IQ==", + "version": "7.18.6", + "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.18.6.tgz", + "integrity": "sha512-cQbWBpxcbbs/IUredIPkHiAGULLV8iwgNRMFzvbhEXISp4f3rUUXE5+TIw6KwUWUR3DwyI6gmBRnmAtYaWehwQ==", "dev": true, "requires": { "@ampproject/remapping": "^2.1.0", - "@babel/code-frame": "^7.16.7", - "@babel/generator": "^7.17.7", - "@babel/helper-compilation-targets": "^7.17.7", - "@babel/helper-module-transforms": "^7.17.7", - "@babel/helpers": "^7.17.8", - "@babel/parser": "^7.17.8", - "@babel/template": "^7.16.7", - "@babel/traverse": "^7.17.3", - "@babel/types": "^7.17.0", + "@babel/code-frame": "^7.18.6", + "@babel/generator": "^7.18.6", + "@babel/helper-compilation-targets": "^7.18.6", + "@babel/helper-module-transforms": "^7.18.6", + "@babel/helpers": "^7.18.6", + "@babel/parser": "^7.18.6", + "@babel/template": "^7.18.6", + "@babel/traverse": "^7.18.6", + "@babel/types": "^7.18.6", "convert-source-map": "^1.7.0", "debug": "^4.1.0", "gensync": "^1.0.0-beta.2", - "json5": "^2.1.2", + "json5": "^2.2.1", "semver": "^6.3.0" }, "dependencies": { @@ -5723,25 +8182,38 @@ } }, "@babel/generator": { - "version": "7.17.7", - "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.17.7.tgz", - "integrity": "sha512-oLcVCTeIFadUoArDTwpluncplrYBmTCCZZgXCbgNGvOBBiSDDK3eWO4b/+eOTli5tKv1lg+a5/NAXg+nTcei1w==", + "version": "7.18.7", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.18.7.tgz", + "integrity": "sha512-shck+7VLlY72a2w9c3zYWuE1pwOKEiQHV7GTUbSnhyl5eu3i04t30tBY82ZRWrDfo3gkakCFtevExnxbkf2a3A==", "dev": true, "requires": { - "@babel/types": "^7.17.0", - "jsesc": "^2.5.1", - "source-map": "^0.5.0" + "@babel/types": "^7.18.7", + "@jridgewell/gen-mapping": "^0.3.2", + "jsesc": "^2.5.1" + }, + "dependencies": { + "@jridgewell/gen-mapping": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.2.tgz", + "integrity": "sha512-mh65xKQAzI6iBcFzwv28KVWSmCkdRBWoOh+bYQGW3+6OZvbbN3TqMGo5hqYxQniRcH9F2VZIoJCm4pa3BPDK/A==", + "dev": true, + "requires": { + "@jridgewell/set-array": "^1.0.1", + "@jridgewell/sourcemap-codec": "^1.4.10", + "@jridgewell/trace-mapping": "^0.3.9" + } + } } }, "@babel/helper-compilation-targets": { - "version": "7.17.7", - "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.17.7.tgz", - "integrity": "sha512-UFzlz2jjd8kroj0hmCFV5zr+tQPi1dpC2cRsDV/3IEW8bJfCPrPpmcSN6ZS8RqIq4LXcmpipCQFPddyFA5Yc7w==", + "version": "7.18.6", + "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.18.6.tgz", + "integrity": "sha512-vFjbfhNCzqdeAtZflUFrG5YIFqGTqsctrtkZ1D/NB0mDW9TwW3GmmUepYY4G9wCET5rY5ugz4OGTcLd614IzQg==", "dev": true, "requires": { - "@babel/compat-data": "^7.17.7", - "@babel/helper-validator-option": "^7.16.7", - "browserslist": "^4.17.5", + "@babel/compat-data": "^7.18.6", + "@babel/helper-validator-option": "^7.18.6", + "browserslist": "^4.20.2", "semver": "^6.3.0" }, "dependencies": { @@ -5754,116 +8226,103 @@ } }, "@babel/helper-environment-visitor": { - "version": "7.16.7", - "resolved": "https://registry.npmjs.org/@babel/helper-environment-visitor/-/helper-environment-visitor-7.16.7.tgz", - "integrity": "sha512-SLLb0AAn6PkUeAfKJCCOl9e1R53pQlGAfc4y4XuMRZfqeMYLE0dM1LMhqbGAlGQY0lfw5/ohoYWAe9V1yibRag==", - "dev": true, - "requires": { - "@babel/types": "^7.16.7" - } + "version": "7.18.6", + "resolved": "https://registry.npmjs.org/@babel/helper-environment-visitor/-/helper-environment-visitor-7.18.6.tgz", + "integrity": "sha512-8n6gSfn2baOY+qlp+VSzsosjCVGFqWKmDF0cCWOybh52Dw3SEyoWR1KrhMJASjLwIEkkAufZ0xvr+SxLHSpy2Q==", + "dev": true }, "@babel/helper-function-name": { - "version": "7.16.7", - "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.16.7.tgz", - "integrity": "sha512-QfDfEnIUyyBSR3HtrtGECuZ6DAyCkYFp7GHl75vFtTnn6pjKeK0T1DB5lLkFvBea8MdaiUABx3osbgLyInoejA==", - "dev": true, - "requires": { - "@babel/helper-get-function-arity": "^7.16.7", - "@babel/template": "^7.16.7", - "@babel/types": "^7.16.7" - } - }, - "@babel/helper-get-function-arity": { - "version": "7.16.7", - "resolved": "https://registry.npmjs.org/@babel/helper-get-function-arity/-/helper-get-function-arity-7.16.7.tgz", - "integrity": "sha512-flc+RLSOBXzNzVhcLu6ujeHUrD6tANAOU5ojrRx/as+tbzf8+stUCj7+IfRRoAbEZqj/ahXEMsjhOhgeZsrnTw==", + "version": "7.18.6", + "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.18.6.tgz", + "integrity": "sha512-0mWMxV1aC97dhjCah5U5Ua7668r5ZmSC2DLfH2EZnf9c3/dHZKiFa5pRLMH5tjSl471tY6496ZWk/kjNONBxhw==", "dev": true, "requires": { - "@babel/types": "^7.16.7" + "@babel/template": "^7.18.6", + "@babel/types": "^7.18.6" } }, "@babel/helper-hoist-variables": { - "version": "7.16.7", - "resolved": "https://registry.npmjs.org/@babel/helper-hoist-variables/-/helper-hoist-variables-7.16.7.tgz", - "integrity": "sha512-m04d/0Op34H5v7pbZw6pSKP7weA6lsMvfiIAMeIvkY/R4xQtBSMFEigu9QTZ2qB/9l22vsxtM8a+Q8CzD255fg==", + "version": "7.18.6", + "resolved": "https://registry.npmjs.org/@babel/helper-hoist-variables/-/helper-hoist-variables-7.18.6.tgz", + "integrity": "sha512-UlJQPkFqFULIcyW5sbzgbkxn2FKRgwWiRexcuaR8RNJRy8+LLveqPjwZV/bwrLZCN0eUHD/x8D0heK1ozuoo6Q==", "dev": true, "requires": { - "@babel/types": "^7.16.7" + "@babel/types": "^7.18.6" } }, "@babel/helper-module-imports": { - "version": "7.16.7", - "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.16.7.tgz", - "integrity": "sha512-LVtS6TqjJHFc+nYeITRo6VLXve70xmq7wPhWTqDJusJEgGmkAACWwMiTNrvfoQo6hEhFwAIixNkvB0jPXDL8Wg==", + "version": "7.18.6", + "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.18.6.tgz", + "integrity": "sha512-0NFvs3VkuSYbFi1x2Vd6tKrywq+z/cLeYC/RJNFrIX/30Bf5aiGYbtvGXolEktzJH8o5E5KJ3tT+nkxuuZFVlA==", "dev": true, "requires": { - "@babel/types": "^7.16.7" + "@babel/types": "^7.18.6" } }, "@babel/helper-module-transforms": { - "version": "7.17.7", - "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.17.7.tgz", - "integrity": "sha512-VmZD99F3gNTYB7fJRDTi+u6l/zxY0BE6OIxPSU7a50s6ZUQkHwSDmV92FfM+oCG0pZRVojGYhkR8I0OGeCVREw==", + "version": "7.18.6", + "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.18.6.tgz", + "integrity": "sha512-L//phhB4al5uucwzlimruukHB3jRd5JGClwRMD/ROrVjXfLqovYnvQrK/JK36WYyVwGGO7OD3kMyVTjx+WVPhw==", "dev": true, "requires": { - "@babel/helper-environment-visitor": "^7.16.7", - "@babel/helper-module-imports": "^7.16.7", - "@babel/helper-simple-access": "^7.17.7", - "@babel/helper-split-export-declaration": "^7.16.7", - "@babel/helper-validator-identifier": "^7.16.7", - "@babel/template": "^7.16.7", - "@babel/traverse": "^7.17.3", - "@babel/types": "^7.17.0" + "@babel/helper-environment-visitor": "^7.18.6", + "@babel/helper-module-imports": "^7.18.6", + "@babel/helper-simple-access": "^7.18.6", + "@babel/helper-split-export-declaration": "^7.18.6", + "@babel/helper-validator-identifier": "^7.18.6", + "@babel/template": "^7.18.6", + "@babel/traverse": "^7.18.6", + "@babel/types": "^7.18.6" } }, "@babel/helper-simple-access": { - "version": "7.17.7", - "resolved": "https://registry.npmjs.org/@babel/helper-simple-access/-/helper-simple-access-7.17.7.tgz", - "integrity": "sha512-txyMCGroZ96i+Pxr3Je3lzEJjqwaRC9buMUgtomcrLe5Nd0+fk1h0LLA+ixUF5OW7AhHuQ7Es1WcQJZmZsz2XA==", + "version": "7.18.6", + "resolved": "https://registry.npmjs.org/@babel/helper-simple-access/-/helper-simple-access-7.18.6.tgz", + "integrity": "sha512-iNpIgTgyAvDQpDj76POqg+YEt8fPxx3yaNBg3S30dxNKm2SWfYhD0TGrK/Eu9wHpUW63VQU894TsTg+GLbUa1g==", "dev": true, "requires": { - "@babel/types": "^7.17.0" + "@babel/types": "^7.18.6" } }, "@babel/helper-split-export-declaration": { - "version": "7.16.7", - "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.16.7.tgz", - "integrity": "sha512-xbWoy/PFoxSWazIToT9Sif+jJTlrMcndIsaOKvTA6u7QEo7ilkRZpjew18/W3c7nm8fXdUDXh02VXTbZ0pGDNw==", + "version": "7.18.6", + "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.18.6.tgz", + "integrity": "sha512-bde1etTx6ZyTmobl9LLMMQsaizFVZrquTEHOqKeQESMKo4PlObf+8+JA25ZsIpZhT/WEd39+vOdLXAFG/nELpA==", "dev": true, "requires": { - "@babel/types": "^7.16.7" + "@babel/types": "^7.18.6" } }, "@babel/helper-validator-identifier": { - "version": "7.16.7", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.16.7.tgz", - "integrity": "sha512-hsEnFemeiW4D08A5gUAZxLBTXpZ39P+a+DGDsHw1yxqyQ/jzFEnxf5uTEGp+3bzAbNOxU1paTgYS4ECU/IgfDw==", + "version": "7.18.6", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.18.6.tgz", + "integrity": "sha512-MmetCkz9ej86nJQV+sFCxoGGrUbU3q02kgLciwkrt9QqEB7cP39oKEY0PakknEO0Gu20SskMRi+AYZ3b1TpN9g==", "dev": true }, "@babel/helper-validator-option": { - "version": "7.16.7", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-option/-/helper-validator-option-7.16.7.tgz", - "integrity": "sha512-TRtenOuRUVo9oIQGPC5G9DgK4743cdxvtOw0weQNpZXaS16SCBi5MNjZF8vba3ETURjZpTbVn7Vvcf2eAwFozQ==", + "version": "7.18.6", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-option/-/helper-validator-option-7.18.6.tgz", + "integrity": "sha512-XO7gESt5ouv/LRJdrVjkShckw6STTaB7l9BrpBaAHDeF5YZT+01PCwmR0SJHnkW6i8OwW/EVWRShfi4j2x+KQw==", "dev": true }, "@babel/helpers": { - "version": "7.17.8", - "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.17.8.tgz", - "integrity": "sha512-QcL86FGxpfSJwGtAvv4iG93UL6bmqBdmoVY0CMCU2g+oD2ezQse3PT5Pa+jiD6LJndBQi0EDlpzOWNlLuhz5gw==", + "version": "7.18.6", + "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.18.6.tgz", + "integrity": "sha512-vzSiiqbQOghPngUYt/zWGvK3LAsPhz55vc9XNN0xAl2gV4ieShI2OQli5duxWHD+72PZPTKAcfcZDE1Cwc5zsQ==", "dev": true, "requires": { - "@babel/template": "^7.16.7", - "@babel/traverse": "^7.17.3", - "@babel/types": "^7.17.0" + "@babel/template": "^7.18.6", + "@babel/traverse": "^7.18.6", + "@babel/types": "^7.18.6" } }, "@babel/highlight": { - "version": "7.16.10", - "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.16.10.tgz", - "integrity": "sha512-5FnTQLSLswEj6IkgVw5KusNUUFY9ZGqe/TRFnP/BKYHYgfh7tc+C7mwiy95/yNP7Dh9x580Vv8r7u7ZfTBFxdw==", + "version": "7.18.6", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.18.6.tgz", + "integrity": "sha512-u7stbOuYjaPezCuLj29hNW1v64M2Md2qupEKP1fHc7WdOA3DgLh37suiSrZYY7haUB7iBeQZ9P1uiRF359do3g==", "dev": true, "requires": { - "@babel/helper-validator-identifier": "^7.16.7", + "@babel/helper-validator-identifier": "^7.18.6", "chalk": "^2.0.0", "js-tokens": "^4.0.0" }, @@ -5900,19 +8359,19 @@ "color-name": { "version": "1.1.3", "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", - "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", + "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==", "dev": true }, "escape-string-regexp": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", - "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=", + "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", "dev": true }, "has-flag": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", - "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", + "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", "dev": true }, "supports-color": { @@ -5927,36 +8386,36 @@ } }, "@babel/parser": { - "version": "7.17.8", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.17.8.tgz", - "integrity": "sha512-BoHhDJrJXqcg+ZL16Xv39H9n+AqJ4pcDrQBGZN+wHxIysrLZ3/ECwCBUch/1zUNhnsXULcONU3Ei5Hmkfk6kiQ==", + "version": "7.18.6", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.18.6.tgz", + "integrity": "sha512-uQVSa9jJUe/G/304lXspfWVpKpK4euFLgGiMQFOCpM/bgcAdeoHwi/OQz23O9GK2osz26ZiXRRV9aV+Yl1O8tw==", "dev": true }, "@babel/template": { - "version": "7.16.7", - "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.16.7.tgz", - "integrity": "sha512-I8j/x8kHUrbYRTUxXrrMbfCa7jxkE7tZre39x3kjr9hvI82cK1FfqLygotcWN5kdPGWcLdWMHpSBavse5tWw3w==", + "version": "7.18.6", + "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.18.6.tgz", + "integrity": "sha512-JoDWzPe+wgBsTTgdnIma3iHNFC7YVJoPssVBDjiHfNlyt4YcunDtcDOUmfVDfCK5MfdsaIoX9PkijPhjH3nYUw==", "dev": true, "requires": { - "@babel/code-frame": "^7.16.7", - "@babel/parser": "^7.16.7", - "@babel/types": "^7.16.7" + "@babel/code-frame": "^7.18.6", + "@babel/parser": "^7.18.6", + "@babel/types": "^7.18.6" } }, "@babel/traverse": { - "version": "7.17.3", - "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.17.3.tgz", - "integrity": "sha512-5irClVky7TxRWIRtxlh2WPUUOLhcPN06AGgaQSB8AEwuyEBgJVuJ5imdHm5zxk8w0QS5T+tDfnDxAlhWjpb7cw==", - "dev": true, - "requires": { - "@babel/code-frame": "^7.16.7", - "@babel/generator": "^7.17.3", - "@babel/helper-environment-visitor": "^7.16.7", - "@babel/helper-function-name": "^7.16.7", - "@babel/helper-hoist-variables": "^7.16.7", - "@babel/helper-split-export-declaration": "^7.16.7", - "@babel/parser": "^7.17.3", - "@babel/types": "^7.17.0", + "version": "7.18.6", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.18.6.tgz", + "integrity": "sha512-zS/OKyqmD7lslOtFqbscH6gMLFYOfG1YPqCKfAW5KrTeolKqvB8UelR49Fpr6y93kYkW2Ik00mT1LOGiAGvizw==", + "dev": true, + "requires": { + "@babel/code-frame": "^7.18.6", + "@babel/generator": "^7.18.6", + "@babel/helper-environment-visitor": "^7.18.6", + "@babel/helper-function-name": "^7.18.6", + "@babel/helper-hoist-variables": "^7.18.6", + "@babel/helper-split-export-declaration": "^7.18.6", + "@babel/parser": "^7.18.6", + "@babel/types": "^7.18.6", "debug": "^4.1.0", "globals": "^11.1.0" }, @@ -5970,47 +8429,505 @@ } }, "@babel/types": { - "version": "7.17.0", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.17.0.tgz", - "integrity": "sha512-TmKSNO4D5rzhL5bjWFcVHHLETzfQ/AmbKpKPOSjlP0WoHZ6L911fgoOKY4Alp/emzG4cHJdyN49zpgkbXFEHHw==", + "version": "7.18.7", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.18.7.tgz", + "integrity": "sha512-QG3yxTcTIBoAcQmkCs+wAPYZhu7Dk9rXKacINfNbdJDNERTbLQbHGyVG8q/YGMPeCJRIhSY0+fTc5+xuh6WPSQ==", "dev": true, "requires": { - "@babel/helper-validator-identifier": "^7.16.7", + "@babel/helper-validator-identifier": "^7.18.6", "to-fast-properties": "^2.0.0" } }, - "@cspotcode/source-map-consumer": { - "version": "0.8.0", - "resolved": "https://registry.npmjs.org/@cspotcode/source-map-consumer/-/source-map-consumer-0.8.0.tgz", - "integrity": "sha512-41qniHzTU8yAGbCp04ohlmSrZf8bkf/iJsl3V0dRGsQN/5GFfx+LbCSsCpp2gqrqjTVg/K6O8ycoV35JIwAzAg==", - "dev": true - }, "@cspotcode/source-map-support": { - "version": "0.7.0", - "resolved": "https://registry.npmjs.org/@cspotcode/source-map-support/-/source-map-support-0.7.0.tgz", - "integrity": "sha512-X4xqRHqN8ACt2aHVe51OxeA2HjbcL4MqFqXkrmQszJ1NOUuUu5u6Vqx/0lZSVNku7velL5FC/s5uEAj1lsBMhA==", + "version": "0.8.1", + "resolved": "https://registry.npmjs.org/@cspotcode/source-map-support/-/source-map-support-0.8.1.tgz", + "integrity": "sha512-IchNf6dN4tHoMFIn/7OE8LWZ19Y6q/67Bmf6vnGREv8RSbBVb9LPJxEcnwrcwX6ixSvaiGoomAUvu4YSxXrVgw==", "dev": true, "requires": { - "@cspotcode/source-map-consumer": "0.8.0" + "@jridgewell/trace-mapping": "0.3.9" + }, + "dependencies": { + "@jridgewell/trace-mapping": { + "version": "0.3.9", + "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.9.tgz", + "integrity": "sha512-3Belt6tdc8bPgAtbcmdtNJlirVoTmEb5e2gC94PnkwEW9jI6CAHUeoG85tjWP5WquqfavoMtMwiG4P926ZKKuQ==", + "dev": true, + "requires": { + "@jridgewell/resolve-uri": "^3.0.3", + "@jridgewell/sourcemap-codec": "^1.4.10" + } + } } }, "@eslint/eslintrc": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-1.2.1.tgz", - "integrity": "sha512-bxvbYnBPN1Gibwyp6NrpnFzA3YtRL3BBAyEAFVIpNTm2Rn4Vy87GA5M4aSn3InRrlsbX5N0GW7XIx+U4SAEKdQ==", + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-1.3.0.tgz", + "integrity": "sha512-UWW0TMTmk2d7hLcWD1/e2g5HDM/HQ3csaLSqXCfqwh4uNDuNqlaKWXmEsL4Cs41Z0KnILNvwbHAah3C2yt06kw==", "dev": true, "requires": { "ajv": "^6.12.4", "debug": "^4.3.2", - "espree": "^9.3.1", - "globals": "^13.9.0", + "espree": "^9.3.2", + "globals": "^13.15.0", "ignore": "^5.2.0", "import-fresh": "^3.2.1", "js-yaml": "^4.1.0", - "minimatch": "^3.0.4", + "minimatch": "^3.1.2", "strip-json-comments": "^3.1.1" } }, + "@ethereumjs/block": { + "version": "3.6.3", + "resolved": "https://registry.npmjs.org/@ethereumjs/block/-/block-3.6.3.tgz", + "integrity": "sha512-CegDeryc2DVKnDkg5COQrE0bJfw/p0v3GBk2W5/Dj5dOVfEmb50Ux0GLnSPypooLnfqjwFaorGuT9FokWB3GRg==", + "dev": true, + "requires": { + "@ethereumjs/common": "^2.6.5", + "@ethereumjs/tx": "^3.5.2", + "ethereumjs-util": "^7.1.5", + "merkle-patricia-tree": "^4.2.4" + } + }, + "@ethereumjs/blockchain": { + "version": "5.5.3", + "resolved": "https://registry.npmjs.org/@ethereumjs/blockchain/-/blockchain-5.5.3.tgz", + "integrity": "sha512-bi0wuNJ1gw4ByNCV56H0Z4Q7D+SxUbwyG12Wxzbvqc89PXLRNR20LBcSUZRKpN0+YCPo6m0XZL/JLio3B52LTw==", + "dev": true, + "requires": { + "@ethereumjs/block": "^3.6.2", + "@ethereumjs/common": "^2.6.4", + "@ethereumjs/ethash": "^1.1.0", + "debug": "^4.3.3", + "ethereumjs-util": "^7.1.5", + "level-mem": "^5.0.1", + "lru-cache": "^5.1.1", + "semaphore-async-await": "^1.5.1" + } + }, + "@ethereumjs/common": { + "version": "2.6.5", + "resolved": "https://registry.npmjs.org/@ethereumjs/common/-/common-2.6.5.tgz", + "integrity": "sha512-lRyVQOeCDaIVtgfbowla32pzeDv2Obr8oR8Put5RdUBNRGr1VGPGQNGP6elWIpgK3YdpzqTOh4GyUGOureVeeA==", + "dev": true, + "requires": { + "crc-32": "^1.2.0", + "ethereumjs-util": "^7.1.5" + } + }, + "@ethereumjs/ethash": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@ethereumjs/ethash/-/ethash-1.1.0.tgz", + "integrity": "sha512-/U7UOKW6BzpA+Vt+kISAoeDie1vAvY4Zy2KF5JJb+So7+1yKmJeJEHOGSnQIj330e9Zyl3L5Nae6VZyh2TJnAA==", + "dev": true, + "requires": { + "@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": { + "version": "3.5.2", + "resolved": "https://registry.npmjs.org/@ethereumjs/tx/-/tx-3.5.2.tgz", + "integrity": "sha512-gQDNJWKrSDGu2w7w0PzVXVBNMzb7wwdDOmOqczmhNjqFxFuIbhVJDwiGEnxFNC2/b8ifcZzY7MLcluizohRzNw==", + "dev": true, + "requires": { + "@ethereumjs/common": "^2.6.4", + "ethereumjs-util": "^7.1.5" + } + }, + "@ethereumjs/vm": { + "version": "5.9.3", + "resolved": "https://registry.npmjs.org/@ethereumjs/vm/-/vm-5.9.3.tgz", + "integrity": "sha512-Ha04TeF8goEglr8eL7hkkYyjhzdZS0PsoRURzYlTF6I0VVId5KjKb0N7MrA8GMgheN+UeTncfTgYx52D/WhEmg==", + "dev": true, + "requires": { + "@ethereumjs/block": "^3.6.3", + "@ethereumjs/blockchain": "^5.5.3", + "@ethereumjs/common": "^2.6.5", + "@ethereumjs/tx": "^3.5.2", + "async-eventemitter": "^0.2.4", + "core-js-pure": "^3.0.1", + "debug": "^4.3.3", + "ethereumjs-util": "^7.1.5", + "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": { + "version": "5.6.4", + "resolved": "https://registry.npmjs.org/@ethersproject/abi/-/abi-5.6.4.tgz", + "integrity": "sha512-TTeZUlCeIHG6527/2goZA6gW5F8Emoc7MrZDC7hhP84aRGvW3TEdTnZR08Ls88YXM1m2SuK42Osw/jSi3uO8gg==", + "requires": { + "@ethersproject/address": "^5.6.1", + "@ethersproject/bignumber": "^5.6.2", + "@ethersproject/bytes": "^5.6.1", + "@ethersproject/constants": "^5.6.1", + "@ethersproject/hash": "^5.6.1", + "@ethersproject/keccak256": "^5.6.1", + "@ethersproject/logger": "^5.6.0", + "@ethersproject/properties": "^5.6.0", + "@ethersproject/strings": "^5.6.1" + } + }, + "@ethersproject/abstract-provider": { + "version": "5.6.1", + "resolved": "https://registry.npmjs.org/@ethersproject/abstract-provider/-/abstract-provider-5.6.1.tgz", + "integrity": "sha512-BxlIgogYJtp1FS8Muvj8YfdClk3unZH0vRMVX791Z9INBNT/kuACZ9GzaY1Y4yFq+YSy6/w4gzj3HCRKrK9hsQ==", + "requires": { + "@ethersproject/bignumber": "^5.6.2", + "@ethersproject/bytes": "^5.6.1", + "@ethersproject/logger": "^5.6.0", + "@ethersproject/networks": "^5.6.3", + "@ethersproject/properties": "^5.6.0", + "@ethersproject/transactions": "^5.6.2", + "@ethersproject/web": "^5.6.1" + } + }, + "@ethersproject/abstract-signer": { + "version": "5.6.2", + "resolved": "https://registry.npmjs.org/@ethersproject/abstract-signer/-/abstract-signer-5.6.2.tgz", + "integrity": "sha512-n1r6lttFBG0t2vNiI3HoWaS/KdOt8xyDjzlP2cuevlWLG6EX0OwcKLyG/Kp/cuwNxdy/ous+R/DEMdTUwWQIjQ==", + "requires": { + "@ethersproject/abstract-provider": "^5.6.1", + "@ethersproject/bignumber": "^5.6.2", + "@ethersproject/bytes": "^5.6.1", + "@ethersproject/logger": "^5.6.0", + "@ethersproject/properties": "^5.6.0" + } + }, + "@ethersproject/address": { + "version": "5.6.1", + "resolved": "https://registry.npmjs.org/@ethersproject/address/-/address-5.6.1.tgz", + "integrity": "sha512-uOgF0kS5MJv9ZvCz7x6T2EXJSzotiybApn4XlOgoTX0xdtyVIJ7pF+6cGPxiEq/dpBiTfMiw7Yc81JcwhSYA0Q==", + "requires": { + "@ethersproject/bignumber": "^5.6.2", + "@ethersproject/bytes": "^5.6.1", + "@ethersproject/keccak256": "^5.6.1", + "@ethersproject/logger": "^5.6.0", + "@ethersproject/rlp": "^5.6.1" + } + }, + "@ethersproject/base64": { + "version": "5.6.1", + "resolved": "https://registry.npmjs.org/@ethersproject/base64/-/base64-5.6.1.tgz", + "integrity": "sha512-qB76rjop6a0RIYYMiB4Eh/8n+Hxu2NIZm8S/Q7kNo5pmZfXhHGHmS4MinUainiBC54SCyRnwzL+KZjj8zbsSsw==", + "requires": { + "@ethersproject/bytes": "^5.6.1" + } + }, + "@ethersproject/basex": { + "version": "5.6.1", + "resolved": "https://registry.npmjs.org/@ethersproject/basex/-/basex-5.6.1.tgz", + "integrity": "sha512-a52MkVz4vuBXR06nvflPMotld1FJWSj2QT0985v7P/emPZO00PucFAkbcmq2vpVU7Ts7umKiSI6SppiLykVWsA==", + "requires": { + "@ethersproject/bytes": "^5.6.1", + "@ethersproject/properties": "^5.6.0" + } + }, + "@ethersproject/bignumber": { + "version": "5.6.2", + "resolved": "https://registry.npmjs.org/@ethersproject/bignumber/-/bignumber-5.6.2.tgz", + "integrity": "sha512-v7+EEUbhGqT3XJ9LMPsKvXYHFc8eHxTowFCG/HgJErmq4XHJ2WR7aeyICg3uTOAQ7Icn0GFHAohXEhxQHq4Ubw==", + "requires": { + "@ethersproject/bytes": "^5.6.1", + "@ethersproject/logger": "^5.6.0", + "bn.js": "^5.2.1" + }, + "dependencies": { + "bn.js": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-5.2.1.tgz", + "integrity": "sha512-eXRvHzWyYPBuB4NBy0cmYQjGitUrtqwbvlzP3G6VFnNRbsZQIxQ10PbKKHt8gZ/HW/D/747aDl+QkDqg3KQLMQ==" + } + } + }, + "@ethersproject/bytes": { + "version": "5.6.1", + "resolved": "https://registry.npmjs.org/@ethersproject/bytes/-/bytes-5.6.1.tgz", + "integrity": "sha512-NwQt7cKn5+ZE4uDn+X5RAXLp46E1chXoaMmrxAyA0rblpxz8t58lVkrHXoRIn0lz1joQElQ8410GqhTqMOwc6g==", + "requires": { + "@ethersproject/logger": "^5.6.0" + } + }, + "@ethersproject/constants": { + "version": "5.6.1", + "resolved": "https://registry.npmjs.org/@ethersproject/constants/-/constants-5.6.1.tgz", + "integrity": "sha512-QSq9WVnZbxXYFftrjSjZDUshp6/eKp6qrtdBtUCm0QxCV5z1fG/w3kdlcsjMCQuQHUnAclKoK7XpXMezhRDOLg==", + "requires": { + "@ethersproject/bignumber": "^5.6.2" + } + }, + "@ethersproject/contracts": { + "version": "5.6.2", + "resolved": "https://registry.npmjs.org/@ethersproject/contracts/-/contracts-5.6.2.tgz", + "integrity": "sha512-hguUA57BIKi6WY0kHvZp6PwPlWF87MCeB4B7Z7AbUpTxfFXFdn/3b0GmjZPagIHS+3yhcBJDnuEfU4Xz+Ks/8g==", + "requires": { + "@ethersproject/abi": "^5.6.3", + "@ethersproject/abstract-provider": "^5.6.1", + "@ethersproject/abstract-signer": "^5.6.2", + "@ethersproject/address": "^5.6.1", + "@ethersproject/bignumber": "^5.6.2", + "@ethersproject/bytes": "^5.6.1", + "@ethersproject/constants": "^5.6.1", + "@ethersproject/logger": "^5.6.0", + "@ethersproject/properties": "^5.6.0", + "@ethersproject/transactions": "^5.6.2" + } + }, + "@ethersproject/hash": { + "version": "5.6.1", + "resolved": "https://registry.npmjs.org/@ethersproject/hash/-/hash-5.6.1.tgz", + "integrity": "sha512-L1xAHurbaxG8VVul4ankNX5HgQ8PNCTrnVXEiFnE9xoRnaUcgfD12tZINtDinSllxPLCtGwguQxJ5E6keE84pA==", + "requires": { + "@ethersproject/abstract-signer": "^5.6.2", + "@ethersproject/address": "^5.6.1", + "@ethersproject/bignumber": "^5.6.2", + "@ethersproject/bytes": "^5.6.1", + "@ethersproject/keccak256": "^5.6.1", + "@ethersproject/logger": "^5.6.0", + "@ethersproject/properties": "^5.6.0", + "@ethersproject/strings": "^5.6.1" + } + }, + "@ethersproject/hdnode": { + "version": "5.6.2", + "resolved": "https://registry.npmjs.org/@ethersproject/hdnode/-/hdnode-5.6.2.tgz", + "integrity": "sha512-tERxW8Ccf9CxW2db3WsN01Qao3wFeRsfYY9TCuhmG0xNpl2IO8wgXU3HtWIZ49gUWPggRy4Yg5axU0ACaEKf1Q==", + "requires": { + "@ethersproject/abstract-signer": "^5.6.2", + "@ethersproject/basex": "^5.6.1", + "@ethersproject/bignumber": "^5.6.2", + "@ethersproject/bytes": "^5.6.1", + "@ethersproject/logger": "^5.6.0", + "@ethersproject/pbkdf2": "^5.6.1", + "@ethersproject/properties": "^5.6.0", + "@ethersproject/sha2": "^5.6.1", + "@ethersproject/signing-key": "^5.6.2", + "@ethersproject/strings": "^5.6.1", + "@ethersproject/transactions": "^5.6.2", + "@ethersproject/wordlists": "^5.6.1" + } + }, + "@ethersproject/json-wallets": { + "version": "5.6.1", + "resolved": "https://registry.npmjs.org/@ethersproject/json-wallets/-/json-wallets-5.6.1.tgz", + "integrity": "sha512-KfyJ6Zwz3kGeX25nLihPwZYlDqamO6pfGKNnVMWWfEVVp42lTfCZVXXy5Ie8IZTN0HKwAngpIPi7gk4IJzgmqQ==", + "requires": { + "@ethersproject/abstract-signer": "^5.6.2", + "@ethersproject/address": "^5.6.1", + "@ethersproject/bytes": "^5.6.1", + "@ethersproject/hdnode": "^5.6.2", + "@ethersproject/keccak256": "^5.6.1", + "@ethersproject/logger": "^5.6.0", + "@ethersproject/pbkdf2": "^5.6.1", + "@ethersproject/properties": "^5.6.0", + "@ethersproject/random": "^5.6.1", + "@ethersproject/strings": "^5.6.1", + "@ethersproject/transactions": "^5.6.2", + "aes-js": "3.0.0", + "scrypt-js": "3.0.1" + } + }, + "@ethersproject/keccak256": { + "version": "5.6.1", + "resolved": "https://registry.npmjs.org/@ethersproject/keccak256/-/keccak256-5.6.1.tgz", + "integrity": "sha512-bB7DQHCTRDooZZdL3lk9wpL0+XuG3XLGHLh3cePnybsO3V0rdCAOQGpn/0R3aODmnTOOkCATJiD2hnL+5bwthA==", + "requires": { + "@ethersproject/bytes": "^5.6.1", + "js-sha3": "0.8.0" + } + }, + "@ethersproject/logger": { + "version": "5.6.0", + "resolved": "https://registry.npmjs.org/@ethersproject/logger/-/logger-5.6.0.tgz", + "integrity": "sha512-BiBWllUROH9w+P21RzoxJKzqoqpkyM1pRnEKG69bulE9TSQD8SAIvTQqIMZmmCO8pUNkgLP1wndX1gKghSpBmg==" + }, + "@ethersproject/networks": { + "version": "5.6.4", + "resolved": "https://registry.npmjs.org/@ethersproject/networks/-/networks-5.6.4.tgz", + "integrity": "sha512-KShHeHPahHI2UlWdtDMn2lJETcbtaJge4k7XSjDR9h79QTd6yQJmv6Cp2ZA4JdqWnhszAOLSuJEd9C0PRw7hSQ==", + "requires": { + "@ethersproject/logger": "^5.6.0" + } + }, + "@ethersproject/pbkdf2": { + "version": "5.6.1", + "resolved": "https://registry.npmjs.org/@ethersproject/pbkdf2/-/pbkdf2-5.6.1.tgz", + "integrity": "sha512-k4gRQ+D93zDRPNUfmduNKq065uadC2YjMP/CqwwX5qG6R05f47boq6pLZtV/RnC4NZAYOPH1Cyo54q0c9sshRQ==", + "requires": { + "@ethersproject/bytes": "^5.6.1", + "@ethersproject/sha2": "^5.6.1" + } + }, + "@ethersproject/properties": { + "version": "5.6.0", + "resolved": "https://registry.npmjs.org/@ethersproject/properties/-/properties-5.6.0.tgz", + "integrity": "sha512-szoOkHskajKePTJSZ46uHUWWkbv7TzP2ypdEK6jGMqJaEt2sb0jCgfBo0gH0m2HBpRixMuJ6TBRaQCF7a9DoCg==", + "requires": { + "@ethersproject/logger": "^5.6.0" + } + }, + "@ethersproject/providers": { + "version": "5.6.8", + "resolved": "https://registry.npmjs.org/@ethersproject/providers/-/providers-5.6.8.tgz", + "integrity": "sha512-Wf+CseT/iOJjrGtAOf3ck9zS7AgPmr2fZ3N97r4+YXN3mBePTG2/bJ8DApl9mVwYL+RpYbNxMEkEp4mPGdwG/w==", + "requires": { + "@ethersproject/abstract-provider": "^5.6.1", + "@ethersproject/abstract-signer": "^5.6.2", + "@ethersproject/address": "^5.6.1", + "@ethersproject/base64": "^5.6.1", + "@ethersproject/basex": "^5.6.1", + "@ethersproject/bignumber": "^5.6.2", + "@ethersproject/bytes": "^5.6.1", + "@ethersproject/constants": "^5.6.1", + "@ethersproject/hash": "^5.6.1", + "@ethersproject/logger": "^5.6.0", + "@ethersproject/networks": "^5.6.3", + "@ethersproject/properties": "^5.6.0", + "@ethersproject/random": "^5.6.1", + "@ethersproject/rlp": "^5.6.1", + "@ethersproject/sha2": "^5.6.1", + "@ethersproject/strings": "^5.6.1", + "@ethersproject/transactions": "^5.6.2", + "@ethersproject/web": "^5.6.1", + "bech32": "1.1.4", + "ws": "7.4.6" + } + }, + "@ethersproject/random": { + "version": "5.6.1", + "resolved": "https://registry.npmjs.org/@ethersproject/random/-/random-5.6.1.tgz", + "integrity": "sha512-/wtPNHwbmng+5yi3fkipA8YBT59DdkGRoC2vWk09Dci/q5DlgnMkhIycjHlavrvrjJBkFjO/ueLyT+aUDfc4lA==", + "requires": { + "@ethersproject/bytes": "^5.6.1", + "@ethersproject/logger": "^5.6.0" + } + }, + "@ethersproject/rlp": { + "version": "5.6.1", + "resolved": "https://registry.npmjs.org/@ethersproject/rlp/-/rlp-5.6.1.tgz", + "integrity": "sha512-uYjmcZx+DKlFUk7a5/W9aQVaoEC7+1MOBgNtvNg13+RnuUwT4F0zTovC0tmay5SmRslb29V1B7Y5KCri46WhuQ==", + "requires": { + "@ethersproject/bytes": "^5.6.1", + "@ethersproject/logger": "^5.6.0" + } + }, + "@ethersproject/sha2": { + "version": "5.6.1", + "resolved": "https://registry.npmjs.org/@ethersproject/sha2/-/sha2-5.6.1.tgz", + "integrity": "sha512-5K2GyqcW7G4Yo3uenHegbXRPDgARpWUiXc6RiF7b6i/HXUoWlb7uCARh7BAHg7/qT/Q5ydofNwiZcim9qpjB6g==", + "requires": { + "@ethersproject/bytes": "^5.6.1", + "@ethersproject/logger": "^5.6.0", + "hash.js": "1.1.7" + } + }, + "@ethersproject/signing-key": { + "version": "5.6.2", + "resolved": "https://registry.npmjs.org/@ethersproject/signing-key/-/signing-key-5.6.2.tgz", + "integrity": "sha512-jVbu0RuP7EFpw82vHcL+GP35+KaNruVAZM90GxgQnGqB6crhBqW/ozBfFvdeImtmb4qPko0uxXjn8l9jpn0cwQ==", + "requires": { + "@ethersproject/bytes": "^5.6.1", + "@ethersproject/logger": "^5.6.0", + "@ethersproject/properties": "^5.6.0", + "bn.js": "^5.2.1", + "elliptic": "6.5.4", + "hash.js": "1.1.7" + }, + "dependencies": { + "bn.js": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-5.2.1.tgz", + "integrity": "sha512-eXRvHzWyYPBuB4NBy0cmYQjGitUrtqwbvlzP3G6VFnNRbsZQIxQ10PbKKHt8gZ/HW/D/747aDl+QkDqg3KQLMQ==" + } + } + }, + "@ethersproject/strings": { + "version": "5.6.1", + "resolved": "https://registry.npmjs.org/@ethersproject/strings/-/strings-5.6.1.tgz", + "integrity": "sha512-2X1Lgk6Jyfg26MUnsHiT456U9ijxKUybz8IM1Vih+NJxYtXhmvKBcHOmvGqpFSVJ0nQ4ZCoIViR8XlRw1v/+Cw==", + "requires": { + "@ethersproject/bytes": "^5.6.1", + "@ethersproject/constants": "^5.6.1", + "@ethersproject/logger": "^5.6.0" + } + }, + "@ethersproject/transactions": { + "version": "5.6.2", + "resolved": "https://registry.npmjs.org/@ethersproject/transactions/-/transactions-5.6.2.tgz", + "integrity": "sha512-BuV63IRPHmJvthNkkt9G70Ullx6AcM+SDc+a8Aw/8Yew6YwT51TcBKEp1P4oOQ/bP25I18JJr7rcFRgFtU9B2Q==", + "requires": { + "@ethersproject/address": "^5.6.1", + "@ethersproject/bignumber": "^5.6.2", + "@ethersproject/bytes": "^5.6.1", + "@ethersproject/constants": "^5.6.1", + "@ethersproject/keccak256": "^5.6.1", + "@ethersproject/logger": "^5.6.0", + "@ethersproject/properties": "^5.6.0", + "@ethersproject/rlp": "^5.6.1", + "@ethersproject/signing-key": "^5.6.2" + } + }, + "@ethersproject/units": { + "version": "5.6.1", + "resolved": "https://registry.npmjs.org/@ethersproject/units/-/units-5.6.1.tgz", + "integrity": "sha512-rEfSEvMQ7obcx3KWD5EWWx77gqv54K6BKiZzKxkQJqtpriVsICrktIQmKl8ReNToPeIYPnFHpXvKpi068YFZXw==", + "requires": { + "@ethersproject/bignumber": "^5.6.2", + "@ethersproject/constants": "^5.6.1", + "@ethersproject/logger": "^5.6.0" + } + }, + "@ethersproject/wallet": { + "version": "5.6.2", + "resolved": "https://registry.npmjs.org/@ethersproject/wallet/-/wallet-5.6.2.tgz", + "integrity": "sha512-lrgh0FDQPuOnHcF80Q3gHYsSUODp6aJLAdDmDV0xKCN/T7D99ta1jGVhulg3PY8wiXEngD0DfM0I2XKXlrqJfg==", + "requires": { + "@ethersproject/abstract-provider": "^5.6.1", + "@ethersproject/abstract-signer": "^5.6.2", + "@ethersproject/address": "^5.6.1", + "@ethersproject/bignumber": "^5.6.2", + "@ethersproject/bytes": "^5.6.1", + "@ethersproject/hash": "^5.6.1", + "@ethersproject/hdnode": "^5.6.2", + "@ethersproject/json-wallets": "^5.6.1", + "@ethersproject/keccak256": "^5.6.1", + "@ethersproject/logger": "^5.6.0", + "@ethersproject/properties": "^5.6.0", + "@ethersproject/random": "^5.6.1", + "@ethersproject/signing-key": "^5.6.2", + "@ethersproject/transactions": "^5.6.2", + "@ethersproject/wordlists": "^5.6.1" + } + }, + "@ethersproject/web": { + "version": "5.6.1", + "resolved": "https://registry.npmjs.org/@ethersproject/web/-/web-5.6.1.tgz", + "integrity": "sha512-/vSyzaQlNXkO1WV+RneYKqCJwualcUdx/Z3gseVovZP0wIlOFcCE1hkRhKBH8ImKbGQbMl9EAAyJFrJu7V0aqA==", + "requires": { + "@ethersproject/base64": "^5.6.1", + "@ethersproject/bytes": "^5.6.1", + "@ethersproject/logger": "^5.6.0", + "@ethersproject/properties": "^5.6.0", + "@ethersproject/strings": "^5.6.1" + } + }, + "@ethersproject/wordlists": { + "version": "5.6.1", + "resolved": "https://registry.npmjs.org/@ethersproject/wordlists/-/wordlists-5.6.1.tgz", + "integrity": "sha512-wiPRgBpNbNwCQFoCr8bcWO8o5I810cqO6mkdtKfLKFlLxeCWcnzDi4Alu8iyNzlhYuS9npCwivMbRWF19dyblw==", + "requires": { + "@ethersproject/bytes": "^5.6.1", + "@ethersproject/hash": "^5.6.1", + "@ethersproject/logger": "^5.6.0", + "@ethersproject/properties": "^5.6.0", + "@ethersproject/strings": "^5.6.1" + } + }, "@harmony-js/account": { "version": "0.1.56", "resolved": "https://registry.npmjs.org/@harmony-js/account/-/account-0.1.56.tgz", @@ -6097,6 +9014,13 @@ "pbkdf2": "^3.0.17", "scrypt-shim": "github:web3-js/scrypt-shim", "uuid": "^3.3.2" + }, + "dependencies": { + "aes-js": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/aes-js/-/aes-js-3.1.2.tgz", + "integrity": "sha512-e5pEa2kBnBOgR4Y/p20pskXI74UEz7de8ZGVo58asOtvSVG5YAbJeELPZxOmt+Bnz3rX753YKhfIn4X4l1PPRQ==" + } } }, "@harmony-js/network": { @@ -6253,28 +9177,74 @@ "integrity": "sha512-ZXRY4jNvVgSVQ8DL3LTcakaAtXwTVUxE81hslsyD2AtoXW/wVob10HkOJ1X/pAlcI7D+2YoZKg5do8G/w6RYgA==", "dev": true }, + "@jridgewell/gen-mapping": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.1.1.tgz", + "integrity": "sha512-sQXCasFk+U8lWYEe66WxRDOE9PjVz4vSM51fTu3Hw+ClTpUSQb718772vH3pyS5pShp6lvQM7SxgIDXXXmOX7w==", + "dev": true, + "requires": { + "@jridgewell/set-array": "^1.0.0", + "@jridgewell/sourcemap-codec": "^1.4.10" + } + }, "@jridgewell/resolve-uri": { - "version": "3.0.5", - "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.0.5.tgz", - "integrity": "sha512-VPeQ7+wH0itvQxnG+lIzWgkysKIr3L9sslimFW55rHMdGu/qCQ5z5h9zq4gI8uBtqkpHhsF4Z/OwExufUCThew==", + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.0.tgz", + "integrity": "sha512-F2msla3tad+Mfht5cJq7LSXcdudKTWCVYUgw6pLFOOHSTtZlj6SWNYAp+AhuqLmWdBO2X5hPrLcu8cVP8fy28w==", + "dev": true + }, + "@jridgewell/set-array": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@jridgewell/set-array/-/set-array-1.1.2.tgz", + "integrity": "sha512-xnkseuNADM0gt2bs+BvhO0p78Mk762YnZdsuzFV018NoG1Sj1SCQvpSqa7XUaTam5vAGasABV9qXASMKnFMwMw==", "dev": true }, "@jridgewell/sourcemap-codec": { - "version": "1.4.11", - "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.11.tgz", - "integrity": "sha512-Fg32GrJo61m+VqYSdRSjRXMjQ06j8YIYfcTqndLYVAaHmroZHLJZCydsWBOTDqXS2v+mjxohBWEMfg97GXmYQg==", + "version": "1.4.14", + "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.14.tgz", + "integrity": "sha512-XPSJHWmi394fuUuzDnGz1wiKqWfo1yXecHQMRf2l6hztTO+nPru658AyDngaBe7isIxEkRsPR3FZh+s7iVa4Uw==", "dev": true }, "@jridgewell/trace-mapping": { - "version": "0.3.4", - "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.4.tgz", - "integrity": "sha512-vFv9ttIedivx0ux3QSjhgtCVjPZd5l46ZOMDSCwnH1yUO2e964gO8LZGyv2QkqcgR6TnBU1v+1IFqmeoG+0UJQ==", + "version": "0.3.14", + "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.14.tgz", + "integrity": "sha512-bJWEfQ9lPTvm3SneWwRFVLzrh6nhjwqw7TUFFBEMzwvg7t7PCDenf2lDwqo4NQXzdpgBXyFgDWnQA+2vkruksQ==", "dev": true, "requires": { "@jridgewell/resolve-uri": "^3.0.3", "@jridgewell/sourcemap-codec": "^1.4.10" } }, + "@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": { + "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" + } + } + } + }, "@nodelib/fs.scandir": { "version": "2.1.5", "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", @@ -6302,11 +9272,92 @@ } }, "@openzeppelin/contracts": { - "version": "4.5.0", - "resolved": "https://registry.npmjs.org/@openzeppelin/contracts/-/contracts-4.5.0.tgz", - "integrity": "sha512-fdkzKPYMjrRiPK6K4y64e6GzULR7R7RwxSigHS8DDp7aWDeoReqsQI+cxHV1UuhAqX69L1lAaWDxenfP+xiqzA==", + "version": "2.5.1", + "resolved": "https://registry.npmjs.org/@openzeppelin/contracts/-/contracts-2.5.1.tgz", + "integrity": "sha512-qIy6tLx8rtybEsIOAlrM4J/85s2q2nPkDqj/Rx46VakBZ0LwtFhXIVub96LXHczQX0vaqmAueDqNPXtbSXSaYQ==", + "dev": true + }, + "@sentry/core": { + "version": "5.30.0", + "resolved": "https://registry.npmjs.org/@sentry/core/-/core-5.30.0.tgz", + "integrity": "sha512-TmfrII8w1PQZSZgPpUESqjB+jC6MvZJZdLtE/0hZ+SrnKhW3x5WlYLvTXZpcWePYBku7rl2wn1RZu6uT0qCTeg==", + "dev": true, + "requires": { + "@sentry/hub": "5.30.0", + "@sentry/minimal": "5.30.0", + "@sentry/types": "5.30.0", + "@sentry/utils": "5.30.0", + "tslib": "^1.9.3" + } + }, + "@sentry/hub": { + "version": "5.30.0", + "resolved": "https://registry.npmjs.org/@sentry/hub/-/hub-5.30.0.tgz", + "integrity": "sha512-2tYrGnzb1gKz2EkMDQcfLrDTvmGcQPuWxLnJKXJvYTQDGLlEvi2tWz1VIHjunmOvJrB5aIQLhm+dcMRwFZDCqQ==", + "dev": true, + "requires": { + "@sentry/types": "5.30.0", + "@sentry/utils": "5.30.0", + "tslib": "^1.9.3" + } + }, + "@sentry/minimal": { + "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==", + "dev": true, + "requires": { + "@sentry/hub": "5.30.0", + "@sentry/types": "5.30.0", + "tslib": "^1.9.3" + } + }, + "@sentry/node": { + "version": "5.30.0", + "resolved": "https://registry.npmjs.org/@sentry/node/-/node-5.30.0.tgz", + "integrity": "sha512-Br5oyVBF0fZo6ZS9bxbJZG4ApAjRqAnqFFurMVJJdunNb80brh7a5Qva2kjhm+U6r9NJAB5OmDyPkA1Qnt+QVg==", + "dev": true, + "requires": { + "@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" + } + }, + "@sentry/tracing": { + "version": "5.30.0", + "resolved": "https://registry.npmjs.org/@sentry/tracing/-/tracing-5.30.0.tgz", + "integrity": "sha512-dUFowCr0AIMwiLD7Fs314Mdzcug+gBVo/+NCMyDw8tFxJkwWAKl7Qa2OZxLQ0ZHjakcj1hNKfCQJ9rhyfOl4Aw==", + "dev": true, + "requires": { + "@sentry/hub": "5.30.0", + "@sentry/minimal": "5.30.0", + "@sentry/types": "5.30.0", + "@sentry/utils": "5.30.0", + "tslib": "^1.9.3" + } + }, + "@sentry/types": { + "version": "5.30.0", + "resolved": "https://registry.npmjs.org/@sentry/types/-/types-5.30.0.tgz", + "integrity": "sha512-R8xOqlSTZ+htqrfteCWU5Nk0CDN5ApUTvrlvBuiH1DyP6czDZ4ktbZB0hAgBlVcK0U+qpD3ag3Tqqpa5Q67rPw==", "dev": true }, + "@sentry/utils": { + "version": "5.30.0", + "resolved": "https://registry.npmjs.org/@sentry/utils/-/utils-5.30.0.tgz", + "integrity": "sha512-zaYmoH0NWWtvnJjC9/CBseXMtKHm/tm40sz3YfJRxeQjyzRqNQPgivpd9R/oDJCYj999mzdW382p/qi2ypjLww==", + "dev": true, + "requires": { + "@sentry/types": "5.30.0", + "tslib": "^1.9.3" + } + }, "@sinonjs/commons": { "version": "1.8.3", "resolved": "https://registry.npmjs.org/@sinonjs/commons/-/commons-1.8.3.tgz", @@ -6317,9 +9368,9 @@ } }, "@sinonjs/fake-timers": { - "version": "9.1.1", - "resolved": "https://registry.npmjs.org/@sinonjs/fake-timers/-/fake-timers-9.1.1.tgz", - "integrity": "sha512-Wp5vwlZ0lOqpSYGKqr53INws9HLkt6JDc/pDZcPf7bchQnrXJMXPns8CXx0hFikMSGSWfvtvvpb2gtMVfkWagA==", + "version": "9.1.2", + "resolved": "https://registry.npmjs.org/@sinonjs/fake-timers/-/fake-timers-9.1.2.tgz", + "integrity": "sha512-BPS4ynJW/o92PUR4wgriz2Ud5gpST5vz6GQfMixEDK0Z8ZCUv2M7SkBLykH56T++Xs+8ln9zTGbOvNGIe02/jw==", "dev": true, "requires": { "@sinonjs/commons": "^1.7.0" @@ -6342,34 +9393,50 @@ "integrity": "sha512-+iTbntw2IZPb/anVDbypzfQa+ay64MW0Zo8aJ8gZPWMMK6/OubMVb6lUPMagqjOPnmtauXnFCACVl3O7ogjeqQ==", "dev": true }, + "@solidity-parser/parser": { + "version": "0.14.2", + "resolved": "https://registry.npmjs.org/@solidity-parser/parser/-/parser-0.14.2.tgz", + "integrity": "sha512-10cr0s+MtRtqjEw0WFJrm2rwULN30xx7btd/v9cmqME2617/2M5MbHDkFIGIGTa7lwNw4bN9mVGfhlLzrYw8pA==", + "dev": true, + "requires": { + "antlr4ts": "^0.5.0-alpha.4" + } + }, "@tsconfig/node10": { - "version": "1.0.8", - "resolved": "https://registry.npmjs.org/@tsconfig/node10/-/node10-1.0.8.tgz", - "integrity": "sha512-6XFfSQmMgq0CFLY1MslA/CPUfhIL919M1rMsa5lP2P097N2Wd1sSX0tx1u4olM16fLNhtHZpRhedZJphNJqmZg==", + "version": "1.0.9", + "resolved": "https://registry.npmjs.org/@tsconfig/node10/-/node10-1.0.9.tgz", + "integrity": "sha512-jNsYVVxU8v5g43Erja32laIDHXeoNvFEpX33OK4d6hljo3jDhCBDhx5dhCCTMWUojscpAagGiRkBKxpdl9fxqA==", "dev": true }, "@tsconfig/node12": { - "version": "1.0.9", - "resolved": "https://registry.npmjs.org/@tsconfig/node12/-/node12-1.0.9.tgz", - "integrity": "sha512-/yBMcem+fbvhSREH+s14YJi18sp7J9jpuhYByADT2rypfajMZZN4WQ6zBGgBKp53NKmqI36wFYDb3yaMPurITw==", + "version": "1.0.11", + "resolved": "https://registry.npmjs.org/@tsconfig/node12/-/node12-1.0.11.tgz", + "integrity": "sha512-cqefuRsh12pWyGsIoBKJA9luFu3mRxCA+ORZvA4ktLSzIuCUtWVxGIuXigEwO5/ywWFMZ2QEGKWvkZG1zDMTag==", "dev": true }, "@tsconfig/node14": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/@tsconfig/node14/-/node14-1.0.1.tgz", - "integrity": "sha512-509r2+yARFfHHE7T6Puu2jjkoycftovhXRqW328PDXTVGKihlb1P8Z9mMZH04ebyajfRY7dedfGynlrFHJUQCg==", + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/@tsconfig/node14/-/node14-1.0.3.tgz", + "integrity": "sha512-ysT8mhdixWK6Hw3i1V2AeRqZ5WfXg1G43mqoYlM2nc6388Fq5jcXyr5mRsqViLx/GJYdoL0bfXD8nmF+Zn/Iow==", "dev": true }, "@tsconfig/node16": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/@tsconfig/node16/-/node16-1.0.2.tgz", - "integrity": "sha512-eZxlbI8GZscaGS7kkc/trHTT5xgrjH3/1n2JDwusC9iahPKWMRvRjJSAN5mCXviuTGQ/lHnhvv8Q1YTpnfz9gA==", + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/@tsconfig/node16/-/node16-1.0.3.tgz", + "integrity": "sha512-yOlFc+7UtL/89t2ZhjPvvB/DeAr3r+Dq58IgzsFkOAvVC6NMJXmCGjbptdXdR9qsX7pKcTL+s87FtYREi2dEEQ==", + "dev": true + }, + "@types/abstract-leveldown": { + "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/bip39": { "version": "2.4.2", "resolved": "https://registry.npmjs.org/@types/bip39/-/bip39-2.4.2.tgz", "integrity": "sha512-Vo9lqOIRq8uoIzEVrV87ZvcIM0PN9t0K3oYZ/CS61fIYKCBdOIM7mlWzXuRvSXrDtVa1uUO2w1cdfufxTC0bzg==", + "dev": true, "requires": { "@types/node": "*" } @@ -6383,9 +9450,9 @@ } }, "@types/chai": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/@types/chai/-/chai-4.3.0.tgz", - "integrity": "sha512-/ceqdqeRraGolFTcfoXNiqjyQhZzbINDngeoAq9GoHa8PPK1yNzTaxWjA6BFWp5Ua9JpXEMSS4s5i9tS0hOJtw==", + "version": "4.3.1", + "resolved": "https://registry.npmjs.org/@types/chai/-/chai-4.3.1.tgz", + "integrity": "sha512-/zPMqDkzSZ8t3VtxOa4KPq7uzzW978M9Tvh+j7GHKuo6k6GTLxPJ4J5gE5cjfJ26pnXst0N5Hax8Sr0T2Mi9zQ==", "dev": true }, "@types/chai-as-promised": { @@ -6407,32 +9474,73 @@ } }, "@types/json-schema": { - "version": "7.0.10", - "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.10.tgz", - "integrity": "sha512-BLO9bBq59vW3fxCpD4o0N4U+DXsvwvIcl+jofw0frQo/GrBFC+/jRZj1E7kgp6dvTyNmA4y6JCV5Id/r3mNP5A==", + "version": "7.0.11", + "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.11.tgz", + "integrity": "sha512-wOuvG1SN4Us4rez+tylwwwCV1psiNVOkJeM3AUWUNWg/jDQY2+HE/444y5gc+jBmRqASOm2Oeh5c1axHobwRKQ==", "dev": true }, "@types/json5": { "version": "0.0.29", "resolved": "https://registry.npmjs.org/@types/json5/-/json5-0.0.29.tgz", - "integrity": "sha1-7ihweulOEdK4J7y+UnC86n8+ce4=", + "integrity": "sha512-dRLjCWHYg4oaA77cxO64oO+7JwCwnIzkZPdrrC71jQmQtlhM556pwKo5bUzqvZndkVbeFLIIi+9TC40JNF5hNQ==", + "dev": true + }, + "@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==", + "dev": true + }, + "@types/levelup": { + "version": "4.3.3", + "resolved": "https://registry.npmjs.org/@types/levelup/-/levelup-4.3.3.tgz", + "integrity": "sha512-K+OTIjJcZHVlZQN1HmU64VtrC0jC3dXWQozuEIR9zVvltIk90zaGPM2AgT+fIkChpzHhFE3YnvFLCbLtzAmexA==", + "dev": true, + "requires": { + "@types/abstract-leveldown": "*", + "@types/level-errors": "*", + "@types/node": "*" + } + }, + "@types/lru-cache": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/@types/lru-cache/-/lru-cache-5.1.1.tgz", + "integrity": "sha512-ssE3Vlrys7sdIzs5LOxCzTVMsU7i9oa/IaW92wF32JFb3CVczqOkru2xspuKczHEbG3nvmPY7IFqVmGGHdNbYw==", "dev": true }, "@types/mocha": { - "version": "9.1.0", - "resolved": "https://registry.npmjs.org/@types/mocha/-/mocha-9.1.0.tgz", - "integrity": "sha512-QCWHkbMv4Y5U9oW10Uxbr45qMMSzl4OzijsozynUAgx3kEHUdXB00udx2dWDQ7f2TU2a2uuiFaRZjCe3unPpeg==", + "version": "9.1.1", + "resolved": "https://registry.npmjs.org/@types/mocha/-/mocha-9.1.1.tgz", + "integrity": "sha512-Z61JK7DKDtdKTWwLeElSEBcWGRLY8g95ic5FoQqI9CMx0ns/Ghep3B4DfcEimiKMvtamNVULVNKEsiwV3aQmXw==", "dev": true }, "@types/node": { - "version": "16.11.26", - "resolved": "https://registry.npmjs.org/@types/node/-/node-16.11.26.tgz", - "integrity": "sha512-GZ7bu5A6+4DtG7q9GsoHXy3ALcgeIHP4NnL0Vv2wu0uUB/yQex26v0tf6/na1mm0+bS9Uw+0DFex7aaKr2qawQ==" + "version": "16.11.43", + "resolved": "https://registry.npmjs.org/@types/node/-/node-16.11.43.tgz", + "integrity": "sha512-GqWykok+3uocgfAJM8imbozrqLnPyTrpFlrryURQlw1EesPUCx5XxTiucWDSFF9/NUEXDuD4bnvHm8xfVGWTpQ==" + }, + "@types/pbkdf2": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/@types/pbkdf2/-/pbkdf2-3.1.0.tgz", + "integrity": "sha512-Cf63Rv7jCQ0LaL8tNXmEyqTHuIJxRdlS5vMh1mj5voN4+QFhVZnlZruezqpWYDiJ8UTzhP0VmeLXCmBk66YrMQ==", + "dev": true, + "requires": { + "@types/node": "*" + } + }, + "@types/secp256k1": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/@types/secp256k1/-/secp256k1-4.0.3.tgz", + "integrity": "sha512-Da66lEIFeIz9ltsdMZcpQvmrmmoqrfju8pm1BH8WbYjZSwUgCwXLb9C+9XYogwBITnbsSaMdVPb2ekf7TV+03w==", + "dev": true, + "requires": { + "@types/node": "*" + } }, "@types/sinon": { - "version": "10.0.11", - "resolved": "https://registry.npmjs.org/@types/sinon/-/sinon-10.0.11.tgz", - "integrity": "sha512-dmZsHlBsKUtBpHriNjlK0ndlvEh8dcb9uV9Afsbt89QIyydpC7NcR+nWlAhASfy3GHnxTl4FX/aKE7XZUt/B4g==", + "version": "10.0.12", + "resolved": "https://registry.npmjs.org/@types/sinon/-/sinon-10.0.12.tgz", + "integrity": "sha512-uWf4QJ4oky/GckJ1MYQxU52cgVDcXwBhDkpvLbi4EKoLPqLE4MOH6T/ttM33l3hi0oZ882G6oIzWv/oupRYSxQ==", "dev": true, "requires": { "@types/sinonjs__fake-timers": "*" @@ -6454,98 +9562,98 @@ } }, "@typescript-eslint/eslint-plugin": { - "version": "5.16.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.16.0.tgz", - "integrity": "sha512-SJoba1edXvQRMmNI505Uo4XmGbxCK9ARQpkvOd00anxzri9RNQk0DDCxD+LIl+jYhkzOJiOMMKYEHnHEODjdCw==", + "version": "5.30.5", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.30.5.tgz", + "integrity": "sha512-lftkqRoBvc28VFXEoRgyZuztyVUQ04JvUnATSPtIRFAccbXTWL6DEtXGYMcbg998kXw1NLUJm7rTQ9eUt+q6Ig==", "dev": true, "requires": { - "@typescript-eslint/scope-manager": "5.16.0", - "@typescript-eslint/type-utils": "5.16.0", - "@typescript-eslint/utils": "5.16.0", - "debug": "^4.3.2", + "@typescript-eslint/scope-manager": "5.30.5", + "@typescript-eslint/type-utils": "5.30.5", + "@typescript-eslint/utils": "5.30.5", + "debug": "^4.3.4", "functional-red-black-tree": "^1.0.1", - "ignore": "^5.1.8", + "ignore": "^5.2.0", "regexpp": "^3.2.0", - "semver": "^7.3.5", + "semver": "^7.3.7", "tsutils": "^3.21.0" } }, "@typescript-eslint/parser": { - "version": "5.16.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-5.16.0.tgz", - "integrity": "sha512-fkDq86F0zl8FicnJtdXakFs4lnuebH6ZADDw6CYQv0UZeIjHvmEw87m9/29nk2Dv5Lmdp0zQ3zDQhiMWQf/GbA==", + "version": "5.30.5", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-5.30.5.tgz", + "integrity": "sha512-zj251pcPXI8GO9NDKWWmygP6+UjwWmrdf9qMW/L/uQJBM/0XbU2inxe5io/234y/RCvwpKEYjZ6c1YrXERkK4Q==", "dev": true, "requires": { - "@typescript-eslint/scope-manager": "5.16.0", - "@typescript-eslint/types": "5.16.0", - "@typescript-eslint/typescript-estree": "5.16.0", - "debug": "^4.3.2" + "@typescript-eslint/scope-manager": "5.30.5", + "@typescript-eslint/types": "5.30.5", + "@typescript-eslint/typescript-estree": "5.30.5", + "debug": "^4.3.4" } }, "@typescript-eslint/scope-manager": { - "version": "5.16.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-5.16.0.tgz", - "integrity": "sha512-P+Yab2Hovg8NekLIR/mOElCDPyGgFZKhGoZA901Yax6WR6HVeGLbsqJkZ+Cvk5nts/dAlFKm8PfL43UZnWdpIQ==", + "version": "5.30.5", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-5.30.5.tgz", + "integrity": "sha512-NJ6F+YHHFT/30isRe2UTmIGGAiXKckCyMnIV58cE3JkHmaD6e5zyEYm5hBDv0Wbin+IC0T1FWJpD3YqHUG/Ydg==", "dev": true, "requires": { - "@typescript-eslint/types": "5.16.0", - "@typescript-eslint/visitor-keys": "5.16.0" + "@typescript-eslint/types": "5.30.5", + "@typescript-eslint/visitor-keys": "5.30.5" } }, "@typescript-eslint/type-utils": { - "version": "5.16.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-5.16.0.tgz", - "integrity": "sha512-SKygICv54CCRl1Vq5ewwQUJV/8padIWvPgCxlWPGO/OgQLCijY9G7lDu6H+mqfQtbzDNlVjzVWQmeqbLMBLEwQ==", + "version": "5.30.5", + "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-5.30.5.tgz", + "integrity": "sha512-k9+ejlv1GgwN1nN7XjVtyCgE0BTzhzT1YsQF0rv4Vfj2U9xnslBgMYYvcEYAFVdvhuEscELJsB7lDkN7WusErw==", "dev": true, "requires": { - "@typescript-eslint/utils": "5.16.0", - "debug": "^4.3.2", + "@typescript-eslint/utils": "5.30.5", + "debug": "^4.3.4", "tsutils": "^3.21.0" } }, "@typescript-eslint/types": { - "version": "5.16.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-5.16.0.tgz", - "integrity": "sha512-oUorOwLj/3/3p/HFwrp6m/J2VfbLC8gjW5X3awpQJ/bSG+YRGFS4dpsvtQ8T2VNveV+LflQHjlLvB6v0R87z4g==", + "version": "5.30.5", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-5.30.5.tgz", + "integrity": "sha512-kZ80w/M2AvsbRvOr3PjaNh6qEW1LFqs2pLdo2s5R38B2HYXG8Z0PP48/4+j1QHJFL3ssHIbJ4odPRS8PlHrFfw==", "dev": true }, "@typescript-eslint/typescript-estree": { - "version": "5.16.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-5.16.0.tgz", - "integrity": "sha512-SE4VfbLWUZl9MR+ngLSARptUv2E8brY0luCdgmUevU6arZRY/KxYoLI/3V/yxaURR8tLRN7bmZtJdgmzLHI6pQ==", + "version": "5.30.5", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-5.30.5.tgz", + "integrity": "sha512-qGTc7QZC801kbYjAr4AgdOfnokpwStqyhSbiQvqGBLixniAKyH+ib2qXIVo4P9NgGzwyfD9I0nlJN7D91E1VpQ==", "dev": true, "requires": { - "@typescript-eslint/types": "5.16.0", - "@typescript-eslint/visitor-keys": "5.16.0", - "debug": "^4.3.2", - "globby": "^11.0.4", + "@typescript-eslint/types": "5.30.5", + "@typescript-eslint/visitor-keys": "5.30.5", + "debug": "^4.3.4", + "globby": "^11.1.0", "is-glob": "^4.0.3", - "semver": "^7.3.5", + "semver": "^7.3.7", "tsutils": "^3.21.0" } }, "@typescript-eslint/utils": { - "version": "5.16.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-5.16.0.tgz", - "integrity": "sha512-iYej2ER6AwmejLWMWzJIHy3nPJeGDuCqf8Jnb+jAQVoPpmWzwQOfa9hWVB8GIQE5gsCv/rfN4T+AYb/V06WseQ==", + "version": "5.30.5", + "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-5.30.5.tgz", + "integrity": "sha512-o4SSUH9IkuA7AYIfAvatldovurqTAHrfzPApOZvdUq01hHojZojCFXx06D/aFpKCgWbMPRdJBWAC3sWp3itwTA==", "dev": true, "requires": { "@types/json-schema": "^7.0.9", - "@typescript-eslint/scope-manager": "5.16.0", - "@typescript-eslint/types": "5.16.0", - "@typescript-eslint/typescript-estree": "5.16.0", + "@typescript-eslint/scope-manager": "5.30.5", + "@typescript-eslint/types": "5.30.5", + "@typescript-eslint/typescript-estree": "5.30.5", "eslint-scope": "^5.1.1", "eslint-utils": "^3.0.0" } }, "@typescript-eslint/visitor-keys": { - "version": "5.16.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-5.16.0.tgz", - "integrity": "sha512-jqxO8msp5vZDhikTwq9ubyMHqZ67UIvawohr4qF3KhlpL7gzSjOd+8471H3nh5LyABkaI85laEKKU8SnGUK5/g==", + "version": "5.30.5", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-5.30.5.tgz", + "integrity": "sha512-D+xtGo9HUMELzWIUqcQc0p2PO4NyvTrgIOK/VnSH083+8sq0tiLozNRKuLarwHYGRuA6TVBQSuuLwJUDWd3aaA==", "dev": true, "requires": { - "@typescript-eslint/types": "5.16.0", - "eslint-visitor-keys": "^3.0.0" + "@typescript-eslint/types": "5.30.5", + "eslint-visitor-keys": "^3.3.0" } }, "@ungap/promise-all-settled": { @@ -6554,10 +9662,32 @@ "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", + "integrity": "sha512-h8lQ8tacZYnR3vNQTgibj+tODHI5/+l06Au2Pcriv/Gmet0eaj4TwWH41sO9wnHDiQsEj19q0drzdWdeAHtweg==", + "dev": true, + "requires": { + "event-target-shim": "^5.0.0" + } + }, + "abstract-leveldown": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/abstract-leveldown/-/abstract-leveldown-6.3.0.tgz", + "integrity": "sha512-TU5nlYgta8YrBMNpc9FwQzRbiXsj49gsALsXadbGHt9CROPzX5fB0rWDR5mtdpOOKa5XqRFpbj1QroPAoPzVjQ==", + "dev": true, + "requires": { + "buffer": "^5.5.0", + "immediate": "^3.2.3", + "level-concat-iterator": "~2.0.0", + "level-supports": "~1.0.0", + "xtend": "~4.0.0" + } + }, "acorn": { - "version": "8.7.0", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.7.0.tgz", - "integrity": "sha512-V/LGr1APy+PXIwKebEWrkZPwoeoF+w1jiOBUmuxuiUIaOHtob8Qc9BTrYo7VuI5fR8tqsy+buA2WFooR5olqvQ==", + "version": "8.7.1", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.7.1.tgz", + "integrity": "sha512-Xx54uLJQZ19lKygFXOWsscKUbsBZW0CPykPhVQdhIeIwrbPmJzqeASDInc8nKBnp/JT6igTs82qPXz069H8I/A==", "dev": true }, "acorn-jsx": { @@ -6573,10 +9703,25 @@ "integrity": "sha512-k+iyHEuPgSw6SbuDpGQM+06HQUa04DZ3o+F6CSzXMvvI5KMvnaEqXe+YVe555R9nn6GPt404fos4wcgpw12SDA==", "dev": true }, + "adm-zip": { + "version": "0.4.16", + "resolved": "https://registry.npmjs.org/adm-zip/-/adm-zip-0.4.16.tgz", + "integrity": "sha512-TFi4HBKSGfIKsK5YCkKaaFG2m4PEDyViZmEwof3MTIgzimHLto6muaHVpbrljdIvIrFZzEq/p4nafOeLcYegrg==", + "dev": true + }, "aes-js": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/aes-js/-/aes-js-3.1.2.tgz", - "integrity": "sha512-e5pEa2kBnBOgR4Y/p20pskXI74UEz7de8ZGVo58asOtvSVG5YAbJeELPZxOmt+Bnz3rX753YKhfIn4X4l1PPRQ==" + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/aes-js/-/aes-js-3.0.0.tgz", + "integrity": "sha512-H7wUZRn8WpTq9jocdxQ2c8x2sKo9ZVmzfRE13GiNJXfp7NcKYEdvl3vspKjXox6RIG2VtaRe4JFvxG4rqp2Zuw==" + }, + "agent-base": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-6.0.2.tgz", + "integrity": "sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ==", + "dev": true, + "requires": { + "debug": "4" + } }, "aggregate-error": { "version": "3.1.0", @@ -6601,11 +9746,28 @@ } }, "ansi-colors": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-4.1.1.tgz", - "integrity": "sha512-JoX0apGbHaUJBNl6yF+p6JAFYZ666/hhCGKN5t9QFjbJQKUU/g8MNbFDbvfrgKXvI1QpZplPOnwIo99lX/AAmA==", + "version": "4.1.3", + "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-4.1.3.tgz", + "integrity": "sha512-/6w/C21Pm1A7aZitlI5Ni/2J6FFQN8i1Cvz3kHABAAbw93v/NlvKdVOqz7CCWz/3iv/JplRSEEZ83XION15ovw==", "dev": true }, + "ansi-escapes": { + "version": "4.3.2", + "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-4.3.2.tgz", + "integrity": "sha512-gKXj5ALrKWQLsYG9jlTRmR/xKluxHV+Z9QEwNIgCfM1/uwPMCuzVVnh5mwTd+OuBZcwSIMbqssNWRm1lE51QaQ==", + "dev": true, + "requires": { + "type-fest": "^0.21.3" + }, + "dependencies": { + "type-fest": { + "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==", + "dev": true + } + } + }, "ansi-regex": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", @@ -6621,6 +9783,12 @@ "color-convert": "^2.0.1" } }, + "antlr4ts": { + "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==", + "dev": true + }, "anymatch": { "version": "3.1.2", "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.2.tgz", @@ -6643,7 +9811,7 @@ "archy": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/archy/-/archy-1.0.0.tgz", - "integrity": "sha1-+cjBN1fMHde8N5rHeyxipcKGjEA=", + "integrity": "sha512-Xg+9RwCg/0p32teKdGMPTPnVXKD0w3DfHnFTficozsAgsvq2XenPJq/MYpzzQ/v8zrOyJn6Ds39VA4JIDwFfqw==", "dev": true }, "arg": { @@ -6659,14 +9827,14 @@ "dev": true }, "array-includes": { - "version": "3.1.4", - "resolved": "https://registry.npmjs.org/array-includes/-/array-includes-3.1.4.tgz", - "integrity": "sha512-ZTNSQkmWumEbiHO2GF4GmWxYVTiQyJy2XOTa15sdQSrvKn7l+180egQMqlrMOUMCyLMD7pmyQe4mMDUT6Behrw==", + "version": "3.1.5", + "resolved": "https://registry.npmjs.org/array-includes/-/array-includes-3.1.5.tgz", + "integrity": "sha512-iSDYZMMyTPkiFasVqfuAQnWAYcvO/SeBSCGKePoEthjp4LEMTe4uLc7b025o4jAZpHhihh8xPo99TNWUWWkGDQ==", "dev": true, "requires": { "call-bind": "^1.0.2", - "define-properties": "^1.1.3", - "es-abstract": "^1.19.1", + "define-properties": "^1.1.4", + "es-abstract": "^1.19.5", "get-intrinsic": "^1.1.1", "is-string": "^1.0.7" } @@ -6678,14 +9846,15 @@ "dev": true }, "array.prototype.flat": { - "version": "1.2.5", - "resolved": "https://registry.npmjs.org/array.prototype.flat/-/array.prototype.flat-1.2.5.tgz", - "integrity": "sha512-KaYU+S+ndVqyUnignHftkwc58o3uVU1jzczILJ1tN2YaIZpFIKBiP/x/j97E5MVPsaCloPbqWLB/8qCTVvT2qg==", + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/array.prototype.flat/-/array.prototype.flat-1.3.0.tgz", + "integrity": "sha512-12IUEkHsAhA4DY5s0FPgNXIdc8VRSqD9Zp78a5au9abH/SOBrsp082JOWFNTjkMozh8mqcdiKuaLGhPeYztxSw==", "dev": true, "requires": { "call-bind": "^1.0.2", "define-properties": "^1.1.3", - "es-abstract": "^1.19.0" + "es-abstract": "^1.19.2", + "es-shim-unscopables": "^1.0.0" } }, "assertion-error": { @@ -6694,6 +9863,24 @@ "integrity": "sha512-jgsaNduz+ndvGyFt3uSuWqvy4lCnIJiovtouQN5JZHOKCS2QuhEdbcQHFhVksz2N2U9hXJo8odG7ETyWlEeuDw==", "dev": true }, + "async": { + "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" + } + }, + "async-eventemitter": { + "version": "0.2.4", + "resolved": "https://registry.npmjs.org/async-eventemitter/-/async-eventemitter-0.2.4.tgz", + "integrity": "sha512-pd20BwL7Yt1zwDFy+8MX8F1+WCT8aQeKj0kQnTrH9WaeRETlRamVhD0JtRPmrV4GfOJ2F9CvdQkZeZhnh2TuHw==", + "dev": true, + "requires": { + "async": "^2.4.0" + } + }, "balanced-match": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", @@ -6708,6 +9895,17 @@ "safe-buffer": "^5.0.1" } }, + "base64-js": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz", + "integrity": "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==", + "dev": true + }, + "bech32": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/bech32/-/bech32-1.1.4.tgz", + "integrity": "sha512-s0IrSOzLlbvX7yp4WBfPITzpAU8sqQcpsmwXDiKwrG4r491vwCO/XpejasRNl0piBMe/DvP4Tz0mIS/X1DPJBQ==" + }, "binary-extensions": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.2.0.tgz", @@ -6737,11 +9935,17 @@ "bip66": { "version": "1.1.5", "resolved": "https://registry.npmjs.org/bip66/-/bip66-1.1.5.tgz", - "integrity": "sha1-AfqHSHhcpwlV1QESF9GzE5lpyiI=", + "integrity": "sha512-nemMHz95EmS38a26XbbdxIYj5csHd3RMP3H5bwQknX0WYHF01qhpufP42mLOwVICuH2JmhIhXiWs89MfUGL7Xw==", "requires": { "safe-buffer": "^5.0.1" } }, + "blakejs": { + "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": { "version": "4.12.0", "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.0.tgz", @@ -6769,7 +9973,7 @@ "brorand": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/brorand/-/brorand-1.1.0.tgz", - "integrity": "sha1-EsJe/kCkXjwyPrhnWgoM5XsiNx8=" + "integrity": "sha512-cKV8tMCEpQs4hK/ik71d6LrPOnpkpGBR0wzxqr68g2m/LB2GxVYQroAjMJZRVM1Y4BCjCKc3vAamxSzOY2RP+w==" }, "browser-stdout": { "version": "1.3.1", @@ -6788,25 +9992,31 @@ "evp_bytestokey": "^1.0.3", "inherits": "^2.0.1", "safe-buffer": "^5.0.1" + }, + "dependencies": { + "buffer-xor": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/buffer-xor/-/buffer-xor-1.0.3.tgz", + "integrity": "sha512-571s0T7nZWK6vB67HI5dyUF7wXiNcfaPPPTl6zYCNApANjIvYJTg7hlud/+cJpdAhS7dVzqMLmfhfHR3rAcOjQ==" + } } }, "browserslist": { - "version": "4.20.2", - "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.20.2.tgz", - "integrity": "sha512-CQOBCqp/9pDvDbx3xfMi+86pr4KXIf2FDkTTdeuYw8OxS9t898LA1Khq57gtufFILXpfgsSx5woNgsBgvGjpsA==", + "version": "4.21.1", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.21.1.tgz", + "integrity": "sha512-Nq8MFCSrnJXSc88yliwlzQe3qNe3VntIjhsArW9IJOEPSHNx23FalwApUVbzAWABLhYJJ7y8AynWI/XM8OdfjQ==", "dev": true, "requires": { - "caniuse-lite": "^1.0.30001317", - "electron-to-chromium": "^1.4.84", - "escalade": "^3.1.1", - "node-releases": "^2.0.2", - "picocolors": "^1.0.0" + "caniuse-lite": "^1.0.30001359", + "electron-to-chromium": "^1.4.172", + "node-releases": "^2.0.5", + "update-browserslist-db": "^1.0.4" } }, "bs58": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/bs58/-/bs58-4.0.1.tgz", - "integrity": "sha1-vhYedsNU9veIrkBx9j806MTwpCo=", + "integrity": "sha512-Ok3Wdf5vOIlBrgCvTq96gBkJw+JUEzdBgyaza5HLtPm7yTHkjRy8+JzNyHF7BHa0bNWOQIp3m5YF0nnFcOIKLw==", "requires": { "base-x": "^3.0.2" } @@ -6821,6 +10031,16 @@ "safe-buffer": "^5.1.2" } }, + "buffer": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/buffer/-/buffer-5.7.1.tgz", + "integrity": "sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ==", + "dev": true, + "requires": { + "base64-js": "^1.3.1", + "ieee754": "^1.1.13" + } + }, "buffer-from": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.2.tgz", @@ -6828,9 +10048,13 @@ "dev": true }, "buffer-xor": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/buffer-xor/-/buffer-xor-1.0.3.tgz", - "integrity": "sha1-JuYe0UIvtw3ULm42cp7VHYVf6Nk=" + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/buffer-xor/-/buffer-xor-2.0.2.tgz", + "integrity": "sha512-eHslX0bin3GB+Lx2p7lEYRShRewuNZL3fUl4qlVJGGiwoPGftmt8JQgk2Y9Ji5/01TnVDo33E5b5O3vUB1HdqQ==", + "dev": true, + "requires": { + "safe-buffer": "^5.1.1" + } }, "bufferutil": { "version": "4.0.6", @@ -6840,6 +10064,12 @@ "node-gyp-build": "^4.3.0" } }, + "bytes": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.2.tgz", + "integrity": "sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg==", + "dev": true + }, "caching-transform": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/caching-transform/-/caching-transform-4.0.0.tgz", @@ -6875,9 +10105,9 @@ "dev": true }, "caniuse-lite": { - "version": "1.0.30001320", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001320.tgz", - "integrity": "sha512-MWPzG54AGdo3nWx7zHZTefseM5Y1ccM7hlQKHRqJkPozUaw3hNbBTMmLn16GG2FUzjR13Cr3NPfhIieX5PzXDA==", + "version": "1.0.30001363", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001363.tgz", + "integrity": "sha512-HpQhpzTGGPVMnCjIomjt+jvyUu8vNFo3TaDiZ/RcoTrlOq/5+tC8zHdsbgFB6MxmaY+jCpsH09aD80Bb4Ow3Sg==", "dev": true }, "chai": { @@ -6917,7 +10147,7 @@ "check-error": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/check-error/-/check-error-1.0.2.tgz", - "integrity": "sha1-V00xLt2Iu13YkS6Sht1sCu1KrII=", + "integrity": "sha512-BrgHpW9NURQgzoNyjfq0Wu6VFO6D7IZEmJNdtgNqpzGG8RuNFHt2jQxWlAs4HMe119chBnv+34syEZtc6IhLtA==", "dev": true }, "chokidar": { @@ -6947,6 +10177,12 @@ } } }, + "ci-info": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-2.0.0.tgz", + "integrity": "sha512-5tK7EtrZ0N+OLFMthtqOj4fI2Jeb88C4CAZPu25LDVUgXJ0A3Js4PMGqrn0JU1W0Mh1/Z8wZzYPxqUrXeBboCQ==", + "dev": true + }, "cipher-base": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/cipher-base/-/cipher-base-1.0.4.tgz", @@ -6988,16 +10224,28 @@ "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", "dev": true }, + "command-exists": { + "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==", + "dev": true + }, + "commander": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/commander/-/commander-3.0.2.tgz", + "integrity": "sha512-Gar0ASD4BDyKC4hl4DwHqDrmvjoxWKZigVnAbn5H1owvm4CxCPdb0HQDehwNYMJpla5+M2tPmPARzhtYuwpHow==", + "dev": true + }, "commondir": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/commondir/-/commondir-1.0.1.tgz", - "integrity": "sha1-3dgA2gxmEnOTzKWVDqloo6rxJTs=", + "integrity": "sha512-W9pAhw0ja1Edb5GVdIF1mjZw/ASI0AlShXM83UUGe2DVr5TdAPEA1OA8m/g8zWp9x6On7gqufY+FatDbC3MDQg==", "dev": true }, "concat-map": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", - "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", + "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==", "dev": true }, "concat-stream": { @@ -7015,7 +10263,7 @@ "isarray": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", + "integrity": "sha512-VLghIWNM6ELQzo7zwmcg0NmTVyWKYjvIeM83yjp0wRDTmUnrM678fQbcKBo6n2CJEF0szoG//ytg+TKla89ALQ==", "dev": true }, "readable-stream": { @@ -7067,12 +10315,30 @@ } } }, + "cookie": { + "version": "0.4.2", + "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.4.2.tgz", + "integrity": "sha512-aSWTXFzaKWkvHO1Ny/s+ePFpvKsPnjc551iI41v3ny/ow6tBG5Vd+FuqGNhh1LxOmVzOlGUriIlOaokOvhaStA==", + "dev": true + }, + "core-js-pure": { + "version": "3.23.3", + "resolved": "https://registry.npmjs.org/core-js-pure/-/core-js-pure-3.23.3.tgz", + "integrity": "sha512-XpoouuqIj4P+GWtdyV8ZO3/u4KftkeDVMfvp+308eGMhCrA3lVDSmAxO0c6GGOcmgVlaKDrgWVMo49h2ab/TDA==", + "dev": true + }, "core-util-is": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.3.tgz", "integrity": "sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==", "dev": true }, + "crc-32": { + "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", "resolved": "https://registry.npmjs.org/create-hash/-/create-hash-1.2.0.tgz", @@ -7144,7 +10410,7 @@ "decamelize": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz", - "integrity": "sha1-9lNNFRSCabIDUue+4m9QH5oZEpA=", + "integrity": "sha512-z2S+W9X73hAUUki+N+9Za2lBlun89zigOyGrsax+KUQ6wKW4ZoWpEYBkGhQjwAjjDCkWxhY0VKEhk8wzY7F5cA==", "dev": true }, "deep-eql": { @@ -7171,15 +10437,47 @@ "strip-bom": "^4.0.0" } }, + "deferred-leveldown": { + "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==", + "dev": true, + "requires": { + "abstract-leveldown": "~6.2.1", + "inherits": "^2.0.3" + }, + "dependencies": { + "abstract-leveldown": { + "version": "6.2.3", + "resolved": "https://registry.npmjs.org/abstract-leveldown/-/abstract-leveldown-6.2.3.tgz", + "integrity": "sha512-BsLm5vFMRUrrLeCcRc+G0t2qOaTzpoJQLOubq2XM72eNpjF5UdU5o/5NvlNhx95XHcAvcl8OMXr4mlg/fRgUXQ==", + "dev": true, + "requires": { + "buffer": "^5.5.0", + "immediate": "^3.2.3", + "level-concat-iterator": "~2.0.0", + "level-supports": "~1.0.0", + "xtend": "~4.0.0" + } + } + } + }, "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==", + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.1.4.tgz", + "integrity": "sha512-uckOqKcfaVvtBdsVkdPv3XjveQJsNQqmhXgRi8uhvWWuPYZCNlzT8qAyblUgNoXdHdjMTzAqeGjAoli8f+bzPA==", "dev": true, "requires": { - "object-keys": "^1.0.12" + "has-property-descriptors": "^1.0.0", + "object-keys": "^1.1.1" } }, + "depd": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/depd/-/depd-2.0.0.tgz", + "integrity": "sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==", + "dev": true + }, "diff": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/diff/-/diff-5.0.0.tgz", @@ -7205,15 +10503,15 @@ } }, "dotenv": { - "version": "16.0.0", - "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-16.0.0.tgz", - "integrity": "sha512-qD9WU0MPM4SWLPJy/r2Be+2WgQj8plChsyrCNQzW/0WjvcJQiKQJ9mH3ZgB3fxbUUxgc/11ZJ0Fi5KiimWGz2Q==", + "version": "16.0.1", + "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-16.0.1.tgz", + "integrity": "sha512-1K6hR6wtk2FviQ4kEiSjFiH5rpzEVi8WW0x96aztHVMhEspNpc4DVOUTEHtEva5VThQ8IaBX1Pe4gSzpVVUsKQ==", "dev": true }, "drbg.js": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/drbg.js/-/drbg.js-1.0.1.tgz", - "integrity": "sha1-Pja2xCs3BDgjzbwzLVjzHiRFSAs=", + "integrity": "sha512-F4wZ06PvqxYLFEZKkFxTDcns9oFNk34hvmJSEwdzsxVQ8YI5YaxtACgQatkYgv2VI2CFkUd2Y+xosPQnHv809g==", "requires": { "browserify-aes": "^1.0.6", "create-hash": "^1.1.2", @@ -7221,9 +10519,9 @@ } }, "electron-to-chromium": { - "version": "1.4.92", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.92.tgz", - "integrity": "sha512-YAVbvQIcDE/IJ/vzDMjD484/hsRbFPW2qXJPaYTfOhtligmfYEYOep+5QojpaEU9kq6bMvNeC2aG7arYvTHYsA==", + "version": "1.4.182", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.182.tgz", + "integrity": "sha512-OpEjTADzGoXABjqobGhpy0D2YsTncAax7IkER68ycc4adaq0dqEG9//9aenKPy7BGA90bqQdLac0dPp6uMkcSg==", "dev": true }, "elliptic": { @@ -7246,32 +10544,80 @@ "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", "dev": true }, + "encoding-down": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/encoding-down/-/encoding-down-6.3.0.tgz", + "integrity": "sha512-QKrV0iKR6MZVJV08QY0wp1e7vF6QbhnbQhb07bwpEyuz4uZiZgPlEGdkCROuFkUwdxlFaiPIhjyarH1ee/3vhw==", + "dev": true, + "requires": { + "abstract-leveldown": "^6.2.1", + "inherits": "^2.0.3", + "level-codec": "^9.0.0", + "level-errors": "^2.0.0" + } + }, + "enquirer": { + "version": "2.3.6", + "resolved": "https://registry.npmjs.org/enquirer/-/enquirer-2.3.6.tgz", + "integrity": "sha512-yjNnPr315/FjS4zIsUxYguYUPP2e1NK4d7E7ZOLiyYCcbFBiTMyID+2wvm2w6+pZ/odMA7cRkjhsPbltwBOrLg==", + "dev": true, + "requires": { + "ansi-colors": "^4.1.1" + } + }, + "env-paths": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/env-paths/-/env-paths-2.2.1.tgz", + "integrity": "sha512-+h1lkLKhZMTYjog1VEpJNG7NZJWcuc2DDk/qsqSTRRCOXiLjeQ1d1/udrUGhqMxUgAlwKNZ0cf2uqan5GLuS2A==", + "dev": true + }, + "errno": { + "version": "0.1.8", + "resolved": "https://registry.npmjs.org/errno/-/errno-0.1.8.tgz", + "integrity": "sha512-dJ6oBr5SQ1VSd9qkk7ByRgb/1SH4JZjCHSW/mr63/QcXO9zLVxvJ6Oy13nio03rxpSnVDDjFor75SjVeZWPW/A==", + "dev": true, + "requires": { + "prr": "~1.0.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==", + "version": "1.20.1", + "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.20.1.tgz", + "integrity": "sha512-WEm2oBhfoI2sImeM4OF2zE2V3BYdSF+KnSi9Sidz51fQHd7+JuF8Xgcj9/0o+OWeIeIS/MiuNnlruQrJf16GQA==", "dev": true, "requires": { "call-bind": "^1.0.2", "es-to-primitive": "^1.2.1", "function-bind": "^1.1.1", + "function.prototype.name": "^1.1.5", "get-intrinsic": "^1.1.1", "get-symbol-description": "^1.0.0", "has": "^1.0.3", - "has-symbols": "^1.0.2", + "has-property-descriptors": "^1.0.0", + "has-symbols": "^1.0.3", "internal-slot": "^1.0.3", "is-callable": "^1.2.4", - "is-negative-zero": "^2.0.1", + "is-negative-zero": "^2.0.2", "is-regex": "^1.1.4", - "is-shared-array-buffer": "^1.0.1", + "is-shared-array-buffer": "^1.0.2", "is-string": "^1.0.7", - "is-weakref": "^1.0.1", - "object-inspect": "^1.11.0", + "is-weakref": "^1.0.2", + "object-inspect": "^1.12.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" + "regexp.prototype.flags": "^1.4.3", + "string.prototype.trimend": "^1.0.5", + "string.prototype.trimstart": "^1.0.5", + "unbox-primitive": "^1.0.2" + } + }, + "es-shim-unscopables": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/es-shim-unscopables/-/es-shim-unscopables-1.0.0.tgz", + "integrity": "sha512-Jm6GPcCdC30eMLbZ2x8z2WuRwAws3zTBBKuusffYVUrNj/GVSUAZ+xKMaUpfNDR5IbyNA5LJbaecoUVbmUcB1w==", + "dev": true, + "requires": { + "has": "^1.0.3" } }, "es-to-primitive": { @@ -7286,9 +10632,9 @@ } }, "es5-ext": { - "version": "0.10.59", - "resolved": "https://registry.npmjs.org/es5-ext/-/es5-ext-0.10.59.tgz", - "integrity": "sha512-cOgyhW0tIJyQY1Kfw6Kr0viu9ZlUctVchRMZ7R0HiH3dxTSp5zJDLecwxUqPUrGKMsgBI1wd1FL+d9Jxfi4cLw==", + "version": "0.10.61", + "resolved": "https://registry.npmjs.org/es5-ext/-/es5-ext-0.10.61.tgz", + "integrity": "sha512-yFhIqQAzu2Ca2I4SE2Au3rxVfmohU9Y7wqGR+s7+H7krk26NXhIRAZDgqd6xqjCEFUomDEA3/Bo/7fKmIkW1kA==", "requires": { "es6-iterator": "^2.0.3", "es6-symbol": "^3.1.3", @@ -7304,7 +10650,7 @@ "es6-iterator": { "version": "2.0.3", "resolved": "https://registry.npmjs.org/es6-iterator/-/es6-iterator-2.0.3.tgz", - "integrity": "sha1-p96IkUGgWpSwhUQDstCg+/qY87c=", + "integrity": "sha512-zw4SRzoUkd+cl+ZoE15A9o1oQd920Bb0iOJMQkQhl3jNc03YqVjAhG7scf9C5KWRU/R13Orf588uCC6525o02g==", "requires": { "d": "1", "es5-ext": "^0.10.35", @@ -7333,12 +10679,12 @@ "dev": true }, "eslint": { - "version": "8.11.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.11.0.tgz", - "integrity": "sha512-/KRpd9mIRg2raGxHRGwW9ZywYNAClZrHjdueHcrVDuO3a6bj83eoTirCCk0M0yPwOjWYKHwRVRid+xK4F/GHgA==", + "version": "8.19.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.19.0.tgz", + "integrity": "sha512-SXOPj3x9VKvPe81TjjUJCYlV4oJjQw68Uek+AM0X4p+33dj2HY5bpTZOgnQHcG2eAm1mtCU9uNMnJi7exU/kYw==", "dev": true, "requires": { - "@eslint/eslintrc": "^1.2.1", + "@eslint/eslintrc": "^1.3.0", "@humanwhocodes/config-array": "^0.9.2", "ajv": "^6.10.0", "chalk": "^4.0.0", @@ -7349,14 +10695,14 @@ "eslint-scope": "^7.1.1", "eslint-utils": "^3.0.0", "eslint-visitor-keys": "^3.3.0", - "espree": "^9.3.1", + "espree": "^9.3.2", "esquery": "^1.4.0", "esutils": "^2.0.2", "fast-deep-equal": "^3.1.3", "file-entry-cache": "^6.0.1", "functional-red-black-tree": "^1.0.1", "glob-parent": "^6.0.1", - "globals": "^13.6.0", + "globals": "^13.15.0", "ignore": "^5.2.0", "import-fresh": "^3.0.0", "imurmurhash": "^0.1.4", @@ -7365,7 +10711,7 @@ "json-stable-stringify-without-jsonify": "^1.0.1", "levn": "^0.4.1", "lodash.merge": "^4.6.2", - "minimatch": "^3.0.4", + "minimatch": "^3.1.2", "natural-compare": "^1.4.0", "optionator": "^0.9.1", "regexpp": "^3.2.0", @@ -7443,9 +10789,9 @@ } }, "eslint-plugin-import": { - "version": "2.25.4", - "resolved": "https://registry.npmjs.org/eslint-plugin-import/-/eslint-plugin-import-2.25.4.tgz", - "integrity": "sha512-/KJBASVFxpu0xg1kIBn9AUa8hQVnszpwgE7Ld0lKAlx7Ie87yzEzCgSkekt+le/YVhiaosO4Y14GDAOc41nfxA==", + "version": "2.26.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-import/-/eslint-plugin-import-2.26.0.tgz", + "integrity": "sha512-hYfi3FXaM8WPLf4S1cikh/r4IxnO6zrhZbEGz2b660EJRbuxgpDS5gkCuYgGWg2xxh2rBuIr4Pvhve/7c31koA==", "dev": true, "requires": { "array-includes": "^3.1.4", @@ -7453,14 +10799,14 @@ "debug": "^2.6.9", "doctrine": "^2.1.0", "eslint-import-resolver-node": "^0.3.6", - "eslint-module-utils": "^2.7.2", + "eslint-module-utils": "^2.7.3", "has": "^1.0.3", - "is-core-module": "^2.8.0", + "is-core-module": "^2.8.1", "is-glob": "^4.0.3", - "minimatch": "^3.0.4", + "minimatch": "^3.1.2", "object.values": "^1.1.5", - "resolve": "^1.20.0", - "tsconfig-paths": "^3.12.0" + "resolve": "^1.22.0", + "tsconfig-paths": "^3.14.1" }, "dependencies": { "debug": { @@ -7484,15 +10830,15 @@ "ms": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", + "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==", "dev": true } } }, "eslint-plugin-prettier": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/eslint-plugin-prettier/-/eslint-plugin-prettier-4.0.0.tgz", - "integrity": "sha512-98MqmCJ7vJodoQK359bqQWaxOE0CS8paAz/GgjaZLyex4TTk3g9HugoO89EqWCrFiOqn9EVvcoo7gZzONCWVwQ==", + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/eslint-plugin-prettier/-/eslint-plugin-prettier-4.2.1.tgz", + "integrity": "sha512-f/0rXLXUt0oFYs8ra4w49wYZBG5GKZpAYsJSm6rnYL5uVDjd+zowwMwVZHnAjf4edNrKpCDYfXDgmRE/Ak7QyQ==", "dev": true, "requires": { "prettier-linter-helpers": "^1.0.0" @@ -7532,13 +10878,13 @@ "dev": true }, "espree": { - "version": "9.3.1", - "resolved": "https://registry.npmjs.org/espree/-/espree-9.3.1.tgz", - "integrity": "sha512-bvdyLmJMfwkV3NCRl5ZhJf22zBFo1y8bYh3VYb+bfzqNB4Je68P2sSuXyuFquzWLebHpNd2/d5uv7yoP9ISnGQ==", + "version": "9.3.2", + "resolved": "https://registry.npmjs.org/espree/-/espree-9.3.2.tgz", + "integrity": "sha512-D211tC7ZwouTIuY5x9XnS0E9sWNChB7IYKX/Xp5eQj3nFXhqmiUDB9q27y76oFl8jTg3pXcQx/bpxMfs3CIZbA==", "dev": true, "requires": { - "acorn": "^8.7.0", - "acorn-jsx": "^5.3.1", + "acorn": "^8.7.1", + "acorn-jsx": "^5.3.2", "eslint-visitor-keys": "^3.3.0" } }, @@ -7565,33 +10911,129 @@ } } }, - "esrecurse": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.3.0.tgz", - "integrity": "sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==", + "esrecurse": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.3.0.tgz", + "integrity": "sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==", + "dev": true, + "requires": { + "estraverse": "^5.2.0" + }, + "dependencies": { + "estraverse": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", + "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", + "dev": true + } + } + }, + "estraverse": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.3.0.tgz", + "integrity": "sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==", + "dev": true + }, + "esutils": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz", + "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==", + "dev": true + }, + "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, + "requires": { + "@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": { + "version": "0.6.8", + "resolved": "https://registry.npmjs.org/ethereumjs-abi/-/ethereumjs-abi-0.6.8.tgz", + "integrity": "sha512-Tx0r/iXI6r+lRsdvkFDlut0N08jWMnKRZ6Gkq+Nmw75lZe4e6o3EkSnkaBP5NF6+m5PTGAr9JP43N3LyeoglsA==", + "dev": true, + "requires": { + "bn.js": "^4.11.8", + "ethereumjs-util": "^6.0.0" + }, + "dependencies": { + "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" + } + } + } + }, + "ethereumjs-util": { + "version": "7.1.5", + "resolved": "https://registry.npmjs.org/ethereumjs-util/-/ethereumjs-util-7.1.5.tgz", + "integrity": "sha512-SDl5kKrQAudFBUe5OJM9Ac6WmMyYmXX/6sTmLZ3ffG2eY6ZIGBes3pEDxNN6V72WyOw4CPD5RomKdsa8DAAwLg==", "dev": true, "requires": { - "estraverse": "^5.2.0" + "@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" }, "dependencies": { - "estraverse": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", - "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", + "@types/bn.js": { + "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==", + "dev": true, + "requires": { + "@types/node": "*" + } + }, + "bn.js": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-5.2.1.tgz", + "integrity": "sha512-eXRvHzWyYPBuB4NBy0cmYQjGitUrtqwbvlzP3G6VFnNRbsZQIxQ10PbKKHt8gZ/HW/D/747aDl+QkDqg3KQLMQ==", "dev": true } } }, - "estraverse": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.3.0.tgz", - "integrity": "sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==", - "dev": true + "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, + "requires": { + "is-hex-prefixed": "1.0.0", + "strip-hex-prefix": "1.0.0" + } }, - "esutils": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz", - "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==", + "event-target-shim": { + "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==", "dev": true }, "evp_bytestokey": { @@ -7663,7 +11105,7 @@ "fast-levenshtein": { "version": "2.0.6", "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", - "integrity": "sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc=", + "integrity": "sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==", "dev": true }, "fastq": { @@ -7712,7 +11154,7 @@ "find-up": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/find-up/-/find-up-2.1.0.tgz", - "integrity": "sha1-RdG35QbHF93UgndaK3eSCjwMV6c=", + "integrity": "sha512-NWzkk0jSJtTt08+FBFMvXoeZnOJD+jTtsRmBYbAIzJdX6l7dLgR7CTubCM5/eDdPUBvLCeVasP1brfVR/9/EZQ==", "dev": true, "requires": { "locate-path": "^2.0.0" @@ -7735,9 +11177,15 @@ } }, "flatted": { - "version": "3.2.5", - "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.2.5.tgz", - "integrity": "sha512-WIWGi2L3DyTUvUrwRKgGi9TwxQMUEqPOPQBVi71R96jZXJdFskXEmf54BoZaS1kknGODoIGASGEzBUYdyMCBJg==", + "version": "3.2.6", + "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.2.6.tgz", + "integrity": "sha512-0sQoMh9s0BYsm+12Huy/rkKxVu4R1+r96YX5cG44rHV0pQ6iC3Q+mkoMFaGWObMFYQxCVT+ssG1ksneA2MI9KQ==", + "dev": true + }, + "follow-redirects": { + "version": "1.15.1", + "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.1.tgz", + "integrity": "sha512-yLAMQs+k0b2m7cVxpS1VKJVvoz7SS9Td1zss3XRwXj+ZDH00RJgnuLx7E44wx02kQLrdM3aOOy+FpzS7+8OizA==", "dev": true }, "foreground-child": { @@ -7750,16 +11198,33 @@ "signal-exit": "^3.0.2" } }, + "fp-ts": { + "version": "1.19.3", + "resolved": "https://registry.npmjs.org/fp-ts/-/fp-ts-1.19.3.tgz", + "integrity": "sha512-H5KQDspykdHuztLTg+ajGN0Z2qUjcEf3Ybxc6hLt0k7/zPkn29XnKnxlBPyW2XIddWrGaJBzBl4VLYOtk39yZg==", + "dev": true + }, "fromentries": { "version": "1.3.2", "resolved": "https://registry.npmjs.org/fromentries/-/fromentries-1.3.2.tgz", "integrity": "sha512-cHEpEQHUg0f8XdtZCc2ZAhrHzKzT0MrFUTcvx+hfxYu7rGMDc5SKoXFh+n4YigxsHXRzc6OrCshdR1bWH6HHyg==", "dev": true }, + "fs-extra": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-7.0.1.tgz", + "integrity": "sha512-YJDaCJZEnBmcbw13fvdAM9AwNOJwOzrE4pqMqBq5nFiEqXUqHwlK4B+3pUw6JNvfSPtX05xFHtYy/1ni01eGCw==", + "dev": true, + "requires": { + "graceful-fs": "^4.1.2", + "jsonfile": "^4.0.0", + "universalify": "^0.1.0" + } + }, "fs.realpath": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", - "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", + "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==", "dev": true }, "fsevents": { @@ -7775,10 +11240,28 @@ "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==", "dev": true }, + "function.prototype.name": { + "version": "1.1.5", + "resolved": "https://registry.npmjs.org/function.prototype.name/-/function.prototype.name-1.1.5.tgz", + "integrity": "sha512-uN7m/BzVKQnCUF/iW8jYea67v++2u7m5UgENbHRtdDVclOUP+FMPlCNdmk0h/ysGyo2tavMJEDqJAkJdRa1vMA==", + "dev": true, + "requires": { + "call-bind": "^1.0.2", + "define-properties": "^1.1.3", + "es-abstract": "^1.19.0", + "functions-have-names": "^1.2.2" + } + }, "functional-red-black-tree": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz", - "integrity": "sha1-GwqzvVU7Kg1jmdKcDj6gslIHgyc=", + "integrity": "sha512-dsKNQNdj6xA3T+QlADDA7mOSlX0qiMINjn0cgr+eGHGsbSHzTabcIogz2+p/iqP1Xs6EP/sS2SbqH+brGTbq0g==", + "dev": true + }, + "functions-have-names": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/functions-have-names/-/functions-have-names-1.2.3.tgz", + "integrity": "sha512-xckBUXyTIqT97tq2x2AMb+g163b5JFysYk0x4qxNFwbfQkmNZoiRHb6sPzI9/QV33WeuvVYBUIiD4NzNIyqaRQ==", "dev": true }, "gensync": { @@ -7796,18 +11279,18 @@ "get-func-name": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/get-func-name/-/get-func-name-2.0.0.tgz", - "integrity": "sha1-6td0q+5y4gQJQzoGY2YCPdaIekE=", + "integrity": "sha512-Hm0ixYtaSZ/V7C8FJrtZIuBBI+iSgL+1Aq82zSu8VQNB4S3Gk8e7Qs3VwBDJAhmRZcFqkl3tQu36g/Foh5I5ig==", "dev": true }, "get-intrinsic": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.1.1.tgz", - "integrity": "sha512-kWZrnVM42QCiEA2Ig1bG8zjoIMOgxWwYCEeNdwY6Tv/cOSeGpcoX4pXHfKUxNKVoArnrEr2e9srnAxxGIraS9Q==", + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.1.2.tgz", + "integrity": "sha512-Jfm3OyCxHh9DJyc28qGk+JmfkpO41A4XkneDSujN9MDXrm4oDKdHvndhZ2dN94+ERNfkYJWDclW6k2L/ZGHjXA==", "dev": true, "requires": { "function-bind": "^1.1.1", "has": "^1.0.3", - "has-symbols": "^1.0.1" + "has-symbols": "^1.0.3" } }, "get-package-type": { @@ -7850,9 +11333,9 @@ } }, "globals": { - "version": "13.13.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-13.13.0.tgz", - "integrity": "sha512-EQ7Q18AJlPwp3vUDL4mKA0KXrXyNIQyWon6T6XQiBQF0XHvRsiCSrWmmeATpUzdJN2HhWZU6Pdl0a9zdep5p6A==", + "version": "13.16.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-13.16.0.tgz", + "integrity": "sha512-A1lrQfpNF+McdPOnnFqY3kSN0AFTy485bTi1bkLk4mVPODIUEcSfhHgRqA+QdXPksrSTTztYXx37NFV+GpGk3Q==", "dev": true, "requires": { "type-fest": "^0.20.2" @@ -7873,9 +11356,9 @@ } }, "graceful-fs": { - "version": "4.2.9", - "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.9.tgz", - "integrity": "sha512-NtNxqUcXgpW2iMrfqSfR73Glt39K+BLwWsPs94yR63v45T0Wbej7eRmL5cWfwEgqXnmjQp3zaJTshdRW/qC2ZQ==", + "version": "4.2.10", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.10.tgz", + "integrity": "sha512-9ByhssR2fPVsNZj478qUUbKfmL0+t5BDVyjShtyZZLiK7ZDAArFFfopyOTj0M05wE2tJPisA4iTnnXl2YoPvOA==", "dev": true }, "growl": { @@ -7884,6 +11367,150 @@ "integrity": "sha512-qBr4OuELkhPenW6goKVXiv47US3clb3/IbuWF9KNKEijAy9oeHxU9IgzjvJhHkUzhaj7rOUD7+YGWqUjLp5oSA==", "dev": true }, + "hardhat": { + "version": "2.9.9", + "resolved": "https://registry.npmjs.org/hardhat/-/hardhat-2.9.9.tgz", + "integrity": "sha512-Qv7SXnRc0zq1kGXruNnSKpP3eFccXMR5Qv6GVX9hBIJ5efN0PflKPq92aQ5Cv3jrjJeRevLznWZVz7bttXhVfw==", + "dev": true, + "requires": { + "@ethereumjs/block": "^3.6.2", + "@ethereumjs/blockchain": "^5.5.2", + "@ethereumjs/common": "^2.6.4", + "@ethereumjs/tx": "^3.5.1", + "@ethereumjs/vm": "^5.9.0", + "@ethersproject/abi": "^5.1.2", + "@metamask/eth-sig-util": "^4.0.0", + "@sentry/node": "^5.18.1", + "@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", + "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.4", + "find-up": "^2.1.0", + "fp-ts": "1.19.3", + "fs-extra": "^7.0.1", + "glob": "7.2.0", + "immutable": "^4.0.0-rc.12", + "io-ts": "1.10.4", + "lodash": "^4.17.11", + "merkle-patricia-tree": "^4.2.4", + "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", + "undici": "^5.4.0", + "uuid": "^8.3.2", + "ws": "^7.4.6" + }, + "dependencies": { + "@types/bn.js": { + "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==", + "dev": true, + "requires": { + "@types/node": "*" + } + }, + "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": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==", + "dev": true + }, + "escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", + "dev": true + }, + "has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", + "dev": true + }, + "resolve": { + "version": "1.17.0", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.17.0.tgz", + "integrity": "sha512-ic+7JYiV8Vi2yzQGFWOkiZD5Z9z7O2Zhm9XMaTxdJExKasieFCr+yXZ/WmXsckHiKl12ar0y6XiXDx3m4RHn1w==", + "dev": true, + "requires": { + "path-parse": "^1.0.6" + } + }, + "semver": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "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" + } + }, + "uuid": { + "version": "8.3.2", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz", + "integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==", + "dev": true + } + } + }, "has": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", @@ -7894,9 +11521,9 @@ } }, "has-bigints": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/has-bigints/-/has-bigints-1.0.1.tgz", - "integrity": "sha512-LSBS2LjbNBTf6287JEbEzvJgftkF5qFkmCo9hDRpAzKhUOlJ+hx8dd4USs00SgsUNwc4617J9ki5YtEClM2ffA==", + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/has-bigints/-/has-bigints-1.0.2.tgz", + "integrity": "sha512-tSvCKtBr9lkF0Ex0aQiP9N+OpV4zi2r/Nee5VkRDbaqv35RLYMzbwQfFSZZH0kR+Rd6302UJZ2p/bJCEoR3VoQ==", "dev": true }, "has-flag": { @@ -7905,6 +11532,15 @@ "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", "dev": true }, + "has-property-descriptors": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/has-property-descriptors/-/has-property-descriptors-1.0.0.tgz", + "integrity": "sha512-62DVLZGoiEBDHQyqG4w9xCuZ7eJEwNmJRWw2VY84Oedb7WFcA27fiEVe8oUQx9hAUJ4ekurquucTGwsyO1XGdQ==", + "dev": true, + "requires": { + "get-intrinsic": "^1.1.1" + } + }, "has-symbols": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.3.tgz", @@ -7965,6 +11601,23 @@ "bs58check": "^2.1.2", "safe-buffer": "^5.1.1", "secp256k1": "^3.0.1" + }, + "dependencies": { + "secp256k1": { + "version": "3.8.0", + "resolved": "https://registry.npmjs.org/secp256k1/-/secp256k1-3.8.0.tgz", + "integrity": "sha512-k5ke5avRZbtl9Tqx/SA7CbY3NF6Ro+Sj9cZxezFzuBlLDmyqPiL8hJJ+EmzD8Ig4LUDByHJ3/iPOVoRixs/hmw==", + "requires": { + "bindings": "^1.5.0", + "bip66": "^1.1.5", + "bn.js": "^4.11.8", + "create-hash": "^1.2.0", + "drbg.js": "^1.0.1", + "elliptic": "^6.5.2", + "nan": "^2.14.0", + "safe-buffer": "^5.1.2" + } + } } }, "he": { @@ -7976,7 +11629,7 @@ "hmac-drbg": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/hmac-drbg/-/hmac-drbg-1.0.1.tgz", - "integrity": "sha1-0nRXAQJabHdabFRXk+1QL8DGSaE=", + "integrity": "sha512-Tti3gMqLdZfhOQY1Mzf/AanLiqh1WTiJgEj26ZuYQ9fbkLomzGchCws4FyrSd4VkpBfiNhaE1On+lOz894jvXg==", "requires": { "hash.js": "^1.0.3", "minimalistic-assert": "^1.0.0", @@ -7989,12 +11642,62 @@ "integrity": "sha512-H2iMtd0I4Mt5eYiapRdIDjp+XzelXQ0tFE4JS7YFwFevXXMmOp9myNrUvCg0D6ws8iqkRPBfKHgbwig1SmlLfg==", "dev": true }, + "http-errors": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-2.0.0.tgz", + "integrity": "sha512-FtwrG/euBzaEjYeRqOgly7G0qviiXoJWnvEH2Z1plBdXgbyjv34pHTSb9zoeHMyDy33+DWy5Wt9Wo+TURtOYSQ==", + "dev": true, + "requires": { + "depd": "2.0.0", + "inherits": "2.0.4", + "setprototypeof": "1.2.0", + "statuses": "2.0.1", + "toidentifier": "1.0.1" + } + }, + "https-proxy-agent": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-5.0.1.tgz", + "integrity": "sha512-dFcAjpTQFgoLMzC2VwU+C/CbS7uRL0lWmxDITmqm7C+7F0Odmj6s9l6alZc6AELXhrnggM2CeWSXHGOdX2YtwA==", + "dev": true, + "requires": { + "agent-base": "6", + "debug": "4" + } + }, + "iconv-lite": { + "version": "0.4.24", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", + "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", + "dev": true, + "requires": { + "safer-buffer": ">= 2.1.2 < 3" + } + }, + "ieee754": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.2.1.tgz", + "integrity": "sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==", + "dev": true + }, "ignore": { "version": "5.2.0", "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.2.0.tgz", "integrity": "sha512-CmxgYGiEPCLhfLnpPp1MoRmifwEIOgjcHXxOBjv7mY96c+eWScsOP9c112ZyLdWHi0FxHjI+4uVhKYp/gcdRmQ==", "dev": true }, + "immediate": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/immediate/-/immediate-3.3.0.tgz", + "integrity": "sha512-HR7EVodfFUdQCTIeySw+WDRFJlPcLOJbXfwwZ7Oom6tjsvZ3bOkCDJHehQC3nxJrv7+f9XecwazynjU8e4Vw3Q==", + "dev": true + }, + "immutable": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/immutable/-/immutable-4.1.0.tgz", + "integrity": "sha512-oNkuqVTA8jqG1Q6c+UglTOD1xhC1BtjKI7XkCXRkZHrN5m18/XsnUp8Q89GkQO/z+0WjonSvl0FLhDYftp46nQ==", + "dev": true + }, "import-fresh": { "version": "3.3.0", "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.0.tgz", @@ -8008,7 +11711,7 @@ "imurmurhash": { "version": "0.1.4", "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", - "integrity": "sha1-khi5srkoojixPcT7a21XbyMUU+o=", + "integrity": "sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==", "dev": true }, "indent-string": { @@ -8020,7 +11723,7 @@ "inflight": { "version": "1.0.6", "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", - "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", + "integrity": "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==", "dev": true, "requires": { "once": "^1.3.0", @@ -8043,6 +11746,15 @@ "side-channel": "^1.0.4" } }, + "io-ts": { + "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==", + "dev": true, + "requires": { + "fp-ts": "^1.0.0" + } + }, "is-bigint": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/is-bigint/-/is-bigint-1.0.4.tgz", @@ -8078,9 +11790,9 @@ "dev": true }, "is-core-module": { - "version": "2.8.1", - "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.8.1.tgz", - "integrity": "sha512-SdNCUs284hr40hFTFP6l0IfZ/RSrMXF3qgoRHd3/79unUTvrFO/JoXwkGm+5J/Oe3E/b5GsnG330uUNgRpu1PA==", + "version": "2.9.0", + "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.9.0.tgz", + "integrity": "sha512-+5FPy5PnwmO3lvfMb0AsoPaBG+5KHUI0wYFXOtYPnVVVspTFUuMZNfNaNVRt3FZadstu2c8x23vykRW/NBoU6A==", "dev": true, "requires": { "has": "^1.0.3" @@ -8098,7 +11810,7 @@ "is-extglob": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", - "integrity": "sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=", + "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==", "dev": true }, "is-fullwidth-code-point": { @@ -8116,6 +11828,12 @@ "is-extglob": "^2.1.1" } }, + "is-hex-prefixed": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-hex-prefixed/-/is-hex-prefixed-1.0.0.tgz", + "integrity": "sha512-WvtOiug1VFrE9v1Cydwm+FnXd3+w9GaeVUss5W4v/SLy3UW00vP+6iNF2SdnfiBoLy4bTqVdkftNGTUeOFVsbA==", + "dev": true + }, "is-negative-zero": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/is-negative-zero/-/is-negative-zero-2.0.2.tgz", @@ -8129,9 +11847,9 @@ "dev": true }, "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==", + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/is-number-object/-/is-number-object-1.0.7.tgz", + "integrity": "sha512-k1U0IRzLMo7ZlYIfzRu23Oh6MiIFasgpb9X76eqfFZAqwH44UI4KTBvBYIZ1dSL9ZzChTB9ShHfLkR4pdW5krQ==", "dev": true, "requires": { "has-tostringtag": "^1.0.0" @@ -8154,10 +11872,13 @@ } }, "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 + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-shared-array-buffer/-/is-shared-array-buffer-1.0.2.tgz", + "integrity": "sha512-sqN2UDu1/0y6uvXyStCOzyhAjCSlHceFoMKJW8W9EU9cvic/QdsZ0kEU93HEy3IUEFZIiH/3w+AH/UQbPHNdhA==", + "dev": true, + "requires": { + "call-bind": "^1.0.2" + } }, "is-stream": { "version": "2.0.1", @@ -8186,7 +11907,7 @@ "is-typedarray": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz", - "integrity": "sha1-5HnICFjfDBsR3dppQPlgEfzaSpo=" + "integrity": "sha512-cyA56iCMHAh5CdzjJIa4aohJyeO1YbwLi3Jc35MmRU6poroFjIGZzUzupGiRPOjgHg9TLu43xbpwXk523fMxKA==" }, "is-unicode-supported": { "version": "0.1.0", @@ -8212,13 +11933,13 @@ "isarray": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", - "integrity": "sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8=", + "integrity": "sha512-D2S+3GLxWH+uhrNEcoh/fnmYeP8E8/zHl644d/jdA0g2uyXvy3sb0qxotE+ne0LtccHknQzWwZEzhak7oJ0COQ==", "dev": true }, "isexe": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", - "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=", + "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", "dev": true }, "istanbul-lib-coverage": { @@ -8257,18 +11978,34 @@ } }, "istanbul-lib-processinfo": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/istanbul-lib-processinfo/-/istanbul-lib-processinfo-2.0.2.tgz", - "integrity": "sha512-kOwpa7z9hme+IBPZMzQ5vdQj8srYgAtaRqeI48NGmAQ+/5yKiHLV0QbYqQpxsdEF0+w14SoB8YbnHKcXE2KnYw==", + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/istanbul-lib-processinfo/-/istanbul-lib-processinfo-2.0.3.tgz", + "integrity": "sha512-NkwHbo3E00oybX6NGJi6ar0B29vxyvNwoC7eJ4G4Yq28UfY758Hgn/heV8VRFhevPED4LXfFz0DQ8z/0kw9zMg==", "dev": true, "requires": { "archy": "^1.0.0", - "cross-spawn": "^7.0.0", - "istanbul-lib-coverage": "^3.0.0-alpha.1", - "make-dir": "^3.0.0", + "cross-spawn": "^7.0.3", + "istanbul-lib-coverage": "^3.2.0", "p-map": "^3.0.0", "rimraf": "^3.0.0", - "uuid": "^3.3.3" + "uuid": "^8.3.2" + }, + "dependencies": { + "p-map": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/p-map/-/p-map-3.0.0.tgz", + "integrity": "sha512-d3qXVTF/s+W+CdJ5A29wywV2n8CQQYahlgz2bFiA+4eVNJbHJodPZ+/gXwPGh0bOqA+j8S+6+ckmvLGPk1QpxQ==", + "dev": true, + "requires": { + "aggregate-error": "^3.0.0" + } + }, + "uuid": { + "version": "8.3.2", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz", + "integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==", + "dev": true + } } }, "istanbul-lib-report": { @@ -8291,14 +12028,6 @@ "debug": "^4.1.1", "istanbul-lib-coverage": "^3.0.0", "source-map": "^0.6.1" - }, - "dependencies": { - "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 - } } }, "istanbul-reports": { @@ -8346,20 +12075,137 @@ "json-stable-stringify-without-jsonify": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz", - "integrity": "sha1-nbe1lJatPzz+8wp1FC0tkwrXJlE=", + "integrity": "sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw==", + "dev": true + }, + "json5": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.1.tgz", + "integrity": "sha512-1hqLFMSrGHRHxav9q9gNjJ5EXznIxGVO09xQRrwplcS8qs28pZ8s8hupZAmqDwZUmVZ2Qb2jnyPOWcDH8m8dlA==", + "dev": true + }, + "jsonfile": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz", + "integrity": "sha512-m6F1R3z8jjlf2imQHS2Qez5sjKWQzbuuhuJ/FKYFRZvPE3PuHcSMVZzfsLhGVOkfd20obL5SWEBew5ShlquNxg==", + "dev": true, + "requires": { + "graceful-fs": "^4.1.6" + } + }, + "just-extend": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/just-extend/-/just-extend-4.2.1.tgz", + "integrity": "sha512-g3UB796vUFIY90VIv/WX3L2c8CS2MdWUww3CNrYmqza1Fg0DURc2K/O4YrnklBdQarSJ/y8JnJYDGc+1iumQjg==", + "dev": true + }, + "keccak": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/keccak/-/keccak-3.0.2.tgz", + "integrity": "sha512-PyKKjkH53wDMLGrvmRGSNWgmSxZOUqbnXwKL9tmgbFYA1iAYqW21kfR7mZXV0MlESiefxQQE9X9fTa3X+2MPDQ==", + "dev": true, + "requires": { + "node-addon-api": "^2.0.0", + "node-gyp-build": "^4.2.0", + "readable-stream": "^3.6.0" + } + }, + "klaw": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/klaw/-/klaw-1.3.1.tgz", + "integrity": "sha512-TED5xi9gGQjGpNnvRWknrwAB1eL5GciPfVFOt3Vk1OJCVDQbzuSfrF3hkUQKlsgKrG1F+0t5W0m+Fje1jIt8rw==", + "dev": true, + "requires": { + "graceful-fs": "^4.1.9" + } + }, + "level-codec": { + "version": "9.0.2", + "resolved": "https://registry.npmjs.org/level-codec/-/level-codec-9.0.2.tgz", + "integrity": "sha512-UyIwNb1lJBChJnGfjmO0OR+ezh2iVu1Kas3nvBS/BzGnx79dv6g7unpKIDNPMhfdTEGoc7mC8uAu51XEtX+FHQ==", + "dev": true, + "requires": { + "buffer": "^5.6.0" + } + }, + "level-concat-iterator": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/level-concat-iterator/-/level-concat-iterator-2.0.1.tgz", + "integrity": "sha512-OTKKOqeav2QWcERMJR7IS9CUo1sHnke2C0gkSmcR7QuEtFNLLzHQAvnMw8ykvEcv0Qtkg0p7FOwP1v9e5Smdcw==", "dev": true }, - "json5": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.1.tgz", - "integrity": "sha512-1hqLFMSrGHRHxav9q9gNjJ5EXznIxGVO09xQRrwplcS8qs28pZ8s8hupZAmqDwZUmVZ2Qb2jnyPOWcDH8m8dlA==", - "dev": true + "level-errors": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/level-errors/-/level-errors-2.0.1.tgz", + "integrity": "sha512-UVprBJXite4gPS+3VznfgDSU8PTRuVX0NXwoWW50KLxd2yw4Y1t2JUR5In1itQnudZqRMT9DlAM3Q//9NCjCFw==", + "dev": true, + "requires": { + "errno": "~0.1.1" + } + }, + "level-iterator-stream": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/level-iterator-stream/-/level-iterator-stream-4.0.2.tgz", + "integrity": "sha512-ZSthfEqzGSOMWoUGhTXdX9jv26d32XJuHz/5YnuHZzH6wldfWMOVwI9TBtKcya4BKTyTt3XVA0A3cF3q5CY30Q==", + "dev": true, + "requires": { + "inherits": "^2.0.4", + "readable-stream": "^3.4.0", + "xtend": "^4.0.2" + } + }, + "level-mem": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/level-mem/-/level-mem-5.0.1.tgz", + "integrity": "sha512-qd+qUJHXsGSFoHTziptAKXoLX87QjR7v2KMbqncDXPxQuCdsQlzmyX+gwrEHhlzn08vkf8TyipYyMmiC6Gobzg==", + "dev": true, + "requires": { + "level-packager": "^5.0.3", + "memdown": "^5.0.0" + } + }, + "level-packager": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/level-packager/-/level-packager-5.1.1.tgz", + "integrity": "sha512-HMwMaQPlTC1IlcwT3+swhqf/NUO+ZhXVz6TY1zZIIZlIR0YSn8GtAAWmIvKjNY16ZkEg/JcpAuQskxsXqC0yOQ==", + "dev": true, + "requires": { + "encoding-down": "^6.3.0", + "levelup": "^4.3.2" + } + }, + "level-supports": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/level-supports/-/level-supports-1.0.1.tgz", + "integrity": "sha512-rXM7GYnW8gsl1vedTJIbzOrRv85c/2uCMpiiCzO2fndd06U/kUXEEU9evYn4zFggBOg36IsBW8LzqIpETwwQzg==", + "dev": true, + "requires": { + "xtend": "^4.0.2" + } + }, + "level-ws": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/level-ws/-/level-ws-2.0.0.tgz", + "integrity": "sha512-1iv7VXx0G9ec1isqQZ7y5LmoZo/ewAsyDHNA8EFDW5hqH2Kqovm33nSFkSdnLLAK+I5FlT+lo5Cw9itGe+CpQA==", + "dev": true, + "requires": { + "inherits": "^2.0.3", + "readable-stream": "^3.1.0", + "xtend": "^4.0.1" + } }, - "just-extend": { - "version": "4.2.1", - "resolved": "https://registry.npmjs.org/just-extend/-/just-extend-4.2.1.tgz", - "integrity": "sha512-g3UB796vUFIY90VIv/WX3L2c8CS2MdWUww3CNrYmqza1Fg0DURc2K/O4YrnklBdQarSJ/y8JnJYDGc+1iumQjg==", - "dev": true + "levelup": { + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/levelup/-/levelup-4.4.0.tgz", + "integrity": "sha512-94++VFO3qN95cM/d6eBXvd894oJE0w3cInq9USsyQzzoJxmiYzPAocNcuGCPGGjoXqDVJcr3C1jzt1TSjyaiLQ==", + "dev": true, + "requires": { + "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" + } }, "levn": { "version": "0.4.1", @@ -8374,23 +12220,29 @@ "locate-path": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-2.0.0.tgz", - "integrity": "sha1-K1aLJl7slExtnA3pw9u7ygNUzY4=", + "integrity": "sha512-NCI2kiDkyR7VeEKm27Kda/iQHyKJe1Bu0FlTbYp3CqJu+9IFe9bLyAjMxf5ZDDbEg+iMPzB5zYyUTSm8wVTKmA==", "dev": true, "requires": { "p-locate": "^2.0.0", "path-exists": "^3.0.0" } }, + "lodash": { + "version": "4.17.21", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", + "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==", + "dev": true + }, "lodash.flattendeep": { "version": "4.4.0", "resolved": "https://registry.npmjs.org/lodash.flattendeep/-/lodash.flattendeep-4.4.0.tgz", - "integrity": "sha1-+wMJF/hqMTTlvJvsDWngAT3f7bI=", + "integrity": "sha512-uHaJFihxmJcEX3kT4I23ABqKKalJ/zDrDg0lsFtc1h+3uw49SIJ5beyhx5ExVRti3AvKoOJngIj7xz3oylPdWQ==", "dev": true }, "lodash.get": { "version": "4.4.2", "resolved": "https://registry.npmjs.org/lodash.get/-/lodash.get-4.4.2.tgz", - "integrity": "sha1-LRd/ZS+jHpObRDjVNBSZ36OCXpk=", + "integrity": "sha512-z+Uw/vLuy6gQe8cfaFWD7p0wVv8fJl3mbzXh33RS+0oW2wvUqiRXiQ69gLWSLpgB5/6sU+r6BlQR0MBILadqTQ==", "dev": true }, "lodash.merge": { @@ -8418,15 +12270,27 @@ "get-func-name": "^2.0.0" } }, + "lru_map": { + "version": "0.3.3", + "resolved": "https://registry.npmjs.org/lru_map/-/lru_map-0.3.3.tgz", + "integrity": "sha512-Pn9cox5CsMYngeDbmChANltQl+5pi6XmTrraMSzhPmMBbmgcxmqWry0U3PGapCU1yB4/LqCcom7qhHZiF/jGfQ==", + "dev": true + }, "lru-cache": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", - "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-5.1.1.tgz", + "integrity": "sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==", "dev": true, "requires": { - "yallist": "^4.0.0" + "yallist": "^3.0.2" } }, + "ltgt": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/ltgt/-/ltgt-2.2.1.tgz", + "integrity": "sha512-AI2r85+4MquTw9ZYqabu4nMwy9Oftlfa/e/52t9IjtfG+mGBbTNdAoZ3RQKLHR6r0wQnwZnPIEh/Ya6XTWAKNA==", + "dev": true + }, "make-dir": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-3.1.0.tgz", @@ -8450,6 +12314,12 @@ "integrity": "sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw==", "dev": true }, + "mcl-wasm": { + "version": "0.7.9", + "resolved": "https://registry.npmjs.org/mcl-wasm/-/mcl-wasm-0.7.9.tgz", + "integrity": "sha512-iJIUcQWA88IJB/5L15GnJVnSQJmf/YaxxV6zRavv83HILHaJQb6y0iFyDMdDO0gN8X37tdxmAOrH/P8B6RB8sQ==", + "dev": true + }, "md5.js": { "version": "1.3.5", "resolved": "https://registry.npmjs.org/md5.js/-/md5.js-1.3.5.tgz", @@ -8460,20 +12330,85 @@ "safe-buffer": "^5.1.2" } }, + "memdown": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/memdown/-/memdown-5.1.0.tgz", + "integrity": "sha512-B3J+UizMRAlEArDjWHTMmadet+UKwHd3UjMgGBkZcKAxAYVPS9o0Yeiha4qvz7iGiL2Sb3igUft6p7nbFWctpw==", + "dev": true, + "requires": { + "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" + }, + "dependencies": { + "abstract-leveldown": { + "version": "6.2.3", + "resolved": "https://registry.npmjs.org/abstract-leveldown/-/abstract-leveldown-6.2.3.tgz", + "integrity": "sha512-BsLm5vFMRUrrLeCcRc+G0t2qOaTzpoJQLOubq2XM72eNpjF5UdU5o/5NvlNhx95XHcAvcl8OMXr4mlg/fRgUXQ==", + "dev": true, + "requires": { + "buffer": "^5.5.0", + "immediate": "^3.2.3", + "level-concat-iterator": "~2.0.0", + "level-supports": "~1.0.0", + "xtend": "~4.0.0" + } + }, + "immediate": { + "version": "3.2.3", + "resolved": "https://registry.npmjs.org/immediate/-/immediate-3.2.3.tgz", + "integrity": "sha512-RrGCXRm/fRVqMIhqXrGEX9rRADavPiDFSoMb/k64i9XMk8uH4r/Omi5Ctierj6XzNecwDbO4WuFbDD1zmpl3Tg==", + "dev": true + } + } + }, + "memorystream": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/memorystream/-/memorystream-0.3.1.tgz", + "integrity": "sha512-S3UwM3yj5mtUSEfP41UZmt/0SCoVYUcU1rkXv+BQ5Ig8ndL4sPoJNBUJERafdPb5jjHJGuMgytgKvKIf58XNBw==", + "dev": true + }, "merge2": { "version": "1.4.1", "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz", "integrity": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==", "dev": true }, + "merkle-patricia-tree": { + "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.4", + "level-mem": "^5.0.1", + "level-ws": "^2.0.0", + "readable-stream": "^3.6.0", + "semaphore-async-await": "^1.5.1" + } + }, "micromatch": { - "version": "4.0.4", - "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.4.tgz", - "integrity": "sha512-pRmzw/XUcwXGpD9aI9q/0XOwLNygjETJ8y0ao0wdqprrzDa4YnxLcz7fQRZr8voh8V10kGhABbNcHVk5wHgWwg==", + "version": "4.0.5", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.5.tgz", + "integrity": "sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA==", + "dev": true, + "requires": { + "braces": "^3.0.2", + "picomatch": "^2.3.1" + } + }, + "miller-rabin": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/miller-rabin/-/miller-rabin-4.0.1.tgz", + "integrity": "sha512-115fLhvZVqWwHPbClyntxEVfVDfl9DLLTuJvq3g2O/Oxi8AiNouAHvDSzHS0viUJc+V5vm3eq91Xwqn9dp4jRA==", "dev": true, "requires": { - "braces": "^3.0.1", - "picomatch": "^2.2.3" + "bn.js": "^4.0.0", + "brorand": "^1.0.1" } }, "minimalistic-assert": { @@ -8484,7 +12419,7 @@ "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=" + "integrity": "sha512-JIYlbt6g8i5jKfJ3xz7rF0LXmv2TkDxBLUkiBeZ7bAx4GnnNMr8xFpGnOxn6GhTEHx3SjRrZEoU+j04prX1ktg==" }, "minimatch": { "version": "3.1.2", @@ -8506,6 +12441,15 @@ "resolved": "https://registry.npmjs.org/mitt/-/mitt-1.2.0.tgz", "integrity": "sha512-r6lj77KlwqLhIUku9UWYes7KJtsczvolZkzp8hbaDPPaE24OmWl5s539Mytlj22siEQKosZ26qCBgda2PKwoJw==" }, + "mnemonist": { + "version": "0.38.5", + "resolved": "https://registry.npmjs.org/mnemonist/-/mnemonist-0.38.5.tgz", + "integrity": "sha512-bZTFT5rrPKtPJxj8KSV0WkPyNxl72vQepqqVUAW2ARUpUSF2qXMB6jZj7hW5/k7C1rtpzqbD/IIbJwLXUjCHeg==", + "dev": true, + "requires": { + "obliterator": "^2.0.0" + } + }, "mocha": { "version": "9.2.2", "resolved": "https://registry.npmjs.org/mocha/-/mocha-9.2.2.tgz", @@ -8538,6 +12482,12 @@ "yargs-unparser": "2.0.0" }, "dependencies": { + "ansi-colors": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-4.1.1.tgz", + "integrity": "sha512-JoX0apGbHaUJBNl6yF+p6JAFYZ666/hhCGKN5t9QFjbJQKUU/g8MNbFDbvfrgKXvI1QpZplPOnwIo99lX/AAmA==", + "dev": true + }, "debug": { "version": "4.3.3", "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.3.tgz", @@ -8631,9 +12581,9 @@ "dev": true }, "nan": { - "version": "2.15.0", - "resolved": "https://registry.npmjs.org/nan/-/nan-2.15.0.tgz", - "integrity": "sha512-8ZtvEnA2c5aYCZYd1cvgdnU6cqwixRoYg70xPLWUws5ORTa/lnw+u4amixRS/Ac5U5mQVgp9pnlSUnbNWFaWZQ==" + "version": "2.16.0", + "resolved": "https://registry.npmjs.org/nan/-/nan-2.16.0.tgz", + "integrity": "sha512-UdAqHyFngu7TfQKsCBgAA6pWDkT8MAO7d0jyOecVhN5354xbLqdn8mV9Tat9gepAupm0bt2DbeaSC8vS52MuFA==" }, "nanoid": { "version": "3.3.1", @@ -8644,7 +12594,7 @@ "natural-compare": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", - "integrity": "sha1-Sr6/7tdUHywnrPspvbvRXI1bpPc=", + "integrity": "sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==", "dev": true }, "next-tick": { @@ -8665,6 +12615,12 @@ "path-to-regexp": "^1.7.0" } }, + "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 + }, "node-fetch": { "version": "2.6.7", "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.7.tgz", @@ -8674,9 +12630,9 @@ } }, "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.5.0", + "resolved": "https://registry.npmjs.org/node-gyp-build/-/node-gyp-build-4.5.0.tgz", + "integrity": "sha512-2iGbaQBV+ITgCz76ZEjmhUKAKVf7xfY1sRl4UiKQspfZMH2h06SyhNsnSVy50cwkFQDGLyif6m/6uFXHkOZ6rg==" }, "node-preload": { "version": "0.2.1", @@ -8688,9 +12644,9 @@ } }, "node-releases": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.2.tgz", - "integrity": "sha512-XxYDdcQ6eKqp/YjI+tb2C5WM2LgjnZrfYg4vgQt49EK268b6gYCHsBLrK2qvJo4FmCtqmKezb0WZFK4fkrZNsg==", + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.5.tgz", + "integrity": "sha512-U9h1NLROZTq9uE1SNffn6WuPDg8icmi3ns4rEl/oTfIle4iLjTliCzgTsbaIFMq/Xn078/lfY/BL0GWZ+psK4Q==", "dev": true }, "normalize-path": { @@ -8782,6 +12738,15 @@ "p-limit": "^2.2.0" } }, + "p-map": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/p-map/-/p-map-3.0.0.tgz", + "integrity": "sha512-d3qXVTF/s+W+CdJ5A29wywV2n8CQQYahlgz2bFiA+4eVNJbHJodPZ+/gXwPGh0bOqA+j8S+6+ckmvLGPk1QpxQ==", + "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", @@ -8849,9 +12814,9 @@ } }, "object-inspect": { - "version": "1.12.0", - "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.12.0.tgz", - "integrity": "sha512-Ho2z80bVIvJloH+YzRmpZVQe87+qASmBUKZDWgx9cu+KDrX2ZDH/3tMy+gXbZETVGs2M8YdxObOh7XAtim9Y0g==", + "version": "1.12.2", + "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.12.2.tgz", + "integrity": "sha512-z+cPxW0QGUp0mcqcsgQyLVRDoXFQbXOwBaqyF7VIgI4TWNQsDHrBpUQslRmIfAoYWdYzs6UlKJtB2XJpTaNSpQ==", "dev": true }, "object-keys": { @@ -8883,10 +12848,16 @@ "es-abstract": "^1.19.1" } }, + "obliterator": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/obliterator/-/obliterator-2.0.4.tgz", + "integrity": "sha512-lgHwxlxV1qIg1Eap7LgIeoBWIMFibOjbrYPIPJZcI1mmGAI2m3lNYpK12Y+GBdPQ0U1hRwSord7GIaawz962qQ==", + "dev": true + }, "once": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", - "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", + "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", "dev": true, "requires": { "wrappy": "1" @@ -8909,7 +12880,13 @@ "os-shim": { "version": "0.1.3", "resolved": "https://registry.npmjs.org/os-shim/-/os-shim-0.1.3.tgz", - "integrity": "sha1-a2LDeRz3kJ6jXtRuF2WLtBfLORc=", + "integrity": "sha512-jd0cvB8qQ5uVt0lvCIexBaROw1KyKm5sbulg2fWOHjETisuCzWyt+eTZKEMs8v6HwzoGs8xik26jg7eCM6pS+A==", + "dev": true + }, + "os-tmpdir": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz", + "integrity": "sha512-D2FR03Vir7FIu45XBY20mTb+/ZSWB00sjU9jdQXt83gDrI4Ztz5Fs7/yy74g2N5SVQY4xY1qDr4rNddwYRVX0g==", "dev": true }, "p-limit": { @@ -8924,16 +12901,16 @@ "p-locate": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-2.0.0.tgz", - "integrity": "sha1-IKAQOyIqcMj9OcwuWAaA893l7EM=", + "integrity": "sha512-nQja7m7gSKuewoVRen45CtVfODR3crN3goVQ0DDZ9N3yHxgpkuBhZqsaiotSQRrADUrne346peY7kT3TSACykg==", "dev": true, "requires": { "p-limit": "^1.1.0" } }, "p-map": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/p-map/-/p-map-3.0.0.tgz", - "integrity": "sha512-d3qXVTF/s+W+CdJ5A29wywV2n8CQQYahlgz2bFiA+4eVNJbHJodPZ+/gXwPGh0bOqA+j8S+6+ckmvLGPk1QpxQ==", + "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" @@ -8942,7 +12919,7 @@ "p-try": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/p-try/-/p-try-1.0.0.tgz", - "integrity": "sha1-y8ec26+P1CKOE/Yh8rGiN8GyB7M=", + "integrity": "sha512-U1etNYuMJoIz3ZXSrrySFjsXQTWOx2/jdi86L+2pRvph/qMKL6sbcCYdH23fqsbm8TH2Gn0OybpT4eSFlCVHww==", "dev": true }, "package-hash": { @@ -8969,13 +12946,13 @@ "path-exists": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz", - "integrity": "sha1-zg6+ql94yxiSXqfYENe1mwEP1RU=", + "integrity": "sha512-bpC7GYwiDYQ4wYLe+FA8lhRjhQCMcQGuSgGGqDkg/QerRWw9CmGRT0iSOVRSZJ29NMLZgIzqaljJ63oaL4NIJQ==", "dev": true }, "path-is-absolute": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", - "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", + "integrity": "sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==", "dev": true }, "path-key": { @@ -9098,7 +13075,7 @@ "pre-commit": { "version": "1.2.2", "resolved": "https://registry.npmjs.org/pre-commit/-/pre-commit-1.2.2.tgz", - "integrity": "sha1-287g7p3nI15X95xW186UZBpp7sY=", + "integrity": "sha512-qokTiqxD6GjODy5ETAIgzsRgnBWWQHQH2ghy86PU7mIn/wuWeTwF3otyNQZxWBwVn8XNr8Tdzj/QfUXpH+gRZA==", "dev": true, "requires": { "cross-spawn": "^5.0.1", @@ -9109,7 +13086,7 @@ "cross-spawn": { "version": "5.1.0", "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-5.1.0.tgz", - "integrity": "sha1-6L0O/uWPz/b4+UUQoKVUu/ojVEk=", + "integrity": "sha512-pTgQJ5KC0d2hcY8eyL1IzlBPYjTkyH72XRZPnLyKus2mBfNjQs3klqbJU2VILqZryAZUt9JOb3h/mWMy23/f5A==", "dev": true, "requires": { "lru-cache": "^4.0.1", @@ -9130,7 +13107,7 @@ "shebang-command": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-1.2.0.tgz", - "integrity": "sha1-RKrGW2lbAzmJaMOfNj/uXer98eo=", + "integrity": "sha512-EV3L1+UQWGor21OmnvojK36mhg+TyIKDh3iFBKBohr5xeXIhNBcx8oWdgkTEEQ+BEFFYdLRuqMfd5L84N1V5Vg==", "dev": true, "requires": { "shebang-regex": "^1.0.0" @@ -9139,13 +13116,13 @@ "shebang-regex": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-1.0.0.tgz", - "integrity": "sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM=", + "integrity": "sha512-wpoSFAxys6b2a2wHZ1XpDSgD7N9iVjg29Ph9uV/uaP9Ex/KXlkTZTeddxDPSYQpgvzKLGJke2UU0AzoGCjNIvQ==", "dev": true }, "which": { "version": "1.2.14", "resolved": "https://registry.npmjs.org/which/-/which-1.2.14.tgz", - "integrity": "sha1-mofEN48D6CfOyvGs31bHNsAcFOU=", + "integrity": "sha512-16uPglFkRPzgiUXYMi1Jf8Z5EzN1iB4V0ZtMXcHZnwsBtQhhHeCqoWw7tsUY42hJGNDWtUsVLTjakIa5BgAxCw==", "dev": true, "requires": { "isexe": "^2.0.0" @@ -9154,7 +13131,7 @@ "yallist": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/yallist/-/yallist-2.1.2.tgz", - "integrity": "sha1-HBH5IY8HYImkfdUS+TxmmaaoHVI=", + "integrity": "sha512-ncTzHV7NvsQZkYe1DW7cbDLm0YpzHmZF5r/iyP3ZnQtMiJ+pjzisCiMNI+Sj+xQF5pXhSHxSB3uDbsBTzY/c2A==", "dev": true } } @@ -9166,9 +13143,9 @@ "dev": true }, "prettier": { - "version": "2.6.0", - "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.6.0.tgz", - "integrity": "sha512-m2FgJibYrBGGgQXNzfd0PuDGShJgRavjUoRCw1mZERIWVSXF0iLzLm+aOqTAbLnC3n6JzUhAA8uZnFVghHJ86A==", + "version": "2.7.1", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.7.1.tgz", + "integrity": "sha512-ujppO+MkdPqoVINuDFDRLClm7D78qbDt0/NR+wp5FqEZOoTNAjPHWj17QRhu7geIHJfcNhRk1XVQmF8Bp3ye+g==", "dev": true }, "prettier-linter-helpers": { @@ -9195,10 +13172,16 @@ "fromentries": "^1.2.0" } }, + "prr": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/prr/-/prr-1.0.1.tgz", + "integrity": "sha512-yPw4Sng1gWghHQWj0B3ZggWUm4qVbPwPFcRG8KyxiU7J2OHFSoEHKS+EZ3fv5l1t9CyCiop6l/ZYeWbrgoQejw==", + "dev": true + }, "pseudomap": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/pseudomap/-/pseudomap-1.0.2.tgz", - "integrity": "sha1-8FKijacOYYkX7wqKw0wa5aaChrM=", + "integrity": "sha512-b/YwNhb8lk1Zz2+bXXpS/LK9OisiZZ1SNsSLxN1x2OXVEhW2Ckr/7mWE5vrC1ZTiJlD9g19jWszTmJsB+oEpFQ==", "dev": true }, "punycode": { @@ -9207,6 +13190,15 @@ "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==", "dev": true }, + "qs": { + "version": "6.11.0", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.11.0.tgz", + "integrity": "sha512-MvjoMCJwEarSbUYk5O+nmoSzSutSsTwF85zcHPQ9OrlFoZOYIjaqBAJIqIXjptyD5vThxGq52Xu/MaJzRkIk4Q==", + "dev": true, + "requires": { + "side-channel": "^1.0.4" + } + }, "queue-microtask": { "version": "1.2.3", "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", @@ -9221,6 +13213,18 @@ "safe-buffer": "^5.1.0" } }, + "raw-body": { + "version": "2.5.1", + "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.5.1.tgz", + "integrity": "sha512-qqJBtEyVgS0ZmPGdCFPWJ3FreoqvG4MVQln/kCgF7Olq95IbOp0/BWyMwbdtn4VTvkM8Y7khCQ2Xgk/tcrCXig==", + "dev": true, + "requires": { + "bytes": "3.1.2", + "http-errors": "2.0.0", + "iconv-lite": "0.4.24", + "unpipe": "1.0.0" + } + }, "readable-stream": { "version": "3.6.0", "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz", @@ -9240,6 +13244,17 @@ "picomatch": "^2.2.1" } }, + "regexp.prototype.flags": { + "version": "1.4.3", + "resolved": "https://registry.npmjs.org/regexp.prototype.flags/-/regexp.prototype.flags-1.4.3.tgz", + "integrity": "sha512-fjggEOO3slI6Wvgjwflkc4NFRCTZAu5CnNfBd5qOMYhWdn67nJBBu34/TkD++eeFmd8C9r9jfXJ27+nSiRkSUA==", + "dev": true, + "requires": { + "call-bind": "^1.0.2", + "define-properties": "^1.1.3", + "functions-have-names": "^1.2.2" + } + }, "regexpp": { "version": "3.2.0", "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-3.2.0.tgz", @@ -9249,7 +13264,7 @@ "release-zalgo": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/release-zalgo/-/release-zalgo-1.0.0.tgz", - "integrity": "sha1-CXALflB0Mpc5Mw5TXFqQ+2eFFzA=", + "integrity": "sha512-gUAyHVHPPC5wdqX/LG4LWtRYtgjxyX78oanFNTMMyFEfOqdC54s3eE82imuWKbOeqYht2CrNf64Qb8vgmmtZGA==", "dev": true, "requires": { "es6-error": "^4.0.1" @@ -9258,7 +13273,13 @@ "require-directory": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", - "integrity": "sha1-jGStX9MNqxyXbiNE/+f3kqam30I=", + "integrity": "sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==", + "dev": true + }, + "require-from-string": { + "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==", "dev": true }, "require-main-filename": { @@ -9268,12 +13289,12 @@ "dev": true }, "resolve": { - "version": "1.22.0", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.0.tgz", - "integrity": "sha512-Hhtrw0nLeSrFQ7phPp4OOcVjLPIeMnRlr5mcnVuMe7M/7eBn98A3hmFRLoFo3DLZkivSYwhRUJTyPyWAk56WLw==", + "version": "1.22.1", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.1.tgz", + "integrity": "sha512-nBpuuYuY5jFsli/JIs1oldw6fOQCBioohqWZg/2hiaOybXOft4lonv85uDOKXdf8rhyK159cxU5cDcK/NKk8zw==", "dev": true, "requires": { - "is-core-module": "^2.8.1", + "is-core-module": "^2.9.0", "path-parse": "^1.0.7", "supports-preserve-symlinks-flag": "^1.0.0" } @@ -9308,6 +13329,23 @@ "inherits": "^2.0.1" } }, + "rlp": { + "version": "2.2.7", + "resolved": "https://registry.npmjs.org/rlp/-/rlp-2.2.7.tgz", + "integrity": "sha512-d5gdPmgQ0Z+AklL2NVXr/IoSjNZFfTVvQWzL/AM2AOcSzYP2xjlb0AC8YyCLc41MSNf6P6QVtjgPdmVtzb+4lQ==", + "dev": true, + "requires": { + "bn.js": "^5.2.0" + }, + "dependencies": { + "bn.js": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-5.2.1.tgz", + "integrity": "sha512-eXRvHzWyYPBuB4NBy0cmYQjGitUrtqwbvlzP3G6VFnNRbsZQIxQ10PbKKHt8gZ/HW/D/747aDl+QkDqg3KQLMQ==", + "dev": true + } + } + }, "run-parallel": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz", @@ -9317,11 +13355,28 @@ "queue-microtask": "^1.2.2" } }, + "rustbn.js": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/rustbn.js/-/rustbn.js-0.2.0.tgz", + "integrity": "sha512-4VlvkRUuCJvr2J6Y0ImW7NvTCriMi7ErOAqWk1y69vAdoNIzCF3yPmgeNzx+RQTLEDFq5sHfscn1MwHxP9hNfA==", + "dev": true + }, "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==" }, + "safer-buffer": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", + "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", + "dev": true + }, + "scrypt-js": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/scrypt-js/-/scrypt-js-3.0.1.tgz", + "integrity": "sha512-cdwTTnqPu0Hyvf5in5asVdZocVDTNRmR7XEcJuIzMjJeSHybHl7vpB66AzwTaIg6CLSbtjcxc8fqcySfnTkccA==" + }, "scrypt-shim": { "version": "git+ssh://git@github.com/web3-js/scrypt-shim.git#aafdadda13e660e25e1c525d1f5b2443f5eb1ebb", "from": "scrypt-shim@github:web3-js/scrypt-shim", @@ -9343,27 +13398,46 @@ "integrity": "sha512-1CdSqHQowJBnMAFyPEBRfqag/YP9OF394FV+4YREIJX4ljD7OxvQRDayyoyyCk+senRjSkP6VnUNQmVQqB6g7w==" }, "secp256k1": { - "version": "3.8.0", - "resolved": "https://registry.npmjs.org/secp256k1/-/secp256k1-3.8.0.tgz", - "integrity": "sha512-k5ke5avRZbtl9Tqx/SA7CbY3NF6Ro+Sj9cZxezFzuBlLDmyqPiL8hJJ+EmzD8Ig4LUDByHJ3/iPOVoRixs/hmw==", + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/secp256k1/-/secp256k1-4.0.3.tgz", + "integrity": "sha512-NLZVf+ROMxwtEj3Xa562qgv2BK5e2WNmXPiOdVIPLgs6lyTzMvBq0aWTYMI5XCP9jZMVKOcqZLw/Wc4vDkuxhA==", + "dev": true, "requires": { - "bindings": "^1.5.0", - "bip66": "^1.1.5", - "bn.js": "^4.11.8", - "create-hash": "^1.2.0", - "drbg.js": "^1.0.1", - "elliptic": "^6.5.2", - "nan": "^2.14.0", - "safe-buffer": "^5.1.2" + "elliptic": "^6.5.4", + "node-addon-api": "^2.0.0", + "node-gyp-build": "^4.2.0" } }, + "semaphore-async-await": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/semaphore-async-await/-/semaphore-async-await-1.5.1.tgz", + "integrity": "sha512-b/ptP11hETwYWpeilHXXQiV5UJNJl7ZWWooKRE5eBIYWoom6dZ0SluCIdCtKycsMtZgKWE01/qAw6jblw1YVhg==", + "dev": true + }, "semver": { - "version": "7.3.5", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.5.tgz", - "integrity": "sha512-PoeGJYh8HK4BTO/a9Tf6ZG3veo/A7ZVsYrSA6J8ny9nb3B1VrpkuN+z9OE5wfE5p6H4LchYZsegiQgbJD94ZFQ==", + "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" + }, + "dependencies": { + "lru-cache": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", + "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", + "dev": true, + "requires": { + "yallist": "^4.0.0" + } + }, + "yallist": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", + "dev": true + } } }, "serialize-javascript": { @@ -9378,7 +13452,19 @@ "set-blocking": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz", - "integrity": "sha1-BF+XgtARrppoA93TgrJDkrPYkPc=", + "integrity": "sha512-KiKBS8AnWGEyLzofFfmvKwpdPzqiy16LvQfK3yv/fVH7Bj13/wl3JSR1J+rfgRE9q7xUJK4qvgS8raSOeLUehw==", + "dev": true + }, + "setimmediate": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/setimmediate/-/setimmediate-1.0.5.tgz", + "integrity": "sha512-MATJdZp8sLqDl/68LfQmbP8zKPLQNV6BIZoIgrscFDQ+RsvK/BxeDQOgyxKKoh0y/8h3BqVFnCqQ/gd+reiIXA==", + "dev": true + }, + "setprototypeof": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.2.0.tgz", + "integrity": "sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw==", "dev": true }, "sha.js": { @@ -9423,13 +13509,13 @@ "dev": true }, "sinon": { - "version": "13.0.1", - "resolved": "https://registry.npmjs.org/sinon/-/sinon-13.0.1.tgz", - "integrity": "sha512-8yx2wIvkBjIq/MGY1D9h1LMraYW+z1X0mb648KZnKSdvLasvDu7maa0dFaNYdTDczFgbjNw2tOmWdTk9saVfwQ==", + "version": "13.0.2", + "resolved": "https://registry.npmjs.org/sinon/-/sinon-13.0.2.tgz", + "integrity": "sha512-KvOrztAVqzSJWMDoxM4vM+GPys1df2VBoXm+YciyB/OLMamfS3VXh3oGh5WtrAGSzrgczNWFFY22oKb7Fi5eeA==", "dev": true, "requires": { "@sinonjs/commons": "^1.8.3", - "@sinonjs/fake-timers": "^9.0.0", + "@sinonjs/fake-timers": "^9.1.2", "@sinonjs/samsam": "^6.1.1", "diff": "^5.0.0", "nise": "^5.1.1", @@ -9442,16 +13528,82 @@ "integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==", "dev": true }, + "solc": { + "version": "0.7.3", + "resolved": "https://registry.npmjs.org/solc/-/solc-0.7.3.tgz", + "integrity": "sha512-GAsWNAjGzIDg7VxzP6mPjdurby3IkGCjQcM8GFYZT6RyaoUZKmMU6Y7YwG+tFGhv7dwZ8rmR4iwFDrrD99JwqA==", + "dev": true, + "requires": { + "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" + }, + "dependencies": { + "fs-extra": { + "version": "0.30.0", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-0.30.0.tgz", + "integrity": "sha512-UvSPKyhMn6LEd/WpUaV9C9t3zATuqoqfWc3QdPhPLb58prN9tqYPlPWi8Krxi44loBoUzlobqZ3+8tGpxxSzwA==", + "dev": true, + "requires": { + "graceful-fs": "^4.1.2", + "jsonfile": "^2.1.0", + "klaw": "^1.0.0", + "path-is-absolute": "^1.0.0", + "rimraf": "^2.2.8" + } + }, + "jsonfile": { + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-2.4.0.tgz", + "integrity": "sha512-PKllAqbgLgxHaj8TElYymKCAgrASebJrWpTnEkOaTowt23VKXXN0sUeriJ+eh7y6ufb/CC5ap11pz71/cM0hUw==", + "dev": true, + "requires": { + "graceful-fs": "^4.1.6" + } + }, + "rimraf": { + "version": "2.7.1", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.7.1.tgz", + "integrity": "sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w==", + "dev": true, + "requires": { + "glob": "^7.1.3" + } + }, + "semver": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", + "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", + "dev": true + } + } + }, "source-map": { - "version": "0.5.7", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", - "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=", + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", "dev": true }, + "source-map-support": { + "version": "0.5.21", + "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.21.tgz", + "integrity": "sha512-uBHU3L3czsIyYXKX88fdrGovxdSCoTGDRZ6SYXtSRxLZUzHg5P/66Ht6uoUlHu9EZod+inXhKo3qQgwXUT/y1w==", + "dev": true, + "requires": { + "buffer-from": "^1.0.0", + "source-map": "^0.6.0" + } + }, "spawn-sync": { "version": "1.0.15", "resolved": "https://registry.npmjs.org/spawn-sync/-/spawn-sync-1.0.15.tgz", - "integrity": "sha1-sAeZVX63+wyDdsKdROih6mfldHY=", + "integrity": "sha512-9DWBgrgYZzNghseho0JOuh+5fg9u6QWhAWa51QC7+U5rCheZ/j1DrEZnyE0RBBRqZ9uEXGPgSSM0nky6burpVw==", "dev": true, "requires": { "concat-stream": "^1.4.7", @@ -9475,7 +13627,30 @@ "sprintf-js": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", - "integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=", + "integrity": "sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g==", + "dev": true + }, + "stacktrace-parser": { + "version": "0.1.10", + "resolved": "https://registry.npmjs.org/stacktrace-parser/-/stacktrace-parser-0.1.10.tgz", + "integrity": "sha512-KJP1OCML99+8fhOHxwwzyWrlUuVX5GQ0ZpJTd1DFXhdkrvg1szxfHhawXUZ3g9TkXORQd4/WG68jMlQZ2p8wlg==", + "dev": true, + "requires": { + "type-fest": "^0.7.1" + }, + "dependencies": { + "type-fest": { + "version": "0.7.1", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.7.1.tgz", + "integrity": "sha512-Ne2YiiGN8bmrmJJEuTWTLJR32nh/JdL1+PSicowtNb0WFpn59GK8/lfD61bVtzguz7b3PBt74nxpv/Pw5po5Rg==", + "dev": true + } + } + }, + "statuses": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/statuses/-/statuses-2.0.1.tgz", + "integrity": "sha512-RwNA9Z/7PrK06rYLIzFMlaF+l73iwpzsqRIFgbMLbTcLD6cOao82TaWefPXQvB2fOC4AjuYSEndS7N/mTCbkdQ==", "dev": true }, "string_decoder": { @@ -9498,23 +13673,25 @@ } }, "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==", + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/string.prototype.trimend/-/string.prototype.trimend-1.0.5.tgz", + "integrity": "sha512-I7RGvmjV4pJ7O3kdf+LXFpVfdNOxtCW/2C8f6jNiW4+PQchwxkCDzlk1/7p+Wl4bqFIZeF47qAHXLuHHWKAxog==", "dev": true, "requires": { "call-bind": "^1.0.2", - "define-properties": "^1.1.3" + "define-properties": "^1.1.4", + "es-abstract": "^1.19.5" } }, "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==", + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/string.prototype.trimstart/-/string.prototype.trimstart-1.0.5.tgz", + "integrity": "sha512-THx16TJCGlsN0o6dl2o6ncWUsdgnLRSA23rRE5pyGBw/mLr3Ej/R2LaqCtgP8VNMGZsvMWnf9ooZPyY2bHvUFg==", "dev": true, "requires": { "call-bind": "^1.0.2", - "define-properties": "^1.1.3" + "define-properties": "^1.1.4", + "es-abstract": "^1.19.5" } }, "strip-ansi": { @@ -9532,6 +13709,15 @@ "integrity": "sha512-3xurFv5tEgii33Zi8Jtp55wEIILR9eh34FAW00PZf+JnSsTmV/ioewSgQl97JHvgjoRGwPShsWm+IdrxB35d0w==", "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": "sha512-q8d4ue7JGEiVcypji1bALTos+0pWtyGlivAWyPuTkHzuTCJqrK9sWxYQZUq6Nq3cuyv3bm734IhHvHtGGURU6A==", + "dev": true, + "requires": { + "is-hex-prefixed": "1.0.0" + } + }, "strip-json-comments": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", @@ -9572,13 +13758,22 @@ "text-table": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", - "integrity": "sha1-f17oI66AUgfACvLfSoTsP8+lcLQ=", + "integrity": "sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw==", "dev": true }, + "tmp": { + "version": "0.0.33", + "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.0.33.tgz", + "integrity": "sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw==", + "dev": true, + "requires": { + "os-tmpdir": "~1.0.2" + } + }, "to-fast-properties": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-2.0.0.tgz", - "integrity": "sha1-3F5pjL0HkmW8c+A3doGk5Og/YW4=", + "integrity": "sha512-/OaKK0xYrs3DmxRYqL/yDc+FxFUVYhDlXMhRmv3z915w2HF1tnN1omB354j8VUGO/hbRzyD6Y3sA7v7GS/ceog==", "dev": true }, "to-regex-range": { @@ -9590,18 +13785,30 @@ "is-number": "^7.0.0" } }, + "toidentifier": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.1.tgz", + "integrity": "sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA==", + "dev": true + }, "tr46": { "version": "0.0.3", "resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz", - "integrity": "sha1-gYT9NH2snNwYWZLzpmIuFLnZq2o=" + "integrity": "sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==" + }, + "true-case-path": { + "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==", + "dev": true }, "ts-node": { - "version": "10.7.0", - "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-10.7.0.tgz", - "integrity": "sha512-TbIGS4xgJoX2i3do417KSaep1uRAW/Lu+WAL2doDHC0D6ummjirVOXU5/7aiZotbQ5p1Zp9tP7U6cYhA0O7M8A==", + "version": "10.8.2", + "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-10.8.2.tgz", + "integrity": "sha512-LYdGnoGddf1D6v8REPtIH+5iq/gTDuZqv2/UJUU7tKjuEU8xVZorBM+buCGNjj+pGEud+sOoM4CX3/YzINpENA==", "dev": true, "requires": { - "@cspotcode/source-map-support": "0.7.0", + "@cspotcode/source-map-support": "^0.8.0", "@tsconfig/node10": "^1.0.7", "@tsconfig/node12": "^1.0.7", "@tsconfig/node14": "^1.0.0", @@ -9612,7 +13819,7 @@ "create-require": "^1.1.0", "diff": "^4.0.1", "make-error": "^1.1.1", - "v8-compile-cache-lib": "^3.0.0", + "v8-compile-cache-lib": "^3.0.1", "yn": "3.1.1" }, "dependencies": { @@ -9648,7 +13855,7 @@ "strip-bom": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz", - "integrity": "sha1-IzTBjpx1n3vdVv3vfprj1YjmjtM=", + "integrity": "sha512-vavAMRXOgBVNF6nyEEmL3DBK19iRpDcoIwW+swQ+CbGiu7lju6t+JklA1MHweoWtadgt4ISVUsXLyDq34ddcwA==", "dev": true } } @@ -9659,6 +13866,12 @@ "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==", "dev": true }, + "tsort": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/tsort/-/tsort-0.0.1.tgz", + "integrity": "sha512-Tyrf5mxF8Ofs1tNoxA13lFeZ2Zrbd6cKbuH3V+MQ5sb6DtBj5FjrXVsRWT8YvNAQTqNoz66dz1WsbigI22aEnw==", + "dev": true + }, "tsutils": { "version": "3.21.0", "resolved": "https://registry.npmjs.org/tsutils/-/tsutils-3.21.0.tgz", @@ -9668,6 +13881,18 @@ "tslib": "^1.8.1" } }, + "tweetnacl": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-1.0.3.tgz", + "integrity": "sha512-6rt+RN7aOi1nGMyC4Xa5DdYiukl2UWCbcJft7YhxReBGQD7OAM8Pbxw6YMo4r2diNEA8FEmu32YOn9rhaiE5yw==", + "dev": true + }, + "tweetnacl-util": { + "version": "0.15.1", + "resolved": "https://registry.npmjs.org/tweetnacl-util/-/tweetnacl-util-0.15.1.tgz", + "integrity": "sha512-RKJBIj8lySrShN4w6i/BonWp2Z/uxwC3h4y7xsRrpP59ZboCd0GpEVsOnMDYLMmKBpYhb5TgHzZXy7wTfYFBRw==", + "dev": true + }, "type": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/type/-/type-1.2.0.tgz", @@ -9697,7 +13922,7 @@ "typedarray": { "version": "0.0.6", "resolved": "https://registry.npmjs.org/typedarray/-/typedarray-0.0.6.tgz", - "integrity": "sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c=", + "integrity": "sha512-/aCDEGatGvZ2BIk+HmLf4ifCJFwvKFNb9/JeZPMulfgFracn9QFcAf5GO8B/mweUjSoblS5In0cWhqpfs/5PQA==", "dev": true }, "typedarray-to-buffer": { @@ -9715,22 +13940,50 @@ "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==", + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/unbox-primitive/-/unbox-primitive-1.0.2.tgz", + "integrity": "sha512-61pPlCD9h51VoreyJ0BReideM3MDKMKnh6+V9L08331ipq6Q8OFXZYiqP6n/tbHx4s5I9uRhcye6BrbkizkBDw==", "dev": true, "requires": { - "function-bind": "^1.1.1", - "has-bigints": "^1.0.1", - "has-symbols": "^1.0.2", + "call-bind": "^1.0.2", + "has-bigints": "^1.0.2", + "has-symbols": "^1.0.3", "which-boxed-primitive": "^1.0.2" } }, + "undici": { + "version": "5.6.0", + "resolved": "https://registry.npmjs.org/undici/-/undici-5.6.0.tgz", + "integrity": "sha512-mc+8SY1fXubTrdx4CXDkeFFGV8lI3Tq4I/70U1V8Z6g4iscGII0uLO7CPnDt56bXEbvaKwo2T2+VrteWbZiXiQ==", + "dev": true + }, + "universalify": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz", + "integrity": "sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==", + "dev": true + }, "unorm": { "version": "1.6.0", "resolved": "https://registry.npmjs.org/unorm/-/unorm-1.6.0.tgz", "integrity": "sha512-b2/KCUlYZUeA7JFUuRJZPUtr4gZvBh7tavtv4fvk4+KV9pfGiR6CQAQAWl49ZpR3ts2dk4FYkP7EIgDJoiOLDA==" }, + "unpipe": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz", + "integrity": "sha512-pjy2bYhSsufwWlKwPc+l3cN7+wuJlK6uz0YdJEOlQDbl6jo/YlPi4mb8agUkVC8BF7V8NuzeyPNqRksA3hztKQ==", + "dev": true + }, + "update-browserslist-db": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.0.4.tgz", + "integrity": "sha512-jnmO2BEGUjsMOe/Fg9u0oczOe/ppIDZPebzccl1yDWGLFP16Pa1/RM5wEoKYPG2zstNcDuAStejyxsOuKINdGA==", + "dev": true, + "requires": { + "escalade": "^3.1.1", + "picocolors": "^1.0.0" + } + }, "uri-js": { "version": "4.4.1", "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", @@ -9751,7 +14004,7 @@ "util-deprecate": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", - "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=" + "integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==" }, "uuid": { "version": "3.4.0", @@ -9765,15 +14018,15 @@ "dev": true }, "v8-compile-cache-lib": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/v8-compile-cache-lib/-/v8-compile-cache-lib-3.0.0.tgz", - "integrity": "sha512-mpSYqfsFvASnSn5qMiwrr4VKfumbPyONLCOPmsR3A6pTY/r0+tSaVbgPWSAIuzbk3lCTa+FForeTiO+wBQGkjA==", + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/v8-compile-cache-lib/-/v8-compile-cache-lib-3.0.1.tgz", + "integrity": "sha512-wa7YjyUGfNZngI/vtK0UHAN+lgDCxBPCylVXGp0zu59Fz5aiGtNXaq3DhIov063MorB+VfufLh3JlF2KdTK3xg==", "dev": true }, "webidl-conversions": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz", - "integrity": "sha1-JFNCdeKnvGvnvIZhHMFq4KVlSHE=" + "integrity": "sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==" }, "websocket": { "version": "1.0.34", @@ -9799,14 +14052,14 @@ "ms": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=" + "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==" } } }, "whatwg-url": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz", - "integrity": "sha1-lmRU6HZUYuN2RNNib2dCzotwll0=", + "integrity": "sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==", "requires": { "tr46": "~0.0.3", "webidl-conversions": "^3.0.0" @@ -9837,7 +14090,7 @@ "which-module": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/which-module/-/which-module-2.0.0.tgz", - "integrity": "sha1-2e8H3Od7mQK4o6j6SzHD4/fm6Ho=", + "integrity": "sha512-B+enWhmw6cjfVC7kS8Pj9pCrKSc5txArRyaYGe088shv/FGWH+0Rjx/xPgtsWfsUtS27FkP697E4DDhgrgoc0Q==", "dev": true }, "word-wrap": { @@ -9866,7 +14119,7 @@ "wrappy": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", - "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", + "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==", "dev": true }, "write-file-atomic": { @@ -9881,6 +14134,18 @@ "typedarray-to-buffer": "^3.1.5" } }, + "ws": { + "version": "7.4.6", + "resolved": "https://registry.npmjs.org/ws/-/ws-7.4.6.tgz", + "integrity": "sha512-YmhHDO4MzaDLB+M9ym/mDA5z0naX8j7SIlT8f8z+I0VtzsRbekxEutHSme7NPS2qE8StCYQNUnfWdXta/Yu85A==", + "requires": {} + }, + "xtend": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz", + "integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==", + "dev": true + }, "y18n": { "version": "5.0.8", "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz", @@ -9890,12 +14155,12 @@ "yaeti": { "version": "0.0.6", "resolved": "https://registry.npmjs.org/yaeti/-/yaeti-0.0.6.tgz", - "integrity": "sha1-8m9ITXJoTPQr7ft2lwqhYI+/lXc=" + "integrity": "sha512-MvQa//+KcZCUkBTIC9blM+CU9J2GzuTytsOUwf2lidtvkx/6gnEp1QvJv34t9vdjhFmha/mUiNDbN0D0mJWdug==" }, "yallist": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", - "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.1.1.tgz", + "integrity": "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==", "dev": true }, "yargs": { diff --git a/package.json b/package.json index 06364e4..598e85a 100644 --- a/package.json +++ b/package.json @@ -17,18 +17,24 @@ "access": "public" }, "scripts": { + "pretest": "npm run build:contracts", "test": "NODE_ENV=test mocha -t 120000 --require ts-node/register src/**/*.spec.ts --exit", + "pretest:watch": "npm run build:contracts", "test:watch": "NODE_ENV=test mocha -t 120000 --watch --watch-files src/**/*.ts --require ts-node/register src/**/*.spec.ts", "test:cov": "nyc npm run test", + "pretest:e2e": "npm run build:contracts", + "test:e2e": "NODE_ENV=test mocha -t 360000 --require ts-node/register src/**/*.e2e-spec.ts --exit", + "build:contracts": "hardhat compile", "clean": "rm -rf ./lib ./lib.esm ./lib.esnext", "build": "tsc --build ./tsconfig.json", + "prebuild-all": "npm run clean", "build-all": "npm run build-cjs && npm run build-esnext && npm run build-esm", "build-cjs": "tsc -p tsconfig.json --outDir lib -t es3 -m commonjs", "build-esnext": "tsc -p tsconfig.json --outDir lib.esnext -t es2015 -m commonjs", "build-esm": "tsc -p tsconfig.json --outDir lib.esm -t es2015 -m es2015", "lint:ci": "eslint \"{src,apps,libs,test}/**/*.ts\"", "lint": "eslint \"{src,apps,libs,test}/**/*.ts\" --fix", - "prepublishOnly": "npm run lint:ci && npm run test && npm run clean && npm run build-all" + "prepublishOnly": "npm run lint:ci && npm run test && npm run build-all" }, "precommit": [ "lint:ci", @@ -52,8 +58,20 @@ "url": "https://github.com/blockcoders/harmony-marketplace-sdk/issues" }, "homepage": "https://github.com/blockcoders/harmony-marketplace-sdk#readme", + "dependencies": { + "@harmony-js/contract": "^0.1.56", + "@harmony-js/core": "^0.1.57", + "@harmony-js/transaction": "^0.1.56", + "@ethersproject/abstract-signer": "^5.6.2", + "@ethersproject/bignumber": "^5.6.2", + "@ethersproject/contracts": "^5.6.2", + "@ethersproject/providers": "^5.6.8", + "@ethersproject/units": "^5.6.1", + "@ethersproject/wallet": "^5.6.2" + }, "devDependencies": { - "@openzeppelin/contracts": "^4.5.0", + "@openzeppelin/contracts": "^2.5.1", + "@types/bip39": "^2.4.2", "@types/chai": "^4.3.0", "@types/chai-as-promised": "^7.1.5", "@types/hdkey": "^2.0.1", @@ -70,6 +88,7 @@ "eslint-config-prettier": "^8.5.0", "eslint-plugin-import": "^2.25.4", "eslint-plugin-prettier": "^4.0.0", + "hardhat": "^2.9.9", "mocha": "^9.2.2", "nyc": "^15.1.0", "pre-commit": "^1.2.2", @@ -78,12 +97,6 @@ "ts-node": "^10.7.0", "typescript": "4.6.2" }, - "dependencies": { - "@harmony-js/contract": "^0.1.56", - "@harmony-js/core": "^0.1.57", - "@harmony-js/transaction": "^0.1.56", - "@types/bip39": "^2.4.2" - }, "peerDependencies": { "@harmony-js/account": "0.1.56", "@harmony-js/crypto": "0.1.56", diff --git a/src/base-token.spec.ts b/src/base-token.spec.ts deleted file mode 100644 index 511267e..0000000 --- a/src/base-token.spec.ts +++ /dev/null @@ -1,198 +0,0 @@ -import { Account } from '@harmony-js/account' -import { ChainID } from '@harmony-js/utils' -import BN from 'bn.js' -import { expect, use } from 'chai' -import chaiAsPromised from 'chai-as-promised' -import sinon from 'sinon' -import { BaseToken } from './base-token' -import { AddressZero, HARMONY_RPC_SHARD_0_TESTNET } from './constants' -import { BNish, HarmonyShards, ITransactionOptions } from './interfaces' -import { MnemonicKey } from './mnemonic-key' -import { PrivateKey } from './private-key' -import { - TEST_ADDRESS_1, - EMPTY_TEST_ADDRESS, - TEST_ADDRESS_2, - TEST_PK_1, - TX_OPTIONS, - TOKEN_GOLD, - TEST_SEED, -} from './tests/constants' -import { ABI } from './tests/contracts/TestToken/abi' - -class TestToken extends BaseToken { - constructor() { - super('0x', ABI, new PrivateKey(HarmonyShards.SHARD_0_TESTNET, TEST_PK_1, ChainID.HmyTestnet)) - } - - public async balanceOf(address: string, id?: BNish, txOptions?: ITransactionOptions): Promise { - return this.getBalance(address, id, txOptions) - } -} - -describe('Base Token Provider', () => { - let contract: TestToken - - use(chaiAsPromised) - - before(() => { - contract = new TestToken() - }) - - afterEach(async () => { - sinon.restore() - }) - - it('should be defined', () => { - expect(contract).to.not.be.undefined - }) - - describe('balanceOf', () => { - it('should throw an error if address is not provided in HRC1155', async () => { - expect(contract.balanceOf('', 1)).to.be.rejectedWith(Error) - }) - - it('should throw an error if address is not provided in HRC721', async () => { - expect(contract.balanceOf('')).to.be.rejectedWith(Error) - }) - - it('should throw an error if provided address is zero-address in HRC1155', async () => { - expect(contract.balanceOf(AddressZero, 1)).to.be.rejectedWith(Error) - }) - - it('should throw an error if provided address is zero-address in HRC721', async () => { - expect(contract.balanceOf(AddressZero)).to.be.rejectedWith(Error) - }) - }) - - describe('setApprovalForAll', () => { - it('should throw an error if addressOperator is not provided in HRC1155', async () => { - expect(contract.setApprovalForAll('', true)).to.be.rejectedWith(Error) - }) - - it('should throw an error if addressOperator is not provided in HRC721', async () => { - expect(contract.setApprovalForAll('', true)).to.be.rejectedWith(Error) - }) - }) - - describe('isApprovedForAll', () => { - it('should throw an error if addressOwner is not provided in HRC1155', async () => { - expect(contract.isApprovedForAll('', EMPTY_TEST_ADDRESS)).to.be.rejectedWith(Error) - }) - - it('should throw an error if addressOwner is not provided in HRC721', async () => { - expect(contract.isApprovedForAll('', EMPTY_TEST_ADDRESS)).to.be.rejectedWith(Error) - }) - - it('should throw an error if addressOperator is not provided in HRC1155', async () => { - expect(contract.isApprovedForAll(TEST_ADDRESS_1, '')).to.be.rejectedWith(Error) - }) - - it('should throw an error if addressOperator is not provided in HRC721', async () => { - expect(contract.isApprovedForAll(TEST_ADDRESS_1, '')).to.be.rejectedWith(Error) - }) - - it('should throw an error if params are not provided in HRC1155', async () => { - expect(contract.isApprovedForAll('', '')).to.be.rejectedWith(Error) - expect(contract.isApprovedForAll('', '')).to.be.rejectedWith(Error) - }) - - it('should throw an error if params are not provided in HRC721', async () => { - expect(contract.isApprovedForAll('', '')).to.be.rejectedWith(Error) - }) - }) - - describe('setSignerByPrivateKey', () => { - it('should return an instance of an Account', async () => { - const account = contract.setSignerByPrivateKey(TEST_PK_1) - - expect(account).to.not.be.null - expect(account).to.not.be.undefined - expect(account).to.be.instanceOf(Account) - }) - - it('should throw an error if privateKey is not provided', async () => { - try { - contract.setSignerByPrivateKey('') - } catch (error) { - expect(error).to.not.null - expect(error).to.not.undefined - expect(error).to.be.instanceOf(Error) - } - }) - - it('should throw an error if privateKey is not valid', async () => { - try { - contract.setSignerByPrivateKey('This is a test') - } catch (error) { - expect(error).to.not.null - expect(error).to.not.undefined - expect(error).to.be.instanceOf(Error) - } - }) - - it('should throw an error if type is not valid', async () => { - try { - contract.setSignerByPrivateKey(TEST_ADDRESS_2) - } catch (error) { - expect(error).to.not.null - expect(error).to.not.undefined - expect(error).to.be.instanceOf(Error) - } - }) - }) - - describe('send', () => { - it('should throw an error if method is invalid', async () => { - expect(contract.send('test', [TOKEN_GOLD], TX_OPTIONS)).to.be.rejectedWith(Error) - }) - - it('should throw an error if there is no transaction response', async () => { - const stub = sinon.stub(BaseToken.prototype, 'send') - stub.withArgs('safeTransferFrom', [TEST_ADDRESS_2, '', TOKEN_GOLD, 10, '0x'], TX_OPTIONS).onFirstCall().rejects() - - expect( - contract.send('safeTransferFrom', [TEST_ADDRESS_2, '', TOKEN_GOLD, 10, '0x'], TX_OPTIONS), - ).to.be.rejectedWith(Error) - }) - - it('should throw an error if there is no params', async () => { - const stub = sinon.stub(BaseToken.prototype, 'send') - stub.withArgs('', []).onFirstCall().rejects() - - expect(contract.send('', [])).to.be.rejectedWith(Error) - }) - }) - - describe('setSignerByMnemonic', () => { - it('should return an Account instance', async () => { - const account = contract.setSignerByMnemonic(TEST_SEED) - - expect(account).to.not.be.null - expect(account).to.not.be.undefined - expect(account).to.be.instanceOf(Account) - }) - - it('should throw an error if mnemonic is not valid', async () => { - try { - contract.setSignerByMnemonic('') - } catch (error) { - expect(error).to.not.null - expect(error).to.not.undefined - expect(error).to.be.instanceOf(Error) - } - }) - }) - - describe('setSignerByKey', () => { - it('should throw an error if key is not valid', async () => { - try { - new MnemonicKey(HARMONY_RPC_SHARD_0_TESTNET.url, {}, ChainID.HmyTestnet) - } catch (error) { - expect(error).to.not.null - expect(error).to.not.undefined - expect(error).to.be.instanceOf(Error) - } - }) - }) -}) diff --git a/src/base-token.ts b/src/base-token.ts deleted file mode 100644 index 91a0974..0000000 --- a/src/base-token.ts +++ /dev/null @@ -1,148 +0,0 @@ -import { Account, Wallet } from '@harmony-js/account' -import { Contract as BaseContract } from '@harmony-js/contract' -import { AbiItemModel } from '@harmony-js/contract/dist/models/types' -import { ContractOptions } from '@harmony-js/contract/dist/utils/options' -import { Transaction } from '@harmony-js/transaction' -import { hexToNumber, Unit } from '@harmony-js/utils' -import BN from 'bn.js' -import { AddressZero, DEFAULT_GAS_PRICE } from './constants' -import { BNish, ContractProviderType, ITransactionOptions } from './interfaces' -import { Key } from './key' -import { MnemonicKey } from './mnemonic-key' -import { PrivateKey } from './private-key' -import { isBNish } from './utils' - -class Contract extends BaseContract { - public readonly wallet: Wallet - - constructor(abi: AbiItemModel[], address: string, provider: ContractProviderType, options?: ContractOptions) { - super(abi, address, options, provider) - - this.wallet = provider - } -} - -export class ContractError extends Error { - public readonly type: string - - constructor(message: string, type: string) { - super(message) - this.name = ContractError.name - this.type = type - - Error.captureStackTrace(this, this.constructor) - } -} - -export abstract class BaseToken { - private readonly _contract: Contract - - constructor(address: string, abi: AbiItemModel[], provider: ContractProviderType, options?: ContractOptions) { - this._contract = new Contract(abi, address, provider, options) - } - - protected async estimateGas( - method: string, - args: any[] = [], - options: ITransactionOptions = { - gasPrice: DEFAULT_GAS_PRICE, - }, - ): Promise { - let gasLimit = options.gasLimit - - if (!gasLimit) { - const hexValue = await this._contract.methods[method](...args).estimateGas({ - gasPrice: new Unit(options.gasPrice).asGwei().toHex(), - }) - gasLimit = hexToNumber(hexValue) - } - - return { gasPrice: new Unit(options.gasPrice).asGwei().toWeiString(), gasLimit } - } - - public async call(method: string, args: any[] = [], txOptions?: ITransactionOptions): Promise { - const options = await this.estimateGas(method, args, txOptions) - const result: any = await this._contract.methods[method](...args).call(options) - - return result as T - } - - public async send(method: string, args: any[] = [], txOptions?: ITransactionOptions): Promise { - const options = await this.estimateGas(method, args, txOptions) - const response: BaseContract = await this._contract.methods[method](...args).send(options) - - if (!response.transaction) { - throw new ContractError('Invalid transaction response', method) - } - - return response.transaction - } - - protected async getBalance(address: string, id?: BNish, txOptions?: ITransactionOptions): Promise { - if (!address || address === AddressZero) { - throw new ContractError('Invalid address provided', '_getBalance') - } - - const args: any[] = [address] - - if (isBNish(id)) { - args.push(id) - } - - return this.call('balanceOf', args, txOptions) - } - - protected sanitizeAddress(address: string): string { - return address.toLowerCase() - } - - public async setApprovalForAll( - addressOperator: string, - approved: boolean, - txOptions?: ITransactionOptions, - ): Promise { - if (!addressOperator) { - throw new Error('You must provide an addressOperator') - } - - return this.send('setApprovalForAll', [addressOperator, approved], txOptions) - } - - public async isApprovedForAll(owner: string, operator: string, txOptions?: ITransactionOptions): Promise { - if (!owner || owner === AddressZero) { - throw new ContractError('Invalid owner provided', 'isApprovedForAll') - } - - if (!operator || operator === AddressZero) { - throw new ContractError('Invalid operator provided', 'isApprovedForAll') - } - - return this.call('isApprovedForAll', [owner, operator], txOptions) - } - - public setSignerByPrivateKey(privateKey: string): Account { - const account = this._contract.wallet.addByPrivateKey(privateKey) - - // Force the new account as defaultSigner - if (account.address) { - this._contract.wallet.setSigner(account.address) - } - - return account - } - - public setSignerByMnemonic(mnemonic: string, index = 0): Account { - const account = this._contract.wallet.addByMnemonic(mnemonic, index) - - // Force the new account as defaultSigner - if (account.address) { - this._contract.wallet.setSigner(account.address) - } - - return account - } - - public setSignerByKey(key: Key | PrivateKey | MnemonicKey): void { - this._contract.connect(key) - } -} diff --git a/src/bridge/bridgeHrc1155Token.ts b/src/bridge/bridgeHrc1155Token.ts new file mode 100644 index 0000000..d170405 --- /dev/null +++ b/src/bridge/bridgeHrc1155Token.ts @@ -0,0 +1,157 @@ +import { TxStatus } from '@harmony-js/transaction' +import { hexToNumber } from '@harmony-js/utils' +import BN from 'bn.js' +import { + AddressZero, + DEFAULT_TX_OPTIONS, + DEVNET_HRC1155_CONTRACTS_ADDRESSES, + HARMONY_RPC_WS, + MAINNET_HRC1155_CONTRACTS_ADDRESSES, +} from '../constants' +import { HRC1155 } from '../contracts' +import { BNish, BridgeResponse, ContractAddresses, HRC1155Info, ITransactionOptions } from '../interfaces' +import { waitForNewBlock } from '../utils' +import { BridgeToken } from './bridgeToken' +import { BridgedHRC1155Token } from './bridgedHrc1155Token' +import { HRC1155EthManager } from './hrc1155EthManager' +import { HRC1155HmyManager } from './hrc1155HmyManager' +import { HRC1155TokenManager } from './hrc1155TokenManager' + +export class BridgeHRC1155Token extends BridgeToken { + private getContractAddresses(): ContractAddresses { + return this.isMainnet ? MAINNET_HRC1155_CONTRACTS_ADDRESSES : DEVNET_HRC1155_CONTRACTS_ADDRESSES + } + + public async getBridgedTokenAddress(token: HRC1155, tokenId: BNish, txOptions: ITransactionOptions): Promise { + const { ethManagerAddress, tokenManagerAddress } = this.getContractAddresses() + const ethManager = new HRC1155EthManager(ethManagerAddress, this.ethOwnerWallet) + const tokenManager = new HRC1155TokenManager(tokenManagerAddress, this.ethMasterWallet) + let erc1155Addr = undefined + // can throw an error if the mapping do not exist. + try { + erc1155Addr = await ethManager.mappings(token.address) + } catch (err) {} + + if (!erc1155Addr || erc1155Addr === AddressZero) { + const [name, symbol, tokenURI] = await Promise.all([ + token.name(txOptions), + token.symbol(txOptions), + token.tokenURI(tokenId, txOptions), + ]) + + await ethManager.addToken(tokenManager.address, token.address, name, symbol, tokenURI) + + erc1155Addr = await ethManager.mappings(token.address) + } + return erc1155Addr + } + + public async ethToHmy( + sender: string, + recipient: string, + token: HRC1155, + tokenInfo: HRC1155Info, + ): Promise { + const { ethManagerAddress } = this.getContractAddresses() + const ethManager = new HRC1155EthManager(ethManagerAddress, this.ethOwnerWallet) + const erc1155Address = await ethManager.mappings(token.address) + const erc1155 = new BridgedHRC1155Token(erc1155Address, this.ethOwnerWallet) + // Verify parameters and balances + const { tokenIds, amounts } = tokenInfo + + if (!tokenIds || tokenIds.length === 0) { + throw Error('Error in tokenInfo, tokenIds cannot be undefined nor empty for HRC1155') + } + + if (!amounts || amounts.length === 0) { + throw Error('Error in tokenInfo, amounts cannot be undefined nor empty for HRC1155') + } + + // creates an array with the same account with a length equal to tokenIds + const senderArray = tokenIds.map(() => sender) + const balances = await erc1155.balanceOfBatch(senderArray, tokenIds) + + balances.forEach((balance, index) => { + if (balance.lt(amounts[index])) { + throw new Error( + `Insufficient funds. Balance: ${balance}. TokenId: ${tokenIds[index]}. Amount: ${amounts[index]}`, + ) + } + }) + + // Approve EthManager to burn the tokens on the Ethereum Network + const approveTx = await erc1155.setApprovalForAll(ethManager.address, true) + + if (approveTx?.status !== 1) { + throw new Error(`Failed to approve erc721: ${approveTx?.transactionHash}`) + } + + // Burn tokens to unlock on Harmony Network + const burnTx = await ethManager.burnTokens(erc1155Address, tokenIds, recipient, amounts) + + if (burnTx?.status !== 1) { + throw new Error(`Failed to approve erc721: ${burnTx?.transactionHash}`) + } + + return { addr: token.address, receiptId: burnTx?.transactionHash } + } + + public async hmyToEth( + sender: string, + recipient: string, + token: HRC1155, + tokenInfo: HRC1155Info, + txOptions: ITransactionOptions = DEFAULT_TX_OPTIONS, + ): Promise { + // Validate parameters and balance + const { tokenIds, amounts, ws = HARMONY_RPC_WS, waitingFor = 12 } = tokenInfo + + if (!tokenIds || tokenIds.length === 0) { + throw Error('Error in tokenInfo, tokenIds cannot be undefined nor empty for HRC1155') + } + + if (!amounts || amounts.length === 0) { + throw Error('Error in tokenInfo, amounts cannot be undefined nor empty for HRC1155') + } + + if (amounts.length !== tokenIds.length) { + throw Error('Error in tokenInfo, amounts length must be same as tokensIds length') + } + + const { hmyManagerAddress } = this.getContractAddresses() + const hmyManager = new HRC1155HmyManager(hmyManagerAddress, this.hmyOwnerWallet) + // creates an array with the same account with a length equal to tokenIds + const senderArray = tokenIds.map(() => sender) + const balances = await token.balanceOfBatch(senderArray, tokenIds, txOptions) + + balances.forEach((balance, index) => { + if (balance.lt(new BN(amounts[index]))) { + throw new Error( + `Insufficient funds. Balance: ${balance}. TokenId: ${tokenIds[index]}. Amount: ${amounts[index]}`, + ) + } + }) + + // Get Bridged Token address + const erc1155Addr = await this.getBridgedTokenAddress(token, tokenIds[0], txOptions) + // Approve hmyManager + const approveTx = await token.setApprovalForAll(hmyManager.address, true, txOptions) + + if (approveTx?.txStatus !== TxStatus.CONFIRMED) { + throw new Error(`Failed to approve manager: ${approveTx}`) + } + + // Lock tokens on Hmy side to mint on Eth side + const lockTokenTx = await hmyManager.lockHRC1155Tokens(token.address, tokenIds, recipient, amounts, [], txOptions) + if (lockTokenTx?.txStatus !== TxStatus.CONFIRMED) { + throw new Error(`Failed to lock tokens: ${lockTokenTx}`) + } + + // Wait for safety reasons + const expectedBlockNumber = parseInt(hexToNumber(lockTokenTx?.receipt?.blockNumber ?? ''), 10) + waitingFor + + await waitForNewBlock(expectedBlockNumber, ws, token.messenger.chainType, token.messenger.chainId) + + return { addr: erc1155Addr, receiptId: lockTokenTx?.id } + } +} diff --git a/src/bridge/bridgeHrc20Token.ts b/src/bridge/bridgeHrc20Token.ts new file mode 100644 index 0000000..369f941 --- /dev/null +++ b/src/bridge/bridgeHrc20Token.ts @@ -0,0 +1,141 @@ +import { TxStatus } from '@harmony-js/transaction' +import { hexToNumber } from '@harmony-js/utils' +import BN from 'bn.js' +import { + AddressZero, + DEFAULT_TX_OPTIONS, + DEVNET_HRC20_CONTRACTS_ADDRESSES, + HARMONY_RPC_WS, + MAINNET_HRC20_CONTRACTS_ADDRESSES, +} from '../constants' +import { HRC20 } from '../contracts' +import { BridgeResponse, ContractAddresses, HRC20Info, ITransactionOptions } from '../interfaces' +import { waitForNewBlock } from '../utils' +import { BridgeToken } from './bridgeToken' +import { BridgedHRC20Token } from './bridgedHrc20Token' +import { HRC20EthManager } from './hrc20EthManager' +import { HRC20HmyManager } from './hrc20HmyManager' +import { HRC20TokenManager } from './hrc20TokenManager' + +export class BridgeHRC20Token extends BridgeToken { + private getContractAddresses(): ContractAddresses { + return this.isMainnet ? MAINNET_HRC20_CONTRACTS_ADDRESSES : DEVNET_HRC20_CONTRACTS_ADDRESSES + } + + public async getBridgedTokenAddress( + token: HRC20, + txOptions: ITransactionOptions = DEFAULT_TX_OPTIONS, + ): Promise { + const { ethManagerAddress, tokenManagerAddress } = this.getContractAddresses() + const ethManager = new HRC20EthManager(ethManagerAddress, this.ethOwnerWallet) + const tokenManager = new HRC20TokenManager(tokenManagerAddress, this.ethMasterWallet) + + let erc20Addr = undefined + // can throw an error if the mapping do not exist. + try { + erc20Addr = await ethManager.mappings(token.address) + } catch (err) {} + + if (!erc20Addr || erc20Addr === AddressZero) { + const [name, symbol, decimals] = await Promise.all([ + token.name(txOptions), + token.symbol(txOptions), + token.decimals(txOptions), + ]) + + await ethManager.addToken(tokenManager.address, token.address, name, symbol, decimals) + + erc20Addr = await ethManager.mappings(token.address) + } + + return erc20Addr + } + + public async ethToHmy( + sender: string, + recipient: string, + token: HRC20, + tokenInfo: HRC20Info, + ): Promise { + const { ethManagerAddress } = this.getContractAddresses() + + const ethManager = new HRC20EthManager(ethManagerAddress, this.ethOwnerWallet) + const erc20Address = await ethManager.mappings(token.address) + const erc20 = new BridgedHRC20Token(erc20Address, this.ethOwnerWallet) + + // Verify parameters and balance + const { amount } = tokenInfo + + if (!amount) { + throw Error('Error in tokenInfo, amount cannot be undefined for HRC20') + } + + const balance = await erc20.balanceOf(sender) + + if (balance.lt(amount)) { + throw Error('Insufficient funds') + } + + // Approve EthManager to burn the tokens on the Ethereum Network + const approveTx = await erc20.approve(ethManager.address, amount) + + if (approveTx?.status !== 1) { + throw new Error(`Failed to approve erc20: ${approveTx?.transactionHash}`) + } + + // Burn tokens to unlock on Harmony Network + const burnTx = await ethManager.burnToken(erc20Address, amount, recipient) + + if (burnTx?.status !== 1) { + throw new Error(`Failed to approve erc20: ${burnTx?.transactionHash}`) + } + + return { addr: token.address, receiptId: burnTx?.transactionHash } + } + + public async hmyToEth( + sender: string, + recipient: string, + token: HRC20, + tokenInfo: HRC20Info, + txOptions: ITransactionOptions = DEFAULT_TX_OPTIONS, + ): Promise { + // Verify parameters and balance + const { amount, ws = HARMONY_RPC_WS, waitingFor = 12 } = tokenInfo + + if (!amount) { + throw Error('Error in tokenInfo, amount cannot be undefined for HRC20') + } + + const balance = await token.balanceOf(sender, txOptions) + + if (balance.lt(new BN(amount))) { + throw new Error(`Insufficient funds. Balance: ${balance}. Amount: ${amount}`) + } + + const { hmyManagerAddress } = this.getContractAddresses() + const hmyManager = new HRC20HmyManager(hmyManagerAddress, this.hmyOwnerWallet) + // Get Bridged Token address + const erc20Addr = await this.getBridgedTokenAddress(token, txOptions) + // Approve hmyManager + const approveTx = await token.approve(hmyManager.address, amount, txOptions) + + if (approveTx?.txStatus !== TxStatus.CONFIRMED) { + throw new Error(`Failed to approve manager: ${approveTx?.id}`) + } + + // Lock tokens on Hmy side to mint on Eth side + const lockTokenTx = await hmyManager.lockToken(token.address, amount, recipient, txOptions) + + if (lockTokenTx?.txStatus !== TxStatus.CONFIRMED) { + throw new Error(`Failed to lock tokens: ${lockTokenTx?.id}`) + } + + // Wait for safety reasons + const expectedBlockNumber = parseInt(hexToNumber(lockTokenTx?.receipt?.blockNumber ?? ''), 10) + waitingFor + + await waitForNewBlock(expectedBlockNumber, ws, token.messenger.chainType, token.messenger.chainId) + + return { addr: erc20Addr, receiptId: lockTokenTx?.id } + } +} diff --git a/src/bridge/bridgeHrc721Token.ts b/src/bridge/bridgeHrc721Token.ts new file mode 100644 index 0000000..f6b3d7c --- /dev/null +++ b/src/bridge/bridgeHrc721Token.ts @@ -0,0 +1,137 @@ +import { TxStatus } from '@harmony-js/transaction' +import { hexToNumber } from '@harmony-js/utils' +import BN from 'bn.js' +import { + AddressZero, + DEFAULT_TX_OPTIONS, + DEVNET_HRC721_CONTRACTS_ADDRESSES, + HARMONY_RPC_WS, + MAINNET_HRC721_CONTRACTS_ADDRESSES, +} from '../constants' +import { HRC721 } from '../contracts' +import { BNish, BridgeResponse, ContractAddresses, HRC721Info, ITransactionOptions } from '../interfaces' +import { waitForNewBlock } from '../utils' +import { BridgeToken } from './bridgeToken' +import { BridgedHRC721Token } from './bridgedHrc721Token' +import { HRC721EthManager } from './hrc721EthManager' +import { HRC721HmyManager } from './hrc721HmyManager' +import { HRC721TokenManager } from './hrc721TokenManager' + +export class BridgeHRC721Token extends BridgeToken { + private getContractAddresses(): ContractAddresses { + return this.isMainnet ? MAINNET_HRC721_CONTRACTS_ADDRESSES : DEVNET_HRC721_CONTRACTS_ADDRESSES + } + + public async getBridgedTokenAddress( + token: HRC721, + tokenId: BNish, + txOptions: ITransactionOptions = DEFAULT_TX_OPTIONS, + ): Promise { + const { ethManagerAddress, tokenManagerAddress } = this.getContractAddresses() + const ethManager = new HRC721EthManager(ethManagerAddress, this.ethOwnerWallet) + const tokenManager = new HRC721TokenManager(tokenManagerAddress, this.ethMasterWallet) + let erc721Addr = undefined + // can throw an error if the mapping do not exist. + try { + erc721Addr = await ethManager.mappings(token.address) + } catch (err) {} + + if (!erc721Addr || erc721Addr === AddressZero) { + const [name, symbol, tokenURI] = await Promise.all([ + token.name(txOptions), + token.symbol(txOptions), + token.tokenURI(tokenId, txOptions), + ]) + + await ethManager.addToken(tokenManager.address, token.address, name, symbol, tokenURI) + + erc721Addr = await ethManager.mappings(token.address) + } + return erc721Addr + } + + public async ethToHmy( + sender: string, + recipient: string, + token: HRC721, + tokenInfo: HRC721Info, + ): Promise { + const { ethManagerAddress } = this.getContractAddresses() + const ethManager = new HRC721EthManager(ethManagerAddress, this.ethOwnerWallet) + const erc721Address = await ethManager.mappings(token.address) + const erc721 = new BridgedHRC721Token(erc721Address, this.ethOwnerWallet) + + // Verify parameters and balance + const balance = await erc721.balanceOf(sender) + + if (balance.lt(1)) { + throw Error('Insufficient funds') + } + const { tokenId } = tokenInfo + if (!tokenId) { + throw Error('Error in tokenInfo, tokenId cannot be undefined for HRC721') + } + + // Approve ethManager to burn tokens on the Ethereum Network + const approveTx = await erc721.approve(ethManager.address, tokenId) + + if (approveTx?.status !== 1) { + throw new Error(`Failed to approve erc721: ${approveTx?.transactionHash}`) + } + + // Burn tokens to unlock on Hamrnoy Network + const burnTx = await ethManager.burnToken(erc721Address, tokenId, recipient) + + if (burnTx?.status !== 1) { + throw new Error(`Failed to approve erc721: ${burnTx?.transactionHash}`) + } + + return { addr: token.address, receiptId: burnTx?.transactionHash } + } + + public async hmyToEth( + sender: string, + recipient: string, + token: HRC721, + tokenInfo: HRC721Info, + txOptions: ITransactionOptions = DEFAULT_TX_OPTIONS, + ): Promise { + const { tokenId, ws = HARMONY_RPC_WS, waitingFor = 12 } = tokenInfo + + // Verify parameters and balance + if (!tokenId) { + throw Error('Error in tokenInfo, tokenId cannot be undefined for HRC721') + } + + const balance = await token.balanceOf(sender, txOptions) + + if (balance.lt(new BN(1))) { + throw new Error(`Insufficient funds. Balance: ${balance}. TokenId: ${tokenId}`) + } + + const { hmyManagerAddress } = this.getContractAddresses() + const hmyManager = new HRC721HmyManager(hmyManagerAddress, this.hmyOwnerWallet) + // Get Bridged Token address + const erc721Addr = await this.getBridgedTokenAddress(token, tokenId, txOptions) + // Approve manager to lock tokens on Harmony network + const approveTx = await token.approve(hmyManagerAddress, tokenId, txOptions) + + if (approveTx?.txStatus !== TxStatus.CONFIRMED) { + throw new Error(`Failed to approve manager: ${approveTx?.id}`) + } + + // Lock tokens on Harmony Network to mint on Ethereum Network + const lockTokenTx = await hmyManager.lockNFT721Token(token.address, tokenId, recipient, txOptions) + + if (lockTokenTx?.txStatus !== TxStatus.CONFIRMED) { + throw new Error(`Failed to lock tokens: ${lockTokenTx?.id}`) + } + + // Wait for safety reasons + const expectedBlockNumber = parseInt(hexToNumber(lockTokenTx?.receipt?.blockNumber ?? ''), 10) + waitingFor + + await waitForNewBlock(expectedBlockNumber, ws, token.messenger.chainType, token.messenger.chainId) + + return { addr: erc721Addr, receiptId: lockTokenTx.id } + } +} diff --git a/src/bridge/bridgeToken.ts b/src/bridge/bridgeToken.ts new file mode 100644 index 0000000..750fb41 --- /dev/null +++ b/src/bridge/bridgeToken.ts @@ -0,0 +1,78 @@ +import { Signer, VoidSigner } from '@ethersproject/abstract-signer' +import { Provider } from '@ethersproject/providers' +import { Wallet } from '@harmony-js/account' +import { + BridgeType, + DEFAULT_TX_OPTIONS, + DEVNET_MULTISIG_WALLET, + HARMONY_RPC_SHARD_0_DEVNET_URL, + HARMONY_RPC_SHARD_0_URL, + MAINNET_MULTISIG_WALLET, + NetworkInfo, +} from '../constants' +import { HRC1155, HRC20, HRC721 } from '../contracts' +import { ITransactionOptions, HRC20Info, HRC1155Info, HRC721Info, BridgeResponse } from '../interfaces' +import { Key } from '../wallets' + +export abstract class BridgeToken { + public readonly isMainnet: boolean + protected readonly ethMasterWallet: Signer + protected readonly hmyMasterWallet: Wallet + protected readonly ethOwnerWallet: Signer + protected readonly hmyOwnerWallet: Wallet + protected readonly network: NetworkInfo + + constructor( + hmyOwnerWallet: Wallet, + ethOwnerWallet: Signer, + ethProvider: Provider, + network: NetworkInfo = NetworkInfo.MAINNET, + ) { + this.network = network + this.isMainnet = this.network === NetworkInfo.MAINNET + + if (this.isMainnet) { + this.ethMasterWallet = new VoidSigner(MAINNET_MULTISIG_WALLET) + this.hmyMasterWallet = new Key(HARMONY_RPC_SHARD_0_URL) + } else { + this.ethMasterWallet = new VoidSigner(DEVNET_MULTISIG_WALLET) + this.hmyMasterWallet = new Key(HARMONY_RPC_SHARD_0_DEVNET_URL) + } + + this.ethMasterWallet = this.ethMasterWallet.connect(ethProvider) + this.hmyMasterWallet.setSigner(MAINNET_MULTISIG_WALLET) + + this.hmyOwnerWallet = hmyOwnerWallet + this.ethOwnerWallet = ethOwnerWallet + } + + public abstract ethToHmy( + sender: string, + recipient: string, + token: HRC20 | HRC721 | HRC1155, + tokenInfo: HRC20Info | HRC721Info | HRC1155Info, + ): Promise + + public abstract hmyToEth( + sender: string, + recipient: string, + token: HRC20 | HRC721 | HRC1155, + tokenInfo: HRC20Info | HRC721Info | HRC1155Info, + txOptions: ITransactionOptions, + ): Promise + + public async sendToken( + type: BridgeType, + sender: string, + recipient: string, + token: HRC20 | HRC721 | HRC1155, + tokenInfo: HRC20Info | HRC721Info | HRC1155Info, + txOptions: ITransactionOptions = DEFAULT_TX_OPTIONS, + ): Promise { + if (type === BridgeType.ETH_TO_HMY) { + return this.ethToHmy(sender, recipient, token, tokenInfo) + } else { + return this.hmyToEth(sender, recipient, token, tokenInfo, txOptions) + } + } +} diff --git a/src/bridge/bridgedHrc1155Token/abi.ts b/src/bridge/bridgedHrc1155Token/abi.ts new file mode 100644 index 0000000..9e0bddc --- /dev/null +++ b/src/bridge/bridgedHrc1155Token/abi.ts @@ -0,0 +1,809 @@ +export default [ + { + inputs: [ + { + internalType: 'address', + name: '_srcTokenAddr', + type: 'address', + }, + { + internalType: 'string', + name: 'name', + type: 'string', + }, + { + internalType: 'string', + name: 'symbol', + type: 'string', + }, + { + internalType: 'string', + name: 'baseMetadataURI', + type: 'string', + }, + ], + payable: false, + stateMutability: 'nonpayable', + type: 'constructor', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: '_owner', + type: 'address', + }, + { + indexed: true, + internalType: 'address', + name: '_operator', + type: 'address', + }, + { + indexed: false, + internalType: 'bool', + name: '_approved', + type: 'bool', + }, + ], + name: 'ApprovalForAll', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'account', + type: 'address', + }, + ], + name: 'MinterAdded', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'account', + type: 'address', + }, + ], + name: 'MinterRemoved', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'previousOwner', + type: 'address', + }, + { + indexed: true, + internalType: 'address', + name: 'newOwner', + type: 'address', + }, + ], + name: 'OwnershipTransferred', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: '_operator', + type: 'address', + }, + { + indexed: true, + internalType: 'address', + name: '_from', + type: 'address', + }, + { + indexed: true, + internalType: 'address', + name: '_to', + type: 'address', + }, + { + indexed: false, + internalType: 'uint256[]', + name: '_ids', + type: 'uint256[]', + }, + { + indexed: false, + internalType: 'uint256[]', + name: '_amounts', + type: 'uint256[]', + }, + ], + name: 'TransferBatch', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: '_operator', + type: 'address', + }, + { + indexed: true, + internalType: 'address', + name: '_from', + type: 'address', + }, + { + indexed: true, + internalType: 'address', + name: '_to', + type: 'address', + }, + { + indexed: false, + internalType: 'uint256', + name: '_id', + type: 'uint256', + }, + { + indexed: false, + internalType: 'uint256', + name: '_amount', + type: 'uint256', + }, + ], + name: 'TransferSingle', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'string', + name: '_uri', + type: 'string', + }, + { + indexed: true, + internalType: 'uint256', + name: '_id', + type: 'uint256', + }, + ], + name: 'URI', + type: 'event', + }, + { + constant: false, + inputs: [ + { + internalType: 'address', + name: 'account', + type: 'address', + }, + ], + name: 'addMinter', + outputs: [], + payable: false, + stateMutability: 'nonpayable', + type: 'function', + }, + { + constant: true, + inputs: [ + { + internalType: 'address', + name: '_owner', + type: 'address', + }, + { + internalType: 'uint256', + name: '_id', + type: 'uint256', + }, + ], + name: 'balanceOf', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + payable: false, + stateMutability: 'view', + type: 'function', + }, + { + constant: true, + inputs: [ + { + internalType: 'address[]', + name: '_owners', + type: 'address[]', + }, + { + internalType: 'uint256[]', + name: '_ids', + type: 'uint256[]', + }, + ], + name: 'balanceOfBatch', + outputs: [ + { + internalType: 'uint256[]', + name: '', + type: 'uint256[]', + }, + ], + payable: false, + stateMutability: 'view', + type: 'function', + }, + { + constant: false, + inputs: [ + { + internalType: 'address', + name: '_from', + type: 'address', + }, + { + internalType: 'uint256[]', + name: '_ids', + type: 'uint256[]', + }, + { + internalType: 'uint256[]', + name: '_amounts', + type: 'uint256[]', + }, + ], + name: 'batchBurn', + outputs: [], + payable: false, + stateMutability: 'nonpayable', + type: 'function', + }, + { + constant: false, + inputs: [ + { + internalType: 'uint256[]', + name: 'amounts', + type: 'uint256[]', + }, + ], + name: 'batchDecrement', + outputs: [], + payable: false, + stateMutability: 'nonpayable', + type: 'function', + }, + { + constant: false, + inputs: [ + { + internalType: 'uint256[]', + name: 'amounts', + type: 'uint256[]', + }, + ], + name: 'batchIncrement', + outputs: [], + payable: false, + stateMutability: 'nonpayable', + type: 'function', + }, + { + constant: false, + inputs: [ + { + internalType: 'address', + name: '_to', + type: 'address', + }, + { + internalType: 'uint256[]', + name: '_ids', + type: 'uint256[]', + }, + { + internalType: 'uint256[]', + name: '_quantities', + type: 'uint256[]', + }, + { + internalType: 'bytes', + name: '_data', + type: 'bytes', + }, + ], + name: 'batchMint', + outputs: [], + payable: false, + stateMutability: 'nonpayable', + type: 'function', + }, + { + constant: false, + inputs: [ + { + internalType: 'address', + name: '_from', + type: 'address', + }, + { + internalType: 'uint256', + name: '_id', + type: 'uint256', + }, + { + internalType: 'uint256', + name: '_amount', + type: 'uint256', + }, + ], + name: 'burn', + outputs: [], + payable: false, + stateMutability: 'nonpayable', + type: 'function', + }, + { + constant: true, + inputs: [ + { + internalType: 'uint256', + name: 'value', + type: 'uint256', + }, + ], + name: 'checkSupply', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + payable: false, + stateMutability: 'view', + type: 'function', + }, + { + constant: true, + inputs: [], + name: 'counter', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + payable: false, + stateMutability: 'view', + type: 'function', + }, + { + constant: false, + inputs: [ + { + internalType: 'uint256', + name: 'amount', + type: 'uint256', + }, + ], + name: 'decrement', + outputs: [], + payable: false, + stateMutability: 'nonpayable', + type: 'function', + }, + { + constant: false, + inputs: [ + { + internalType: 'uint256', + name: 'amount', + type: 'uint256', + }, + ], + name: 'increment', + outputs: [], + payable: false, + stateMutability: 'nonpayable', + type: 'function', + }, + { + constant: true, + inputs: [ + { + internalType: 'address', + name: '_owner', + type: 'address', + }, + { + internalType: 'address', + name: '_operator', + type: 'address', + }, + ], + name: 'isApprovedForAll', + outputs: [ + { + internalType: 'bool', + name: 'isOperator', + type: 'bool', + }, + ], + payable: false, + stateMutability: 'view', + type: 'function', + }, + { + constant: true, + inputs: [ + { + internalType: 'address', + name: 'account', + type: 'address', + }, + ], + name: 'isMinter', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + payable: false, + stateMutability: 'view', + type: 'function', + }, + { + constant: true, + inputs: [], + name: 'isOwner', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + payable: false, + stateMutability: 'view', + type: 'function', + }, + { + constant: false, + inputs: [ + { + internalType: 'address', + name: '_to', + type: 'address', + }, + { + internalType: 'uint256', + name: '_id', + type: 'uint256', + }, + { + internalType: 'uint256', + name: '_quantity', + type: 'uint256', + }, + { + internalType: 'bytes', + name: '_data', + type: 'bytes', + }, + ], + name: 'mint', + outputs: [], + payable: false, + stateMutability: 'nonpayable', + type: 'function', + }, + { + constant: true, + inputs: [], + name: 'name', + outputs: [ + { + internalType: 'string', + name: '', + type: 'string', + }, + ], + payable: false, + stateMutability: 'view', + type: 'function', + }, + { + constant: true, + inputs: [], + name: 'owner', + outputs: [ + { + internalType: 'address', + name: '', + type: 'address', + }, + ], + payable: false, + stateMutability: 'view', + type: 'function', + }, + { + constant: false, + inputs: [], + name: 'renounceMinter', + outputs: [], + payable: false, + stateMutability: 'nonpayable', + type: 'function', + }, + { + constant: false, + inputs: [], + name: 'renounceOwnership', + outputs: [], + payable: false, + stateMutability: 'nonpayable', + type: 'function', + }, + { + constant: false, + inputs: [ + { + internalType: 'address', + name: '_from', + type: 'address', + }, + { + internalType: 'address', + name: '_to', + type: 'address', + }, + { + internalType: 'uint256[]', + name: '_ids', + type: 'uint256[]', + }, + { + internalType: 'uint256[]', + name: '_amounts', + type: 'uint256[]', + }, + { + internalType: 'bytes', + name: '_data', + type: 'bytes', + }, + ], + name: 'safeBatchTransferFrom', + outputs: [], + payable: false, + stateMutability: 'nonpayable', + type: 'function', + }, + { + constant: false, + inputs: [ + { + internalType: 'address', + name: '_from', + type: 'address', + }, + { + internalType: 'address', + name: '_to', + type: 'address', + }, + { + internalType: 'uint256', + name: '_id', + type: 'uint256', + }, + { + internalType: 'uint256', + name: '_amount', + type: 'uint256', + }, + { + internalType: 'bytes', + name: '_data', + type: 'bytes', + }, + ], + name: 'safeTransferFrom', + outputs: [], + payable: false, + stateMutability: 'nonpayable', + type: 'function', + }, + { + constant: false, + inputs: [ + { + internalType: 'address', + name: '_operator', + type: 'address', + }, + { + internalType: 'bool', + name: '_approved', + type: 'bool', + }, + ], + name: 'setApprovalForAll', + outputs: [], + payable: false, + stateMutability: 'nonpayable', + type: 'function', + }, + { + constant: false, + inputs: [ + { + internalType: 'string', + name: '_newBaseMetadataURI', + type: 'string', + }, + ], + name: 'setBaseMetadataURI', + outputs: [], + payable: false, + stateMutability: 'nonpayable', + type: 'function', + }, + { + constant: true, + inputs: [], + name: 'srcTokenAddr', + outputs: [ + { + internalType: 'address', + name: '', + type: 'address', + }, + ], + payable: false, + stateMutability: 'view', + type: 'function', + }, + { + constant: true, + inputs: [ + { + internalType: 'bytes4', + name: '_interfaceID', + type: 'bytes4', + }, + ], + name: 'supportsInterface', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + payable: false, + stateMutability: 'view', + type: 'function', + }, + { + constant: true, + inputs: [], + name: 'symbol', + outputs: [ + { + internalType: 'string', + name: '', + type: 'string', + }, + ], + payable: false, + stateMutability: 'view', + type: 'function', + }, + { + constant: true, + inputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + name: 'tokenSupply', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + payable: false, + stateMutability: 'view', + type: 'function', + }, + { + constant: true, + inputs: [ + { + internalType: 'uint256', + name: '_id', + type: 'uint256', + }, + ], + name: 'totalSupply', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + payable: false, + stateMutability: 'view', + type: 'function', + }, + { + constant: false, + inputs: [ + { + internalType: 'address', + name: 'newOwner', + type: 'address', + }, + ], + name: 'transferOwnership', + outputs: [], + payable: false, + stateMutability: 'nonpayable', + type: 'function', + }, + { + constant: true, + inputs: [ + { + internalType: 'uint256', + name: '_id', + type: 'uint256', + }, + ], + name: 'uri', + outputs: [ + { + internalType: 'string', + name: '', + type: 'string', + }, + ], + payable: false, + stateMutability: 'view', + type: 'function', + }, +] diff --git a/src/bridge/bridgedHrc1155Token/index.ts b/src/bridge/bridgedHrc1155Token/index.ts new file mode 100644 index 0000000..b13e9ff --- /dev/null +++ b/src/bridge/bridgedHrc1155Token/index.ts @@ -0,0 +1,95 @@ +import { Signer } from '@ethersproject/abstract-signer' +import { BigNumberish, BigNumber } from '@ethersproject/bignumber' +import { CallOverrides } from '@ethersproject/contracts' +import { TransactionReceipt } from '@ethersproject/providers' +import { AddressZero } from '../../constants' +import { ContractError, EthBaseContract } from '../../contracts' +import ABI from './abi' + +export class BridgedHRC1155Token extends EthBaseContract { + constructor(address: string, signer: Signer) { + super(address, ABI, signer) + } + + public async balanceOf(address: string, id: BigNumberish): Promise { + return this.read('balanceOf', [address, id]) + } + + public async balanceOfBatch(accounts: string[], ids: BigNumberish[]): Promise { + if (accounts.length !== ids.length) { + throw new ContractError('Accounts and ids must have the same length', 'balanceOfBatch') + } + + return this.read('balanceOfBatch', [accounts, ids]) + } + + public async safeTransferFrom( + from: string, + to: string, + id: BigNumberish, + amount: BigNumberish, + data: any, + txOptions?: CallOverrides, + ): Promise { + if (to === AddressZero) { + throw new ContractError(`The to cannot be the ${AddressZero}`, 'safeTransferFrom') + } + + return this.write('safeTransferFrom', [from, to, id, amount, data], txOptions) + } + + public async safeBatchTransferFrom( + from: string, + to: string, + ids: BigNumberish[], + amounts: BigNumberish[], + data: any, + txOptions?: CallOverrides, + ): Promise { + if (amounts.length !== ids.length) { + throw new ContractError('amounts and ids must have the same length', 'safeBatchTransferFrom') + } + + return this.write('safeBatchTransferFrom', [from, to, ids, amounts, data], txOptions) + } + + public async setApprovalForAll( + addressOperator: string, + approved: boolean, + txOptions?: CallOverrides, + ): Promise { + if (!addressOperator) { + throw new Error('You must provide an addressOperator') + } + return this.write('setApprovalForAll', [addressOperator, approved], txOptions) + } + + public async isApprovedForAll(owner: string, operator: string): Promise { + if (!owner || owner === AddressZero) { + throw new ContractError('Invalid owner provided', 'isApprovedForAll') + } + + if (!operator || operator === AddressZero) { + throw new ContractError('Invalid operator provided', 'isApprovedForAll') + } + + return this.read('isApprovedForAll', [owner, operator]) + } + + public async owner(): Promise { + const address = await this.read('owner', []) + return address.toLowerCase() + } + + public async tokenURIPrefix(): Promise { + return this.read('tokenURIPrefix', []) + } + + public async contractURI(): Promise { + return this.read('contractURI', []) + } + + public async totalSupply(id: BigNumberish): Promise { + return this.read('totalSupply', [id]) + } +} diff --git a/src/bridge/bridgedHrc20Token/abi.ts b/src/bridge/bridgedHrc20Token/abi.ts new file mode 100644 index 0000000..3ec6d2a --- /dev/null +++ b/src/bridge/bridgedHrc20Token/abi.ts @@ -0,0 +1,468 @@ +export default [ + { + inputs: [ + { + internalType: 'address', + name: '_ethTokenAddr', + type: 'address', + }, + { + internalType: 'string', + name: 'name', + type: 'string', + }, + { + internalType: 'string', + name: 'symbol', + type: 'string', + }, + { + internalType: 'uint8', + name: 'decimals', + type: 'uint8', + }, + ], + payable: false, + stateMutability: 'nonpayable', + type: 'constructor', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'owner', + type: 'address', + }, + { + indexed: true, + internalType: 'address', + name: 'spender', + type: 'address', + }, + { + indexed: false, + internalType: 'uint256', + name: 'value', + type: 'uint256', + }, + ], + name: 'Approval', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'account', + type: 'address', + }, + ], + name: 'MinterAdded', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'account', + type: 'address', + }, + ], + name: 'MinterRemoved', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'from', + type: 'address', + }, + { + indexed: true, + internalType: 'address', + name: 'to', + type: 'address', + }, + { + indexed: false, + internalType: 'uint256', + name: 'value', + type: 'uint256', + }, + ], + name: 'Transfer', + type: 'event', + }, + { + constant: false, + inputs: [ + { + internalType: 'address', + name: 'account', + type: 'address', + }, + ], + name: 'addMinter', + outputs: [], + payable: false, + stateMutability: 'nonpayable', + type: 'function', + }, + { + constant: true, + inputs: [ + { + internalType: 'address', + name: 'owner', + type: 'address', + }, + { + internalType: 'address', + name: 'spender', + type: 'address', + }, + ], + name: 'allowance', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + payable: false, + stateMutability: 'view', + type: 'function', + }, + { + constant: false, + inputs: [ + { + internalType: 'address', + name: 'spender', + type: 'address', + }, + { + internalType: 'uint256', + name: 'amount', + type: 'uint256', + }, + ], + name: 'approve', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + payable: false, + stateMutability: 'nonpayable', + type: 'function', + }, + { + constant: true, + inputs: [ + { + internalType: 'address', + name: 'account', + type: 'address', + }, + ], + name: 'balanceOf', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + payable: false, + stateMutability: 'view', + type: 'function', + }, + { + constant: false, + inputs: [ + { + internalType: 'uint256', + name: 'amount', + type: 'uint256', + }, + ], + name: 'burn', + outputs: [], + payable: false, + stateMutability: 'nonpayable', + type: 'function', + }, + { + constant: false, + inputs: [ + { + internalType: 'address', + name: 'account', + type: 'address', + }, + { + internalType: 'uint256', + name: 'amount', + type: 'uint256', + }, + ], + name: 'burnFrom', + outputs: [], + payable: false, + stateMutability: 'nonpayable', + type: 'function', + }, + { + constant: true, + inputs: [], + name: 'decimals', + outputs: [ + { + internalType: 'uint8', + name: '', + type: 'uint8', + }, + ], + payable: false, + stateMutability: 'view', + type: 'function', + }, + { + constant: false, + inputs: [ + { + internalType: 'address', + name: 'spender', + type: 'address', + }, + { + internalType: 'uint256', + name: 'subtractedValue', + type: 'uint256', + }, + ], + name: 'decreaseAllowance', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + payable: false, + stateMutability: 'nonpayable', + type: 'function', + }, + { + constant: true, + inputs: [], + name: 'ethTokenAddr', + outputs: [ + { + internalType: 'address', + name: '', + type: 'address', + }, + ], + payable: false, + stateMutability: 'view', + type: 'function', + }, + { + constant: false, + inputs: [ + { + internalType: 'address', + name: 'spender', + type: 'address', + }, + { + internalType: 'uint256', + name: 'addedValue', + type: 'uint256', + }, + ], + name: 'increaseAllowance', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + payable: false, + stateMutability: 'nonpayable', + type: 'function', + }, + { + constant: true, + inputs: [ + { + internalType: 'address', + name: 'account', + type: 'address', + }, + ], + name: 'isMinter', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + payable: false, + stateMutability: 'view', + type: 'function', + }, + { + constant: false, + inputs: [ + { + internalType: 'address', + name: 'account', + type: 'address', + }, + { + internalType: 'uint256', + name: 'amount', + type: 'uint256', + }, + ], + name: 'mint', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + payable: false, + stateMutability: 'nonpayable', + type: 'function', + }, + { + constant: true, + inputs: [], + name: 'name', + outputs: [ + { + internalType: 'string', + name: '', + type: 'string', + }, + ], + payable: false, + stateMutability: 'view', + type: 'function', + }, + { + constant: false, + inputs: [], + name: 'renounceMinter', + outputs: [], + payable: false, + stateMutability: 'nonpayable', + type: 'function', + }, + { + constant: true, + inputs: [], + name: 'symbol', + outputs: [ + { + internalType: 'string', + name: '', + type: 'string', + }, + ], + payable: false, + stateMutability: 'view', + type: 'function', + }, + { + constant: true, + inputs: [], + name: 'totalSupply', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + payable: false, + stateMutability: 'view', + type: 'function', + }, + { + constant: false, + inputs: [ + { + internalType: 'address', + name: 'recipient', + type: 'address', + }, + { + internalType: 'uint256', + name: 'amount', + type: 'uint256', + }, + ], + name: 'transfer', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + payable: false, + stateMutability: 'nonpayable', + type: 'function', + }, + { + constant: false, + inputs: [ + { + internalType: 'address', + name: 'sender', + type: 'address', + }, + { + internalType: 'address', + name: 'recipient', + type: 'address', + }, + { + internalType: 'uint256', + name: 'amount', + type: 'uint256', + }, + ], + name: 'transferFrom', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + payable: false, + stateMutability: 'nonpayable', + type: 'function', + }, +] diff --git a/src/bridge/bridgedHrc20Token/index.ts b/src/bridge/bridgedHrc20Token/index.ts new file mode 100644 index 0000000..c82a798 --- /dev/null +++ b/src/bridge/bridgedHrc20Token/index.ts @@ -0,0 +1,53 @@ +import { Signer } from '@ethersproject/abstract-signer' +import { BigNumberish, BigNumber } from '@ethersproject/bignumber' +import { CallOverrides } from '@ethersproject/contracts' +import { TransactionReceipt } from '@ethersproject/providers' +import { EthBaseContract } from '../../contracts' +import ABI from './abi' + +export class BridgedHRC20Token extends EthBaseContract { + constructor(address: string, signer: Signer) { + super(address, ABI, signer) + } + + public async totalSupply(): Promise { + return this.read('totalSupply') + } + + public async balanceOf(address: string): Promise { + return this.read('balanceOf', [address]) + } + + public async transfer(to: string, amount: BigNumberish, txOptions?: CallOverrides): Promise { + return this.write('transfer', [to, amount], txOptions) + } + + public async allowance(owner: string, spender: string): Promise { + return this.read('allowance', [owner, spender]) + } + + public async approve(spender: string, amount: BigNumberish, txOptions?: CallOverrides): Promise { + return this.write('approve', [spender, amount], txOptions) + } + + public async transferFrom( + from: string, + to: string, + amount: BigNumberish, + txOptions?: CallOverrides, + ): Promise { + return this.write('transferFrom', [from, to, amount], txOptions) + } + + public async symbol(): Promise { + return this.read('symbol') + } + + public async name(): Promise { + return this.read('name') + } + + public async decimals(): Promise { + return this.read('decimals') + } +} diff --git a/src/bridge/bridgedHrc721Token/abi.ts b/src/bridge/bridgedHrc721Token/abi.ts new file mode 100644 index 0000000..f88918e --- /dev/null +++ b/src/bridge/bridgedHrc721Token/abi.ts @@ -0,0 +1,740 @@ +export default [ + { + inputs: [ + { + internalType: 'address', + name: '_ethTokenAddr', + type: 'address', + }, + { + internalType: 'string', + name: 'name', + type: 'string', + }, + { + internalType: 'string', + name: 'symbol', + type: 'string', + }, + { + internalType: 'string', + name: 'baseURI', + type: 'string', + }, + ], + payable: false, + stateMutability: 'nonpayable', + type: 'constructor', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'owner', + type: 'address', + }, + { + indexed: true, + internalType: 'address', + name: 'approved', + type: 'address', + }, + { + indexed: true, + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + ], + name: 'Approval', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'owner', + type: 'address', + }, + { + indexed: true, + internalType: 'address', + name: 'operator', + type: 'address', + }, + { + indexed: false, + internalType: 'bool', + name: 'approved', + type: 'bool', + }, + ], + name: 'ApprovalForAll', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'account', + type: 'address', + }, + ], + name: 'MinterAdded', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'account', + type: 'address', + }, + ], + name: 'MinterRemoved', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'from', + type: 'address', + }, + { + indexed: true, + internalType: 'address', + name: 'to', + type: 'address', + }, + { + indexed: true, + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + ], + name: 'Transfer', + type: 'event', + }, + { + constant: false, + inputs: [ + { + internalType: 'address', + name: 'account', + type: 'address', + }, + ], + name: 'addMinter', + outputs: [], + payable: false, + stateMutability: 'nonpayable', + type: 'function', + }, + { + constant: false, + inputs: [ + { + internalType: 'address', + name: 'to', + type: 'address', + }, + { + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + ], + name: 'approve', + outputs: [], + payable: false, + stateMutability: 'nonpayable', + type: 'function', + }, + { + constant: true, + inputs: [ + { + internalType: 'address', + name: 'owner', + type: 'address', + }, + ], + name: 'balanceOf', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + payable: false, + stateMutability: 'view', + type: 'function', + }, + { + constant: true, + inputs: [], + name: 'baseURI', + outputs: [ + { + internalType: 'string', + name: '', + type: 'string', + }, + ], + payable: false, + stateMutability: 'view', + type: 'function', + }, + { + constant: false, + inputs: [ + { + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + ], + name: 'burn', + outputs: [], + payable: false, + stateMutability: 'nonpayable', + type: 'function', + }, + { + constant: false, + inputs: [ + { + internalType: 'address', + name: 'owner', + type: 'address', + }, + { + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + ], + name: 'burnFrom', + outputs: [], + payable: false, + stateMutability: 'nonpayable', + type: 'function', + }, + { + constant: true, + inputs: [ + { + internalType: 'uint256', + name: 'value', + type: 'uint256', + }, + ], + name: 'checkSupply', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + payable: false, + stateMutability: 'view', + type: 'function', + }, + { + constant: true, + inputs: [], + name: 'counter', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + payable: false, + stateMutability: 'view', + type: 'function', + }, + { + constant: false, + inputs: [], + name: 'decrement', + outputs: [], + payable: false, + stateMutability: 'nonpayable', + type: 'function', + }, + { + constant: true, + inputs: [], + name: 'ethTokenAddr', + outputs: [ + { + internalType: 'address', + name: '', + type: 'address', + }, + ], + payable: false, + stateMutability: 'view', + type: 'function', + }, + { + constant: true, + inputs: [ + { + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + ], + name: 'getApproved', + outputs: [ + { + internalType: 'address', + name: '', + type: 'address', + }, + ], + payable: false, + stateMutability: 'view', + type: 'function', + }, + { + constant: false, + inputs: [], + name: 'increment', + outputs: [], + payable: false, + stateMutability: 'nonpayable', + type: 'function', + }, + { + constant: true, + inputs: [ + { + internalType: 'address', + name: 'owner', + type: 'address', + }, + { + internalType: 'address', + name: 'operator', + type: 'address', + }, + ], + name: 'isApprovedForAll', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + payable: false, + stateMutability: 'view', + type: 'function', + }, + { + constant: true, + inputs: [ + { + internalType: 'address', + name: 'account', + type: 'address', + }, + ], + name: 'isMinter', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + payable: false, + stateMutability: 'view', + type: 'function', + }, + { + constant: false, + inputs: [ + { + internalType: 'address', + name: 'to', + type: 'address', + }, + { + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + ], + name: 'mint', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + payable: false, + stateMutability: 'nonpayable', + type: 'function', + }, + { + constant: true, + inputs: [], + name: 'name', + outputs: [ + { + internalType: 'string', + name: '', + type: 'string', + }, + ], + payable: false, + stateMutability: 'view', + type: 'function', + }, + { + constant: true, + inputs: [ + { + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + ], + name: 'ownerOf', + outputs: [ + { + internalType: 'address', + name: '', + type: 'address', + }, + ], + payable: false, + stateMutability: 'view', + type: 'function', + }, + { + constant: false, + inputs: [], + name: 'renounceMinter', + outputs: [], + payable: false, + stateMutability: 'nonpayable', + type: 'function', + }, + { + constant: false, + inputs: [ + { + internalType: 'address', + name: 'to', + type: 'address', + }, + { + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + { + internalType: 'bytes', + name: '_data', + type: 'bytes', + }, + ], + name: 'safeMint', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + payable: false, + stateMutability: 'nonpayable', + type: 'function', + }, + { + constant: false, + inputs: [ + { + internalType: 'address', + name: 'to', + type: 'address', + }, + { + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + ], + name: 'safeMint', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + payable: false, + stateMutability: 'nonpayable', + type: 'function', + }, + { + constant: false, + inputs: [ + { + internalType: 'address', + name: 'from', + type: 'address', + }, + { + internalType: 'address', + name: 'to', + type: 'address', + }, + { + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + ], + name: 'safeTransferFrom', + outputs: [], + payable: false, + stateMutability: 'nonpayable', + type: 'function', + }, + { + constant: false, + inputs: [ + { + internalType: 'address', + name: 'from', + type: 'address', + }, + { + internalType: 'address', + name: 'to', + type: 'address', + }, + { + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + { + internalType: 'bytes', + name: '_data', + type: 'bytes', + }, + ], + name: 'safeTransferFrom', + outputs: [], + payable: false, + stateMutability: 'nonpayable', + type: 'function', + }, + { + constant: false, + inputs: [ + { + internalType: 'address', + name: 'to', + type: 'address', + }, + { + internalType: 'bool', + name: 'approved', + type: 'bool', + }, + ], + name: 'setApprovalForAll', + outputs: [], + payable: false, + stateMutability: 'nonpayable', + type: 'function', + }, + { + constant: false, + inputs: [ + { + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + { + internalType: 'string', + name: 'tokenURI', + type: 'string', + }, + ], + name: 'setTokenURI', + outputs: [], + payable: false, + stateMutability: 'nonpayable', + type: 'function', + }, + { + constant: true, + inputs: [ + { + internalType: 'bytes4', + name: 'interfaceId', + type: 'bytes4', + }, + ], + name: 'supportsInterface', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + payable: false, + stateMutability: 'view', + type: 'function', + }, + { + constant: true, + inputs: [], + name: 'symbol', + outputs: [ + { + internalType: 'string', + name: '', + type: 'string', + }, + ], + payable: false, + stateMutability: 'view', + type: 'function', + }, + { + constant: true, + inputs: [ + { + internalType: 'uint256', + name: 'index', + type: 'uint256', + }, + ], + name: 'tokenByIndex', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + payable: false, + stateMutability: 'view', + type: 'function', + }, + { + constant: true, + inputs: [ + { + internalType: 'address', + name: 'owner', + type: 'address', + }, + { + internalType: 'uint256', + name: 'index', + type: 'uint256', + }, + ], + name: 'tokenOfOwnerByIndex', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + payable: false, + stateMutability: 'view', + type: 'function', + }, + { + constant: true, + inputs: [ + { + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + ], + name: 'tokenURI', + outputs: [ + { + internalType: 'string', + name: '', + type: 'string', + }, + ], + payable: false, + stateMutability: 'view', + type: 'function', + }, + { + constant: true, + inputs: [], + name: 'totalSupply', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + payable: false, + stateMutability: 'view', + type: 'function', + }, + { + constant: false, + inputs: [ + { + internalType: 'address', + name: 'from', + type: 'address', + }, + { + internalType: 'address', + name: 'to', + type: 'address', + }, + { + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + ], + name: 'transferFrom', + outputs: [], + payable: false, + stateMutability: 'nonpayable', + type: 'function', + }, +] diff --git a/src/bridge/bridgedHrc721Token/index.ts b/src/bridge/bridgedHrc721Token/index.ts new file mode 100644 index 0000000..dff06c5 --- /dev/null +++ b/src/bridge/bridgedHrc721Token/index.ts @@ -0,0 +1,45 @@ +import { Signer } from '@ethersproject/abstract-signer' +import { BigNumberish, BigNumber } from '@ethersproject/bignumber' +import { CallOverrides } from '@ethersproject/contracts' +import { TransactionReceipt } from '@ethersproject/providers' +import { EthBaseContract } from '../../contracts' +import ABI from './abi' + +export class BridgedHRC721Token extends EthBaseContract { + constructor(address: string, signer: Signer) { + super(address, ABI, signer) + } + + public async totalSupply(): Promise { + return this.read('totalSupply') + } + + public async balanceOf(address: string): Promise { + return this.read('balanceOf', [address]) + } + + public async approve(spender: string, tokenId: BigNumberish, txOptions?: CallOverrides): Promise { + return this.write('approve', [spender, tokenId], txOptions) + } + + public async transferFrom( + from: string, + to: string, + tokenId: BigNumberish, + txOptions?: CallOverrides, + ): Promise { + return this.write('transferFrom', [from, to, tokenId], txOptions) + } + + public async symbol(): Promise { + return this.read('symbol') + } + + public async name(): Promise { + return this.read('name') + } + + public async tokenURI(tokenId: BigNumberish): Promise { + return this.read('tokenURI', [tokenId]) + } +} diff --git a/src/tests/contracts/HRC1155/abi.ts b/src/bridge/hrc1155/abi.ts similarity index 56% rename from src/tests/contracts/HRC1155/abi.ts rename to src/bridge/hrc1155/abi.ts index 51aa34b..2ebcba7 100644 --- a/src/tests/contracts/HRC1155/abi.ts +++ b/src/bridge/hrc1155/abi.ts @@ -1,23 +1,45 @@ -export const ABI: any = [ +export default [ + { + inputs: [ + { + internalType: 'string', + name: 'name', + type: 'string', + }, + { + internalType: 'string', + name: 'symbol', + type: 'string', + }, + { + internalType: 'string', + name: 'uri', + type: 'string', + }, + ], + payable: false, + stateMutability: 'nonpayable', + type: 'constructor', + }, { anonymous: false, inputs: [ { indexed: true, internalType: 'address', - name: 'account', + name: '_owner', type: 'address', }, { indexed: true, internalType: 'address', - name: 'operator', + name: '_operator', type: 'address', }, { indexed: false, internalType: 'bool', - name: 'approved', + name: '_approved', type: 'bool', }, ], @@ -30,31 +52,57 @@ export const ABI: any = [ { indexed: true, internalType: 'address', - name: 'operator', + name: 'account', type: 'address', }, + ], + name: 'MinterAdded', + type: 'event', + }, + { + anonymous: false, + inputs: [ { indexed: true, internalType: 'address', - name: 'from', + name: 'account', + type: 'address', + }, + ], + name: 'MinterRemoved', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: '_operator', type: 'address', }, { indexed: true, internalType: 'address', - name: 'to', + name: '_from', + type: 'address', + }, + { + indexed: true, + internalType: 'address', + name: '_to', type: 'address', }, { indexed: false, internalType: 'uint256[]', - name: 'ids', + name: '_ids', type: 'uint256[]', }, { indexed: false, internalType: 'uint256[]', - name: 'values', + name: '_amounts', type: 'uint256[]', }, ], @@ -67,31 +115,31 @@ export const ABI: any = [ { indexed: true, internalType: 'address', - name: 'operator', + name: '_operator', type: 'address', }, { indexed: true, internalType: 'address', - name: 'from', + name: '_from', type: 'address', }, { indexed: true, internalType: 'address', - name: 'to', + name: '_to', type: 'address', }, { indexed: false, internalType: 'uint256', - name: 'id', + name: '_id', type: 'uint256', }, { indexed: false, internalType: 'uint256', - name: 'value', + name: '_amount', type: 'uint256', }, ], @@ -104,13 +152,13 @@ export const ABI: any = [ { indexed: false, internalType: 'string', - name: 'value', + name: '_uri', type: 'string', }, { indexed: true, internalType: 'uint256', - name: 'id', + name: '_id', type: 'uint256', }, ], @@ -118,15 +166,31 @@ export const ABI: any = [ type: 'event', }, { + constant: false, inputs: [ { internalType: 'address', name: 'account', type: 'address', }, + ], + name: 'addMinter', + outputs: [], + payable: false, + stateMutability: 'nonpayable', + type: 'function', + }, + { + constant: true, + inputs: [ + { + internalType: 'address', + name: '_owner', + type: 'address', + }, { internalType: 'uint256', - name: 'id', + name: '_id', type: 'uint256', }, ], @@ -138,19 +202,21 @@ export const ABI: any = [ type: 'uint256', }, ], + payable: false, stateMutability: 'view', type: 'function', }, { + constant: true, inputs: [ { internalType: 'address[]', - name: 'accounts', + name: '_owners', type: 'address[]', }, { internalType: 'uint256[]', - name: 'ids', + name: '_ids', type: 'uint256[]', }, ], @@ -162,23 +228,46 @@ export const ABI: any = [ type: 'uint256[]', }, ], + payable: false, stateMutability: 'view', type: 'function', }, { + constant: true, inputs: [ { internalType: 'address', - name: 'account', + name: '_owner', type: 'address', }, { internalType: 'address', - name: 'operator', + name: '_operator', type: 'address', }, ], name: 'isApprovedForAll', + outputs: [ + { + internalType: 'bool', + name: 'isOperator', + type: 'bool', + }, + ], + payable: false, + stateMutability: 'view', + type: 'function', + }, + { + constant: true, + inputs: [ + { + internalType: 'address', + name: 'account', + type: 'address', + }, + ], + name: 'isMinter', outputs: [ { internalType: 'bool', @@ -186,98 +275,160 @@ export const ABI: any = [ type: 'bool', }, ], + payable: false, + stateMutability: 'view', + type: 'function', + }, + { + constant: false, + inputs: [ + { + internalType: 'address', + name: '_to', + type: 'address', + }, + { + internalType: 'uint256', + name: '_id', + type: 'uint256', + }, + { + internalType: 'uint256', + name: '_quantity', + type: 'uint256', + }, + { + internalType: 'bytes', + name: '_data', + type: 'bytes', + }, + ], + name: 'mint', + outputs: [], + payable: false, + stateMutability: 'nonpayable', + type: 'function', + }, + { + constant: true, + inputs: [], + name: 'name', + outputs: [ + { + internalType: 'string', + name: '', + type: 'string', + }, + ], + payable: false, stateMutability: 'view', type: 'function', }, { + constant: false, + inputs: [], + name: 'renounceMinter', + outputs: [], + payable: false, + stateMutability: 'nonpayable', + type: 'function', + }, + { + constant: false, inputs: [ { internalType: 'address', - name: 'from', + name: '_from', type: 'address', }, { internalType: 'address', - name: 'to', + name: '_to', type: 'address', }, { internalType: 'uint256[]', - name: 'ids', + name: '_ids', type: 'uint256[]', }, { internalType: 'uint256[]', - name: 'amounts', + name: '_amounts', type: 'uint256[]', }, { internalType: 'bytes', - name: 'data', + name: '_data', type: 'bytes', }, ], name: 'safeBatchTransferFrom', outputs: [], + payable: false, stateMutability: 'nonpayable', type: 'function', }, { + constant: false, inputs: [ { internalType: 'address', - name: 'from', + name: '_from', type: 'address', }, { internalType: 'address', - name: 'to', + name: '_to', type: 'address', }, { internalType: 'uint256', - name: 'id', + name: '_id', type: 'uint256', }, { internalType: 'uint256', - name: 'amount', + name: '_amount', type: 'uint256', }, { internalType: 'bytes', - name: 'data', + name: '_data', type: 'bytes', }, ], name: 'safeTransferFrom', outputs: [], + payable: false, stateMutability: 'nonpayable', type: 'function', }, { + constant: false, inputs: [ { internalType: 'address', - name: 'operator', + name: '_operator', type: 'address', }, { internalType: 'bool', - name: 'approved', + name: '_approved', type: 'bool', }, ], name: 'setApprovalForAll', outputs: [], + payable: false, stateMutability: 'nonpayable', type: 'function', }, { + constant: true, inputs: [ { internalType: 'bytes4', - name: 'interfaceId', + name: '_interfaceID', type: 'bytes4', }, ], @@ -289,14 +440,31 @@ export const ABI: any = [ type: 'bool', }, ], + payable: false, + stateMutability: 'view', + type: 'function', + }, + { + constant: true, + inputs: [], + name: 'symbol', + outputs: [ + { + internalType: 'string', + name: '', + type: 'string', + }, + ], + payable: false, stateMutability: 'view', type: 'function', }, { + constant: true, inputs: [ { internalType: 'uint256', - name: 'id', + name: '_id', type: 'uint256', }, ], @@ -308,6 +476,7 @@ export const ABI: any = [ type: 'string', }, ], + payable: false, stateMutability: 'view', type: 'function', }, diff --git a/src/bridge/hrc1155EthManager/abi.ts b/src/bridge/hrc1155EthManager/abi.ts new file mode 100644 index 0000000..1138999 --- /dev/null +++ b/src/bridge/hrc1155EthManager/abi.ts @@ -0,0 +1,414 @@ +export default [ + { + inputs: [ + { + internalType: 'address', + name: '_wallet', + type: 'address', + }, + ], + payable: false, + stateMutability: 'nonpayable', + type: 'constructor', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'token', + type: 'address', + }, + { + indexed: true, + internalType: 'address', + name: 'sender', + type: 'address', + }, + { + indexed: false, + internalType: 'uint256[]', + name: 'tokenIds', + type: 'uint256[]', + }, + { + indexed: false, + internalType: 'address', + name: 'recipient', + type: 'address', + }, + { + indexed: false, + internalType: 'uint256[]', + name: 'amounts', + type: 'uint256[]', + }, + ], + name: 'BatchBurned', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'address', + name: 'oneToken', + type: 'address', + }, + { + indexed: false, + internalType: 'uint256[]', + name: 'tokenIds', + type: 'uint256[]', + }, + { + indexed: false, + internalType: 'address', + name: 'recipient', + type: 'address', + }, + { + indexed: false, + internalType: 'bytes32', + name: 'receiptId', + type: 'bytes32', + }, + { + indexed: false, + internalType: 'uint256[]', + name: 'amounts', + type: 'uint256[]', + }, + ], + name: 'BatchMinted', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'token', + type: 'address', + }, + { + indexed: true, + internalType: 'address', + name: 'sender', + type: 'address', + }, + { + indexed: false, + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + { + indexed: false, + internalType: 'address', + name: 'recipient', + type: 'address', + }, + { + indexed: false, + internalType: 'uint256', + name: 'amount', + type: 'uint256', + }, + ], + name: 'Burned', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'address', + name: 'oneToken', + type: 'address', + }, + { + indexed: false, + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + { + indexed: false, + internalType: 'address', + name: 'recipient', + type: 'address', + }, + { + indexed: false, + internalType: 'bytes32', + name: 'receiptId', + type: 'bytes32', + }, + { + indexed: false, + internalType: 'uint256', + name: 'amount', + type: 'uint256', + }, + ], + name: 'Minted', + type: 'event', + }, + { + constant: false, + inputs: [ + { + internalType: 'address', + name: 'tokenManager', + type: 'address', + }, + { + internalType: 'address', + name: 'ethTokenAddr', + type: 'address', + }, + { + internalType: 'string', + name: 'name', + type: 'string', + }, + { + internalType: 'string', + name: 'symbol', + type: 'string', + }, + { + internalType: 'string', + name: 'baseURI', + type: 'string', + }, + ], + name: 'addToken', + outputs: [], + payable: false, + stateMutability: 'nonpayable', + type: 'function', + }, + { + constant: false, + inputs: [ + { + internalType: 'address', + name: 'oneToken', + type: 'address', + }, + { + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + { + internalType: 'address', + name: 'recipient', + type: 'address', + }, + { + internalType: 'uint256', + name: 'amount', + type: 'uint256', + }, + ], + name: 'burnToken', + outputs: [], + payable: false, + stateMutability: 'nonpayable', + type: 'function', + }, + { + constant: false, + inputs: [ + { + internalType: 'address', + name: 'oneToken', + type: 'address', + }, + { + internalType: 'uint256[]', + name: 'tokenIds', + type: 'uint256[]', + }, + { + internalType: 'address', + name: 'recipient', + type: 'address', + }, + { + internalType: 'uint256[]', + name: 'amounts', + type: 'uint256[]', + }, + ], + name: 'burnTokens', + outputs: [], + payable: false, + stateMutability: 'nonpayable', + type: 'function', + }, + { + constant: true, + inputs: [ + { + internalType: 'address', + name: '', + type: 'address', + }, + ], + name: 'mappings', + outputs: [ + { + internalType: 'address', + name: '', + type: 'address', + }, + ], + payable: false, + stateMutability: 'view', + type: 'function', + }, + { + constant: false, + inputs: [ + { + internalType: 'address', + name: 'oneToken', + type: 'address', + }, + { + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + { + internalType: 'address', + name: 'recipient', + type: 'address', + }, + { + internalType: 'bytes32', + name: 'receiptId', + type: 'bytes32', + }, + { + internalType: 'uint256', + name: 'amount', + type: 'uint256', + }, + { + internalType: 'bytes', + name: 'data', + type: 'bytes', + }, + ], + name: 'mintToken', + outputs: [], + payable: false, + stateMutability: 'nonpayable', + type: 'function', + }, + { + constant: false, + inputs: [ + { + internalType: 'address', + name: 'oneToken', + type: 'address', + }, + { + internalType: 'uint256[]', + name: 'tokenIds', + type: 'uint256[]', + }, + { + internalType: 'address', + name: 'recipient', + type: 'address', + }, + { + internalType: 'bytes32', + name: 'receiptId', + type: 'bytes32', + }, + { + internalType: 'uint256[]', + name: 'amounts', + type: 'uint256[]', + }, + { + internalType: 'bytes', + name: 'data', + type: 'bytes', + }, + ], + name: 'mintTokens', + outputs: [], + payable: false, + stateMutability: 'nonpayable', + type: 'function', + }, + { + constant: false, + inputs: [ + { + internalType: 'address', + name: 'tokenManager', + type: 'address', + }, + { + internalType: 'address', + name: 'ethTokenAddr', + type: 'address', + }, + ], + name: 'removeToken', + outputs: [], + payable: false, + stateMutability: 'nonpayable', + type: 'function', + }, + { + constant: true, + inputs: [ + { + internalType: 'bytes32', + name: '', + type: 'bytes32', + }, + ], + name: 'usedEvents_', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + payable: false, + stateMutability: 'view', + type: 'function', + }, + { + constant: true, + inputs: [], + name: 'wallet', + outputs: [ + { + internalType: 'address', + name: '', + type: 'address', + }, + ], + payable: false, + stateMutability: 'view', + type: 'function', + }, +] diff --git a/src/bridge/hrc1155EthManager/index.ts b/src/bridge/hrc1155EthManager/index.ts new file mode 100644 index 0000000..dd84add --- /dev/null +++ b/src/bridge/hrc1155EthManager/index.ts @@ -0,0 +1,79 @@ +import { Signer } from '@ethersproject/abstract-signer' +import { BigNumberish } from '@ethersproject/bignumber' +import { CallOverrides } from '@ethersproject/contracts' +import { TransactionReceipt } from '@ethersproject/providers' +import { EthBaseContract } from '../../contracts' +import ABI from './abi' + +export class HRC1155EthManager extends EthBaseContract { + constructor(address: string, signer: Signer) { + super(address, ABI, signer) + } + + public async addToken( + tokenManager: string, + ethTokenAddr: string, + name: string, + symbol: string, + tokenURI: string, + txOptions?: CallOverrides, + ): Promise { + return this.write('addToken', [tokenManager, ethTokenAddr, name, symbol, tokenURI], txOptions) + } + + public async removeToken( + tokenManager: string, + ethTokenAddr: string, + txOptions?: CallOverrides, + ): Promise { + return this.write('removeToken', [tokenManager, ethTokenAddr], txOptions) + } + + public async burnToken( + oneToken: string, + tokenId: BigNumberish, + recipient: string, + amount: BigNumberish, + txOptions?: CallOverrides, + ): Promise { + return this.write('burnToken', [oneToken, tokenId, recipient, amount], txOptions) + } + + public async burnTokens( + oneToken: string, + tokenIds: BigNumberish[], + recipient: string, + amounts: BigNumberish[], + txOptions?: CallOverrides, + ): Promise { + return this.write('burnTokens', [oneToken, tokenIds, recipient, amounts], txOptions) + } + + public async mintToken( + oneToken: string, + tokenId: BigNumberish, + recipient: string, + receiptId: string, + amount: BigNumberish, + data: string[], + txOptions?: CallOverrides, + ): Promise { + return this.write('mintToken', [oneToken, tokenId, recipient, receiptId, amount, data], txOptions) + } + + public async mintTokens( + oneToken: string, + tokenIds: BigNumberish[], + amounts: BigNumberish[], + recipient: string, + receiptId: string, + data: string[], + txOptions?: CallOverrides, + ): Promise { + return this.write('mintTokens', [oneToken, tokenIds, recipient, receiptId, amounts, data], txOptions) + } + + public async mappings(hrc1155Addr: string): Promise { + return this.read('mappings', [hrc1155Addr]) + } +} diff --git a/src/bridge/hrc1155HmyManager/abi.ts b/src/bridge/hrc1155HmyManager/abi.ts new file mode 100644 index 0000000..1a117fb --- /dev/null +++ b/src/bridge/hrc1155HmyManager/abi.ts @@ -0,0 +1,451 @@ +export default [ + { + inputs: [ + { + internalType: 'address', + name: '_wallet', + type: 'address', + }, + ], + payable: false, + stateMutability: 'nonpayable', + type: 'constructor', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'token', + type: 'address', + }, + { + indexed: true, + internalType: 'address', + name: 'sender', + type: 'address', + }, + { + indexed: false, + internalType: 'uint256[]', + name: 'tokenIds', + type: 'uint256[]', + }, + { + indexed: false, + internalType: 'address', + name: 'recipient', + type: 'address', + }, + { + indexed: false, + internalType: 'uint256[]', + name: 'amounts', + type: 'uint256[]', + }, + ], + name: 'BatchLocked', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'address', + name: 'ethToken', + type: 'address', + }, + { + indexed: false, + internalType: 'uint256[]', + name: 'tokenIds', + type: 'uint256[]', + }, + { + indexed: false, + internalType: 'address', + name: 'recipient', + type: 'address', + }, + { + indexed: false, + internalType: 'bytes32', + name: 'receiptId', + type: 'bytes32', + }, + { + indexed: false, + internalType: 'uint256[]', + name: 'amounts', + type: 'uint256[]', + }, + ], + name: 'BatchUnlocked', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'token', + type: 'address', + }, + { + indexed: true, + internalType: 'address', + name: 'sender', + type: 'address', + }, + { + indexed: false, + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + { + indexed: false, + internalType: 'address', + name: 'recipient', + type: 'address', + }, + { + indexed: false, + internalType: 'uint256', + name: 'amount', + type: 'uint256', + }, + ], + name: 'Locked', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'address', + name: 'ethToken', + type: 'address', + }, + { + indexed: false, + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + { + indexed: false, + internalType: 'address', + name: 'recipient', + type: 'address', + }, + { + indexed: false, + internalType: 'bytes32', + name: 'receiptId', + type: 'bytes32', + }, + { + indexed: false, + internalType: 'uint256', + name: 'amount', + type: 'uint256', + }, + ], + name: 'Unlocked', + type: 'event', + }, + { + constant: false, + inputs: [ + { + internalType: 'address', + name: 'ethTokenAddr', + type: 'address', + }, + { + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + { + internalType: 'address', + name: 'recipient', + type: 'address', + }, + { + internalType: 'uint256', + name: 'amount', + type: 'uint256', + }, + { + internalType: 'bytes', + name: 'data', + type: 'bytes', + }, + ], + name: 'lockHRC1155Token', + outputs: [], + payable: false, + stateMutability: 'nonpayable', + type: 'function', + }, + { + constant: false, + inputs: [ + { + internalType: 'address', + name: 'ethTokenAddr', + type: 'address', + }, + { + internalType: 'uint256[]', + name: 'tokenIds', + type: 'uint256[]', + }, + { + internalType: 'address', + name: 'recipient', + type: 'address', + }, + { + internalType: 'uint256[]', + name: 'amounts', + type: 'uint256[]', + }, + { + internalType: 'bytes', + name: 'data', + type: 'bytes', + }, + ], + name: 'lockHRC1155Tokens', + outputs: [], + payable: false, + stateMutability: 'nonpayable', + type: 'function', + }, + { + constant: false, + inputs: [ + { + internalType: 'address', + name: '', + type: 'address', + }, + { + internalType: 'address', + name: '', + type: 'address', + }, + { + internalType: 'uint256[]', + name: '', + type: 'uint256[]', + }, + { + internalType: 'uint256[]', + name: '', + type: 'uint256[]', + }, + { + internalType: 'bytes', + name: '', + type: 'bytes', + }, + ], + name: 'onERC1155BatchReceived', + outputs: [ + { + internalType: 'bytes4', + name: '', + type: 'bytes4', + }, + ], + payable: false, + stateMutability: 'nonpayable', + type: 'function', + }, + { + constant: false, + inputs: [ + { + internalType: 'address', + name: '', + type: 'address', + }, + { + internalType: 'address', + name: '', + type: 'address', + }, + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + { + internalType: 'bytes', + name: '', + type: 'bytes', + }, + ], + name: 'onERC1155Received', + outputs: [ + { + internalType: 'bytes4', + name: '', + type: 'bytes4', + }, + ], + payable: false, + stateMutability: 'nonpayable', + type: 'function', + }, + { + constant: true, + inputs: [ + { + internalType: 'bytes4', + name: 'interfaceID', + type: 'bytes4', + }, + ], + name: 'supportsInterface', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + payable: false, + stateMutability: 'view', + type: 'function', + }, + { + constant: false, + inputs: [ + { + internalType: 'address', + name: 'ethTokenAddr', + type: 'address', + }, + { + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + { + internalType: 'address', + name: 'recipient', + type: 'address', + }, + { + internalType: 'bytes32', + name: 'receiptId', + type: 'bytes32', + }, + { + internalType: 'uint256', + name: 'amount', + type: 'uint256', + }, + { + internalType: 'bytes', + name: 'data', + type: 'bytes', + }, + ], + name: 'unlockHRC1155Token', + outputs: [], + payable: false, + stateMutability: 'nonpayable', + type: 'function', + }, + { + constant: false, + inputs: [ + { + internalType: 'address', + name: 'ethTokenAddr', + type: 'address', + }, + { + internalType: 'uint256[]', + name: 'tokenIds', + type: 'uint256[]', + }, + { + internalType: 'address', + name: 'recipient', + type: 'address', + }, + { + internalType: 'bytes32', + name: 'receiptId', + type: 'bytes32', + }, + { + internalType: 'uint256[]', + name: 'amounts', + type: 'uint256[]', + }, + { + internalType: 'bytes', + name: 'data', + type: 'bytes', + }, + ], + name: 'unlockHRC1155Tokens', + outputs: [], + payable: false, + stateMutability: 'nonpayable', + type: 'function', + }, + { + constant: true, + inputs: [ + { + internalType: 'bytes32', + name: '', + type: 'bytes32', + }, + ], + name: 'usedEvents_', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + payable: false, + stateMutability: 'view', + type: 'function', + }, + { + constant: true, + inputs: [], + name: 'wallet', + outputs: [ + { + internalType: 'address', + name: '', + type: 'address', + }, + ], + payable: false, + stateMutability: 'view', + type: 'function', + }, +] diff --git a/src/bridge/hrc1155HmyManager/index.ts b/src/bridge/hrc1155HmyManager/index.ts new file mode 100644 index 0000000..c5d0b97 --- /dev/null +++ b/src/bridge/hrc1155HmyManager/index.ts @@ -0,0 +1,57 @@ +import { ContractOptions } from '@harmony-js/contract/dist/utils/options' +import { Transaction } from '@harmony-js/transaction' +import { BaseContract } from '../../contracts' +import { BNish, ContractProviderType, ITransactionOptions } from '../../interfaces' +import ABI from './abi' + +export class HRC1155HmyManager extends BaseContract { + constructor(address: string, provider: ContractProviderType, options?: ContractOptions) { + super(address, ABI, provider, options) + } + + public async lockHRC1155Token( + ethTokenAddr: string, + tokenId: BNish, + recipient: string, + amount: BNish, + data: string[], + txOptions?: ITransactionOptions, + ): Promise { + return this.send('lockHRC1155Token', [ethTokenAddr, tokenId, recipient, amount, data], txOptions) + } + + public async lockHRC1155Tokens( + ethTokenAddr: string, + tokenIds: BNish[], + recipient: string, + amounts: BNish[], + data: string[], + txOptions?: ITransactionOptions, + ): Promise { + return this.send('lockHRC1155Tokens', [ethTokenAddr, tokenIds, recipient, amounts, data], txOptions) + } + + public async unlockHRC1155Token( + ethTokenAddr: string, + tokenId: BNish, + amount: BNish, + recipient: string, + receiptId: string, + data: string[], + txOptions?: ITransactionOptions, + ): Promise { + return this.send('unlockHRC1155Token', [ethTokenAddr, tokenId, recipient, receiptId, amount, data], txOptions) + } + + public async unlockHRC1155Tokens( + ethTokenAddr: string, + tokenIds: BNish[], + amounts: BNish[], + recipient: string, + receiptId: string, + data: string[], + txOptions?: ITransactionOptions, + ): Promise { + return this.send('unlockHRC1155Tokens', [ethTokenAddr, tokenIds, recipient, receiptId, amounts, data], txOptions) + } +} diff --git a/src/bridge/hrc1155TokenManager/abi.ts b/src/bridge/hrc1155TokenManager/abi.ts new file mode 100644 index 0000000..3f412c8 --- /dev/null +++ b/src/bridge/hrc1155TokenManager/abi.ts @@ -0,0 +1,248 @@ +export default [ + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'previousOwner', + type: 'address', + }, + { + indexed: true, + internalType: 'address', + name: 'newOwner', + type: 'address', + }, + ], + name: 'OwnershipTransferred', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'tokenReq', + type: 'address', + }, + { + indexed: true, + internalType: 'address', + name: 'tokenAck', + type: 'address', + }, + ], + name: 'TokenMapAck', + type: 'event', + }, + { + constant: false, + inputs: [ + { + internalType: 'address', + name: 'ethTokenAddr', + type: 'address', + }, + { + internalType: 'string', + name: 'name', + type: 'string', + }, + { + internalType: 'string', + name: 'symbol', + type: 'string', + }, + { + internalType: 'string', + name: 'baseURI', + type: 'string', + }, + ], + name: 'addHRC1155Token', + outputs: [ + { + internalType: 'address', + name: '', + type: 'address', + }, + ], + payable: false, + stateMutability: 'nonpayable', + type: 'function', + }, + { + constant: false, + inputs: [ + { + internalType: 'address', + name: 'guy', + type: 'address', + }, + ], + name: 'deny', + outputs: [], + payable: false, + stateMutability: 'nonpayable', + type: 'function', + }, + { + constant: true, + inputs: [], + name: 'isOwner', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + payable: false, + stateMutability: 'view', + type: 'function', + }, + { + constant: true, + inputs: [ + { + internalType: 'address', + name: '', + type: 'address', + }, + ], + name: 'mappedTokens', + outputs: [ + { + internalType: 'address', + name: '', + type: 'address', + }, + ], + payable: false, + stateMutability: 'view', + type: 'function', + }, + { + constant: true, + inputs: [], + name: 'owner', + outputs: [ + { + internalType: 'address', + name: '', + type: 'address', + }, + ], + payable: false, + stateMutability: 'view', + type: 'function', + }, + { + constant: false, + inputs: [ + { + internalType: 'address', + name: 'ethTokenAddr', + type: 'address', + }, + { + internalType: 'address', + name: 'oneTokenAddr', + type: 'address', + }, + ], + name: 'registerToken', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + payable: false, + stateMutability: 'nonpayable', + type: 'function', + }, + { + constant: false, + inputs: [ + { + internalType: 'address', + name: 'guy', + type: 'address', + }, + ], + name: 'rely', + outputs: [], + payable: false, + stateMutability: 'nonpayable', + type: 'function', + }, + { + constant: false, + inputs: [ + { + internalType: 'address', + name: 'ethTokenAddr', + type: 'address', + }, + { + internalType: 'uint256', + name: 'supply', + type: 'uint256', + }, + ], + name: 'removeHRC1155Token', + outputs: [], + payable: false, + stateMutability: 'nonpayable', + type: 'function', + }, + { + constant: false, + inputs: [], + name: 'renounceOwnership', + outputs: [], + payable: false, + stateMutability: 'nonpayable', + type: 'function', + }, + { + constant: false, + inputs: [ + { + internalType: 'address', + name: 'newOwner', + type: 'address', + }, + ], + name: 'transferOwnership', + outputs: [], + payable: false, + stateMutability: 'nonpayable', + type: 'function', + }, + { + constant: true, + inputs: [ + { + internalType: 'address', + name: '', + type: 'address', + }, + ], + name: 'wards', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + payable: false, + stateMutability: 'view', + type: 'function', + }, +] diff --git a/src/bridge/hrc1155TokenManager/index.ts b/src/bridge/hrc1155TokenManager/index.ts new file mode 100644 index 0000000..651087c --- /dev/null +++ b/src/bridge/hrc1155TokenManager/index.ts @@ -0,0 +1,46 @@ +import { Signer } from '@ethersproject/abstract-signer' +import { BigNumberish } from '@ethersproject/bignumber' +import { CallOverrides } from '@ethersproject/contracts' +import { TransactionReceipt } from '@ethersproject/providers' +import { EthBaseContract } from '../../contracts' +import ABI from './abi' + +export class HRC1155TokenManager extends EthBaseContract { + constructor(address: string, signer: Signer) { + super(address, ABI, signer) + } + + public async rely(address: string, txOptions?: CallOverrides): Promise { + return this.write('rely', [address], txOptions) + } + + public async deny(address: string, txOptions?: CallOverrides): Promise { + return this.write('deny', [address], txOptions) + } + + public async addHRC1155Token( + ethTokenAddr: string, + name: string, + symbol: string, + tokenURI: string, + txOptions?: CallOverrides, + ): Promise { + return this.write('addHRC1155Token', [ethTokenAddr, name, symbol, tokenURI], txOptions) + } + + public async registerToken( + ethTokenAddr: string, + oneTokenAddr: string, + txOptions?: CallOverrides, + ): Promise { + return this.write('registerToken', [ethTokenAddr, oneTokenAddr], txOptions) + } + + public async removeHRC1155Token( + ethTokenAddr: string, + supply: BigNumberish, + txOptions?: CallOverrides, + ): Promise { + return this.write('removeHRC1155Token', [ethTokenAddr, supply], txOptions) + } +} diff --git a/src/bridge/hrc20/abi.ts b/src/bridge/hrc20/abi.ts new file mode 100644 index 0000000..3f1e074 --- /dev/null +++ b/src/bridge/hrc20/abi.ts @@ -0,0 +1,448 @@ +export default [ + { + inputs: [ + { + internalType: 'string', + name: 'name', + type: 'string', + }, + { + internalType: 'string', + name: 'symbol', + type: 'string', + }, + { + internalType: 'uint8', + name: 'decimals', + type: 'uint8', + }, + ], + payable: false, + stateMutability: 'nonpayable', + type: 'constructor', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'owner', + type: 'address', + }, + { + indexed: true, + internalType: 'address', + name: 'spender', + type: 'address', + }, + { + indexed: false, + internalType: 'uint256', + name: 'value', + type: 'uint256', + }, + ], + name: 'Approval', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'account', + type: 'address', + }, + ], + name: 'MinterAdded', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'account', + type: 'address', + }, + ], + name: 'MinterRemoved', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'from', + type: 'address', + }, + { + indexed: true, + internalType: 'address', + name: 'to', + type: 'address', + }, + { + indexed: false, + internalType: 'uint256', + name: 'value', + type: 'uint256', + }, + ], + name: 'Transfer', + type: 'event', + }, + { + constant: false, + inputs: [ + { + internalType: 'address', + name: 'account', + type: 'address', + }, + ], + name: 'addMinter', + outputs: [], + payable: false, + stateMutability: 'nonpayable', + type: 'function', + }, + { + constant: true, + inputs: [ + { + internalType: 'address', + name: 'owner', + type: 'address', + }, + { + internalType: 'address', + name: 'spender', + type: 'address', + }, + ], + name: 'allowance', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + payable: false, + stateMutability: 'view', + type: 'function', + }, + { + constant: false, + inputs: [ + { + internalType: 'address', + name: 'spender', + type: 'address', + }, + { + internalType: 'uint256', + name: 'amount', + type: 'uint256', + }, + ], + name: 'approve', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + payable: false, + stateMutability: 'nonpayable', + type: 'function', + }, + { + constant: true, + inputs: [ + { + internalType: 'address', + name: 'account', + type: 'address', + }, + ], + name: 'balanceOf', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + payable: false, + stateMutability: 'view', + type: 'function', + }, + { + constant: false, + inputs: [ + { + internalType: 'uint256', + name: 'amount', + type: 'uint256', + }, + ], + name: 'burn', + outputs: [], + payable: false, + stateMutability: 'nonpayable', + type: 'function', + }, + { + constant: false, + inputs: [ + { + internalType: 'address', + name: 'account', + type: 'address', + }, + { + internalType: 'uint256', + name: 'amount', + type: 'uint256', + }, + ], + name: 'burnFrom', + outputs: [], + payable: false, + stateMutability: 'nonpayable', + type: 'function', + }, + { + constant: true, + inputs: [], + name: 'decimals', + outputs: [ + { + internalType: 'uint8', + name: '', + type: 'uint8', + }, + ], + payable: false, + stateMutability: 'view', + type: 'function', + }, + { + constant: false, + inputs: [ + { + internalType: 'address', + name: 'spender', + type: 'address', + }, + { + internalType: 'uint256', + name: 'subtractedValue', + type: 'uint256', + }, + ], + name: 'decreaseAllowance', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + payable: false, + stateMutability: 'nonpayable', + type: 'function', + }, + { + constant: false, + inputs: [ + { + internalType: 'address', + name: 'spender', + type: 'address', + }, + { + internalType: 'uint256', + name: 'addedValue', + type: 'uint256', + }, + ], + name: 'increaseAllowance', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + payable: false, + stateMutability: 'nonpayable', + type: 'function', + }, + { + constant: true, + inputs: [ + { + internalType: 'address', + name: 'account', + type: 'address', + }, + ], + name: 'isMinter', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + payable: false, + stateMutability: 'view', + type: 'function', + }, + { + constant: false, + inputs: [ + { + internalType: 'address', + name: 'account', + type: 'address', + }, + { + internalType: 'uint256', + name: 'amount', + type: 'uint256', + }, + ], + name: 'mint', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + payable: false, + stateMutability: 'nonpayable', + type: 'function', + }, + { + constant: true, + inputs: [], + name: 'name', + outputs: [ + { + internalType: 'string', + name: '', + type: 'string', + }, + ], + payable: false, + stateMutability: 'view', + type: 'function', + }, + { + constant: false, + inputs: [], + name: 'renounceMinter', + outputs: [], + payable: false, + stateMutability: 'nonpayable', + type: 'function', + }, + { + constant: true, + inputs: [], + name: 'symbol', + outputs: [ + { + internalType: 'string', + name: '', + type: 'string', + }, + ], + payable: false, + stateMutability: 'view', + type: 'function', + }, + { + constant: true, + inputs: [], + name: 'totalSupply', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + payable: false, + stateMutability: 'view', + type: 'function', + }, + { + constant: false, + inputs: [ + { + internalType: 'address', + name: 'recipient', + type: 'address', + }, + { + internalType: 'uint256', + name: 'amount', + type: 'uint256', + }, + ], + name: 'transfer', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + payable: false, + stateMutability: 'nonpayable', + type: 'function', + }, + { + constant: false, + inputs: [ + { + internalType: 'address', + name: 'sender', + type: 'address', + }, + { + internalType: 'address', + name: 'recipient', + type: 'address', + }, + { + internalType: 'uint256', + name: 'amount', + type: 'uint256', + }, + ], + name: 'transferFrom', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + payable: false, + stateMutability: 'nonpayable', + type: 'function', + }, +] diff --git a/src/bridge/hrc20EthManager/abi.ts b/src/bridge/hrc20EthManager/abi.ts new file mode 100644 index 0000000..f8a7cc5 --- /dev/null +++ b/src/bridge/hrc20EthManager/abi.ts @@ -0,0 +1,243 @@ +export default [ + { + inputs: [ + { + internalType: 'address', + name: '_wallet', + type: 'address', + }, + ], + payable: false, + stateMutability: 'nonpayable', + type: 'constructor', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'token', + type: 'address', + }, + { + indexed: true, + internalType: 'address', + name: 'sender', + type: 'address', + }, + { + indexed: false, + internalType: 'uint256', + name: 'amount', + type: 'uint256', + }, + { + indexed: false, + internalType: 'address', + name: 'recipient', + type: 'address', + }, + ], + name: 'Burned', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'address', + name: 'ethToken', + type: 'address', + }, + { + indexed: false, + internalType: 'uint256', + name: 'amount', + type: 'uint256', + }, + { + indexed: false, + internalType: 'address', + name: 'recipient', + type: 'address', + }, + { + indexed: false, + internalType: 'bytes32', + name: 'receiptId', + type: 'bytes32', + }, + ], + name: 'Minted', + type: 'event', + }, + { + constant: false, + inputs: [ + { + internalType: 'address', + name: 'tokenManager', + type: 'address', + }, + { + internalType: 'address', + name: 'hmyTokenAddr', + type: 'address', + }, + { + internalType: 'string', + name: 'name', + type: 'string', + }, + { + internalType: 'string', + name: 'symbol', + type: 'string', + }, + { + internalType: 'uint8', + name: 'decimals', + type: 'uint8', + }, + ], + name: 'addToken', + outputs: [], + payable: false, + stateMutability: 'nonpayable', + type: 'function', + }, + { + constant: false, + inputs: [ + { + internalType: 'address', + name: 'ethToken', + type: 'address', + }, + { + internalType: 'uint256', + name: 'amount', + type: 'uint256', + }, + { + internalType: 'address', + name: 'recipient', + type: 'address', + }, + ], + name: 'burnToken', + outputs: [], + payable: false, + stateMutability: 'nonpayable', + type: 'function', + }, + { + constant: true, + inputs: [ + { + internalType: 'address', + name: '', + type: 'address', + }, + ], + name: 'mappings', + outputs: [ + { + internalType: 'address', + name: '', + type: 'address', + }, + ], + payable: false, + stateMutability: 'view', + type: 'function', + }, + { + constant: false, + inputs: [ + { + internalType: 'address', + name: 'ethToken', + type: 'address', + }, + { + internalType: 'uint256', + name: 'amount', + type: 'uint256', + }, + { + internalType: 'address', + name: 'recipient', + type: 'address', + }, + { + internalType: 'bytes32', + name: 'receiptId', + type: 'bytes32', + }, + ], + name: 'mintToken', + outputs: [], + payable: false, + stateMutability: 'nonpayable', + type: 'function', + }, + { + constant: false, + inputs: [ + { + internalType: 'address', + name: 'tokenManager', + type: 'address', + }, + { + internalType: 'address', + name: 'hmyTokenAddr', + type: 'address', + }, + ], + name: 'removeToken', + outputs: [], + payable: false, + stateMutability: 'nonpayable', + type: 'function', + }, + { + constant: true, + inputs: [ + { + internalType: 'bytes32', + name: '', + type: 'bytes32', + }, + ], + name: 'usedEvents_', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + payable: false, + stateMutability: 'view', + type: 'function', + }, + { + constant: true, + inputs: [], + name: 'wallet', + outputs: [ + { + internalType: 'address', + name: '', + type: 'address', + }, + ], + payable: false, + stateMutability: 'view', + type: 'function', + }, +] diff --git a/src/bridge/hrc20EthManager/index.ts b/src/bridge/hrc20EthManager/index.ts new file mode 100644 index 0000000..2c1b5cd --- /dev/null +++ b/src/bridge/hrc20EthManager/index.ts @@ -0,0 +1,54 @@ +import { Signer } from '@ethersproject/abstract-signer' +import { BigNumberish } from '@ethersproject/bignumber' +import { CallOverrides } from '@ethersproject/contracts' +import { TransactionReceipt } from '@ethersproject/providers' +import { EthBaseContract } from '../../contracts' +import ABI from './abi' + +export class HRC20EthManager extends EthBaseContract { + constructor(address: string, signer: Signer) { + super(address, ABI, signer) + } + + public async addToken( + tokenManager: string, + hmyTokenAddr: string, + name: string, + symbol: string, + decimals: BigNumberish, + txOptions?: CallOverrides, + ): Promise { + return this.write('addToken', [tokenManager, hmyTokenAddr, name, symbol, decimals], txOptions) + } + + public async removeToken( + tokenManager: string, + hmyTokenAddr: string, + txOptions?: CallOverrides, + ): Promise { + return this.write('removeToken', [tokenManager, hmyTokenAddr], txOptions) + } + + public async burnToken( + ethToken: string, + amount: BigNumberish, + recipient: string, + txOptions?: CallOverrides, + ): Promise { + return this.write('burnToken', [ethToken, amount, recipient], txOptions) + } + + public async mintToken( + ethToken: string, + amount: BigNumberish, + recipient: string, + receiptId: string, + txOptions?: CallOverrides, + ): Promise { + return this.write('mintToken', [ethToken, amount, recipient, receiptId], txOptions) + } + + public async mappings(hrc20Addr: string): Promise { + return this.read('mappings', [hrc20Addr]) + } +} diff --git a/src/bridge/hrc20HmyManager/abi.ts b/src/bridge/hrc20HmyManager/abi.ts new file mode 100644 index 0000000..3572d7d --- /dev/null +++ b/src/bridge/hrc20HmyManager/abi.ts @@ -0,0 +1,257 @@ +export default [ + { + inputs: [ + { + internalType: 'address', + name: '_wallet', + type: 'address', + }, + ], + payable: false, + stateMutability: 'nonpayable', + type: 'constructor', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'token', + type: 'address', + }, + { + indexed: true, + internalType: 'address', + name: 'sender', + type: 'address', + }, + { + indexed: false, + internalType: 'uint256', + name: 'amount', + type: 'uint256', + }, + { + indexed: false, + internalType: 'address', + name: 'recipient', + type: 'address', + }, + ], + name: 'Locked', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'address', + name: 'hmyToken', + type: 'address', + }, + { + indexed: false, + internalType: 'uint256', + name: 'amount', + type: 'uint256', + }, + { + indexed: false, + internalType: 'address', + name: 'recipient', + type: 'address', + }, + { + indexed: false, + internalType: 'bytes32', + name: 'receiptId', + type: 'bytes32', + }, + ], + name: 'Unlocked', + type: 'event', + }, + { + constant: true, + inputs: [], + name: 'HMY_ADDRESS', + outputs: [ + { + internalType: 'contract IERC20', + name: '', + type: 'address', + }, + ], + payable: false, + stateMutability: 'view', + type: 'function', + }, + { + constant: false, + inputs: [ + { + internalType: 'uint256', + name: 'amount', + type: 'uint256', + }, + { + internalType: 'address', + name: 'recipient', + type: 'address', + }, + ], + name: 'lockOne', + outputs: [], + payable: true, + stateMutability: 'payable', + type: 'function', + }, + { + constant: false, + inputs: [ + { + internalType: 'address', + name: 'hmyTokenAddr', + type: 'address', + }, + { + internalType: 'uint256', + name: 'amount', + type: 'uint256', + }, + { + internalType: 'address', + name: 'recipient', + type: 'address', + }, + ], + name: 'lockToken', + outputs: [], + payable: false, + stateMutability: 'nonpayable', + type: 'function', + }, + { + constant: false, + inputs: [ + { + internalType: 'address', + name: 'hmyTokenAddr', + type: 'address', + }, + { + internalType: 'address', + name: 'userAddr', + type: 'address', + }, + { + internalType: 'uint256', + name: 'amount', + type: 'uint256', + }, + { + internalType: 'address', + name: 'recipient', + type: 'address', + }, + ], + name: 'lockTokenFor', + outputs: [], + payable: false, + stateMutability: 'nonpayable', + type: 'function', + }, + { + constant: false, + inputs: [ + { + internalType: 'uint256', + name: 'amount', + type: 'uint256', + }, + { + internalType: 'address payable', + name: 'recipient', + type: 'address', + }, + { + internalType: 'bytes32', + name: 'receiptId', + type: 'bytes32', + }, + ], + name: 'unlockOne', + outputs: [], + payable: false, + stateMutability: 'nonpayable', + type: 'function', + }, + { + constant: false, + inputs: [ + { + internalType: 'address', + name: 'hmyTokenAddr', + type: 'address', + }, + { + internalType: 'uint256', + name: 'amount', + type: 'uint256', + }, + { + internalType: 'address', + name: 'recipient', + type: 'address', + }, + { + internalType: 'bytes32', + name: 'receiptId', + type: 'bytes32', + }, + ], + name: 'unlockToken', + outputs: [], + payable: false, + stateMutability: 'nonpayable', + type: 'function', + }, + { + constant: true, + inputs: [ + { + internalType: 'bytes32', + name: '', + type: 'bytes32', + }, + ], + name: 'usedEvents_', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + payable: false, + stateMutability: 'view', + type: 'function', + }, + { + constant: true, + inputs: [], + name: 'wallet', + outputs: [ + { + internalType: 'address', + name: '', + type: 'address', + }, + ], + payable: false, + stateMutability: 'view', + type: 'function', + }, +] diff --git a/src/bridge/hrc20HmyManager/index.ts b/src/bridge/hrc20HmyManager/index.ts new file mode 100644 index 0000000..d4df8ca --- /dev/null +++ b/src/bridge/hrc20HmyManager/index.ts @@ -0,0 +1,53 @@ +import { ContractOptions } from '@harmony-js/contract/dist/utils/options' +import { Transaction } from '@harmony-js/transaction' +import { BaseContract } from '../../contracts' +import { BNish, ContractProviderType, ITransactionOptions } from '../../interfaces' +import ABI from './abi' + +export class HRC20HmyManager extends BaseContract { + constructor(address: string, provider: ContractProviderType, options?: ContractOptions) { + super(address, ABI, provider, options) + } + + public async lockToken( + hmyTokenAddr: string, + amount: BNish, + recipient: string, + txOptions?: ITransactionOptions, + ): Promise { + return this.send('lockToken', [hmyTokenAddr, amount, recipient], txOptions) + } + + public async lockTokenFor( + hmyTokenAddr: string, + userAddr: string, + amount: BNish, + recipient: string, + txOptions?: ITransactionOptions, + ): Promise { + return this.send('lockTokenFor', [hmyTokenAddr, userAddr, amount, recipient], txOptions) + } + + public async unlockToken( + hmyTokenAddr: string, + amount: BNish, + recipient: string, + receiptId: string, + txOptions?: ITransactionOptions, + ): Promise { + return this.send('unlockToken', [hmyTokenAddr, amount, recipient, receiptId], txOptions) + } + + public async lockOne(amount: BNish, recipient: string, txOptions?: ITransactionOptions): Promise { + return this.send('lockOne', [amount, recipient], txOptions) + } + + public async unlockOne( + amount: BNish, + recipient: string, + receiptId: string, + txOptions?: ITransactionOptions, + ): Promise { + return this.send('unlockOne', [amount, recipient, receiptId], txOptions) + } +} diff --git a/src/bridge/hrc20TokenManager/abi.ts b/src/bridge/hrc20TokenManager/abi.ts new file mode 100644 index 0000000..a124cbc --- /dev/null +++ b/src/bridge/hrc20TokenManager/abi.ts @@ -0,0 +1,248 @@ +export default [ + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'previousOwner', + type: 'address', + }, + { + indexed: true, + internalType: 'address', + name: 'newOwner', + type: 'address', + }, + ], + name: 'OwnershipTransferred', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'tokenReq', + type: 'address', + }, + { + indexed: true, + internalType: 'address', + name: 'tokenAck', + type: 'address', + }, + ], + name: 'TokenMapAck', + type: 'event', + }, + { + constant: false, + inputs: [ + { + internalType: 'address', + name: 'ethTokenAddr', + type: 'address', + }, + { + internalType: 'string', + name: 'name', + type: 'string', + }, + { + internalType: 'string', + name: 'symbol', + type: 'string', + }, + { + internalType: 'uint8', + name: 'decimals', + type: 'uint8', + }, + ], + name: 'addToken', + outputs: [ + { + internalType: 'address', + name: '', + type: 'address', + }, + ], + payable: false, + stateMutability: 'nonpayable', + type: 'function', + }, + { + constant: false, + inputs: [ + { + internalType: 'address', + name: 'guy', + type: 'address', + }, + ], + name: 'deny', + outputs: [], + payable: false, + stateMutability: 'nonpayable', + type: 'function', + }, + { + constant: true, + inputs: [], + name: 'isOwner', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + payable: false, + stateMutability: 'view', + type: 'function', + }, + { + constant: true, + inputs: [ + { + internalType: 'address', + name: '', + type: 'address', + }, + ], + name: 'mappedTokens', + outputs: [ + { + internalType: 'address', + name: '', + type: 'address', + }, + ], + payable: false, + stateMutability: 'view', + type: 'function', + }, + { + constant: true, + inputs: [], + name: 'owner', + outputs: [ + { + internalType: 'address', + name: '', + type: 'address', + }, + ], + payable: false, + stateMutability: 'view', + type: 'function', + }, + { + constant: false, + inputs: [ + { + internalType: 'address', + name: 'ethTokenAddr', + type: 'address', + }, + { + internalType: 'address', + name: 'oneTokenAddr', + type: 'address', + }, + ], + name: 'registerToken', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + payable: false, + stateMutability: 'nonpayable', + type: 'function', + }, + { + constant: false, + inputs: [ + { + internalType: 'address', + name: 'guy', + type: 'address', + }, + ], + name: 'rely', + outputs: [], + payable: false, + stateMutability: 'nonpayable', + type: 'function', + }, + { + constant: false, + inputs: [ + { + internalType: 'address', + name: 'ethTokenAddr', + type: 'address', + }, + { + internalType: 'uint256', + name: 'supply', + type: 'uint256', + }, + ], + name: 'removeToken', + outputs: [], + payable: false, + stateMutability: 'nonpayable', + type: 'function', + }, + { + constant: false, + inputs: [], + name: 'renounceOwnership', + outputs: [], + payable: false, + stateMutability: 'nonpayable', + type: 'function', + }, + { + constant: false, + inputs: [ + { + internalType: 'address', + name: 'newOwner', + type: 'address', + }, + ], + name: 'transferOwnership', + outputs: [], + payable: false, + stateMutability: 'nonpayable', + type: 'function', + }, + { + constant: true, + inputs: [ + { + internalType: 'address', + name: '', + type: 'address', + }, + ], + name: 'wards', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + payable: false, + stateMutability: 'view', + type: 'function', + }, +] diff --git a/src/bridge/hrc20TokenManager/index.ts b/src/bridge/hrc20TokenManager/index.ts new file mode 100644 index 0000000..8932a09 --- /dev/null +++ b/src/bridge/hrc20TokenManager/index.ts @@ -0,0 +1,46 @@ +import { Signer } from '@ethersproject/abstract-signer' +import { BigNumberish } from '@ethersproject/bignumber' +import { CallOverrides } from '@ethersproject/contracts' +import { TransactionReceipt } from '@ethersproject/providers' +import { EthBaseContract } from '../../contracts' +import ABI from './abi' + +export class HRC20TokenManager extends EthBaseContract { + constructor(address: string, signer: Signer) { + super(address, ABI, signer) + } + + public async rely(address: string, txOptions?: CallOverrides): Promise { + return this.write('rely', [address], txOptions) + } + + public async deny(address: string, txOptions?: CallOverrides): Promise { + return this.write('deny', [address], txOptions) + } + + public async addToken( + ethTokenAddr: string, + name: string, + symbol: string, + decimals: BigNumberish, + txOptions?: CallOverrides, + ): Promise { + return this.write('addToken', [ethTokenAddr, name, symbol, decimals], txOptions) + } + + public async registerToken( + ethTokenAddr: string, + oneTokenAddr: string, + txOptions?: CallOverrides, + ): Promise { + return this.write('registerToken', [ethTokenAddr, oneTokenAddr], txOptions) + } + + public async removeToken( + ethTokenAddr: string, + supply: BigNumberish, + txOptions?: CallOverrides, + ): Promise { + return this.write('removeToken', [ethTokenAddr, supply], txOptions) + } +} diff --git a/src/bridge/hrc721/abi.ts b/src/bridge/hrc721/abi.ts new file mode 100644 index 0000000..5f4206b --- /dev/null +++ b/src/bridge/hrc721/abi.ts @@ -0,0 +1,626 @@ +export default [ + { + inputs: [ + { + internalType: 'string', + name: 'name', + type: 'string', + }, + { + internalType: 'string', + name: 'symbol', + type: 'string', + }, + { + internalType: 'string', + name: 'baseURI', + type: 'string', + }, + ], + payable: false, + stateMutability: 'nonpayable', + type: 'constructor', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'owner', + type: 'address', + }, + { + indexed: true, + internalType: 'address', + name: 'approved', + type: 'address', + }, + { + indexed: true, + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + ], + name: 'Approval', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'owner', + type: 'address', + }, + { + indexed: true, + internalType: 'address', + name: 'operator', + type: 'address', + }, + { + indexed: false, + internalType: 'bool', + name: 'approved', + type: 'bool', + }, + ], + name: 'ApprovalForAll', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'account', + type: 'address', + }, + ], + name: 'MinterAdded', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'account', + type: 'address', + }, + ], + name: 'MinterRemoved', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'from', + type: 'address', + }, + { + indexed: true, + internalType: 'address', + name: 'to', + type: 'address', + }, + { + indexed: true, + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + ], + name: 'Transfer', + type: 'event', + }, + { + constant: false, + inputs: [ + { + internalType: 'address', + name: 'account', + type: 'address', + }, + ], + name: 'addMinter', + outputs: [], + payable: false, + stateMutability: 'nonpayable', + type: 'function', + }, + { + constant: false, + inputs: [ + { + internalType: 'address', + name: 'to', + type: 'address', + }, + { + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + ], + name: 'approve', + outputs: [], + payable: false, + stateMutability: 'nonpayable', + type: 'function', + }, + { + constant: true, + inputs: [ + { + internalType: 'address', + name: 'owner', + type: 'address', + }, + ], + name: 'balanceOf', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + payable: false, + stateMutability: 'view', + type: 'function', + }, + { + constant: true, + inputs: [], + name: 'baseURI', + outputs: [ + { + internalType: 'string', + name: '', + type: 'string', + }, + ], + payable: false, + stateMutability: 'view', + type: 'function', + }, + { + constant: false, + inputs: [ + { + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + ], + name: 'burn', + outputs: [], + payable: false, + stateMutability: 'nonpayable', + type: 'function', + }, + { + constant: true, + inputs: [ + { + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + ], + name: 'getApproved', + outputs: [ + { + internalType: 'address', + name: '', + type: 'address', + }, + ], + payable: false, + stateMutability: 'view', + type: 'function', + }, + { + constant: true, + inputs: [ + { + internalType: 'address', + name: 'owner', + type: 'address', + }, + { + internalType: 'address', + name: 'operator', + type: 'address', + }, + ], + name: 'isApprovedForAll', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + payable: false, + stateMutability: 'view', + type: 'function', + }, + { + constant: true, + inputs: [ + { + internalType: 'address', + name: 'account', + type: 'address', + }, + ], + name: 'isMinter', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + payable: false, + stateMutability: 'view', + type: 'function', + }, + { + constant: false, + inputs: [ + { + internalType: 'address', + name: 'to', + type: 'address', + }, + { + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + ], + name: 'mint', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + payable: false, + stateMutability: 'nonpayable', + type: 'function', + }, + { + constant: true, + inputs: [], + name: 'name', + outputs: [ + { + internalType: 'string', + name: '', + type: 'string', + }, + ], + payable: false, + stateMutability: 'view', + type: 'function', + }, + { + constant: true, + inputs: [ + { + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + ], + name: 'ownerOf', + outputs: [ + { + internalType: 'address', + name: '', + type: 'address', + }, + ], + payable: false, + stateMutability: 'view', + type: 'function', + }, + { + constant: false, + inputs: [], + name: 'renounceMinter', + outputs: [], + payable: false, + stateMutability: 'nonpayable', + type: 'function', + }, + { + constant: false, + inputs: [ + { + internalType: 'address', + name: 'to', + type: 'address', + }, + { + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + { + internalType: 'bytes', + name: '_data', + type: 'bytes', + }, + ], + name: 'safeMint', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + payable: false, + stateMutability: 'nonpayable', + type: 'function', + }, + { + constant: false, + inputs: [ + { + internalType: 'address', + name: 'to', + type: 'address', + }, + { + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + ], + name: 'safeMint', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + payable: false, + stateMutability: 'nonpayable', + type: 'function', + }, + { + constant: false, + inputs: [ + { + internalType: 'address', + name: 'from', + type: 'address', + }, + { + internalType: 'address', + name: 'to', + type: 'address', + }, + { + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + ], + name: 'safeTransferFrom', + outputs: [], + payable: false, + stateMutability: 'nonpayable', + type: 'function', + }, + { + constant: false, + inputs: [ + { + internalType: 'address', + name: 'from', + type: 'address', + }, + { + internalType: 'address', + name: 'to', + type: 'address', + }, + { + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + { + internalType: 'bytes', + name: '_data', + type: 'bytes', + }, + ], + name: 'safeTransferFrom', + outputs: [], + payable: false, + stateMutability: 'nonpayable', + type: 'function', + }, + { + constant: false, + inputs: [ + { + internalType: 'address', + name: 'to', + type: 'address', + }, + { + internalType: 'bool', + name: 'approved', + type: 'bool', + }, + ], + name: 'setApprovalForAll', + outputs: [], + payable: false, + stateMutability: 'nonpayable', + type: 'function', + }, + { + constant: true, + inputs: [ + { + internalType: 'bytes4', + name: 'interfaceId', + type: 'bytes4', + }, + ], + name: 'supportsInterface', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + payable: false, + stateMutability: 'view', + type: 'function', + }, + { + constant: true, + inputs: [], + name: 'symbol', + outputs: [ + { + internalType: 'string', + name: '', + type: 'string', + }, + ], + payable: false, + stateMutability: 'view', + type: 'function', + }, + { + constant: true, + inputs: [ + { + internalType: 'uint256', + name: 'index', + type: 'uint256', + }, + ], + name: 'tokenByIndex', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + payable: false, + stateMutability: 'view', + type: 'function', + }, + { + constant: true, + inputs: [ + { + internalType: 'address', + name: 'owner', + type: 'address', + }, + { + internalType: 'uint256', + name: 'index', + type: 'uint256', + }, + ], + name: 'tokenOfOwnerByIndex', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + payable: false, + stateMutability: 'view', + type: 'function', + }, + { + constant: true, + inputs: [ + { + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + ], + name: 'tokenURI', + outputs: [ + { + internalType: 'string', + name: '', + type: 'string', + }, + ], + payable: false, + stateMutability: 'view', + type: 'function', + }, + { + constant: true, + inputs: [], + name: 'totalSupply', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + payable: false, + stateMutability: 'view', + type: 'function', + }, + { + constant: false, + inputs: [ + { + internalType: 'address', + name: 'from', + type: 'address', + }, + { + internalType: 'address', + name: 'to', + type: 'address', + }, + { + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + ], + name: 'transferFrom', + outputs: [], + payable: false, + stateMutability: 'nonpayable', + type: 'function', + }, +] diff --git a/src/tests/contracts/HRC721/abi.ts b/src/bridge/hrc721EthManager/abi.ts similarity index 64% rename from src/tests/contracts/HRC721/abi.ts rename to src/bridge/hrc721EthManager/abi.ts index 6edb149..3531b67 100644 --- a/src/tests/contracts/HRC721/abi.ts +++ b/src/bridge/hrc721EthManager/abi.ts @@ -1,94 +1,108 @@ -export const ABI: any = [ +export default [ { - constant: false, inputs: [ { internalType: 'address', - name: 'to', + name: '_wallet', type: 'address', }, - { - internalType: 'uint256', - name: 'tokenId', - type: 'uint256', - }, ], - name: 'approve', - outputs: [], payable: false, stateMutability: 'nonpayable', - type: 'function', + type: 'constructor', }, { - constant: false, + anonymous: false, inputs: [ { + indexed: true, internalType: 'address', - name: 'to', + name: 'token', type: 'address', }, { + indexed: true, + internalType: 'address', + name: 'sender', + type: 'address', + }, + { + indexed: false, internalType: 'uint256', name: 'tokenId', type: 'uint256', }, + { + indexed: false, + internalType: 'address', + name: 'recipient', + type: 'address', + }, ], - name: 'mint', - outputs: [], - payable: false, - stateMutability: 'nonpayable', - type: 'function', + name: 'Burned', + type: 'event', }, { - constant: false, + anonymous: false, inputs: [ { + indexed: false, internalType: 'address', - name: 'from', + name: 'oneToken', type: 'address', }, { + indexed: false, + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + { + indexed: false, internalType: 'address', - name: 'to', + name: 'recipient', type: 'address', }, { - internalType: 'uint256', - name: 'tokenId', - type: 'uint256', + indexed: false, + internalType: 'bytes32', + name: 'receiptId', + type: 'bytes32', }, ], - name: 'safeTransferFrom', - outputs: [], - payable: false, - stateMutability: 'nonpayable', - type: 'function', + name: 'Minted', + type: 'event', }, { constant: false, inputs: [ { internalType: 'address', - name: 'from', + name: 'tokenManager', type: 'address', }, { internalType: 'address', - name: 'to', + name: 'ethTokenAddr', type: 'address', }, { - internalType: 'uint256', - name: 'tokenId', - type: 'uint256', + internalType: 'string', + name: 'name', + type: 'string', }, { - internalType: 'bytes', - name: '_data', - type: 'bytes', + internalType: 'string', + name: 'symbol', + type: 'string', + }, + { + internalType: 'string', + name: 'baseURI', + type: 'string', }, ], - name: 'safeTransferFrom', + name: 'addToken', outputs: [], payable: false, stateMutability: 'nonpayable', @@ -99,16 +113,21 @@ export const ABI: any = [ inputs: [ { internalType: 'address', - name: 'to', + name: 'oneToken', type: 'address', }, { - internalType: 'bool', - name: 'approved', - type: 'bool', + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + { + internalType: 'address', + name: 'recipient', + type: 'address', }, ], - name: 'setApprovalForAll', + name: 'burnToken', outputs: [], payable: false, stateMutability: 'nonpayable', @@ -119,190 +138,142 @@ export const ABI: any = [ inputs: [ { internalType: 'address', - name: 'from', + name: 'oneToken', type: 'address', }, { - internalType: 'address', - name: 'to', - type: 'address', + internalType: 'uint256[]', + name: 'tokenIds', + type: 'uint256[]', }, { - internalType: 'uint256', - name: 'tokenId', - type: 'uint256', + internalType: 'address', + name: 'recipient', + type: 'address', }, ], - name: 'transferFrom', + name: 'burnTokens', outputs: [], payable: false, stateMutability: 'nonpayable', type: 'function', }, { - inputs: [], - payable: false, - stateMutability: 'nonpayable', - type: 'constructor', - }, - { - anonymous: false, + constant: true, inputs: [ { - indexed: true, internalType: 'address', - name: 'from', + name: '', type: 'address', }, + ], + name: 'mappings', + outputs: [ { - indexed: true, internalType: 'address', - name: 'to', + name: '', type: 'address', }, - { - indexed: true, - internalType: 'uint256', - name: 'tokenId', - type: 'uint256', - }, ], - name: 'Transfer', - type: 'event', + payable: false, + stateMutability: 'view', + type: 'function', }, { - anonymous: false, + constant: false, inputs: [ { - indexed: true, - internalType: 'address', - name: 'owner', - type: 'address', - }, - { - indexed: true, internalType: 'address', - name: 'approved', + name: 'oneToken', type: 'address', }, { - indexed: true, internalType: 'uint256', name: 'tokenId', type: 'uint256', }, - ], - name: 'Approval', - type: 'event', - }, - { - anonymous: false, - inputs: [ { - indexed: true, internalType: 'address', - name: 'owner', + name: 'recipient', type: 'address', }, { - indexed: true, - internalType: 'address', - name: 'operator', - type: 'address', - }, - { - indexed: false, - internalType: 'bool', - name: 'approved', - type: 'bool', + internalType: 'bytes32', + name: 'receiptId', + type: 'bytes32', }, ], - name: 'ApprovalForAll', - type: 'event', + name: 'mintToken', + outputs: [], + payable: false, + stateMutability: 'nonpayable', + type: 'function', }, { - constant: true, + constant: false, inputs: [ { internalType: 'address', - name: 'owner', + name: 'oneToken', type: 'address', }, - ], - name: 'balanceOf', - outputs: [ { - internalType: 'uint256', - name: '', - type: 'uint256', + internalType: 'uint256[]', + name: 'tokenIds', + type: 'uint256[]', }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - }, - { - constant: true, - inputs: [ - { - internalType: 'uint256', - name: 'tokenId', - type: 'uint256', - }, - ], - name: 'getApproved', - outputs: [ { internalType: 'address', - name: '', + name: 'recipient', type: 'address', }, + { + internalType: 'bytes32', + name: 'receiptId', + type: 'bytes32', + }, ], + name: 'mintTokens', + outputs: [], payable: false, - stateMutability: 'view', + stateMutability: 'nonpayable', type: 'function', }, { - constant: true, + constant: false, inputs: [ { internalType: 'address', - name: 'owner', + name: 'tokenManager', type: 'address', }, { internalType: 'address', - name: 'operator', + name: 'ethTokenAddr', type: 'address', }, ], - name: 'isApprovedForAll', - outputs: [ - { - internalType: 'bool', - name: '', - type: 'bool', - }, - ], + name: 'removeToken', + outputs: [], payable: false, - stateMutability: 'view', + stateMutability: 'nonpayable', type: 'function', }, { constant: true, inputs: [ { - internalType: 'uint256', - name: 'tokenId', - type: 'uint256', + internalType: 'bytes32', + name: '', + type: 'bytes32', }, ], - name: 'ownerOf', + name: 'usedEvents_', outputs: [ { - internalType: 'address', + internalType: 'bool', name: '', - type: 'address', + type: 'bool', }, ], payable: false, @@ -311,19 +282,13 @@ export const ABI: any = [ }, { constant: true, - inputs: [ - { - internalType: 'bytes4', - name: 'interfaceId', - type: 'bytes4', - }, - ], - name: 'supportsInterface', + inputs: [], + name: 'wallet', outputs: [ { - internalType: 'bool', + internalType: 'address', name: '', - type: 'bool', + type: 'address', }, ], payable: false, diff --git a/src/bridge/hrc721EthManager/index.ts b/src/bridge/hrc721EthManager/index.ts new file mode 100644 index 0000000..c327d90 --- /dev/null +++ b/src/bridge/hrc721EthManager/index.ts @@ -0,0 +1,73 @@ +import { Signer } from '@ethersproject/abstract-signer' +import { BigNumberish } from '@ethersproject/bignumber' +import { CallOverrides } from '@ethersproject/contracts' +import { TransactionReceipt } from '@ethersproject/providers' +import { EthBaseContract } from '../../contracts' +import ABI from './abi' + +export class HRC721EthManager extends EthBaseContract { + constructor(address: string, signer: Signer) { + super(address, ABI, signer) + } + + public async addToken( + tokenManager: string, + ethTokenAddr: string, + name: string, + symbol: string, + tokenURI: string, + txOptions?: CallOverrides, + ): Promise { + return this.write('addToken', [tokenManager, ethTokenAddr, name, symbol, tokenURI], txOptions) + } + + public async removeToken( + tokenManager: string, + ethTokenAddr: string, + txOptions?: CallOverrides, + ): Promise { + return this.write('removeToken', [tokenManager, ethTokenAddr], txOptions) + } + + public async burnToken( + oneToken: string, + tokenId: BigNumberish, + recipient: string, + txOptions?: CallOverrides, + ): Promise { + return this.write('burnToken', [oneToken, tokenId, recipient], txOptions) + } + + public async burnTokens( + oneToken: string, + tokenIds: BigNumberish[], + recipient: string, + txOptions?: CallOverrides, + ): Promise { + return this.write('burnTokens', [oneToken, tokenIds, recipient], txOptions) + } + + public async mintToken( + oneToken: string, + tokenId: BigNumberish, + recipient: string, + receiptId: string, + txOptions?: CallOverrides, + ): Promise { + return this.write('mintToken', [oneToken, tokenId, recipient, receiptId], txOptions) + } + + public async mintTokens( + oneToken: string, + tokenIds: BigNumberish[], + recipient: string, + receiptId: string, + txOptions?: CallOverrides, + ): Promise { + return this.write('mintTokens', [oneToken, tokenIds, recipient, receiptId], txOptions) + } + + public async mappings(hrc721Addr: string): Promise { + return this.read('mappings', [hrc721Addr]) + } +} diff --git a/src/bridge/hrc721HmyManager/abi.ts b/src/bridge/hrc721HmyManager/abi.ts new file mode 100644 index 0000000..715e9ff --- /dev/null +++ b/src/bridge/hrc721HmyManager/abi.ts @@ -0,0 +1,481 @@ +export default [ + { + inputs: [ + { + internalType: 'address', + name: '_wallet', + type: 'address', + }, + ], + payable: false, + stateMutability: 'nonpayable', + type: 'constructor', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'token', + type: 'address', + }, + { + indexed: true, + internalType: 'address', + name: 'sender', + type: 'address', + }, + { + indexed: false, + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + { + indexed: false, + internalType: 'address', + name: 'recipient', + type: 'address', + }, + ], + name: 'Locked', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'address', + name: 'ethToken', + type: 'address', + }, + { + indexed: false, + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + { + indexed: false, + internalType: 'address', + name: 'recipient', + type: 'address', + }, + { + indexed: false, + internalType: 'bytes32', + name: 'receiptId', + type: 'bytes32', + }, + ], + name: 'Unlocked', + type: 'event', + }, + { + constant: false, + inputs: [ + { + internalType: 'address', + name: 'ethTokenAddr', + type: 'address', + }, + { + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + { + internalType: 'address', + name: 'recipient', + type: 'address', + }, + { + internalType: 'uint256', + name: 'amount', + type: 'uint256', + }, + { + internalType: 'bytes', + name: 'data', + type: 'bytes', + }, + ], + name: 'lockNFT1155Token', + outputs: [], + payable: false, + stateMutability: 'nonpayable', + type: 'function', + }, + { + constant: false, + inputs: [ + { + internalType: 'address', + name: 'ethTokenAddr', + type: 'address', + }, + { + internalType: 'uint256[]', + name: 'tokenIds', + type: 'uint256[]', + }, + { + internalType: 'address', + name: 'recipient', + type: 'address', + }, + ], + name: 'lockNFT1155Tokens', + outputs: [], + payable: false, + stateMutability: 'nonpayable', + type: 'function', + }, + { + constant: false, + inputs: [ + { + internalType: 'address', + name: 'ethTokenAddr', + type: 'address', + }, + { + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + { + internalType: 'address', + name: 'recipient', + type: 'address', + }, + ], + name: 'lockNFT721Token', + outputs: [], + payable: false, + stateMutability: 'nonpayable', + type: 'function', + }, + { + constant: false, + inputs: [ + { + internalType: 'address', + name: 'ethTokenAddr', + type: 'address', + }, + { + internalType: 'uint256[]', + name: 'tokenIds', + type: 'uint256[]', + }, + { + internalType: 'address', + name: 'recipient', + type: 'address', + }, + ], + name: 'lockTokens', + outputs: [], + payable: false, + stateMutability: 'nonpayable', + type: 'function', + }, + { + constant: false, + inputs: [ + { + internalType: 'address', + name: '', + type: 'address', + }, + { + internalType: 'address', + name: '', + type: 'address', + }, + { + internalType: 'uint256[]', + name: '', + type: 'uint256[]', + }, + { + internalType: 'uint256[]', + name: '', + type: 'uint256[]', + }, + { + internalType: 'bytes', + name: '', + type: 'bytes', + }, + ], + name: 'onERC1155BatchReceived', + outputs: [ + { + internalType: 'bytes4', + name: '', + type: 'bytes4', + }, + ], + payable: false, + stateMutability: 'nonpayable', + type: 'function', + }, + { + constant: false, + inputs: [ + { + internalType: 'address', + name: '', + type: 'address', + }, + { + internalType: 'address', + name: '', + type: 'address', + }, + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + { + internalType: 'bytes', + name: '', + type: 'bytes', + }, + ], + name: 'onERC1155Received', + outputs: [ + { + internalType: 'bytes4', + name: '', + type: 'bytes4', + }, + ], + payable: false, + stateMutability: 'nonpayable', + type: 'function', + }, + { + constant: false, + inputs: [ + { + internalType: 'address', + name: '', + type: 'address', + }, + { + internalType: 'address', + name: '', + type: 'address', + }, + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + { + internalType: 'bytes', + name: '', + type: 'bytes', + }, + ], + name: 'onERC721Received', + outputs: [ + { + internalType: 'bytes4', + name: '', + type: 'bytes4', + }, + ], + payable: false, + stateMutability: 'nonpayable', + type: 'function', + }, + { + constant: true, + inputs: [ + { + internalType: 'bytes4', + name: 'interfaceID', + type: 'bytes4', + }, + ], + name: 'supportsInterface', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + payable: false, + stateMutability: 'view', + type: 'function', + }, + { + constant: false, + inputs: [ + { + internalType: 'address', + name: 'ethTokenAddr', + type: 'address', + }, + { + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + { + internalType: 'address', + name: 'recipient', + type: 'address', + }, + { + internalType: 'bytes32', + name: 'receiptId', + type: 'bytes32', + }, + ], + name: 'unlockNFT1155Token', + outputs: [], + payable: false, + stateMutability: 'nonpayable', + type: 'function', + }, + { + constant: false, + inputs: [ + { + internalType: 'address', + name: 'ethTokenAddr', + type: 'address', + }, + { + internalType: 'uint256[]', + name: 'tokenIds', + type: 'uint256[]', + }, + { + internalType: 'address', + name: 'recipient', + type: 'address', + }, + { + internalType: 'bytes32', + name: 'receiptId', + type: 'bytes32', + }, + ], + name: 'unlockNFT1155Tokens', + outputs: [], + payable: false, + stateMutability: 'nonpayable', + type: 'function', + }, + { + constant: false, + inputs: [ + { + internalType: 'address', + name: 'ethTokenAddr', + type: 'address', + }, + { + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + { + internalType: 'address', + name: 'recipient', + type: 'address', + }, + { + internalType: 'bytes32', + name: 'receiptId', + type: 'bytes32', + }, + ], + name: 'unlockToken', + outputs: [], + payable: false, + stateMutability: 'nonpayable', + type: 'function', + }, + { + constant: false, + inputs: [ + { + internalType: 'address', + name: 'ethTokenAddr', + type: 'address', + }, + { + internalType: 'uint256[]', + name: 'tokenIds', + type: 'uint256[]', + }, + { + internalType: 'address', + name: 'recipient', + type: 'address', + }, + { + internalType: 'bytes32', + name: 'receiptId', + type: 'bytes32', + }, + ], + name: 'unlockTokens', + outputs: [], + payable: false, + stateMutability: 'nonpayable', + type: 'function', + }, + { + constant: true, + inputs: [ + { + internalType: 'bytes32', + name: '', + type: 'bytes32', + }, + ], + name: 'usedEvents_', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + payable: false, + stateMutability: 'view', + type: 'function', + }, + { + constant: true, + inputs: [], + name: 'wallet', + outputs: [ + { + internalType: 'address', + name: '', + type: 'address', + }, + ], + payable: false, + stateMutability: 'view', + type: 'function', + }, +] diff --git a/src/bridge/hrc721HmyManager/index.ts b/src/bridge/hrc721HmyManager/index.ts new file mode 100644 index 0000000..b138e6f --- /dev/null +++ b/src/bridge/hrc721HmyManager/index.ts @@ -0,0 +1,88 @@ +import { ContractOptions } from '@harmony-js/contract/dist/utils/options' +import { Transaction } from '@harmony-js/transaction' +import { BaseContract } from '../../contracts' +import { BNish, ContractProviderType, ITransactionOptions } from '../../interfaces' +import ABI from './abi' + +export class HRC721HmyManager extends BaseContract { + constructor(address: string, provider: ContractProviderType, options?: ContractOptions) { + super(address, ABI, provider, options) + } + + public async lockNFT721Token( + ethTokenAddr: string, + tokenId: BNish, + recipient: string, + txOptions?: ITransactionOptions, + ): Promise { + return this.send('lockNFT721Token', [ethTokenAddr, tokenId, recipient], txOptions) + } + + public async lockNFT1155Token( + ethTokenAddr: string, + tokenId: BNish, + recipient: string, + amount: BNish, + txOptions?: ITransactionOptions, + ): Promise { + return this.send('lockNFT1155Token', [ethTokenAddr, tokenId, recipient, amount, []], txOptions) + } + + public async lockTokens( + ethTokenAddr: string, + tokenIds: BNish[], + recipient: string, + txOptions?: ITransactionOptions, + ): Promise { + return this.send('lockTokens', [ethTokenAddr, tokenIds, recipient], txOptions) + } + + public async lockNFT1155Tokens( + ethTokenAddr: string, + tokenIds: BNish[], + recipient: string, + txOptions?: ITransactionOptions, + ): Promise { + return this.send('lockNFT1155Tokens', [ethTokenAddr, tokenIds, recipient], txOptions) + } + + public async unlockToken( + ethTokenAddr: string, + tokenId: BNish, + recipient: string, + receiptId: string, + txOptions?: ITransactionOptions, + ): Promise { + return this.send('unlockToken', [ethTokenAddr, tokenId, recipient, receiptId], txOptions) + } + + public async unlockNFT1155Token( + ethTokenAddr: string, + tokenId: BNish, + recipient: string, + receiptId: string, + txOptions?: ITransactionOptions, + ): Promise { + return this.send('unlockNFT1155Token', [ethTokenAddr, tokenId, recipient, receiptId], txOptions) + } + + public async unlockTokens( + ethTokenAddr: string, + tokenIds: BNish[], + recipient: string, + receiptId: string, + txOptions?: ITransactionOptions, + ): Promise { + return this.send('unlockTokens', [ethTokenAddr, tokenIds, recipient, receiptId], txOptions) + } + + public async unlockNFT1155Tokens( + ethTokenAddr: string, + tokenIds: BNish[], + recipient: string, + receiptId: string, + txOptions?: ITransactionOptions, + ): Promise { + return this.send('unlockNFT1155Tokens', [ethTokenAddr, tokenIds, recipient, receiptId], txOptions) + } +} diff --git a/src/bridge/hrc721TokenManager/abi.ts b/src/bridge/hrc721TokenManager/abi.ts new file mode 100644 index 0000000..7e34546 --- /dev/null +++ b/src/bridge/hrc721TokenManager/abi.ts @@ -0,0 +1,248 @@ +export default [ + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'previousOwner', + type: 'address', + }, + { + indexed: true, + internalType: 'address', + name: 'newOwner', + type: 'address', + }, + ], + name: 'OwnershipTransferred', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'tokenReq', + type: 'address', + }, + { + indexed: true, + internalType: 'address', + name: 'tokenAck', + type: 'address', + }, + ], + name: 'TokenMapAck', + type: 'event', + }, + { + constant: false, + inputs: [ + { + internalType: 'address', + name: 'ethTokenAddr', + type: 'address', + }, + { + internalType: 'string', + name: 'name', + type: 'string', + }, + { + internalType: 'string', + name: 'symbol', + type: 'string', + }, + { + internalType: 'string', + name: 'baseURI', + type: 'string', + }, + ], + name: 'addToken', + outputs: [ + { + internalType: 'address', + name: '', + type: 'address', + }, + ], + payable: false, + stateMutability: 'nonpayable', + type: 'function', + }, + { + constant: false, + inputs: [ + { + internalType: 'address', + name: 'guy', + type: 'address', + }, + ], + name: 'deny', + outputs: [], + payable: false, + stateMutability: 'nonpayable', + type: 'function', + }, + { + constant: true, + inputs: [], + name: 'isOwner', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + payable: false, + stateMutability: 'view', + type: 'function', + }, + { + constant: true, + inputs: [ + { + internalType: 'address', + name: '', + type: 'address', + }, + ], + name: 'mappedTokens', + outputs: [ + { + internalType: 'address', + name: '', + type: 'address', + }, + ], + payable: false, + stateMutability: 'view', + type: 'function', + }, + { + constant: true, + inputs: [], + name: 'owner', + outputs: [ + { + internalType: 'address', + name: '', + type: 'address', + }, + ], + payable: false, + stateMutability: 'view', + type: 'function', + }, + { + constant: false, + inputs: [ + { + internalType: 'address', + name: 'ethTokenAddr', + type: 'address', + }, + { + internalType: 'address', + name: 'oneTokenAddr', + type: 'address', + }, + ], + name: 'registerToken', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + payable: false, + stateMutability: 'nonpayable', + type: 'function', + }, + { + constant: false, + inputs: [ + { + internalType: 'address', + name: 'guy', + type: 'address', + }, + ], + name: 'rely', + outputs: [], + payable: false, + stateMutability: 'nonpayable', + type: 'function', + }, + { + constant: false, + inputs: [ + { + internalType: 'address', + name: 'ethTokenAddr', + type: 'address', + }, + { + internalType: 'uint256', + name: 'supply', + type: 'uint256', + }, + ], + name: 'removeToken', + outputs: [], + payable: false, + stateMutability: 'nonpayable', + type: 'function', + }, + { + constant: false, + inputs: [], + name: 'renounceOwnership', + outputs: [], + payable: false, + stateMutability: 'nonpayable', + type: 'function', + }, + { + constant: false, + inputs: [ + { + internalType: 'address', + name: 'newOwner', + type: 'address', + }, + ], + name: 'transferOwnership', + outputs: [], + payable: false, + stateMutability: 'nonpayable', + type: 'function', + }, + { + constant: true, + inputs: [ + { + internalType: 'address', + name: '', + type: 'address', + }, + ], + name: 'wards', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + payable: false, + stateMutability: 'view', + type: 'function', + }, +] diff --git a/src/bridge/hrc721TokenManager/index.ts b/src/bridge/hrc721TokenManager/index.ts new file mode 100644 index 0000000..dbf1ded --- /dev/null +++ b/src/bridge/hrc721TokenManager/index.ts @@ -0,0 +1,46 @@ +import { Signer } from '@ethersproject/abstract-signer' +import { BigNumberish } from '@ethersproject/bignumber' +import { CallOverrides } from '@ethersproject/contracts' +import { TransactionReceipt } from '@ethersproject/providers' +import { EthBaseContract } from '../../contracts' +import ABI from './abi' + +export class HRC721TokenManager extends EthBaseContract { + constructor(address: string, signer: Signer) { + super(address, ABI, signer) + } + + public async rely(address: string, txOptions?: CallOverrides): Promise { + return this.write('rely', [address], txOptions) + } + + public async deny(address: string, txOptions?: CallOverrides): Promise { + return this.write('deny', [address], txOptions) + } + + public async addToken( + ethTokenAddr: string, + name: string, + symbol: string, + tokenURI: string, + txOptions?: CallOverrides, + ): Promise { + return this.write('addToken', [ethTokenAddr, name, symbol, tokenURI], txOptions) + } + + public async registerToken( + ethTokenAddr: string, + oneTokenAddr: string, + txOptions?: CallOverrides, + ): Promise { + return this.write('registerToken', [ethTokenAddr, oneTokenAddr], txOptions) + } + + public async removeToken( + ethTokenAddr: string, + supply: BigNumberish, + txOptions?: CallOverrides, + ): Promise { + return this.write('removeToken', [ethTokenAddr, supply], txOptions) + } +} diff --git a/src/bridge/index.ts b/src/bridge/index.ts new file mode 100644 index 0000000..44c56d0 --- /dev/null +++ b/src/bridge/index.ts @@ -0,0 +1,14 @@ +export * from './bridgedHrc20Token' +export * from './bridgedHrc721Token' +export * from './bridgedHrc1155Token' +export * from './hrc20EthManager' +export * from './hrc20HmyManager' +export * from './hrc20TokenManager' +export * from './hrc721EthManager' +export * from './hrc721HmyManager' +export * from './hrc721TokenManager' +export * from './hrc1155EthManager' +export * from './hrc1155HmyManager' +export * from './hrc1155TokenManager' +export * from './bridgeHrc20Token' +export * from './bridgeToken' diff --git a/src/constants.ts b/src/constants.ts index 987554e..49de03f 100644 --- a/src/constants.ts +++ b/src/constants.ts @@ -1,19 +1,16 @@ -import { ChainID, ChainType } from '@harmony-js/utils' -import { HarmonyRpcConfig, HarmonyShards } from './interfaces' +import { ChainID, ChainType, Unit } from '@harmony-js/utils' +import { ContractAddresses, HarmonyRpcConfig, HarmonyShards, ITransactionOptions } from './interfaces' export const AddressZero = '0x0000000000000000000000000000000000000000' -export const DEFAULT_GAS_PRICE = '1' // 1 Gwei -export const DEFAULT_GAS_LIMIT = '21000' +export const DEFAULT_GAS_PRICE = '1000000000' +export const DEFAULT_GAS_LIMIT = '3500000' export const HARMONY_RPC_SHARD_0_URL = 'https://api.harmony.one' export const HARMONY_RPC_SHARD_1_URL = 'https://s1.api.harmony.one' export const HARMONY_RPC_SHARD_2_URL = 'https://s2.api.harmony.one' export const HARMONY_RPC_SHARD_3_URL = 'https://s3.api.harmony.one' -export const HARMONY_RPC_SHARD_0_TESTNET_URL = 'https://api.s0.b.hmny.io' -export const HARMONY_RPC_SHARD_1_TESTNET_URL = 'https://api.s1.b.hmny.io' -export const HARMONY_RPC_SHARD_2_TESTNET_URL = 'https://api.s2.b.hmny.io' -export const HARMONY_RPC_SHARD_3_TESTNET_URL = 'https://api.s3.b.hmny.io' +export const HARMONY_RPC_SHARD_0_DEVNET_URL = 'https://api.s0.ps.hmny.io' export const HARMONY_RPC_WS = 'wss://ws.s0.t.hmny.io' -export const HARMONY_RPC_TESTNET_WS = 'wss://ws.s0.b.hmny.io' +export const HARMONY_RPC_DEVNET_WS = 'wss://ws.s0.ps.hmny.io' export const HARMONY_RPC_SHARD_0: HarmonyRpcConfig = { url: HARMONY_RPC_SHARD_0_URL, chainId: ChainID.HmyMainnet, @@ -34,24 +31,9 @@ export const HARMONY_RPC_SHARD_3: HarmonyRpcConfig = { chainId: ChainID.HmyMainnet, chainType: ChainType.Harmony, } -export const HARMONY_RPC_SHARD_0_TESTNET: HarmonyRpcConfig = { - url: HARMONY_RPC_SHARD_0_TESTNET_URL, - chainId: ChainID.HmyTestnet, - chainType: ChainType.Harmony, -} -export const HARMONY_RPC_SHARD_1_TESTNET: HarmonyRpcConfig = { - url: HARMONY_RPC_SHARD_1_TESTNET_URL, - chainId: ChainID.HmyTestnet, - chainType: ChainType.Harmony, -} -export const HARMONY_RPC_SHARD_2_TESTNET: HarmonyRpcConfig = { - url: HARMONY_RPC_SHARD_2_TESTNET_URL, - chainId: ChainID.HmyTestnet, - chainType: ChainType.Harmony, -} -export const HARMONY_RPC_SHARD_3_TESTNET: HarmonyRpcConfig = { - url: HARMONY_RPC_SHARD_3_TESTNET_URL, - chainId: ChainID.HmyTestnet, +export const HARMONY_RPC_SHARD_0_DEVNET: HarmonyRpcConfig = { + url: HARMONY_RPC_SHARD_0_DEVNET_URL, + chainId: 4, chainType: ChainType.Harmony, } @@ -60,8 +42,67 @@ export const HARMONY_SHARDS = { [HarmonyShards.SHARD_1]: HARMONY_RPC_SHARD_1, [HarmonyShards.SHARD_2]: HARMONY_RPC_SHARD_2, [HarmonyShards.SHARD_3]: HARMONY_RPC_SHARD_3, - [HarmonyShards.SHARD_0_TESTNET]: HARMONY_RPC_SHARD_0_TESTNET, - [HarmonyShards.SHARD_1_TESTNET]: HARMONY_RPC_SHARD_1_TESTNET, - [HarmonyShards.SHARD_2_TESTNET]: HARMONY_RPC_SHARD_2_TESTNET, - [HarmonyShards.SHARD_3_TESTNET]: HARMONY_RPC_SHARD_3_TESTNET, + [HarmonyShards.SHARD_0_DEVNET]: HARMONY_RPC_SHARD_0_DEVNET, +} + +export enum NetworkInfo { + MAINNET, + DEVNET, +} + +export enum TokenType { + HRC20, + HRC721, + HRC1155, +} + +export enum BridgeType { + HMY_TO_ETH, + ETH_TO_HMY, +} + +// Harmony owner of the manager contracts +export const MAINNET_MULTISIG_WALLET = '0x715CdDa5e9Ad30A0cEd14940F9997EE611496De6' + +export const MAINNET_HRC20_CONTRACTS_ADDRESSES: ContractAddresses = { + ethManagerAddress: '0x2912885736Ce25E437c0113200254140a709a58d', + hmyManagerAddress: '0xe0c1267f1c63e83472d2b3e25d970740940d752b', + tokenManagerAddress: '0x92591545c6462ad0751c890D15DF5F47846fF4Bf', +} + +export const MAINNET_HRC721_CONTRACTS_ADDRESSES: ContractAddresses = { + ethManagerAddress: '0x426A61A2127fDD1318Ec0EdCe02474f382FdAd30', + hmyManagerAddress: '0xbaf4d51738a42b976c3558b5f983cf4721451499', + tokenManagerAddress: '0xF837fe0Eba85bE14446E546115ef20891E357D2B', +} + +export const MAINNET_HRC1155_CONTRACTS_ADDRESSES: ContractAddresses = { + ethManagerAddress: '0x478279c5A0beb8401De1b4EaCB4863a243a8e3A3', + hmyManagerAddress: '0x4f9b3defb4f61227a7574f2a7adfe2841e1ae20e', + tokenManagerAddress: '0x94da065b27f4a61d6595c2ebb541bb7bd11b6266', +} + +export const DEVNET_MULTISIG_WALLET = '0xC12208C19f895df6BD589fD4F574CCf53992B9F5' + +export const DEVNET_HRC20_CONTRACTS_ADDRESSES: ContractAddresses = { + ethManagerAddress: '0xb6bE28Dc813D52A4740c3FA9C0c04e6542cce48d', + hmyManagerAddress: '0xe494ebf0290833ee655e4edecca95ef82ae60c4e', + tokenManagerAddress: '0x4a9832Aa2b22417Be739b15391Ec386403461f4b', +} + +export const DEVNET_HRC721_CONTRACTS_ADDRESSES: ContractAddresses = { + ethManagerAddress: '0x5c8a5cC4b46C8cdD2C50b3357984086814956DA7', + hmyManagerAddress: '0x2150cbd4a66f8922a21eec68c1c9cafdaca5eddc', + tokenManagerAddress: '0xCda2C033FDD220D987555e9F4934E6E69C5BC4Bd', +} + +export const DEVNET_HRC1155_CONTRACTS_ADDRESSES: ContractAddresses = { + ethManagerAddress: '0x30Ec2A1002D1b099537d243b8A753A328A8f5ff1', + hmyManagerAddress: '0x7bf2fbfd386e61776085bd4b69821145fb8b059f', + tokenManagerAddress: '0x61BC4C52cE08A4BF5A3d5CBcF5d1664842c64f53', +} + +export const DEFAULT_TX_OPTIONS: ITransactionOptions = { + gasPrice: new Unit('30').asGwei().toWei(), + gasLimit: 3500000, } diff --git a/src/contracts/baseContract.ts b/src/contracts/baseContract.ts new file mode 100644 index 0000000..80459c3 --- /dev/null +++ b/src/contracts/baseContract.ts @@ -0,0 +1,110 @@ +import { Account, Wallet } from '@harmony-js/account' +import { Contract as HmyContract } from '@harmony-js/contract' +import { ContractOptions } from '@harmony-js/contract/dist/utils/options' +import { Messenger } from '@harmony-js/network' +import { Transaction } from '@harmony-js/transaction' +import { hexToNumber, numberToHex } from '@harmony-js/utils' +import { DEFAULT_GAS_PRICE } from '../constants' +import { ContractProviderType, ITransactionOptions } from '../interfaces' +import { Key, MnemonicKey, PrivateKey } from '../wallets' + +export class ContractError extends Error { + public readonly type: string + + constructor(message: string, type: string) { + super(message) + this.name = ContractError.name + this.type = type + + Error.captureStackTrace(this, this.constructor) + } +} + +export class HarmonyContract extends HmyContract { + public readonly wallet: Wallet + + constructor(abi: any[], address: string, provider: ContractProviderType, options?: ContractOptions) { + super(abi, address, options, provider) + this.wallet = provider + } +} + +export abstract class BaseContract { + public readonly address: string + public readonly messenger: Messenger + protected readonly _contract: HarmonyContract + protected readonly _provider: ContractProviderType + + constructor(address: string, abi: any[], provider: ContractProviderType, options?: ContractOptions) { + this._contract = new HarmonyContract(abi, address, provider, options) + this._provider = provider + this.address = this._contract.address + this.messenger = this._provider.messenger + } + + protected sanitizeAddress(address: string): string { + return address.toLowerCase() + } + + protected async estimateGas( + method: string, + args: any[] = [], + options: ITransactionOptions = { + gasPrice: DEFAULT_GAS_PRICE, + }, + ): Promise { + let gasLimit = options.gasLimit + + if (!gasLimit) { + const hexValue = await this._contract.methods[method](...args).estimateGas({ + gasPrice: numberToHex(options.gasPrice), + }) + gasLimit = hexToNumber(hexValue) + } + + return { ...options, gasLimit } + } + + public async call(method: string, args: any[] = [], txOptions?: ITransactionOptions): Promise { + const options = await this.estimateGas(method, args, txOptions) + + return this._contract.methods[method](...args).call(options) + } + + public async send(method: string, args: any[] = [], txOptions?: ITransactionOptions): Promise { + const options = await this.estimateGas(method, args, txOptions) + const response: HmyContract = await this._contract.methods[method](...args).send(options) + + if (!response.transaction) { + throw new ContractError('Invalid transaction response', method) + } + + return response.transaction + } + + public setSignerByPrivateKey(privateKey: string): Account { + const account = this._contract.wallet.addByPrivateKey(privateKey) + + // Force the new account as defaultSigner + if (account.address) { + this._contract.wallet.setSigner(account.address) + } + + return account + } + + public setSignerByMnemonic(mnemonic: string, index = 0): Account { + const account = this._contract.wallet.addByMnemonic(mnemonic, index) + + // Force the new account as defaultSigner + if (account.address) { + this._contract.wallet.setSigner(account.address) + } + + return account + } + + public setSignerByKey(key: Key | PrivateKey | MnemonicKey): void { + this._contract.connect(key) + } +} diff --git a/src/contracts/baseToken.ts b/src/contracts/baseToken.ts new file mode 100644 index 0000000..047c142 --- /dev/null +++ b/src/contracts/baseToken.ts @@ -0,0 +1,21 @@ +import BN from 'bn.js' +import { AddressZero } from '../constants' +import { BNish, ITransactionOptions } from '../interfaces' +import { isBNish } from '../utils' +import { BaseContract, ContractError } from './baseContract' + +export abstract class BaseToken extends BaseContract { + protected async getBalance(address: string, id?: BNish, txOptions?: ITransactionOptions): Promise { + if (!address || address === AddressZero) { + throw new ContractError('Invalid address provided', '_getBalance') + } + + const args: any[] = [address] + + if (isBNish(id)) { + args.push(id) + } + + return this.call('balanceOf', args, txOptions) + } +} diff --git a/src/contracts/ethBaseContract.ts b/src/contracts/ethBaseContract.ts new file mode 100644 index 0000000..ae0de35 --- /dev/null +++ b/src/contracts/ethBaseContract.ts @@ -0,0 +1,64 @@ +import { Signer } from '@ethersproject/abstract-signer' +import { BigNumber } from '@ethersproject/bignumber' +import { CallOverrides, Contract, ContractInterface } from '@ethersproject/contracts' +import { Provider, TransactionReceipt } from '@ethersproject/providers' +import { parseUnits, formatUnits } from '@ethersproject/units' + +export class EthBaseContract { + public readonly address: string + public readonly _contract: Contract + + constructor(address: string, abi: ContractInterface, signerOrProvider: Signer | Provider) { + this._contract = new Contract(address, abi, signerOrProvider) + this.address = this._contract.address + } + + private async getGasLimit(methodName: string, args: any[]): Promise { + let gasEstimate: BigNumber + + try { + gasEstimate = await this._contract.estimateGas[methodName](...args) + } catch (gasError: any) { + try { + const errorResult = await this._contract.callStatic[methodName](...args) + + throw new Error( + `Unexpected successful call after failed estimate gas. Gas error: ${gasError.message}, Error: ${errorResult.message}`, + ) + } catch (callStaticError: any) { + throw new Error(`Unexpected issue with estimating the gas, ${callStaticError.message}. Please try again.`) + } + } + + return gasEstimate.mul(BigNumber.from(10000).add(BigNumber.from(1000))).div(BigNumber.from(10000)) + } + + protected async getCallOptions(methodName: string, args: any[]): Promise { + const [gasLimit, fees] = await Promise.all([ + this.getGasLimit(methodName, args), + this._contract.provider.getFeeData(), + ]) + + return { + gasLimit, + maxFeePerGas: parseUnits(formatUnits(fees.maxFeePerGas ?? 0, 'gwei'), 'gwei'), + maxPriorityFeePerGas: parseUnits(formatUnits(fees.maxPriorityFeePerGas ?? 0, 'gwei'), 'gwei'), + } + } + + public async read(methodName: string, args: any[] = []): Promise { + return this._contract[methodName](...args) + } + + public async write(methodName: string, args: any[] = [], txOptions?: CallOverrides): Promise { + let options = txOptions + + if (!options) { + options = await this.getCallOptions(methodName, args) + } + + const tx = await this._contract[methodName](...args, options) + + return tx.wait() + } +} diff --git a/src/contracts/hrc1155.ts b/src/contracts/hrc1155.ts new file mode 100644 index 0000000..c7ca873 --- /dev/null +++ b/src/contracts/hrc1155.ts @@ -0,0 +1,121 @@ +import { Transaction } from '@harmony-js/transaction' +import BN from 'bn.js' +import { AddressZero } from '../constants' +import { BNish, ITransactionOptions } from '../interfaces' +import * as Utils from '../utils' +import { ContractError } from './baseContract' +import { BaseToken } from './baseToken' + +export class HRC1155 extends BaseToken { + public async balanceOf(address: string, id: BNish, txOptions?: ITransactionOptions): Promise { + return this.getBalance(address, id, txOptions) + } + + public async balanceOfBatch(accounts: string[], ids: BNish[], txOptions?: ITransactionOptions): Promise { + if (accounts.length !== ids.length) { + throw new ContractError('Accounts and ids must have the same length', 'balanceOfBatch') + } + + return this.call('balanceOfBatch', [accounts, ids], txOptions) + } + + public async safeTransferFrom( + from: string, + to: string, + id: BNish, + amount: BNish, + data: any, + txOptions?: ITransactionOptions, + ): Promise { + if (to === AddressZero) { + throw new ContractError(`The to cannot be the ${AddressZero}`, 'safeTransferFrom') + } + + return this.send('safeTransferFrom', [from, to, id, amount, data], txOptions) + } + + public async safeBatchTransferFrom( + from: string, + to: string, + ids: BNish[], + amounts: BNish[], + data: any, + txOptions?: ITransactionOptions, + ): Promise { + if (amounts.length !== ids.length) { + throw new ContractError('amounts and ids must have the same length', 'safeBatchTransferFrom') + } + + return this.send('safeBatchTransferFrom', [from, to, ids, amounts, data], txOptions) + } + + public async setApprovalForAll( + addressOperator: string, + approved: boolean, + txOptions?: ITransactionOptions, + ): Promise { + if (!addressOperator) { + throw new Error('You must provide an addressOperator') + } + return this.send('setApprovalForAll', [addressOperator, approved], txOptions) + } + + public async isApprovedForAll(owner: string, operator: string, txOptions?: ITransactionOptions): Promise { + if (!owner || owner === AddressZero) { + throw new ContractError('Invalid owner provided', 'isApprovedForAll') + } + + if (!operator || operator === AddressZero) { + throw new ContractError('Invalid operator provided', 'isApprovedForAll') + } + + return this.call('isApprovedForAll', [owner, operator], txOptions) + } + + public async owner(txOptions?: ITransactionOptions): Promise { + const address = await this.call('owner', [], txOptions) + + return this.sanitizeAddress(address) + } + + public async tokenURIPrefix(txOptions?: ITransactionOptions): Promise { + return this.call('tokenURIPrefix', [], txOptions) + } + + public async contractURI(txOptions?: ITransactionOptions): Promise { + return this.call('contractURI', [], txOptions) + } + + public async totalSupply(id: BNish, txOptions?: ITransactionOptions): Promise { + return this.call('totalSupply', [id], txOptions) + } + + public async tokenURI(tokenId: BNish, txOptions?: ITransactionOptions): Promise { + if (!Utils.isBNish(tokenId)) { + throw new ContractError('You must provide a tokenId', 'uri') + } + + return this.call('uri', [tokenId], txOptions) + } + + public async symbol(txOptions?: ITransactionOptions): Promise { + return this.call('symbol', [], txOptions) + } + + public async name(txOptions?: ITransactionOptions): Promise { + return this.call('name', [], txOptions) + } + + public mint(account: string, tokenId: BNish, amount: BNish, txOptions?: ITransactionOptions): Promise { + return this.send('mint', [account, tokenId, amount, []], txOptions) + } + + public mintBatch( + account: string, + tokenIds: BNish[], + amounts: BNish[], + txOptions?: ITransactionOptions, + ): Promise { + return this.send('mintBatch', [account, tokenIds, amounts, []], txOptions) + } +} diff --git a/src/contracts/hrc20.ts b/src/contracts/hrc20.ts new file mode 100644 index 0000000..f04a004 --- /dev/null +++ b/src/contracts/hrc20.ts @@ -0,0 +1,59 @@ +import { Transaction } from '@harmony-js/transaction' +import BN from 'bn.js' +import { BNish, ITransactionOptions } from '../interfaces' +import { BaseToken } from './baseToken' + +export class HRC20 extends BaseToken { + public async totalSupply(txOptions?: ITransactionOptions): Promise { + return this.call('totalSupply', [], txOptions) + } + + public async balanceOf(address: string, txOptions?: ITransactionOptions): Promise { + return await this.getBalance(address, undefined, txOptions) + } + + public async transfer(to: string, amount: BNish, txOptions?: ITransactionOptions): Promise { + return this.send('transfer', [to, amount], txOptions) + } + + public async allowance(owner: string, spender: string, txOptions?: ITransactionOptions): Promise { + return this.call('allowance', [owner, spender], txOptions) + } + + public async approve(spender: string, amount: BNish, txOptions?: ITransactionOptions): Promise { + return this.send('approve', [spender, amount], txOptions) + } + + public async transferFrom( + from: string, + to: string, + amount: BNish, + txOptions?: ITransactionOptions, + ): Promise { + return this.send('transferFrom', [from, to, amount], txOptions) + } + + public async symbol(txOptions?: ITransactionOptions): Promise { + return this.call('symbol', [], txOptions) + } + + public async name(txOptions?: ITransactionOptions): Promise { + return this.call('name', [], txOptions) + } + + public async decimals(txOptions?: ITransactionOptions): Promise { + return this.call('decimals', [], txOptions) + } + + public mint(account: string, amount: BNish, txOptions?: ITransactionOptions): Promise { + return this.send('mint', [account, amount], txOptions) + } + + public burn(amount: number, txOptions?: ITransactionOptions) { + return this.send('burn', [amount], txOptions) + } + + public burnFrom(account: string, amount: number, txOptions?: ITransactionOptions) { + return this.send('burnFrom', [account, amount], txOptions) + } +} diff --git a/src/hrc721.ts b/src/contracts/hrc721.ts similarity index 51% rename from src/hrc721.ts rename to src/contracts/hrc721.ts index a837a46..e63f381 100644 --- a/src/hrc721.ts +++ b/src/contracts/hrc721.ts @@ -1,22 +1,18 @@ -import { AbiItemModel } from '@harmony-js/contract/dist/models/types' -import { ContractOptions } from '@harmony-js/contract/dist/utils/options' import { Transaction } from '@harmony-js/transaction' import BN from 'bn.js' -import { BaseToken, ContractError } from './base-token' -import { BNish, ContractProviderType, ITransactionOptions } from './interfaces' -import { isBNish } from './utils' +import { AddressZero } from '../constants' +import { BNish, ITransactionOptions } from '../interfaces' +import * as Utils from '../utils' +import { ContractError } from './baseContract' +import { BaseToken } from './baseToken' export class HRC721 extends BaseToken { - constructor(address: string, abi: AbiItemModel[], provider: ContractProviderType, options?: ContractOptions) { - super(address, abi, provider, options) - } - public async balanceOf(address: string, txOptions?: ITransactionOptions): Promise { return await this.getBalance(address, undefined, txOptions) } public async ownerOf(tokenId: BNish, txOptions?: ITransactionOptions): Promise { - if (!isBNish(tokenId)) { + if (!Utils.isBNish(tokenId)) { throw new ContractError('You must provide a tokenId', 'ownerOf') } @@ -55,7 +51,7 @@ export class HRC721 extends BaseToken { } public async getApproved(tokenId: BNish, txOptions?: ITransactionOptions): Promise { - if (!isBNish(tokenId)) { + if (!Utils.isBNish(tokenId)) { throw new ContractError('You must provide a tokenId', 'getApproved') } @@ -64,12 +60,35 @@ export class HRC721 extends BaseToken { return this.sanitizeAddress(address) } - public async totalSupply(txOptions?: ITransactionOptions): Promise { - return this.call('totalSupply', [], txOptions) + public async setApprovalForAll( + addressOperator: string, + approved: boolean, + txOptions?: ITransactionOptions, + ): Promise { + if (!addressOperator) { + throw new Error('You must provide an addressOperator') + } + return this.send('setApprovalForAll', [addressOperator, approved], txOptions) + } + + public async isApprovedForAll(owner: string, operator: string, txOptions?: ITransactionOptions): Promise { + if (!owner || owner === AddressZero) { + throw new ContractError('Invalid owner provided', 'isApprovedForAll') + } + + if (!operator || operator === AddressZero) { + throw new ContractError('Invalid operator provided', 'isApprovedForAll') + } + + return this.call('isApprovedForAll', [owner, operator], txOptions) + } + + public async totalSupply(txOptions?: ITransactionOptions): Promise { + return this.call('totalSupply', [], txOptions) } public async tokenURI(tokenId: BNish, txOptions?: ITransactionOptions): Promise { - if (!isBNish(tokenId)) { + if (!Utils.isBNish(tokenId)) { throw new ContractError('You must provide a tokenId', 'tokenURI') } @@ -83,4 +102,24 @@ export class HRC721 extends BaseToken { public async name(txOptions?: ITransactionOptions): Promise { return this.call('name', [], txOptions) } + + public async increaseAllowance(spender: string, value: BNish, txOptions?: ITransactionOptions): Promise { + return this.send('increaseAllowance', [spender, value], txOptions) + } + + public async decreaseAllowance(spender: string, value: BNish, txOptions?: ITransactionOptions): Promise { + return this.send('decreaseAllowance', [spender, value], txOptions) + } + + public mint(account: string, tokenId: BNish, txOptions?: ITransactionOptions): Promise { + return this.send('mint', [account, tokenId], txOptions) + } + + public safeMint(to: string, tokenId: BNish, txOptions?: ITransactionOptions): Promise { + return this.send('safeMint', [to, tokenId], txOptions) + } + + public burn(tokenId: BNish, txOptions?: ITransactionOptions): Promise { + return this.send('burn', [tokenId], txOptions) + } } diff --git a/src/contracts/index.ts b/src/contracts/index.ts new file mode 100644 index 0000000..94b723b --- /dev/null +++ b/src/contracts/index.ts @@ -0,0 +1,6 @@ +export * from './baseContract' +export * from './baseToken' +export * from './ethBaseContract' +export * from './hrc20' +export * from './hrc721' +export * from './hrc1155' diff --git a/src/game-item.ts b/src/game-item.ts deleted file mode 100644 index f185095..0000000 --- a/src/game-item.ts +++ /dev/null @@ -1,29 +0,0 @@ -import BN from 'bn.js' -import { HRC1155 } from './hrc1155' - -export class GameItems extends HRC1155 { - async getGold(): Promise { - const gold = await this.call('GOLD') - return gold.toNumber() - } - - async getSilver(): Promise { - const silver = await this.call('SILVER') - return silver.toNumber() - } - - async getThorsHammer(): Promise { - const thors = await this.call('THORS_HAMMER') - return thors.toNumber() - } - - async getSword(): Promise { - const sword = await this.call('SWORD') - return sword.toNumber() - } - - async getShield(): Promise { - const shield = await this.call('SHIELD') - return shield.toNumber() - } -} diff --git a/src/hrc1155.ts b/src/hrc1155.ts deleted file mode 100644 index 8be8305..0000000 --- a/src/hrc1155.ts +++ /dev/null @@ -1,69 +0,0 @@ -import { AbiItemModel } from '@harmony-js/contract/dist/models/types' -import { ContractOptions } from '@harmony-js/contract/dist/utils/options' -import { Transaction } from '@harmony-js/transaction' -import BN from 'bn.js' -import { BaseToken, ContractError } from './base-token' -import { AddressZero } from './constants' -import { BNish, ContractProviderType, ITransactionOptions } from './interfaces' - -export class HRC1155 extends BaseToken { - constructor(address: string, abi: AbiItemModel[], provider: ContractProviderType, options?: ContractOptions) { - super(address, abi, provider, options) - } - - public async balanceOf(address: string, id: BNish, txOptions?: ITransactionOptions): Promise { - return this.getBalance(address, id, txOptions) - } - - public async balanceOfBatch(accounts: string[], ids: BNish[], txOptions?: ITransactionOptions): Promise { - if (accounts.length !== ids.length) { - throw new ContractError('Accounts and ids must have the same length', 'balanceOfBatch') - } - - return this.call('balanceOfBatch', [accounts, ids], txOptions) - } - - public async safeTransferFrom( - from: string, - to: string, - id: BNish, - amount: BNish, - data: any, - txOptions?: ITransactionOptions, - ): Promise { - if (to === AddressZero) { - throw new ContractError(`The to cannot be the ${AddressZero}`, 'safeTransferFrom') - } - - return this.send('safeTransferFrom', [from, to, id, amount, data], txOptions) - } - - public async safeBatchTransferFrom( - from: string, - to: string, - ids: BNish[], - amounts: BNish[], - data: any, - txOptions?: ITransactionOptions, - ): Promise { - if (amounts.length !== ids.length) { - throw new ContractError('amounts and ids must have the same length', 'safeBatchTransferFrom') - } - - return this.send('safeBatchTransferFrom', [from, to, ids, amounts, data], txOptions) - } - - public async owner(txOptions?: ITransactionOptions): Promise { - const address = await this.call('owner', [], txOptions) - - return this.sanitizeAddress(address) - } - - public async tokenURIPrefix(txOptions?: ITransactionOptions): Promise { - return this.call('tokenURIPrefix', [], txOptions) - } - - public async contractURI(txOptions?: ITransactionOptions): Promise { - return this.call('contractURI', [], txOptions) - } -} diff --git a/src/index.ts b/src/index.ts index c1e6c01..cbaa7a6 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,10 +1,6 @@ -export * from './base-token' +export * from './bridge' +export * from './contracts' +export * from './wallets' export * from './constants' -export * from './hrc721' -export * from './hrc1155' export * from './interfaces' -export * from './key' -export * from './mnemonic-key' -export * from './private-key' -export * from './hd-key' export * from './utils' diff --git a/src/interfaces.ts b/src/interfaces.ts index f39c29b..19579c1 100644 --- a/src/interfaces.ts +++ b/src/interfaces.ts @@ -3,15 +3,13 @@ import { Arrayish } from '@harmony-js/crypto' import { HttpProvider, WSProvider } from '@harmony-js/network' import { ChainID, ChainType } from '@harmony-js/utils' import BN from 'bn.js' -import { Key } from './key' -import { MnemonicKey } from './mnemonic-key' -import { PrivateKey } from './private-key' +import { Key, MnemonicKey, PrivateKey } from './wallets' export type BNish = BN | Arrayish | bigint | number export interface ITransactionOptions { - gasLimit?: number | string - gasPrice: number | string + gasLimit?: BN | number | string + gasPrice: BN | number | string } export interface HarmonyRpcConfig { @@ -25,10 +23,7 @@ export enum HarmonyShards { SHARD_1 = 'SHARD_1', SHARD_2 = 'SHARD_2', SHARD_3 = 'SHARD_3', - SHARD_0_TESTNET = 'SHARD_0_TESTNET', - SHARD_1_TESTNET = 'SHARD_1_TESTNET', - SHARD_2_TESTNET = 'SHARD_2_TESTNET', - SHARD_3_TESTNET = 'SHARD_3_TESTNET', + SHARD_0_DEVNET = 'SHARD_0_DEVNET', } export type RpcProviderType = string | HttpProvider | WSProvider | HarmonyShards @@ -56,3 +51,32 @@ export interface HDOptions extends MnemonicOptions { gasLimit?: string gasPrice?: string } + +export interface TokenInfo { + ws?: string + waitingFor?: number +} + +export interface HRC20Info extends TokenInfo { + amount: number | string +} + +export interface HRC721Info extends TokenInfo { + tokenId: number | string +} + +export interface HRC1155Info extends TokenInfo { + tokenIds: number[] + amounts: number[] +} + +export interface ContractAddresses { + ethManagerAddress: string + hmyManagerAddress: string + tokenManagerAddress: string +} + +export interface BridgeResponse { + addr: string + receiptId: string +} diff --git a/src/tests/contracts/GameItems/abi.ts b/src/tests/abi/GameItems/abi.ts similarity index 100% rename from src/tests/contracts/GameItems/abi.ts rename to src/tests/abi/GameItems/abi.ts diff --git a/src/tests/contracts/TestToken/abi.ts b/src/tests/abi/TestToken/abi.ts similarity index 100% rename from src/tests/contracts/TestToken/abi.ts rename to src/tests/abi/TestToken/abi.ts diff --git a/src/tests/base-contract.spec.ts b/src/tests/base-contract.spec.ts new file mode 100644 index 0000000..65bb888 --- /dev/null +++ b/src/tests/base-contract.spec.ts @@ -0,0 +1,128 @@ +import { Account } from '@harmony-js/account' +import { ChainID } from '@harmony-js/utils' +import { expect, use } from 'chai' +import chaiAsPromised from 'chai-as-promised' +import sinon from 'sinon' +import { HARMONY_RPC_SHARD_0_DEVNET } from '../constants' +import { BaseContract } from '../contracts' +import { HarmonyShards } from '../interfaces' +import { MnemonicKey, PrivateKey } from '../wallets' +import { TEST_ADDRESS_2, TEST_PK_1, TX_OPTIONS, TOKEN_GOLD, TEST_SEED } from './constants' + +use(chaiAsPromised) + +class TestToken extends BaseContract { + constructor() { + super('0x', [], new PrivateKey(HarmonyShards.SHARD_0_DEVNET, TEST_PK_1, ChainID.HmyPangaea)) + } +} + +describe('Base Contract', () => { + let contract: TestToken + + before(async () => { + contract = new TestToken() + }) + + afterEach(async () => { + sinon.restore() + }) + + it('should be defined', () => { + expect(contract).to.not.be.undefined + }) + + describe('setSignerByPrivateKey', () => { + it('should return an instance of an Account', async () => { + const account = contract.setSignerByPrivateKey(TEST_PK_1) + + expect(account).to.not.be.null + expect(account).to.not.be.undefined + expect(account).to.be.instanceOf(Account) + }) + + it('should throw an error if privateKey is not provided', async () => { + try { + contract.setSignerByPrivateKey('') + } catch (error) { + expect(error).to.not.null + expect(error).to.not.undefined + expect(error).to.be.instanceOf(Error) + } + }) + + it('should throw an error if privateKey is not valid', async () => { + try { + contract.setSignerByPrivateKey('This is a test') + } catch (error) { + expect(error).to.not.null + expect(error).to.not.undefined + expect(error).to.be.instanceOf(Error) + } + }) + + it('should throw an error if type is not valid', async () => { + try { + contract.setSignerByPrivateKey(TEST_ADDRESS_2) + } catch (error) { + expect(error).to.not.null + expect(error).to.not.undefined + expect(error).to.be.instanceOf(Error) + } + }) + }) + + describe('send', () => { + it('should throw an error if method is invalid', async () => { + expect(contract.send('test', [TOKEN_GOLD], TX_OPTIONS)).to.be.rejectedWith(Error) + }) + + it('should throw an error if there is no transaction response', async () => { + const stub = sinon.stub(BaseContract.prototype, 'send') + stub.withArgs('safeTransferFrom', [TEST_ADDRESS_2, '', TOKEN_GOLD, 10, '0x'], TX_OPTIONS).onFirstCall().rejects() + + expect( + contract.send('safeTransferFrom', [TEST_ADDRESS_2, '', TOKEN_GOLD, 10, '0x'], TX_OPTIONS), + ).to.be.rejectedWith(Error) + }) + + it('should throw an error if there is no params', async () => { + const stub = sinon.stub(BaseContract.prototype, 'send') + stub.withArgs('', []).onFirstCall().rejects() + + expect(contract.send('', [])).to.be.rejectedWith(Error) + }) + }) + + describe('setSignerByMnemonic', () => { + it('should return an Account instance', async () => { + const account = contract.setSignerByMnemonic(TEST_SEED) + + expect(account).to.not.be.null + expect(account).to.not.be.undefined + expect(account).to.be.instanceOf(Account) + }) + + it('should throw an error if mnemonic is not valid', async () => { + try { + contract.setSignerByMnemonic('') + } catch (error) { + expect(error).to.not.null + expect(error).to.not.undefined + expect(error).to.be.instanceOf(Error) + } + }) + }) + + describe('setSignerByKey', () => { + it('should throw an error if key is not valid', async () => { + try { + new MnemonicKey(HARMONY_RPC_SHARD_0_DEVNET.url, {}, ChainID.HmyPangaea) + } catch (error) { + expect(error).to.not.null + expect(error).to.not.undefined + expect(error).to.be.instanceOf(Error) + } + }) + }) +}) diff --git a/src/tests/base-token.spec.ts b/src/tests/base-token.spec.ts new file mode 100644 index 0000000..d54f2b1 --- /dev/null +++ b/src/tests/base-token.spec.ts @@ -0,0 +1,79 @@ +import { ChainID } from '@harmony-js/utils' +import BN from 'bn.js' +import { expect, use } from 'chai' +import chaiAsPromised from 'chai-as-promised' +import sinon from 'sinon' +import { AddressZero } from '../constants' +import { BaseToken } from '../contracts' +import { BNish, HarmonyShards, ITransactionOptions } from '../interfaces' +import { PrivateKey } from '../wallets' +import { TEST_PK_1 } from './constants' + +use(chaiAsPromised) + +const abi = [ + { + constant: true, + inputs: [ + { + internalType: 'address', + name: 'owner', + type: 'address', + }, + ], + name: 'balanceOf', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + payable: false, + stateMutability: 'view', + type: 'function', + }, +] + +class TestToken extends BaseToken { + constructor() { + super('0x', abi, new PrivateKey(HarmonyShards.SHARD_0_DEVNET, TEST_PK_1, ChainID.HmyPangaea)) + } + public async balanceOf(address: string, id?: BNish, txOptions?: ITransactionOptions): Promise { + return this.getBalance(address, id, txOptions) + } +} + +describe('Base Token', () => { + let contract: TestToken + + before(async () => { + contract = new TestToken() + }) + + afterEach(async () => { + sinon.restore() + }) + + it('should be defined', () => { + expect(contract).to.not.be.undefined + }) + + describe('balanceOf', () => { + it('should throw an error if address is not provided in HRC1155', async () => { + expect(contract.balanceOf('', 1)).to.be.rejectedWith(Error) + }) + + it('should throw an error if address is not provided in HRC721', async () => { + expect(contract.balanceOf('')).to.be.rejectedWith(Error) + }) + + it('should throw an error if provided address is zero-address in HRC1155', async () => { + expect(contract.balanceOf(AddressZero, 1)).to.be.rejectedWith(Error) + }) + + it('should throw an error if provided address is zero-address in HRC721', async () => { + expect(contract.balanceOf(AddressZero)).to.be.rejectedWith(Error) + }) + }) +}) diff --git a/src/tests/constants.ts b/src/tests/constants.ts index 090d337..4ba2f4c 100644 --- a/src/tests/constants.ts +++ b/src/tests/constants.ts @@ -1,17 +1,20 @@ -import { Transaction } from '@harmony-js/transaction' -import { ChainID } from '@harmony-js/utils' import 'dotenv/config' -import { ITransactionOptions, HDOptions } from 'src/interfaces' +import { BigNumber } from '@ethersproject/bignumber' +import { EtherscanProvider } from '@ethersproject/providers' +import { Wallet } from '@ethersproject/wallet' +import { Transaction } from '@harmony-js/transaction' +import { ChainID, Unit } from '@harmony-js/utils' +import BN from 'bn.js' +import { ITransactionOptions, HDOptions } from '../interfaces' import { HarmonyShards } from '../interfaces' -import { MnemonicKey } from '../mnemonic-key' -import { PrivateKey } from '../private-key' - -export const HARMONY_TESTNET = 'https://api.s0.b.hmny.io/' +import { PrivateKey } from '../wallets' export const TEST_PK_1 = process.env.TEST_PK_1 ?? '' export const TEST_PK_2 = process.env.TEST_PK_2 ?? '' -export const TEST_SEED = - process.env.TEST_SEED ?? 'pablo diego jose francisco de paula juan nepomuceno maria ruiz y picasso' +export const TEST_SEED = process.env.TEST_SEED ?? '' +export const MASTER_PRIVATE_KEY = process.env.MASTER_PRIVATE_KEY ?? '' +export const OWNER_PRIVATE_KEY = process.env.OWNER_PRIVATE_KEY ?? '' +export const API_KEY = process.env.API_KEY ?? '' if (!TEST_PK_1) { throw new Error('TEST_PK_1 must be defined') @@ -21,45 +24,74 @@ if (!TEST_PK_2) { throw new Error('TEST_PK_2 must be defined') } +if (!MASTER_PRIVATE_KEY) { + throw new Error('MASTER_PRIVATE_KEY must be defined') +} + +if (!OWNER_PRIVATE_KEY) { + throw new Error('OWNER_PRIVATE_KEY must be defined') +} + export const WALLET_PROVIDER_TEST_1: PrivateKey = new PrivateKey( - HarmonyShards.SHARD_0_TESTNET, + HarmonyShards.SHARD_0_DEVNET, TEST_PK_1.toLowerCase(), - ChainID.HmyTestnet, + ChainID.HmyPangaea, ) export const WALLET_PROVIDER_TEST_2: PrivateKey = new PrivateKey( - HarmonyShards.SHARD_0_TESTNET, + HarmonyShards.SHARD_0_DEVNET, TEST_PK_2.toLowerCase(), - ChainID.HmyTestnet, + ChainID.HmyPangaea, ) -export const WALLET_PROVIDER_TEST_3: PrivateKey = new MnemonicKey( - HarmonyShards.SHARD_0_TESTNET, - { mnemonic: TEST_SEED }, - ChainID.HmyTestnet, +export const WALLET_HMY_MASTER = new PrivateKey(HarmonyShards.SHARD_0_DEVNET, MASTER_PRIVATE_KEY.toLowerCase(), 4) +export const WALLET_HMY_OWNER = new PrivateKey(HarmonyShards.SHARD_0_DEVNET, OWNER_PRIVATE_KEY.toLowerCase(), 4) + +const ethProvider = new EtherscanProvider( + { + chainId: 4, + name: 'rinkeby', + }, + API_KEY, ) +export const WALLET_ETH_MASTER = new Wallet(MASTER_PRIVATE_KEY.toLowerCase(), ethProvider) +export const WALLET_ETH_OWNER = new Wallet(OWNER_PRIVATE_KEY.toLowerCase(), ethProvider) export const TEST_ADDRESS_1 = WALLET_PROVIDER_TEST_1.accounts[0].toLowerCase() export const TEST_ADDRESS_2 = WALLET_PROVIDER_TEST_2.accounts[0].toLowerCase() -export const TEST_ADDRESS_3 = WALLET_PROVIDER_TEST_3.accounts[0].toLowerCase() + +export const HMY_OWNER_ADDRESS = WALLET_HMY_OWNER.accounts[0].toLowerCase() +export const HMY_MASTER_ADDRESS = WALLET_HMY_MASTER.accounts[0].toLowerCase() +export const ETH_OWNER_ADDRESS = WALLET_ETH_OWNER.address.toLowerCase() +export const ETH_MASTER_ADDRESS = WALLET_ETH_MASTER.address.toLowerCase() export const EMPTY_TEST_ADDRESS = '0x36f41b8a79eca329610d6158f3ea9676bec281b9'.toLowerCase() -export const HRC721_CONTRACT_ADDRESS = '0xF00373c538cca8ac7f2290ffFA425c32459ef10b'.toLowerCase() -export const HRC1155_CONTRACT_ADDRESS = '0xD59AF020E36F710e8fB1e42e05cE48CF6b86D4B4'.toLowerCase() export const TOKEN_GOLD = 0 +export const TOKEN_GOLD_URI = 'fake token gold URI' export const TOKEN_SILVER = 1 export const TOKEN_THORS_HAMMER = 2 export const TOKEN_SWORD = 3 export const TOKEN_SHIELD = 4 export const TX_OPTIONS: ITransactionOptions = { gasLimit: '5000000', - gasPrice: '100', + gasPrice: '0', } export const FAKE_TX_HRC721 = new Transaction({ shardID: 0, from: 'one103su3u5z464w8cz8d5zn85sacsk94g2x2nty0a', - to: '0xF00373c538cca8ac7f2290ffFA425c32459ef10b', + to: '0xa25006B0aF77c1d248685205771bdC848Cda53d1', + gasPrice: '100000000000', + gasLimit: '5000000', + toShardID: 0, + nonce: 165, + chainId: 2, +}) + +export const FAKE_TX = new Transaction({ + shardID: 0, + from: 'one103su3u5z464w8cz8d5zn85sacsk94g2x2nty0a', + to: '0xa25006B0aF77c1d248685205771bdC848Cda53d1', gasPrice: '100000000000', gasLimit: '5000000', toShardID: 0, @@ -67,10 +99,72 @@ export const FAKE_TX_HRC721 = new Transaction({ chainId: 2, }) +export const FAKE_TX_RECEIPT = { + transactionHash: 'fake', + transactionIndex: 'fake', + blockHash: 'fake', + blockNumber: '0x10', + from: 'fake', + to: 'fake', + gasUsed: 'fake', + cumulativeGasUsed: 'fake', + logs: [], + logsBloom: 'fake', + v: 'fake', + r: 'fake', + s: 'fake', +} + +export const FAKE_ETH_TX_RECEIPT = { + to: '', + from: '', + contractAddress: '', + transactionIndex: 0, + root: '', + gasUsed: BigNumber.from(0), + logsBloom: '', + blockHash: '', + transactionHash: '0xfakeHash', + logs: [], + blockNumber: 0, + confirmations: 0, + cumulativeGasUsed: BigNumber.from(0), + effectiveGasPrice: BigNumber.from(0), + byzantium: true, + type: 0, + status: 1, +} + export const FAKE_BALANCE_HRC1155 = '999999999999999999999889' -export const options: HDOptions = { +export const FAKE_SUPPLY: BN = new BN(100) + +export const HD_KEY_OPTIONS: HDOptions = { numberOfAddresses: 1, gasPrice: '100', gasLimit: '5000000', } + +export const E2E_TX_OPTIONS: ITransactionOptions = { + gasPrice: new Unit('30').asGwei().toWei(), + gasLimit: 3500000, +} + +export enum ContractName { + BlockcodersHRC20 = 'BlockcodersHRC20', + BlockcodersHRC721 = 'BlockcodersHRC721', + BlockcodersHRC1155 = 'BlockcodersHRC1155', + BridgedHRC20Token = 'BridgedHRC20Token', + BridgedHRC721Token = 'BridgedHRC721Token', + BridgedHRC1155Token = 'BridgedHRC1155Token', + HRC20EthManager = 'HRC20EthManager', + HRC20HmyManager = 'HRC20HmyManager', + HRC20TokenManager = 'HRC20TokenManager', + HRC721EthManager = 'HRC721EthManager', + HRC721HmyManager = 'HRC721HmyManager', + HRC721TokenManager = 'HRC721TokenManager', + HRC1155EthManager = 'HRC1155EthManager', + HRC1155HmyManager = 'HRC1155HmyManager', + HRC1155TokenManager = 'HRC1155TokenManager', + GameItems = 'GameItems', +} diff --git a/src/tests/contracts/BlockcodersHRC1155.sol b/src/tests/contracts/BlockcodersHRC1155.sol new file mode 100644 index 0000000..40cec02 --- /dev/null +++ b/src/tests/contracts/BlockcodersHRC1155.sol @@ -0,0 +1,55 @@ +pragma solidity 0.5.17; + +import "./ERC1155.sol"; +import "./ERC1155Metadata.sol"; +import "./ERC1155MintBurn.sol"; +import "@openzeppelin/contracts/access/roles/MinterRole.sol"; + +contract BlockcodersHRC1155 is ERC1155, ERC1155MintBurn, ERC1155Metadata, MinterRole { + string private _name; + string private _symbol; + + constructor( + string memory name, + string memory symbol, + string memory uri + ) public ERC1155() { + _name = name; + _symbol = symbol; + _setBaseMetadataURI(uri); + } + + /** + * @dev Returns the name of the token. + */ + function name() public view returns (string memory) { + return _name; + } + + /** + * @dev Returns the symbol of the token, usually a shorter version of the + * name. + */ + function symbol() public view returns (string memory) { + return _symbol; + } + + function mint( + address _to, + uint256 _id, + uint256 _quantity, + bytes memory _data + ) public onlyMinter { + _mint(_to, _id, _quantity, _data); + } + + function mintBatch( + address to, + uint256[] memory ids, + uint256[] memory amounts, + bytes memory data + ) public onlyMinter returns (bool) { + _batchMint(to, ids, amounts, data); + return true; + } +} diff --git a/src/tests/contracts/BlockcodersHRC20.sol b/src/tests/contracts/BlockcodersHRC20.sol new file mode 100644 index 0000000..f892e61 --- /dev/null +++ b/src/tests/contracts/BlockcodersHRC20.sol @@ -0,0 +1,13 @@ +pragma solidity 0.5.17; + +import "@openzeppelin/contracts/token/ERC20/ERC20Detailed.sol"; +import "@openzeppelin/contracts/token/ERC20/ERC20Burnable.sol"; +import "@openzeppelin/contracts/token/ERC20/ERC20Mintable.sol"; + +contract BlockcodersHRC20 is ERC20Burnable, ERC20Detailed, ERC20Mintable { + constructor( + string memory name, + string memory symbol, + uint8 decimals + ) public ERC20Detailed(name, symbol, decimals) {} +} diff --git a/src/tests/contracts/BlockcodersHRC721.sol b/src/tests/contracts/BlockcodersHRC721.sol new file mode 100644 index 0000000..b0fe8ed --- /dev/null +++ b/src/tests/contracts/BlockcodersHRC721.sol @@ -0,0 +1,15 @@ +pragma solidity 0.5.17; + +import "@openzeppelin/contracts/token/ERC721/ERC721Mintable.sol"; +import "@openzeppelin/contracts/token/ERC721/ERC721Burnable.sol"; +import "./ERC721FullCustom.sol"; + +contract BlockcodersHRC721 is ERC721FullCustom, ERC721Mintable, ERC721Burnable { + constructor( + string memory name, + string memory symbol, + string memory baseURI + ) public ERC721FullCustom(name, symbol) { + _setBaseURI(baseURI); + } +} diff --git a/src/tests/contracts/BridgedHRC1155Token.sol b/src/tests/contracts/BridgedHRC1155Token.sol new file mode 100644 index 0000000..1000862 --- /dev/null +++ b/src/tests/contracts/BridgedHRC1155Token.sol @@ -0,0 +1,201 @@ +pragma solidity 0.5.17; + +import "@openzeppelin/contracts/ownership/Ownable.sol"; +import "@openzeppelin/contracts/access/roles/MinterRole.sol"; +import "./ERC1155.sol"; +import "./ERC1155Metadata.sol"; +import "./ERC1155MintBurn.sol"; +import "./StringsV2.sol"; + +contract BridgedHRC1155Token is +ERC1155, +ERC1155MintBurn, +ERC1155Metadata, +Ownable, +MinterRole +{ + using StringsV2 for string; + + address public srcTokenAddr; + uint256 public counter; + // Contract name + string private _name; + // Contract symbol + string private _symbol; + + mapping(uint256 => uint256) public tokenSupply; + + constructor( + address _srcTokenAddr, + string memory name, + string memory symbol, + string memory baseMetadataURI + ) public { + srcTokenAddr = _srcTokenAddr; + _name = name; + _symbol = symbol; + _setBaseMetadataURI(baseMetadataURI); + } + + /** + * @dev Returns the name of the token. + */ + function name() public view returns (string memory) { + return _name; + } + + /** + * @dev Returns the symbol of the token, usually a shorter version of the + * name. + */ + function symbol() public view returns (string memory) { + return _symbol; + } + + function uri(uint256 _id) public view returns (string memory) { + return StringsV2.strConcat(baseMetadataURI, StringsV2.uint2str(_id)); + } + + /** + * @dev Returns the total quantity for a token ID + * @param _id uint256 ID of the token to query + * @return amount of token in existence + */ + function totalSupply(uint256 _id) public view returns (uint256) { + return tokenSupply[_id]; + } + + /** + * @dev Will update the base URL of token's URI + * @param _newBaseMetadataURI New base URL of token's URI + */ + function setBaseMetadataURI(string memory _newBaseMetadataURI) + public + onlyOwner + { + _setBaseMetadataURI(_newBaseMetadataURI); + } + + /** + * @dev Mints some amount of tokens to an address + * @param _to Address of the future owner of the token + * @param _id Token ID to mint + * @param _quantity Amount of tokens to mint + * @param _data Data to pass if receiver is contract + */ + function mint( + address _to, + uint256 _id, + uint256 _quantity, + bytes memory _data + ) public onlyMinter { + _mint(_to, _id, _quantity, _data); + tokenSupply[_id] = tokenSupply[_id].add(_quantity); + } + + /** + * @dev Mint tokens for each id in _ids + * @param _to The address to mint tokens to + * @param _ids Array of ids to mint + * @param _quantities Array of amounts of tokens to mint per id + * @param _data Data to pass if receiver is contract + */ + function batchMint( + address _to, + uint256[] memory _ids, + uint256[] memory _quantities, + bytes memory _data + ) public onlyMinter { + for (uint256 i = 0; i < _ids.length; i++) { + uint256 _id = _ids[i]; + uint256 quantity = _quantities[i]; + tokenSupply[_id] = tokenSupply[_id].add(quantity); + } + _batchMint(_to, _ids, _quantities, _data); + } + + function isOwnerOrApproved(address operator, address owner) internal view returns (bool) { + return (isOwner() || isApprovedForAll(owner, operator)); + } + + /** + * @notice Burn _amount of tokens of a given token id + * @param _from The address to burn tokens from + * @param _id Token id to burn + * @param _amount The amount to be burned + */ + function burn( + address _from, + uint256 _id, + uint256 _amount + ) public { + require( + isOwnerOrApproved(_msgSender(), _from), + "BridgedNFT1155: caller is not owner nor approved" + ); + //Substract _amount + balances[_from][_id] = balances[_from][_id].sub(_amount); + + // Emit event + emit TransferSingle(msg.sender, _from, address(0x0), _id, _amount); + } + + /** + * @notice Burn tokens of given token id for each (_ids[i], _amounts[i]) pair + * @param _from The address to burn tokens from + * @param _ids Array of token ids to burn + * @param _amounts Array of the amount to be burned + */ + function batchBurn( + address _from, + uint256[] memory _ids, + uint256[] memory _amounts + ) public { + require( + _ids.length == _amounts.length, + "BridgedNFT1155#batchBurn: INVALID_ARRAYS_LENGTH" + ); + require( + isOwnerOrApproved(_msgSender(), _from), + "BridgedNFT1155: caller is not owner nor approved" + ); + + // Number of mints to execute + uint256 nBurn = _ids.length; + + // Executing all minting + for (uint256 i = 0; i < nBurn; i++) { + // Update storage balance + balances[_from][_ids[i]] = balances[_from][_ids[i]].sub( + _amounts[i] + ); + } + + // Emit batch mint event + emit TransferBatch(msg.sender, _from, address(0x0), _ids, _amounts); + } + + function increment(uint256 amount) public onlyMinter { + counter += amount; + } + + function batchIncrement(uint256[] memory amounts) public onlyMinter { + for (uint256 index = 0; index < amounts.length; index++) { + counter += amounts[index]; + } + } + + function decrement(uint256 amount) public onlyMinter { + counter -= amount; + } + + function batchDecrement(uint256[] memory amounts) public onlyMinter { + for (uint256 index = 0; index < amounts.length; index++) { + counter -= amounts[index]; + } + } + + function checkSupply(uint256 value) public view returns (bool) { + return counter == value; + } +} diff --git a/src/tests/contracts/BridgedHRC20Token.sol b/src/tests/contracts/BridgedHRC20Token.sol new file mode 100644 index 0000000..919f82a --- /dev/null +++ b/src/tests/contracts/BridgedHRC20Token.sol @@ -0,0 +1,17 @@ +pragma solidity 0.5.17; + +import "@openzeppelin/contracts/token/ERC20/ERC20Detailed.sol"; +import "@openzeppelin/contracts/token/ERC20/ERC20Burnable.sol"; +import "@openzeppelin/contracts/token/ERC20/ERC20Mintable.sol"; + +contract BridgedHRC20Token is ERC20Burnable, ERC20Detailed, ERC20Mintable { + address public ethTokenAddr; + constructor( + address _ethTokenAddr, + string memory name, + string memory symbol, + uint8 decimals + ) public ERC20Detailed(name, symbol, decimals) { + ethTokenAddr = _ethTokenAddr; + } +} diff --git a/src/tests/contracts/BridgedHRC721Token.sol b/src/tests/contracts/BridgedHRC721Token.sol new file mode 100644 index 0000000..9b664f3 --- /dev/null +++ b/src/tests/contracts/BridgedHRC721Token.sol @@ -0,0 +1,42 @@ +pragma solidity 0.5.17; + +import "@openzeppelin/contracts/token/ERC721/ERC721Burnable.sol"; +import "@openzeppelin/contracts/token/ERC721/ERC721Mintable.sol"; +import "./ERC721FullCustom.sol"; + +contract BridgedHRC721Token is ERC721Mintable, ERC721Burnable, ERC721FullCustom { + address public ethTokenAddr; + uint256 public counter; + constructor( + address _ethTokenAddr, + string memory name, + string memory symbol, + string memory baseURI + ) public ERC721FullCustom(name, symbol) { + ethTokenAddr = _ethTokenAddr; + _setBaseURI(baseURI); + } + + function burnFrom(address owner, uint256 tokenId) public { + //solhint-disable-next-line max-line-length + require(_isApprovedOrOwner(_msgSender(), tokenId), "ERC721Burnable: caller is not owner nor approved"); + _burn(owner, tokenId); + } + + function setTokenURI(uint256 tokenId, string memory tokenURI) public { + require(_msgSender() == ownerOf(tokenId), "only owner can set tokenURI"); + _setTokenURI(tokenId, tokenURI); + } + + function increment() public onlyMinter { + counter += 1; + } + + function decrement() public onlyMinter { + counter -= 1; + } + + function checkSupply(uint256 value) public view returns (bool) { + return counter == value; + } +} \ No newline at end of file diff --git a/src/tests/contracts/ERC1155.sol b/src/tests/contracts/ERC1155.sol new file mode 100644 index 0000000..801ee73 --- /dev/null +++ b/src/tests/contracts/ERC1155.sol @@ -0,0 +1,259 @@ +pragma solidity ^0.5.12; + +import "@openzeppelin/contracts/introspection/IERC165.sol"; +import "@openzeppelin/contracts/math/SafeMath.sol"; +import "./IERC1155TokenReceiver.sol"; +import "./IERC1155.sol"; +import "@openzeppelin/contracts/utils/Address.sol"; + + +/** + * @dev Implementation of Multi-Token Standard contract + */ +contract ERC1155 is IERC165 { + using SafeMath for uint256; + using Address for address; + + + /***********************************| + | Variables and Events | + |__________________________________*/ + + // onReceive function signatures + bytes4 constant internal ERC1155_RECEIVED_VALUE = 0xf23a6e61; + bytes4 constant internal ERC1155_BATCH_RECEIVED_VALUE = 0xbc197c81; + + // Objects balances + mapping (address => mapping(uint256 => uint256)) internal balances; + + // Operator Functions + mapping (address => mapping(address => bool)) internal operators; + + // Events + event TransferSingle(address indexed _operator, address indexed _from, address indexed _to, uint256 _id, uint256 _amount); + event TransferBatch(address indexed _operator, address indexed _from, address indexed _to, uint256[] _ids, uint256[] _amounts); + event ApprovalForAll(address indexed _owner, address indexed _operator, bool _approved); + event URI(string _uri, uint256 indexed _id); + + + /***********************************| + | Public Transfer Functions | + |__________________________________*/ + + /** + * @notice Transfers amount amount of an _id from the _from address to the _to address specified + * @param _from Source address + * @param _to Target address + * @param _id ID of the token type + * @param _amount Transfered amount + * @param _data Additional data with no specified format, sent in call to `_to` + */ + function safeTransferFrom(address _from, address _to, uint256 _id, uint256 _amount, bytes memory _data) + public + { + require((msg.sender == _from) || isApprovedForAll(_from, msg.sender), "ERC1155#safeTransferFrom: INVALID_OPERATOR"); + require(_to != address(0),"ERC1155#safeTransferFrom: INVALID_RECIPIENT"); + // require(_amount >= balances[_from][_id]) is not necessary since checked with safemath operations + + _safeTransferFrom(_from, _to, _id, _amount); + _callonERC1155Received(_from, _to, _id, _amount, _data); + } + + /** + * @notice Send multiple types of Tokens from the _from address to the _to address (with safety call) + * @param _from Source addresses + * @param _to Target addresses + * @param _ids IDs of each token type + * @param _amounts Transfer amounts per token type + * @param _data Additional data with no specified format, sent in call to `_to` + */ + function safeBatchTransferFrom(address _from, address _to, uint256[] memory _ids, uint256[] memory _amounts, bytes memory _data) + public + { + // Requirements + require((msg.sender == _from) || isApprovedForAll(_from, msg.sender), "ERC1155#safeBatchTransferFrom: INVALID_OPERATOR"); + require(_to != address(0), "ERC1155#safeBatchTransferFrom: INVALID_RECIPIENT"); + + _safeBatchTransferFrom(_from, _to, _ids, _amounts); + _callonERC1155BatchReceived(_from, _to, _ids, _amounts, _data); + } + + + /***********************************| + | Internal Transfer Functions | + |__________________________________*/ + + /** + * @notice Transfers amount amount of an _id from the _from address to the _to address specified + * @param _from Source address + * @param _to Target address + * @param _id ID of the token type + * @param _amount Transfered amount + */ + function _safeTransferFrom(address _from, address _to, uint256 _id, uint256 _amount) + internal + { + // Update balances + balances[_from][_id] = balances[_from][_id].sub(_amount); // Subtract amount + balances[_to][_id] = balances[_to][_id].add(_amount); // Add amount + + // Emit event + emit TransferSingle(msg.sender, _from, _to, _id, _amount); + } + + /** + * @notice Verifies if receiver is contract and if so, calls (_to).onERC1155Received(...) + */ + function _callonERC1155Received(address _from, address _to, uint256 _id, uint256 _amount, bytes memory _data) + internal + { + // Check if recipient is contract + if (_to.isContract()) { + bytes4 retval = IERC1155TokenReceiver(_to).onERC1155Received(msg.sender, _from, _id, _amount, _data); + require(retval == ERC1155_RECEIVED_VALUE, "ERC1155#_callonERC1155Received: INVALID_ON_RECEIVE_MESSAGE"); + } + } + + /** + * @notice Send multiple types of Tokens from the _from address to the _to address (with safety call) + * @param _from Source addresses + * @param _to Target addresses + * @param _ids IDs of each token type + * @param _amounts Transfer amounts per token type + */ + function _safeBatchTransferFrom(address _from, address _to, uint256[] memory _ids, uint256[] memory _amounts) + internal + { + require(_ids.length == _amounts.length, "ERC1155#_safeBatchTransferFrom: INVALID_ARRAYS_LENGTH"); + + // Number of transfer to execute + uint256 nTransfer = _ids.length; + + // Executing all transfers + for (uint256 i = 0; i < nTransfer; i++) { + // Update storage balance of previous bin + balances[_from][_ids[i]] = balances[_from][_ids[i]].sub(_amounts[i]); + balances[_to][_ids[i]] = balances[_to][_ids[i]].add(_amounts[i]); + } + + // Emit event + emit TransferBatch(msg.sender, _from, _to, _ids, _amounts); + } + + /** + * @notice Verifies if receiver is contract and if so, calls (_to).onERC1155BatchReceived(...) + */ + function _callonERC1155BatchReceived(address _from, address _to, uint256[] memory _ids, uint256[] memory _amounts, bytes memory _data) + internal + { + // Pass data if recipient is contract + if (_to.isContract()) { + bytes4 retval = IERC1155TokenReceiver(_to).onERC1155BatchReceived(msg.sender, _from, _ids, _amounts, _data); + require(retval == ERC1155_BATCH_RECEIVED_VALUE, "ERC1155#_callonERC1155BatchReceived: INVALID_ON_RECEIVE_MESSAGE"); + } + } + + + /***********************************| + | Operator Functions | + |__________________________________*/ + + /** + * @notice Enable or disable approval for a third party ("operator") to manage all of caller's tokens + * @param _operator Address to add to the set of authorized operators + * @param _approved True if the operator is approved, false to revoke approval + */ + function setApprovalForAll(address _operator, bool _approved) + external + { + // Update operator status + operators[msg.sender][_operator] = _approved; + emit ApprovalForAll(msg.sender, _operator, _approved); + } + + /** + * @notice Queries the approval status of an operator for a given owner + * @param _owner The owner of the Tokens + * @param _operator Address of authorized operator + * @return True if the operator is approved, false if not + */ + function isApprovedForAll(address _owner, address _operator) + public view returns (bool isOperator) + { + return operators[_owner][_operator]; + } + + + /***********************************| + | Balance Functions | + |__________________________________*/ + + /** + * @notice Get the balance of an account's Tokens + * @param _owner The address of the token holder + * @param _id ID of the Token + * @return The _owner's balance of the Token type requested + */ + function balanceOf(address _owner, uint256 _id) + public view returns (uint256) + { + return balances[_owner][_id]; + } + + /** + * @notice Get the balance of multiple account/token pairs + * @param _owners The addresses of the token holders + * @param _ids ID of the Tokens + * @return The _owner's balance of the Token types requested (i.e. balance for each (owner, id) pair) + */ + function balanceOfBatch(address[] memory _owners, uint256[] memory _ids) + public view returns (uint256[] memory) + { + require(_owners.length == _ids.length, "ERC1155#balanceOfBatch: INVALID_ARRAY_LENGTH"); + + // Variables + uint256[] memory batchBalances = new uint256[](_owners.length); + + // Iterate over each owner and token ID + for (uint256 i = 0; i < _owners.length; i++) { + batchBalances[i] = balances[_owners[i]][_ids[i]]; + } + + return batchBalances; + } + + + /***********************************| + | ERC165 Functions | + |__________________________________*/ + + /** + * INTERFACE_SIGNATURE_ERC165 = bytes4(keccak256("supportsInterface(bytes4)")); + */ + bytes4 constant private INTERFACE_SIGNATURE_ERC165 = 0x01ffc9a7; + + /** + * INTERFACE_SIGNATURE_ERC1155 = + * bytes4(keccak256("safeTransferFrom(address,address,uint256,uint256,bytes)")) ^ + * bytes4(keccak256("safeBatchTransferFrom(address,address,uint256[],uint256[],bytes)")) ^ + * bytes4(keccak256("balanceOf(address,uint256)")) ^ + * bytes4(keccak256("balanceOfBatch(address[],uint256[])")) ^ + * bytes4(keccak256("setApprovalForAll(address,bool)")) ^ + * bytes4(keccak256("isApprovedForAll(address,address)")); + */ + bytes4 constant private INTERFACE_SIGNATURE_ERC1155 = 0xd9b67a26; + + /** + * @notice Query if a contract implements an interface + * @param _interfaceID The interface identifier, as specified in ERC-165 + * @return `true` if the contract implements `_interfaceID` and + */ + function supportsInterface(bytes4 _interfaceID) external view returns (bool) { + if (_interfaceID == INTERFACE_SIGNATURE_ERC165 || + _interfaceID == INTERFACE_SIGNATURE_ERC1155) { + return true; + } + return false; + } + +} \ No newline at end of file diff --git a/src/tests/contracts/ERC1155Holder.sol b/src/tests/contracts/ERC1155Holder.sol new file mode 100644 index 0000000..25fe7d9 --- /dev/null +++ b/src/tests/contracts/ERC1155Holder.sol @@ -0,0 +1,35 @@ +pragma solidity 0.5.17; + +import "./IERC1155TokenReceiver.sol"; + +contract ERC1155Holder is IERC1155TokenReceiver { + function onERC1155Received( + address, + address, + uint256, + uint256, + bytes memory + ) public returns (bytes4) { + return this.onERC1155Received.selector; + } + + function onERC1155BatchReceived( + address, + address, + uint256[] memory, + uint256[] memory, + bytes memory + ) public returns (bytes4) { + return this.onERC1155BatchReceived.selector; + } + + function supportsInterface(bytes4 interfaceID) + external + view + returns (bool) + { + return + interfaceID == 0x01ffc9a7 || // ERC-165 support (i.e. `bytes4(keccak256('supportsInterface(bytes4)'))`). + interfaceID == 0x4e2312e0; // ERC-1155 `ERC1155TokenReceiver` support (i.e. `bytes4(keccak256("onERC1155Received(address,address,uint256,uint256,bytes)")) ^ bytes4(keccak256("onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)"))`). + } +} diff --git a/src/tests/contracts/ERC1155Metadata.sol b/src/tests/contracts/ERC1155Metadata.sol new file mode 100644 index 0000000..6a3fb35 --- /dev/null +++ b/src/tests/contracts/ERC1155Metadata.sol @@ -0,0 +1,108 @@ +pragma solidity ^0.5.11; +import "./IERC1155.sol"; + + +/** + * @notice Contract that handles metadata related methods. + * @dev Methods assume a deterministic generation of URI based on token IDs. + * Methods also assume that URI uses hex representation of token IDs. + */ +contract ERC1155Metadata { + + // URI's default URI prefix + string internal baseMetadataURI; + event URI(string _uri, uint256 indexed _id); + + + /***********************************| + | Metadata Public Function s | + |__________________________________*/ + + /** + * @notice A distinct Uniform Resource Identifier (URI) for a given token. + * @dev URIs are defined in RFC 3986. + * URIs are assumed to be deterministically generated based on token ID + * Token IDs are assumed to be represented in their hex format in URIs + * @return URI string + */ + function uri(uint256 _id) public view returns (string memory) { + return string(abi.encodePacked(baseMetadataURI, _uint2str(_id), ".json")); + } + + + /***********************************| + | Metadata Internal Functions | + |__________________________________*/ + + /** + * @notice Will emit default URI log event for corresponding token _id + * @param _tokenIDs Array of IDs of tokens to log default URI + */ + function _logURIs(uint256[] memory _tokenIDs) internal { + string memory baseURL = baseMetadataURI; + string memory tokenURI; + + for (uint256 i = 0; i < _tokenIDs.length; i++) { + tokenURI = string(abi.encodePacked(baseURL, _uint2str(_tokenIDs[i]), ".json")); + emit URI(tokenURI, _tokenIDs[i]); + } + } + + /** + * @notice Will emit a specific URI log event for corresponding token + * @param _tokenIDs IDs of the token corresponding to the _uris logged + * @param _URIs The URIs of the specified _tokenIDs + */ + function _logURIs(uint256[] memory _tokenIDs, string[] memory _URIs) internal { + require(_tokenIDs.length == _URIs.length, "ERC1155Metadata#_logURIs: INVALID_ARRAYS_LENGTH"); + for (uint256 i = 0; i < _tokenIDs.length; i++) { + emit URI(_URIs[i], _tokenIDs[i]); + } + } + + /** + * @notice Will update the base URL of token's URI + * @param _newBaseMetadataURI New base URL of token's URI + */ + function _setBaseMetadataURI(string memory _newBaseMetadataURI) internal { + baseMetadataURI = _newBaseMetadataURI; + } + + + /***********************************| + | Utility Internal Functions | + |__________________________________*/ + + /** + * @notice Convert uint256 to string + * @param _i Unsigned integer to convert to string + */ + function _uint2str(uint256 _i) internal pure returns (string memory _uintAsString) { + if (_i == 0) { + return "0"; + } + + uint256 j = _i; + uint256 ii = _i; + uint256 len; + + // Get number of bytes + while (j != 0) { + len++; + j /= 10; + } + + bytes memory bstr = new bytes(len); + uint256 k = len - 1; + + // Get each individual ASCII + while (ii != 0) { + bstr[k--] = byte(uint8(48 + ii % 10)); + ii /= 10; + } + + // Convert to string + return string(bstr); + } + +} \ No newline at end of file diff --git a/src/tests/contracts/ERC1155MintBurn.sol b/src/tests/contracts/ERC1155MintBurn.sol new file mode 100644 index 0000000..8e4dbfb --- /dev/null +++ b/src/tests/contracts/ERC1155MintBurn.sol @@ -0,0 +1,110 @@ +pragma solidity ^0.5.12; + +import "./ERC1155.sol"; + + +/** + * @dev Multi-Fungible Tokens with minting and burning methods. These methods assume + * a parent contract to be executed as they are `internal` functions + */ +contract ERC1155MintBurn is ERC1155 { + + + /****************************************| + | Minting Functions | + |_______________________________________*/ + + /** + * @notice Mint _amount of tokens of a given id + * @param _to The address to mint tokens to + * @param _id Token id to mint + * @param _amount The amount to be minted + * @param _data Data to pass if receiver is contract + */ + function _mint(address _to, uint256 _id, uint256 _amount, bytes memory _data) + internal + { + // Add _amount + balances[_to][_id] = balances[_to][_id].add(_amount); + + // Emit event + emit TransferSingle(msg.sender, address(0x0), _to, _id, _amount); + + // Calling onReceive method if recipient is contract + _callonERC1155Received(address(0x0), _to, _id, _amount, _data); + } + + /** + * @notice Mint tokens for each ids in _ids + * @param _to The address to mint tokens to + * @param _ids Array of ids to mint + * @param _amounts Array of amount of tokens to mint per id + * @param _data Data to pass if receiver is contract + */ + function _batchMint(address _to, uint256[] memory _ids, uint256[] memory _amounts, bytes memory _data) + internal + { + require(_ids.length == _amounts.length, "ERC1155MintBurn#batchMint: INVALID_ARRAYS_LENGTH"); + + // Number of mints to execute + uint256 nMint = _ids.length; + + // Executing all minting + for (uint256 i = 0; i < nMint; i++) { + // Update storage balance + balances[_to][_ids[i]] = balances[_to][_ids[i]].add(_amounts[i]); + } + + // Emit batch mint event + emit TransferBatch(msg.sender, address(0x0), _to, _ids, _amounts); + + // Calling onReceive method if recipient is contract + _callonERC1155BatchReceived(address(0x0), _to, _ids, _amounts, _data); + } + + + /****************************************| + | Burning Functions | + |_______________________________________*/ + + /** + * @notice Burn _amount of tokens of a given token id + * @param _from The address to burn tokens from + * @param _id Token id to burn + * @param _amount The amount to be burned + */ + function _burn(address _from, uint256 _id, uint256 _amount) + internal + { + //Substract _amount + balances[_from][_id] = balances[_from][_id].sub(_amount); + + // Emit event + emit TransferSingle(msg.sender, _from, address(0x0), _id, _amount); + } + + /** + * @notice Burn tokens of given token id for each (_ids[i], _amounts[i]) pair + * @param _from The address to burn tokens from + * @param _ids Array of token ids to burn + * @param _amounts Array of the amount to be burned + */ + function _batchBurn(address _from, uint256[] memory _ids, uint256[] memory _amounts) + internal + { + require(_ids.length == _amounts.length, "ERC1155MintBurn#batchBurn: INVALID_ARRAYS_LENGTH"); + + // Number of mints to execute + uint256 nBurn = _ids.length; + + // Executing all minting + for (uint256 i = 0; i < nBurn; i++) { + // Update storage balance + balances[_from][_ids[i]] = balances[_from][_ids[i]].sub(_amounts[i]); + } + + // Emit batch mint event + emit TransferBatch(msg.sender, _from, address(0x0), _ids, _amounts); + } + +} diff --git a/src/tests/contracts/ERC721FullCustom.sol b/src/tests/contracts/ERC721FullCustom.sol new file mode 100644 index 0000000..74cd13c --- /dev/null +++ b/src/tests/contracts/ERC721FullCustom.sol @@ -0,0 +1,18 @@ +pragma solidity 0.5.17; + +import "@openzeppelin/contracts/token/ERC721/ERC721.sol"; +import "@openzeppelin/contracts/token/ERC721/ERC721Enumerable.sol"; +import "./ERC721MetadataCustom.sol"; + +/** + * @title Full ERC721 Token + * @dev This implementation includes all the required and some optional functionality of the ERC721 standard + * Moreover, it includes approve all functionality using operator terminology. + * + * See https://eips.ethereum.org/EIPS/eip-721 + */ +contract ERC721FullCustom is ERC721, ERC721Enumerable, ERC721MetadataCustom { + constructor (string memory name, string memory symbol) public ERC721MetadataCustom(name, symbol) { + // solhint-disable-previous-line no-empty-blocks + } +} diff --git a/src/tests/contracts/ERC721MetadataCustom.sol b/src/tests/contracts/ERC721MetadataCustom.sol new file mode 100644 index 0000000..e26ae93 --- /dev/null +++ b/src/tests/contracts/ERC721MetadataCustom.sol @@ -0,0 +1,134 @@ +pragma solidity 0.5.17; + +import "@openzeppelin/contracts/GSN/Context.sol"; +import "@openzeppelin/contracts/token/ERC721/ERC721.sol"; +import "@openzeppelin/contracts/token/ERC721/IERC721Metadata.sol"; +import "@openzeppelin/contracts/introspection/ERC165.sol"; +import "@openzeppelin/contracts/drafts/Strings.sol"; + +contract ERC721MetadataCustom is Context, ERC165, ERC721, IERC721Metadata { + using Strings for uint256; + // Token name + string private _name; + + // Token symbol + string private _symbol; + + // Base URI + string private _baseURI; + + // Optional mapping for token URIs + mapping(uint256 => string) private _tokenURIs; + + /* + * bytes4(keccak256('name()')) == 0x06fdde03 + * bytes4(keccak256('symbol()')) == 0x95d89b41 + * bytes4(keccak256('tokenURI(uint256)')) == 0xc87b56dd + * + * => 0x06fdde03 ^ 0x95d89b41 ^ 0xc87b56dd == 0x5b5e139f + */ + bytes4 private constant _INTERFACE_ID_ERC721_METADATA = 0x5b5e139f; + + /** + * @dev Constructor function + */ + constructor (string memory name, string memory symbol) public { + _name = name; + _symbol = symbol; + + // register the supported interfaces to conform to ERC721 via ERC165 + _registerInterface(_INTERFACE_ID_ERC721_METADATA); + } + + /** + * @dev Gets the token name. + * @return string representing the token name + */ + function name() external view returns (string memory) { + return _name; + } + + /** + * @dev Gets the token symbol. + * @return string representing the token symbol + */ + function symbol() external view returns (string memory) { + return _symbol; + } + + /** + * @dev Returns the URI for a given token ID. May return an empty string. + * + * If the token's URI is non-empty and a base URI was set (via + * {_setBaseURI}), it will be added to the token ID's URI as a prefix. + * + * Reverts if the token ID does not exist. + */ + function tokenURI(uint256 tokenId) external view returns (string memory) { + require(_exists(tokenId), "ERC721Metadata: URI query for nonexistent token"); + + string memory _tokenURI = _tokenURIs[tokenId]; + + // If there is no base URI, return the token URI. + if (bytes(_baseURI).length == 0) { + return _tokenURI; + } + // If both are set, concatenate the baseURI and tokenURI (via abi.encodePacked). + if (bytes(_tokenURI).length > 0) { + return string(abi.encodePacked(_baseURI, _tokenURI)); + } + // If there is a baseURI but no tokenURI, concatenate the tokenID to the baseURI. + return string(abi.encodePacked(_baseURI, Strings.fromUint256(tokenId))); + } + + /** + * @dev Internal function to set the token URI for a given token. + * + * Reverts if the token ID does not exist. + * + * TIP: if all token IDs share a prefix (e.g. if your URIs look like + * `http://api.myproject.com/token/`), use {_setBaseURI} to store + * it and save gas. + */ + function _setTokenURI(uint256 tokenId, string memory _tokenURI) internal { + require(_exists(tokenId), "ERC721Metadata: URI set of nonexistent token"); + _tokenURIs[tokenId] = _tokenURI; + } + + /** + * @dev Internal function to set the base URI for all token IDs. It is + * automatically added as a prefix to the value returned in {tokenURI}. + * + * _Available since v2.5.0._ + */ + function _setBaseURI(string memory baseURI) internal { + _baseURI = baseURI; + } + + /** + * @dev Returns the base URI set via {_setBaseURI}. This will be + * automatically added as a preffix in {tokenURI} to each token's URI, when + * they are non-empty. + * + * _Available since v2.5.0._ + */ + function baseURI() external view returns (string memory) { + return _baseURI; + } + + /** + * @dev Internal function to burn a specific token. + * Reverts if the token does not exist. + * Deprecated, use _burn(uint256) instead. + * @param owner owner of the token to burn + * @param tokenId uint256 ID of the token being burned by the msg.sender + */ + function _burn(address owner, uint256 tokenId) internal { + super._burn(owner, tokenId); + + // Clear metadata (if any) + if (bytes(_tokenURIs[tokenId]).length != 0) { + delete _tokenURIs[tokenId]; + } + } +} diff --git a/src/tests/contracts/GameItems.sol b/src/tests/contracts/GameItems.sol new file mode 100644 index 0000000..08e3534 --- /dev/null +++ b/src/tests/contracts/GameItems.sol @@ -0,0 +1,20 @@ +pragma solidity 0.5.17; + +import "./BlockcodersHRC1155.sol"; + +contract GameItems is BlockcodersHRC1155 { + uint256 public constant GOLD = 0; + uint256 public constant SILVER = 1; + uint256 public constant THORS_HAMMER = 2; + uint256 public constant SWORD = 3; + uint256 public constant SHIELD = 4; + string private _uriPrefix; + + constructor() public BlockcodersHRC1155("GameItems", "GI", "https://gateway.pinata.cloud/ipfs/{id}.json") { + _mint(msg.sender, GOLD, 10**18, ""); + _mint(msg.sender, SILVER, 10**27, ""); + _mint(msg.sender, THORS_HAMMER, 1, ""); + _mint(msg.sender, SWORD, 10**9, ""); + _mint(msg.sender, SHIELD, 10**9, ""); + } +} \ No newline at end of file diff --git a/src/tests/contracts/HRC1155/BlockcodersHRC1155.sol b/src/tests/contracts/HRC1155/BlockcodersHRC1155.sol deleted file mode 100644 index 3d7b393..0000000 --- a/src/tests/contracts/HRC1155/BlockcodersHRC1155.sol +++ /dev/null @@ -1,31 +0,0 @@ -// SPDX-License-Identifier: MIT -pragma solidity ^0.8.4; - -import "@openzeppelin/contracts/token/ERC1155/presets/ERC1155PresetMinterPauser.sol"; -import "@openzeppelin/contracts/access/Ownable.sol"; - -contract BlockcodersHRC1155 is ERC1155PresetMinterPauser, Ownable { - uint256 public constant GOLD = 0; - uint256 public constant SILVER = 1; - uint256 public constant THORS_HAMMER = 2; - uint256 public constant SWORD = 3; - uint256 public constant SHIELD = 4; - string private _uriPrefix; - - constructor() ERC1155PresetMinterPauser("https://gateway.pinata.cloud/ipfs/{id}.json") { - _mint(msg.sender, GOLD, 10**18, ""); - _mint(msg.sender, SILVER, 10**27, ""); - _mint(msg.sender, THORS_HAMMER, 1, ""); - _mint(msg.sender, SWORD, 10**9, ""); - _mint(msg.sender, SHIELD, 10**9, ""); - _uriPrefix = "https://gateway.pinata.cloud/ipfs/"; - } - - function tokenURIPrefix() public view virtual returns (string memory) { - return _uriPrefix; - } - - function contractURI() public view virtual returns (string memory) { - return _uriPrefix; - } -} diff --git a/src/tests/contracts/HRC1155EthManager.sol b/src/tests/contracts/HRC1155EthManager.sol new file mode 100644 index 0000000..cf892f2 --- /dev/null +++ b/src/tests/contracts/HRC1155EthManager.sol @@ -0,0 +1,189 @@ +pragma solidity 0.5.17; + +import "./IERC1155.sol"; +import "./HRC1155TokenManager.sol"; +import "./BridgedHRC1155Token.sol"; + +interface MintableToken { + function mint(address _to, uint256 _id, uint256 _quantity, bytes calldata _data) external; + + function batchMint(address _to, uint256[] calldata _ids, uint256[] calldata _quantities, bytes calldata _data) external; +} + +interface BurnableToken { + function burn(address _from, uint256 _id, uint256 _amount) external; + + function batchBurn(address _from, uint256[] calldata _ids, uint256[] calldata _amounts) external; +} + +contract HRC1155EthManager { + mapping(bytes32 => bool) public usedEvents_; + mapping(address => address) public mappings; + + event Burned( + address indexed token, + address indexed sender, + uint256 tokenId, + address recipient, + uint256 amount + ); + + event BatchBurned( + address indexed token, + address indexed sender, + uint256[] tokenIds, + address recipient, + uint256[] amounts + ); + + event Minted( + address oneToken, + uint256 tokenId, + address recipient, + bytes32 receiptId, + uint256 amount + ); + + event BatchMinted( + address oneToken, + uint256[] tokenIds, + address recipient, + bytes32 receiptId, + uint256[] amounts + ); + + address public wallet; + modifier onlyWallet { + require(msg.sender == wallet, "HmyManager/not-authorized"); + _; + } + + /** + * @dev constructor + * @param _wallet is the multisig wallet + */ + constructor(address _wallet) public { + wallet = _wallet; + } + + /** + * @dev map an ethereum token to harmony + * @param tokenManager address to token manager + * @param ethTokenAddr ethereum token address to map + * @param name of the ethereum token + * @param symbol of the ethereum token + * @param baseURI base URI of the token + */ + function addToken( + address tokenManager, + address ethTokenAddr, + string memory name, + string memory symbol, + string memory baseURI + ) public { + address oneTokenAddr = HRC1155TokenManager(tokenManager).addHRC1155Token( + ethTokenAddr, + name, + symbol, + baseURI + ); + mappings[ethTokenAddr] = oneTokenAddr; + } + + /** + * @dev deregister token mapping in the token manager + * @param tokenManager address to token manager + * @param ethTokenAddr address to remove token + */ + function removeToken(address tokenManager, address ethTokenAddr) public { + HRC1155TokenManager(tokenManager).removeHRC1155Token(ethTokenAddr, 0); + delete mappings[ethTokenAddr]; + } + + /** + * @dev burns tokens on harmony to be unlocked on ethereum + * @param oneToken harmony token address + * @param tokenId tokenId to burn + * @param recipient recipient of the unlock tokens on ethereum + */ + function burnToken( + address oneToken, + uint256 tokenId, + address recipient, + uint256 amount + ) public { + BurnableToken(oneToken).burn(msg.sender, tokenId, amount); + BridgedHRC1155Token(oneToken).decrement(amount); + emit Burned(oneToken, msg.sender, tokenId, recipient, amount); + } + + /** + * @dev burns tokens on harmony to be unlocked on ethereum + * @param oneToken harmony token address + * @param tokenIds tokenIds to burn + * @param recipient recipient of the unlock tokens on ethereum + */ + function burnTokens( + address oneToken, + uint256[] memory tokenIds, + address recipient, + uint256[] memory amounts + ) public { + BurnableToken(oneToken).batchBurn(msg.sender, tokenIds, amounts); + BridgedHRC1155Token(oneToken).batchDecrement(amounts); + emit BatchBurned(oneToken, msg.sender, tokenIds, recipient, amounts); + } + + /** + * @dev mints tokens corresponding to the tokens locked in the ethereum chain + * @param oneToken is the token address for minting + * @param tokenId tokenId for minting + * @param recipient recipient of the minted tokens (harmony address) + * @param receiptId transaction hash of the lock event on ethereum chain + */ + function mintToken( + address oneToken, + uint256 tokenId, + address recipient, + bytes32 receiptId, + uint256 amount, + bytes memory data + ) public { + require( + !usedEvents_[receiptId], + "HmyManager/The lock event cannot be reused" + ); + MintableToken(oneToken).mint(recipient, tokenId, amount, data); + BridgedHRC1155Token(oneToken).increment(amount); + emit Minted(oneToken, tokenId, recipient, receiptId, amount); + + usedEvents_[receiptId] = true; + } + + /** + * @dev mints tokens corresponding to the tokens locked in the ethereum chain + * @param oneToken is the token address for minting + * @param tokenIds tokenIds for minting + * @param recipient recipient of the minted tokens (harmony address) + * @param receiptId transaction hash of the lock event on ethereum chain + */ + function mintTokens( + address oneToken, + uint256[] memory tokenIds, + address recipient, + bytes32 receiptId, + uint256[] memory amounts, + bytes memory data + ) public { + require( + !usedEvents_[receiptId], + "HmyManager/The lock event cannot be reused" + ); + + MintableToken(oneToken).batchMint(recipient, tokenIds, amounts, data); + BridgedHRC1155Token(oneToken).batchIncrement(amounts); + emit BatchMinted(oneToken, tokenIds, recipient, receiptId, amounts); + + usedEvents_[receiptId] = true; + } +} diff --git a/src/tests/contracts/HRC1155HmyManager.sol b/src/tests/contracts/HRC1155HmyManager.sol new file mode 100644 index 0000000..f645d6d --- /dev/null +++ b/src/tests/contracts/HRC1155HmyManager.sol @@ -0,0 +1,155 @@ +pragma solidity 0.5.17; + +import "@openzeppelin/contracts/math/SafeMath.sol"; +import "./ERC1155Holder.sol"; +import "./IERC1155.sol"; + +contract HRC1155HmyManager is ERC1155Holder { + using SafeMath for uint256; + + mapping(bytes32 => bool) public usedEvents_; + + event Locked( + address indexed token, + address indexed sender, + uint256 tokenId, + address recipient, + uint256 amount + ); + + event BatchLocked( + address indexed token, + address indexed sender, + uint256[] tokenIds, + address recipient, + uint256[] amounts + ); + + event Unlocked( + address ethToken, + uint256 tokenId, + address recipient, + bytes32 receiptId, + uint256 amount + ); + + event BatchUnlocked( + address ethToken, + uint256[] tokenIds, + address recipient, + bytes32 receiptId, + uint256[] amounts + ); + + address public wallet; + modifier onlyWallet { + require(msg.sender == wallet, "NFTHmyManager/not-authorized"); + _; + } + + /** + * @dev constructor + * @param _wallet is the multisig wallet + */ + constructor(address _wallet) public { + wallet = _wallet; + } + + /** + * @dev lock tokens to be minted on harmony chain + * @param ethTokenAddr is the ethereum token contract address + * @param tokenId tokenId of the token to lock + * @param recipient recipient address on the harmony chain + * @param amount amount of the token + * @param data additional data with no specified format, sent in call to `_to` + */ + function lockHRC1155Token( + address ethTokenAddr, + uint256 tokenId, + address recipient, + uint256 amount, + bytes memory data + ) public { + IERC1155 ethToken = IERC1155(ethTokenAddr); + ethToken.safeTransferFrom(msg.sender, address(this), tokenId, amount, data); + emit Locked(address(ethToken), msg.sender, tokenId, recipient, amount); + } + + /** + * @dev lock tokens to be minted on harmony chain + * @param ethTokenAddr is the ethereum token contract address + * @param tokenIds tokenIds of the token to lock + * @param recipient recipient address on the harmony chain + * @param amounts amounts of the token + * @param data additional data with no specified format, sent in call to `_to` + */ + function lockHRC1155Tokens( + address ethTokenAddr, + uint256[] memory tokenIds, + address recipient, + uint256[] memory amounts, + bytes memory data + ) public { + require( + recipient != address(0), + "NFTHmyManager/recipient is a zero address" + ); + IERC1155 ethToken = IERC1155(ethTokenAddr); + + ethToken.safeBatchTransferFrom(msg.sender, address(this), tokenIds, amounts, data); + emit BatchLocked(ethTokenAddr, msg.sender, tokenIds, recipient, amounts); + } + + /** + * @dev unlock tokens after burning them on harmony chain + * @param ethTokenAddr is the ethereum token contract address + * @param tokenId tokenId of the token to lock + * @param recipient recipient address on the harmony chain + * @param amount amount of the token + * @param data additional data with no specified format, sent in call to `_to` + */ + function unlockHRC1155Token( + address ethTokenAddr, + uint256 tokenId, + address recipient, + bytes32 receiptId, + uint256 amount, + bytes memory data + ) public onlyWallet { + require( + !usedEvents_[receiptId], + "NFTHmyManager/The burn event cannot be reused" + ); + IERC1155 ethToken = IERC1155(ethTokenAddr); + ethToken.safeTransferFrom(address(this), recipient, tokenId, amount, data); + usedEvents_[receiptId] = true; + emit Unlocked(ethTokenAddr, tokenId, recipient, receiptId, amount); + } + + /** + * @dev unlock tokens after burning them on harmony chain + * @param ethTokenAddr is the ethereum token contract address + * @param tokenIds tokenIds of the token to unlock + * @param recipient recipient of the unlock tokens + * @param receiptId transaction hash of the burn event on harmony chain + * @param amounts amount of the token + * @param data additional data with no specified format, sent in call to `_to` + */ + function unlockHRC1155Tokens( + address ethTokenAddr, + uint256[] memory tokenIds, + address recipient, + bytes32 receiptId, + uint256[] memory amounts, + bytes memory data + ) public onlyWallet { + require( + !usedEvents_[receiptId], + "NFTHmyManager/The burn event cannot be reused" + ); + IERC1155 ethToken = IERC1155(ethTokenAddr); + ethToken.safeBatchTransferFrom(address(this), recipient, tokenIds, amounts, data); + emit BatchUnlocked(ethTokenAddr, tokenIds, recipient, receiptId, amounts); + usedEvents_[receiptId] = true; + } +} diff --git a/src/tests/contracts/HRC1155TokenManager.sol b/src/tests/contracts/HRC1155TokenManager.sol new file mode 100644 index 0000000..9a39ab7 --- /dev/null +++ b/src/tests/contracts/HRC1155TokenManager.sol @@ -0,0 +1,111 @@ +pragma solidity 0.5.17; + +import "@openzeppelin/contracts/ownership/Ownable.sol"; +import "./BridgedHRC1155Token.sol"; + +contract HRC1155TokenManager is Ownable { + // ethtoken to onetoken mapping + mapping(address => address) public mappedTokens; + + event TokenMapAck(address indexed tokenReq, address indexed tokenAck); + + mapping(address => uint256) public wards; + + function rely(address guy) external onlyOwner { + wards[guy] = 1; + } + + function deny(address guy) external onlyOwner { + require(guy != owner(), "TokenManager/cannot deny the owner"); + wards[guy] = 0; + } + + // both owner and admin must approve + modifier auth { + require(wards[msg.sender] == 1, "TokenManager/not-authorized"); + _; + } + + /** + * @dev map ethereum token to harmony token and emit mintAddress + * @param ethTokenAddr address of the ethereum token + * @param name name of the token + * @param symbol of the token + * @param baseURI of the token + * @return mintAddress of the mapped token + */ + function addHRC1155Token( + address ethTokenAddr, + string memory name, + string memory symbol, + string memory baseURI + ) public auth returns (address) { + require( + ethTokenAddr != address(0), + "TokenManager/ethToken is a zero address" + ); + require( + mappedTokens[ethTokenAddr] == address(0), + "TokenManager/ethToken already mapped" + ); + + BridgedHRC1155Token bridgedToken = new BridgedHRC1155Token( + ethTokenAddr, + name, + symbol, + baseURI + ); + address bridgedTokenAddr = address(bridgedToken); + + // store the mapping and created address + mappedTokens[ethTokenAddr] = bridgedTokenAddr; + + // assign minter role to the caller + bridgedToken.addMinter(msg.sender); + + emit TokenMapAck(ethTokenAddr, bridgedTokenAddr); + return bridgedTokenAddr; + } + + /** + * @dev register an ethereum token to harmony token mapping + * @param ethTokenAddr address of the ethereum token + * @return oneToken of the mapped harmony token + */ + function registerToken(address ethTokenAddr, address oneTokenAddr) + public + auth + returns (bool) + { + require( + ethTokenAddr != address(0), + "TokenManager/ethTokenAddr is a zero address" + ); + require( + mappedTokens[ethTokenAddr] == address(0), + "TokenManager/ethTokenAddr already mapped" + ); + + // store the mapping and created address + mappedTokens[ethTokenAddr] = oneTokenAddr; + + return true; + } + + /** + * @dev remove an existing token mapping + * @param ethTokenAddr address of the ethereum token + * @param supply only allow removing mapping when supply, e.g., zero or 10**27 + */ + function removeHRC1155Token(address ethTokenAddr, uint256 supply) public auth { + require( + mappedTokens[ethTokenAddr] != address(0), + "TokenManager/ethToken mapping does not exists" + ); + require( + BridgedHRC1155Token(mappedTokens[ethTokenAddr]).checkSupply(supply), + "TokenManager/remove has non-zero supply" + ); + delete mappedTokens[ethTokenAddr]; + } +} diff --git a/src/tests/contracts/HRC20EthManager.sol b/src/tests/contracts/HRC20EthManager.sol new file mode 100644 index 0000000..867a861 --- /dev/null +++ b/src/tests/contracts/HRC20EthManager.sol @@ -0,0 +1,115 @@ +pragma solidity 0.5.17; + +import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; +import "./HRC20TokenManager.sol"; + +interface MintableToken { + function mint(address beneficiary, uint256 amount) external returns (bool); +} + +interface BurnableToken { + function burnFrom(address account, uint256 amount) external; +} + +contract HRC20EthManager { + mapping(bytes32 => bool) public usedEvents_; + mapping(address => address) public mappings; + + event Burned( + address indexed token, + address indexed sender, + uint256 amount, + address recipient + ); + + event Minted( + address ethToken, + uint256 amount, + address recipient, + bytes32 receiptId + ); + + address public wallet; + modifier onlyWallet { + require(msg.sender == wallet, "EthManager/not-authorized"); + _; + } + + /** + * @dev constructor + * @param _wallet is the multisig wallet + */ + constructor(address _wallet) public { + wallet = _wallet; + } + + /** + * @dev map an harmony token to ethereum + * @param tokenManager address to token manager + * @param hmyTokenAddr harmony token address to map + * @param name of the harmony token + * @param symbol of the harmony token + * @param decimals of the harmony token + */ + function addToken( + address tokenManager, + address hmyTokenAddr, + string memory name, + string memory symbol, + uint8 decimals + ) public { + address ethTokenAddr = HRC20TokenManager(tokenManager).addToken( + hmyTokenAddr, + name, + symbol, + decimals + ); + mappings[hmyTokenAddr] = ethTokenAddr; + } + + /** + * @dev deregister token mapping in the token manager + * @param tokenManager address to token manager + * @param hmyTokenAddr address to remove token + */ + function removeToken(address tokenManager, address hmyTokenAddr) public { + HRC20TokenManager(tokenManager).removeToken(hmyTokenAddr, 0); + } + + /** + * @dev burns tokens on ethereum to be unlocked on harmony + * @param ethToken ethereum token address + * @param amount amount of tokens to burn + * @param recipient recipient of the unlock tokens on ethereum + */ + function burnToken( + address ethToken, + uint256 amount, + address recipient + ) public { + BurnableToken(ethToken).burnFrom(msg.sender, amount); + emit Burned(ethToken, msg.sender, amount, recipient); + } + + /** + * @dev mints tokens corresponding to the tokens locked in the harmony chain + * @param ethToken is the token address for minting + * @param amount amount of tokens for minting + * @param recipient recipient of the minted tokens (ethereum address) + * @param receiptId transaction hash of the lock event on harmony chain + */ + function mintToken( + address ethToken, + uint256 amount, + address recipient, + bytes32 receiptId + ) public { + require( + !usedEvents_[receiptId], + "EthManager/The lock event cannot be reused" + ); + usedEvents_[receiptId] = true; + MintableToken(ethToken).mint(recipient, amount); + emit Minted(ethToken, amount, recipient, receiptId); + } +} diff --git a/src/tests/contracts/HRC20HmyManager.sol b/src/tests/contracts/HRC20HmyManager.sol new file mode 100644 index 0000000..9622db0 --- /dev/null +++ b/src/tests/contracts/HRC20HmyManager.sol @@ -0,0 +1,152 @@ +pragma solidity 0.5.17; + +import "@openzeppelin/contracts/math/SafeMath.sol"; +import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; +import "@openzeppelin/contracts/token/ERC20/SafeERC20.sol"; + +contract HRC20HmyManager { + using SafeMath for uint256; + using SafeERC20 for IERC20; + + IERC20 public constant HMY_ADDRESS = IERC20(0x00eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee); + + mapping(bytes32 => bool) public usedEvents_; + + event Locked( + address indexed token, + address indexed sender, + uint256 amount, + address recipient + ); + + event Unlocked( + address hmyToken, + uint256 amount, + address recipient, + bytes32 receiptId + ); + + address public wallet; + modifier onlyWallet { + require(msg.sender == wallet, "HmyManager/not-authorized"); + _; + } + + /** + * @dev constructor + * @param _wallet is the multisig wallet + */ + constructor(address _wallet) public { + wallet = _wallet; + } + + /** + * @dev lock tokens to be minted on harmony chain + * @param hmyTokenAddr is the ethereum token contract address + * @param amount amount of tokens to lock + * @param recipient recipient address on the harmony chain + */ + function lockToken( + address hmyTokenAddr, + uint256 amount, + address recipient + ) public { + require( + recipient != address(0), + "HmyManager/recipient is a zero address" + ); + require(amount > 0, "HmyManager/zero token locked"); + IERC20 hmyToken = IERC20(hmyTokenAddr); + uint256 _balanceBefore = hmyToken.balanceOf(msg.sender); + hmyToken.safeTransferFrom(msg.sender, address(this), amount); + uint256 _balanceAfter = hmyToken.balanceOf(msg.sender); + uint256 _actualAmount = _balanceBefore.sub(_balanceAfter); + emit Locked(address(hmyToken), msg.sender, _actualAmount, recipient); + } + + /** + * @dev lock tokens for a user address to be minted on harmony chain + * @param hmyTokenAddr is the ethereum token contract address + * @param userAddr is token holder address + * @param amount amount of tokens to lock + * @param recipient recipient address on the harmony chain + */ + function lockTokenFor( + address hmyTokenAddr, + address userAddr, + uint256 amount, + address recipient + ) public onlyWallet { + require( + recipient != address(0), + "HmyManager/recipient is a zero address" + ); + require(amount > 0, "HmyManager/zero token locked"); + IERC20 hmyToken = IERC20(hmyTokenAddr); + uint256 _balanceBefore = hmyToken.balanceOf(userAddr); + hmyToken.safeTransferFrom(userAddr, address(this), amount); + uint256 _balanceAfter = hmyToken.balanceOf(userAddr); + uint256 _actualAmount = _balanceBefore.sub(_balanceAfter); + emit Locked(address(hmyToken), userAddr, _actualAmount, recipient); + } + + /** + * @dev unlock tokens after burning them on harmony chain + * @param hmyTokenAddr is the ethereum token contract address + * @param amount amount of unlock tokens + * @param recipient recipient of the unlock tokens + * @param receiptId transaction hash of the burn event on harmony chain + */ + function unlockToken( + address hmyTokenAddr, + uint256 amount, + address recipient, + bytes32 receiptId + ) public onlyWallet { + require( + !usedEvents_[receiptId], + "HmyManager/The burn event cannot be reused" + ); + IERC20 hmyToken = IERC20(hmyTokenAddr); + usedEvents_[receiptId] = true; + hmyToken.safeTransfer(recipient, amount); + emit Unlocked(hmyTokenAddr, amount, recipient, receiptId); + } + + /** + * @dev lock ONE to be minted on ethereum chain + * @param amount amount of tokens to lock + * @param recipient recipient address on the harmony chain + */ + function lockOne( + uint256 amount, + address recipient + ) public payable { + require( + recipient != address(0), + "HmyManager/recipient is a zero address" + ); + require(msg.value == amount, "HmyManager/zero token locked"); + emit Locked(address(HMY_ADDRESS), msg.sender, amount, recipient); + } + + /** + * @dev unlock ETHs after burning them on harmony chain + * @param amount amount of unlock tokens + * @param recipient recipient of the unlock tokens + * @param receiptId transaction hash of the burn event on harmony chain + */ + function unlockOne( + uint256 amount, + address payable recipient, + bytes32 receiptId + ) public onlyWallet { + require( + !usedEvents_[receiptId], + "HmyManager/The burn event cannot be reused" + ); + usedEvents_[receiptId] = true; + recipient.transfer(amount); + emit Unlocked(address(HMY_ADDRESS), amount, recipient, receiptId); + } +} diff --git a/src/tests/contracts/HRC20TokenManager.sol b/src/tests/contracts/HRC20TokenManager.sol new file mode 100644 index 0000000..53e53de --- /dev/null +++ b/src/tests/contracts/HRC20TokenManager.sol @@ -0,0 +1,108 @@ +pragma solidity 0.5.17; + +import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; +import "@openzeppelin/contracts/ownership/Ownable.sol"; +import "./BridgedHRC20Token.sol"; + +contract HRC20TokenManager is Ownable { + // ethtoken to onetoken mapping + mapping(address => address) public mappedTokens; + + event TokenMapAck(address indexed tokenReq, address indexed tokenAck); + + mapping(address => uint256) public wards; + + function rely(address guy) external onlyOwner { + wards[guy] = 1; + } + + function deny(address guy) external onlyOwner { + require(guy != owner(), "TokenManager/cannot deny the owner"); + wards[guy] = 0; + } + + // both owner and admin must approve + modifier auth { + require(wards[msg.sender] == 1, "TokenManager/not-authorized"); + _; + } + + /** + * @dev map ethereum token to harmony token and emit mintAddress + * @param ethTokenAddr address of the ethereum token + * @return mintAddress of the mapped token + */ + function addToken( + address ethTokenAddr, + string memory name, + string memory symbol, + uint8 decimals + ) public auth returns (address) { + require( + ethTokenAddr != address(0), + "TokenManager/ethToken is a zero address" + ); + require( + mappedTokens[ethTokenAddr] == address(0), + "TokenManager/ethToken already mapped" + ); + + BridgedHRC20Token bridgedToken = new BridgedHRC20Token( + ethTokenAddr, + name, + symbol, + decimals + ); + address bridgedTokenAddr = address(bridgedToken); + + // store the mapping and created address + mappedTokens[ethTokenAddr] = bridgedTokenAddr; + + // assign minter role to the caller + bridgedToken.addMinter(msg.sender); + + emit TokenMapAck(ethTokenAddr, bridgedTokenAddr); + return bridgedTokenAddr; + } + + /** + * @dev register an ethereum token to harmony token mapping + * @param ethTokenAddr address of the ethereum token + * @return oneToken of the mapped harmony token + */ + function registerToken(address ethTokenAddr, address oneTokenAddr) + public + auth + returns (bool) + { + require( + ethTokenAddr != address(0), + "TokenManager/ethTokenAddr is a zero address" + ); + require( + mappedTokens[ethTokenAddr] == address(0), + "TokenManager/ethTokenAddr already mapped" + ); + + // store the mapping and created address + mappedTokens[ethTokenAddr] = oneTokenAddr; + } + + /** + * @dev remove an existing token mapping + * @param ethTokenAddr address of the ethereum token + * @param supply only allow removing mapping when supply, e.g., zero or 10**27 + */ + function removeToken(address ethTokenAddr, uint256 supply) public auth { + require( + mappedTokens[ethTokenAddr] != address(0), + "TokenManager/ethToken mapping does not exists" + ); + IERC20 oneToken = IERC20(mappedTokens[ethTokenAddr]); + require( + oneToken.totalSupply() == supply, + "TokenManager/remove has non-zero supply" + ); + delete mappedTokens[ethTokenAddr]; + } +} diff --git a/src/tests/contracts/HRC721/BlockcodersHRC721.sol b/src/tests/contracts/HRC721/BlockcodersHRC721.sol deleted file mode 100644 index 461e253..0000000 --- a/src/tests/contracts/HRC721/BlockcodersHRC721.sol +++ /dev/null @@ -1,12 +0,0 @@ -// SPDX-License-Identifier: MIT -pragma solidity ^0.8.4; - -import "@openzeppelin/contracts/token/ERC721/presets/ERC721PresetMinterPauserAutoId.sol"; - -contract BlockcodersHRC721 is ERC721PresetMinterPauserAutoId { - constructor() ERC721PresetMinterPauserAutoId("Blockcoders NFT", "Blockcoders", "https://gateway.pinata.cloud/ipfs/QmYDabPt2kJBKP1WZazoRd28xwWaCjThJyf2bStRTcoMvx") { - for (uint i = 0; i < 10; i++) { - _safeMint(msg.sender, i); - } - } -} diff --git a/src/tests/contracts/HRC721EthManager.sol b/src/tests/contracts/HRC721EthManager.sol new file mode 100644 index 0000000..63c4d4b --- /dev/null +++ b/src/tests/contracts/HRC721EthManager.sol @@ -0,0 +1,161 @@ +pragma solidity 0.5.17; +import "@openzeppelin/contracts/token/ERC721/IERC721.sol"; +import "./HRC721TokenManager.sol"; +import "./BridgedHRC721Token.sol"; + +interface MintableToken { + function mint(address beneficiary, uint256 tokenId) external returns (bool); +} + +interface BurnableToken { + function burnFrom(address account, uint256 tokenId) external; +} + +contract HRC721EthManager { + mapping(bytes32 => bool) public usedEvents_; + mapping(address => address) public mappings; + + event Burned( + address indexed token, + address indexed sender, + uint256 tokenId, + address recipient + ); + + event Minted( + address oneToken, + uint256 tokenId, + address recipient, + bytes32 receiptId + ); + + address public wallet; + modifier onlyWallet { + require(msg.sender == wallet, "HmyManager/not-authorized"); + _; + } + + /** + * @dev constructor + * @param _wallet is the multisig wallet + */ + constructor(address _wallet) public { + wallet = _wallet; + } + + /** + * @dev map an ethereum token to harmony + * @param tokenManager address to token manager + * @param ethTokenAddr ethereum token address to map + * @param name of the ethereum token + * @param symbol of the ethereum token + * @param baseURI base URI of the token + */ + function addToken( + address tokenManager, + address ethTokenAddr, + string memory name, + string memory symbol, + string memory baseURI + ) public { + address oneTokenAddr = HRC721TokenManager(tokenManager).addToken( + ethTokenAddr, + name, + symbol, + baseURI + ); + mappings[ethTokenAddr] = oneTokenAddr; + } + + /** + * @dev deregister token mapping in the token manager + * @param tokenManager address to token manager + * @param ethTokenAddr address to remove token + */ + function removeToken(address tokenManager, address ethTokenAddr) public { + HRC721TokenManager(tokenManager).removeToken(ethTokenAddr, 0); + delete mappings[ethTokenAddr]; + } + + /** + * @dev burns tokens on harmony to be unlocked on ethereum + * @param oneToken harmony token address + * @param tokenId tokenId to burn + * @param recipient recipient of the unlock tokens on ethereum + */ + function burnToken( + address oneToken, + uint256 tokenId, + address recipient + ) public { + BurnableToken(oneToken).burnFrom(msg.sender, tokenId); + BridgedHRC721Token(oneToken).decrement(); + emit Burned(oneToken, msg.sender, tokenId, recipient); + } + + /** + * @dev burns tokens on harmony to be unlocked on ethereum + * @param oneToken harmony token address + * @param tokenIds tokenIds to burn + * @param recipient recipient of the unlock tokens on ethereum + */ + function burnTokens( + address oneToken, + uint256[] memory tokenIds, + address recipient + ) public { + for (uint256 index = 0; index < tokenIds.length; index++) { + BurnableToken(oneToken).burnFrom(msg.sender, tokenIds[index]); + BridgedHRC721Token(oneToken).decrement(); + emit Burned(oneToken, msg.sender, tokenIds[index], recipient); + } + } + + /** + * @dev mints tokens corresponding to the tokens locked in the ethereum chain + * @param oneToken is the token address for minting + * @param tokenId tokenId for minting + * @param recipient recipient of the minted tokens (harmony address) + * @param receiptId transaction hash of the lock event on ethereum chain + */ + function mintToken( + address oneToken, + uint256 tokenId, + address recipient, + bytes32 receiptId + ) public { + require( + !usedEvents_[receiptId], + "HmyManager/The lock event cannot be reused" + ); + MintableToken(oneToken).mint(recipient, tokenId); + usedEvents_[receiptId] = true; + BridgedHRC721Token(oneToken).increment(); + emit Minted(oneToken, tokenId, recipient, receiptId); + } + + /** + * @dev mints tokens corresponding to the tokens locked in the ethereum chain + * @param oneToken is the token address for minting + * @param tokenIds tokenIds for minting + * @param recipient recipient of the minted tokens (harmony address) + * @param receiptId transaction hash of the lock event on ethereum chain + */ + function mintTokens( + address oneToken, + uint256[] memory tokenIds, + address recipient, + bytes32 receiptId + ) public { + require( + !usedEvents_[receiptId], + "HmyManager/The lock event cannot be reused" + ); + for (uint256 index = 0; index < tokenIds.length; index++) { + MintableToken(oneToken).mint(recipient, tokenIds[index]); + BridgedHRC721Token(oneToken).increment(); + emit Minted(oneToken, tokenIds[index], recipient, receiptId); + } + usedEvents_[receiptId] = true; + } +} diff --git a/src/tests/contracts/HRC721HmyManager.sol b/src/tests/contracts/HRC721HmyManager.sol new file mode 100644 index 0000000..9930b45 --- /dev/null +++ b/src/tests/contracts/HRC721HmyManager.sol @@ -0,0 +1,186 @@ +pragma solidity 0.5.17; +import "@openzeppelin/contracts/math/SafeMath.sol"; +import "@openzeppelin/contracts/token/ERC721/IERC721.sol"; +import "@openzeppelin/contracts/token/ERC721/ERC721Holder.sol"; +import "./ERC1155Holder.sol"; + +contract HRC721HmyManager is ERC721Holder, ERC1155Holder { + using SafeMath for uint256; + + mapping(bytes32 => bool) public usedEvents_; + + event Locked( + address indexed token, + address indexed sender, + uint256 tokenId, + address recipient + ); + + event Unlocked( + address ethToken, + uint256 tokenId, + address recipient, + bytes32 receiptId + ); + + address public wallet; + modifier onlyWallet { + require(msg.sender == wallet, "NFTHmyManager/not-authorized"); + _; + } + + /** + * @dev constructor + * @param _wallet is the multisig wallet + */ + constructor(address _wallet) public { + wallet = _wallet; + } + + /** + * @dev lock tokens to be minted on harmony chain + * @param ethTokenAddr is the ethereum token contract address + * @param tokenId tokenId of the token to lock + * @param recipient recipient address on the harmony chain + */ + function lockNFT721Token( + address ethTokenAddr, + uint256 tokenId, + address recipient + ) public { + require( + recipient != address(0), + "NFTHmyManager/recipient is a zero address" + ); + IERC721 ethToken = IERC721(ethTokenAddr); + ethToken.safeTransferFrom(msg.sender, address(this), tokenId); + emit Locked(address(ethToken), msg.sender, tokenId, recipient); + } + + /** + * @dev lock tokens to be minted on harmony chain + * @param ethTokenAddr is the ethereum token contract address + * @param tokenId tokenId of the token to lock + * @param recipient recipient address on the harmony chain + */ + function lockNFT1155Token( + address ethTokenAddr, + uint256 tokenId, + address recipient, + uint256 amount, + bytes memory data + ) public { + + } + + /** + * @dev lock tokens to be minted on harmony chain + * @param ethTokenAddr is the ethereum token contract address + * @param tokenIds tokenIds of the token to lock + * @param recipient recipient address on the harmony chain + */ + function lockTokens( + address ethTokenAddr, + uint256[] memory tokenIds, + address recipient + ) public { + require( + recipient != address(0), + "NFTHmyManager/recipient is a zero address" + ); + IERC721 ethToken = IERC721(ethTokenAddr); + for (uint256 index = 0; index < tokenIds.length; index++) { + ethToken.safeTransferFrom( + msg.sender, + address(this), + tokenIds[index] + ); + emit Locked( + address(ethToken), + msg.sender, + tokenIds[index], + recipient + ); + } + } + + /** + * @dev lock tokens to be minted on harmony chain + * @param ethTokenAddr is the ethereum token contract address + * @param tokenIds tokenIds of the token to lock + * @param recipient recipient address on the harmony chain + */ + function lockNFT1155Tokens( + address ethTokenAddr, + uint256[] memory tokenIds, + address recipient + ) public { + + } + + /** + * @dev unlock tokens after burning them on harmony chain + * @param ethTokenAddr is the ethereum token contract address + * @param tokenId tokenId of the token to unlock + * @param recipient recipient of the unlock tokens + * @param receiptId transaction hash of the burn event on harmony chain + */ + function unlockToken( + address ethTokenAddr, + uint256 tokenId, + address recipient, + bytes32 receiptId + ) public onlyWallet { + require( + !usedEvents_[receiptId], + "NFTHmyManager/The burn event cannot be reused" + ); + IERC721 ethToken = IERC721(ethTokenAddr); + ethToken.safeTransferFrom(address(this), recipient, tokenId); + usedEvents_[receiptId] = true; + emit Unlocked(ethTokenAddr, tokenId, recipient, receiptId); + } + + function unlockNFT1155Token( + address ethTokenAddr, + uint256 tokenId, + address recipient, + bytes32 receiptId + ) public onlyWallet { + + } + + /** + * @dev unlock tokens after burning them on harmony chain + * @param ethTokenAddr is the ethereum token contract address + * @param tokenIds tokenIds of the token to unlock + * @param recipient recipient of the unlock tokens + * @param receiptId transaction hash of the burn event on harmony chain + */ + function unlockTokens( + address ethTokenAddr, + uint256[] memory tokenIds, + address recipient, + bytes32 receiptId + ) public onlyWallet { + require( + !usedEvents_[receiptId], + "NFTHmyManager/The burn event cannot be reused" + ); + IERC721 ethToken = IERC721(ethTokenAddr); + for (uint256 index = 0; index < tokenIds.length; index++) { + ethToken.safeTransferFrom(address(this), recipient, tokenIds[index]); + emit Unlocked(ethTokenAddr, tokenIds[index], recipient, receiptId); + } + usedEvents_[receiptId] = true; + } + + function unlockNFT1155Tokens( + address ethTokenAddr, + uint256[] memory tokenIds, + address recipient, + bytes32 receiptId + ) public onlyWallet { + + } +} diff --git a/src/tests/contracts/HRC721TokenManager.sol b/src/tests/contracts/HRC721TokenManager.sol new file mode 100644 index 0000000..1e56951 --- /dev/null +++ b/src/tests/contracts/HRC721TokenManager.sol @@ -0,0 +1,110 @@ +pragma solidity 0.5.17; + +import "@openzeppelin/contracts/token/ERC721/IERC721.sol"; +import "@openzeppelin/contracts/ownership/Ownable.sol"; +import "./BridgedHRC721Token.sol"; + +contract HRC721TokenManager is Ownable { + // ethtoken to onetoken mapping + mapping(address => address) public mappedTokens; + + event TokenMapAck(address indexed tokenReq, address indexed tokenAck); + + mapping(address => uint256) public wards; + + function rely(address guy) external onlyOwner { + wards[guy] = 1; + } + + function deny(address guy) external onlyOwner { + require(guy != owner(), "TokenManager/cannot deny the owner"); + wards[guy] = 0; + } + + // both owner and admin must approve + modifier auth { + require(wards[msg.sender] == 1, "TokenManager/not-authorized"); + _; + } + + /** + * @dev map ethereum token to harmony token and emit mintAddress + * @param ethTokenAddr address of the ethereum token + * @param name name of the token + * @param symbol of the token + * @param baseURI of the token + * @return mintAddress of the mapped token + */ + function addToken( + address ethTokenAddr, + string memory name, + string memory symbol, + string memory baseURI + ) public auth returns (address) { + require( + ethTokenAddr != address(0), + "TokenManager/ethToken is a zero address" + ); + require( + mappedTokens[ethTokenAddr] == address(0), + "TokenManager/ethToken already mapped" + ); + + BridgedHRC721Token bridgedToken = new BridgedHRC721Token( + ethTokenAddr, + name, + symbol, + baseURI + ); + address bridgedTokenAddr = address(bridgedToken); + + // store the mapping and created address + mappedTokens[ethTokenAddr] = bridgedTokenAddr; + + // assign minter role to the caller + bridgedToken.addMinter(msg.sender); + + emit TokenMapAck(ethTokenAddr, bridgedTokenAddr); + return bridgedTokenAddr; + } + + /** + * @dev register an ethereum token to harmony token mapping + * @param ethTokenAddr address of the ethereum token + * @return oneToken of the mapped harmony token + */ + function registerToken(address ethTokenAddr, address oneTokenAddr) + public + auth + returns (bool) + { + require( + ethTokenAddr != address(0), + "TokenManager/ethTokenAddr is a zero address" + ); + require( + mappedTokens[ethTokenAddr] == address(0), + "TokenManager/ethTokenAddr already mapped" + ); + + // store the mapping and created address + mappedTokens[ethTokenAddr] = oneTokenAddr; + } + + /** + * @dev remove an existing token mapping + * @param ethTokenAddr address of the ethereum token + * @param supply only allow removing mapping when supply, e.g., zero or 10**27 + */ + function removeToken(address ethTokenAddr, uint256 supply) public auth { + require( + mappedTokens[ethTokenAddr] != address(0), + "TokenManager/ethToken mapping does not exists" + ); + require( + BridgedHRC721Token(mappedTokens[ethTokenAddr]).checkSupply(supply), + "TokenManager/remove has non-zero supply" + ); + delete mappedTokens[ethTokenAddr]; + } +} diff --git a/src/tests/contracts/IERC1155.sol b/src/tests/contracts/IERC1155.sol new file mode 100644 index 0000000..ba7994c --- /dev/null +++ b/src/tests/contracts/IERC1155.sol @@ -0,0 +1,105 @@ +pragma solidity ^0.5.12; + + +interface IERC1155 { + // Events + + /** + * @dev Either TransferSingle or TransferBatch MUST emit when tokens are transferred, including zero amount transfers as well as minting or burning + * Operator MUST be msg.sender + * When minting/creating tokens, the `_from` field MUST be set to `0x0` + * When burning/destroying tokens, the `_to` field MUST be set to `0x0` + * The total amount transferred from address 0x0 minus the total amount transferred to 0x0 may be used by clients and exchanges to be added to the "circulating supply" for a given token ID + * To broadcast the existence of a token ID with no initial balance, the contract SHOULD emit the TransferSingle event from `0x0` to `0x0`, with the token creator as `_operator`, and a `_amount` of 0 + */ + event TransferSingle(address indexed _operator, address indexed _from, address indexed _to, uint256 _id, uint256 _amount); + + /** + * @dev Either TransferSingle or TransferBatch MUST emit when tokens are transferred, including zero amount transfers as well as minting or burning + * Operator MUST be msg.sender + * When minting/creating tokens, the `_from` field MUST be set to `0x0` + * When burning/destroying tokens, the `_to` field MUST be set to `0x0` + * The total amount transferred from address 0x0 minus the total amount transferred to 0x0 may be used by clients and exchanges to be added to the "circulating supply" for a given token ID + * To broadcast the existence of multiple token IDs with no initial balance, this SHOULD emit the TransferBatch event from `0x0` to `0x0`, with the token creator as `_operator`, and a `_amount` of 0 + */ + event TransferBatch(address indexed _operator, address indexed _from, address indexed _to, uint256[] _ids, uint256[] _amounts); + + /** + * @dev MUST emit when an approval is updated + */ + event ApprovalForAll(address indexed _owner, address indexed _operator, bool _approved); + + /** + * @dev MUST emit when the URI is updated for a token ID + * URIs are defined in RFC 3986 + * The URI MUST point a JSON file that conforms to the "ERC-1155 Metadata JSON Schema" + */ + event URI(string _amount, uint256 indexed _id); + + /** + * @notice Transfers amount of an _id from the _from address to the _to address specified + * @dev MUST emit TransferSingle event on success + * Caller must be approved to manage the _from account's tokens (see isApprovedForAll) + * MUST throw if `_to` is the zero address + * MUST throw if balance of sender for token `_id` is lower than the `_amount` sent + * MUST throw on any other error + * When transfer is complete, this function MUST check if `_to` is a smart contract (code size > 0). If so, it MUST call `onERC1155Received` on `_to` and revert if the return amount is not `bytes4(keccak256("onERC1155Received(address,address,uint256,uint256,bytes)"))` + * @param _from Source address + * @param _to Target address + * @param _id ID of the token type + * @param _amount Transfered amount + * @param _data Additional data with no specified format, sent in call to `_to` + */ + function safeTransferFrom(address _from, address _to, uint256 _id, uint256 _amount, bytes calldata _data) external; + + /** + * @notice Send multiple types of Tokens from the _from address to the _to address (with safety call) + * @dev MUST emit TransferBatch event on success + * Caller must be approved to manage the _from account's tokens (see isApprovedForAll) + * MUST throw if `_to` is the zero address + * MUST throw if length of `_ids` is not the same as length of `_amounts` + * MUST throw if any of the balance of sender for token `_ids` is lower than the respective `_amounts` sent + * MUST throw on any other error + * When transfer is complete, this function MUST check if `_to` is a smart contract (code size > 0). If so, it MUST call `onERC1155BatchReceived` on `_to` and revert if the return amount is not `bytes4(keccak256("onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)"))` + * Transfers and events MUST occur in the array order they were submitted (_ids[0] before _ids[1], etc) + * @param _from Source addresses + * @param _to Target addresses + * @param _ids IDs of each token type + * @param _amounts Transfer amounts per token type + * @param _data Additional data with no specified format, sent in call to `_to` + */ + function safeBatchTransferFrom(address _from, address _to, uint256[] calldata _ids, uint256[] calldata _amounts, bytes calldata _data) external; + + /** + * @notice Get the balance of an account's Tokens + * @param _owner The address of the token holder + * @param _id ID of the Token + * @return The _owner's balance of the Token type requested + */ + function balanceOf(address _owner, uint256 _id) external view returns (uint256); + + /** + * @notice Get the balance of multiple account/token pairs + * @param _owners The addresses of the token holders + * @param _ids ID of the Tokens + * @return The _owner's balance of the Token types requested (i.e. balance for each (owner, id) pair) + */ + function balanceOfBatch(address[] calldata _owners, uint256[] calldata _ids) external view returns (uint256[] memory); + + /** + * @notice Enable or disable approval for a third party ("operator") to manage all of caller's tokens + * @dev MUST emit the ApprovalForAll event on success + * @param _operator Address to add to the set of authorized operators + * @param _approved True if the operator is approved, false to revoke approval + */ + function setApprovalForAll(address _operator, bool _approved) external; + + /** + * @notice Queries the approval status of an operator for a given owner + * @param _owner The owner of the Tokens + * @param _operator Address of authorized operator + * @return True if the operator is approved, false if not + */ + function isApprovedForAll(address _owner, address _operator) external view returns (bool isOperator); + +} \ No newline at end of file diff --git a/src/tests/contracts/IERC1155TokenReceiver.sol b/src/tests/contracts/IERC1155TokenReceiver.sol new file mode 100644 index 0000000..0bc8c91 --- /dev/null +++ b/src/tests/contracts/IERC1155TokenReceiver.sol @@ -0,0 +1,47 @@ +pragma solidity ^0.5.12; + +/** + * @dev ERC-1155 interface for accepting safe transfers. + */ +interface IERC1155TokenReceiver { + + /** + * @notice Handle the receipt of a single ERC1155 token type + * @dev An ERC1155-compliant smart contract MUST call this function on the token recipient contract, at the end of a `safeTransferFrom` after the balance has been updated + * This function MAY throw to revert and reject the transfer + * Return of other amount than the magic value MUST result in the transaction being reverted + * Note: The token contract address is always the message sender + * @param _operator The address which called the `safeTransferFrom` function + * @param _from The address which previously owned the token + * @param _id The id of the token being transferred + * @param _amount The amount of tokens being transferred + * @param _data Additional data with no specified format + * @return `bytes4(keccak256("onERC1155Received(address,address,uint256,uint256,bytes)"))` + */ + function onERC1155Received(address _operator, address _from, uint256 _id, uint256 _amount, bytes calldata _data) external returns(bytes4); + + /** + * @notice Handle the receipt of multiple ERC1155 token types + * @dev An ERC1155-compliant smart contract MUST call this function on the token recipient contract, at the end of a `safeBatchTransferFrom` after the balances have been updated + * This function MAY throw to revert and reject the transfer + * Return of other amount than the magic value WILL result in the transaction being reverted + * Note: The token contract address is always the message sender + * @param _operator The address which called the `safeBatchTransferFrom` function + * @param _from The address which previously owned the token + * @param _ids An array containing ids of each token being transferred + * @param _amounts An array containing amounts of each token being transferred + * @param _data Additional data with no specified format + * @return `bytes4(keccak256("onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)"))` + */ + function onERC1155BatchReceived(address _operator, address _from, uint256[] calldata _ids, uint256[] calldata _amounts, bytes calldata _data) external returns(bytes4); + + /** + * @notice Indicates whether a contract implements the `ERC1155TokenReceiver` functions and so can accept ERC1155 token types. + * @param interfaceID The ERC-165 interface ID that is queried for support.s + * @dev This function MUST return true if it implements the ERC1155TokenReceiver interface and ERC-165 interface. + * This function MUST NOT consume more than 5,000 gas. + * @return Wheter ERC-165 or ERC1155TokenReceiver interfaces are supported. + */ + function supportsInterface(bytes4 interfaceID) external view returns (bool); + +} \ No newline at end of file diff --git a/src/tests/contracts/StringsV2.sol b/src/tests/contracts/StringsV2.sol new file mode 100644 index 0000000..5d01ea4 --- /dev/null +++ b/src/tests/contracts/StringsV2.sol @@ -0,0 +1,77 @@ +pragma solidity 0.5.17; + +library StringsV2 { + // via https://github.com/oraclize/ethereum-api/blob/master/oraclizeAPI_0.5.sol + function strConcat( + string memory _a, + string memory _b, + string memory _c, + string memory _d, + string memory _e + ) internal pure returns (string memory) { + bytes memory _ba = bytes(_a); + bytes memory _bb = bytes(_b); + bytes memory _bc = bytes(_c); + bytes memory _bd = bytes(_d); + bytes memory _be = bytes(_e); + string memory abcde = new string( + _ba.length + _bb.length + _bc.length + _bd.length + _be.length + ); + bytes memory babcde = bytes(abcde); + uint256 k = 0; + for (uint256 i = 0; i < _ba.length; i++) babcde[k++] = _ba[i]; + for (uint256 i = 0; i < _bb.length; i++) babcde[k++] = _bb[i]; + for (uint256 i = 0; i < _bc.length; i++) babcde[k++] = _bc[i]; + for (uint256 i = 0; i < _bd.length; i++) babcde[k++] = _bd[i]; + for (uint256 i = 0; i < _be.length; i++) babcde[k++] = _be[i]; + return string(babcde); + } + + function strConcat( + string memory _a, + string memory _b, + string memory _c, + string memory _d + ) internal pure returns (string memory) { + return strConcat(_a, _b, _c, _d, ""); + } + + function strConcat( + string memory _a, + string memory _b, + string memory _c + ) internal pure returns (string memory) { + return strConcat(_a, _b, _c, "", ""); + } + + function strConcat(string memory _a, string memory _b) + internal + pure + returns (string memory) + { + return strConcat(_a, _b, "", "", ""); + } + + function uint2str(uint256 _i) + internal + pure + returns (string memory _uintAsString) + { + if (_i == 0) { + return "0"; + } + uint256 j = _i; + uint256 len; + while (j != 0) { + len++; + j /= 10; + } + bytes memory bstr = new bytes(len); + uint256 k = len - 1; + while (_i != 0) { + bstr[k--] = bytes1(uint8(48 + (_i % 10))); + _i /= 10; + } + return string(bstr); + } +} diff --git a/src/tests/e2e/bridge-hrc1155.e2e-spec.ts b/src/tests/e2e/bridge-hrc1155.e2e-spec.ts new file mode 100644 index 0000000..5f84113 --- /dev/null +++ b/src/tests/e2e/bridge-hrc1155.e2e-spec.ts @@ -0,0 +1,254 @@ +import 'dotenv/config' +import { TxStatus } from '@harmony-js/transaction' +import { ChainType, hexToNumber } from '@harmony-js/utils' +import BN from 'bn.js' +import { expect, use } from 'chai' +import chaiAsPromised from 'chai-as-promised' +import { BridgedHRC1155Token, HRC1155EthManager, HRC1155HmyManager, HRC1155TokenManager } from '../../bridge' +import { HARMONY_RPC_DEVNET_WS } from '../../constants' +import { HRC1155 } from '../../contracts' +import { waitForNewBlock } from '../../utils' +import { + WALLET_HMY_MASTER, + WALLET_ETH_MASTER, + WALLET_ETH_OWNER, + WALLET_HMY_OWNER, + ETH_MASTER_ADDRESS, + HMY_MASTER_ADDRESS, + HMY_OWNER_ADDRESS, + ETH_OWNER_ADDRESS, + ContractName, + E2E_TX_OPTIONS, +} from '../constants' +import { deployContract, deployEthContract } from '../helpers' + +use(chaiAsPromised) + +describe('Bridge HRC1155 Token', () => { + const name = 'Blockcoders NFT' + const symbol = 'Blockcoders' + const tokenURI = 'https://fakeURI.com' + const tokenIds = [0, 1, 2] + const amounts = [10, 20, 30] + let lockTokenTxHash: string + let burnTokenTxHash: string + let hrc1155: HRC1155 + let ownerHrc1155: HRC1155 + let erc1155Addr: string + let bridgedToken: BridgedHRC1155Token + let ethManager: HRC1155EthManager + let ownerEthManager: HRC1155EthManager + let hmyManager: HRC1155HmyManager + let ownerHmyManager: HRC1155HmyManager + let tokenManager: HRC1155TokenManager + + before(async () => { + // Deploy contracts + const [hrc1155Options, ethManagerOptions] = await Promise.all([ + deployContract(ContractName.BlockcodersHRC1155, WALLET_HMY_MASTER, [name, symbol, tokenURI]), + deployEthContract(ContractName.HRC1155EthManager, WALLET_ETH_MASTER, [ETH_MASTER_ADDRESS]), + ]) + const [hmyManagerOptions, tokenManagerOptions] = await Promise.all([ + deployContract(ContractName.HRC1155HmyManager, WALLET_HMY_MASTER, [HMY_MASTER_ADDRESS]), + deployEthContract(ContractName.HRC1155TokenManager, WALLET_ETH_MASTER), + ]) + + // Create contract instances + hrc1155 = new HRC1155(hrc1155Options.addr, hrc1155Options.abi, WALLET_HMY_MASTER) + ownerHrc1155 = new HRC1155(hrc1155Options.addr, hrc1155Options.abi, WALLET_HMY_OWNER) + hmyManager = new HRC1155HmyManager(hmyManagerOptions.addr, WALLET_HMY_MASTER) + ownerHmyManager = new HRC1155HmyManager(hmyManagerOptions.addr, WALLET_HMY_OWNER) + ethManager = new HRC1155EthManager(ethManagerOptions.addr, WALLET_ETH_MASTER) + ownerEthManager = new HRC1155EthManager(ethManagerOptions.addr, WALLET_ETH_OWNER) + tokenManager = new HRC1155TokenManager(tokenManagerOptions.addr, WALLET_ETH_MASTER) + + // approve HRC1155EthManager on HRC1155TokenManager + const relyTx = await tokenManager.rely(ethManager.address) + console.info('HRC1155TokenManager rely tx hash: ', relyTx.transactionHash) + + // Add token manager + const addTokenTx = await ethManager.addToken(tokenManager.address, hrc1155.address, name, symbol, tokenURI) + console.info('HRC1155EthManager addToken tx hash: ', addTokenTx.transactionHash) + + erc1155Addr = await ethManager.mappings(hrc1155.address) + bridgedToken = new BridgedHRC1155Token(erc1155Addr, WALLET_ETH_OWNER) + }) + + it('contracts should be defined', () => { + expect(hrc1155).to.not.be.undefined + expect(ownerHrc1155).to.not.be.undefined + expect(bridgedToken).to.not.be.undefined + expect(ethManager).to.not.be.undefined + expect(hmyManager).to.not.be.undefined + expect(tokenManager).to.not.be.undefined + }) + + describe('Send HRC1155 from Harmony to Ethereum network', () => { + it('hrc1155 holder should have zero tokens before mint', async () => { + const balance1 = await hrc1155.balanceOf(HMY_OWNER_ADDRESS, tokenIds[0], E2E_TX_OPTIONS) + const balance2 = await hrc1155.balanceOf(HMY_OWNER_ADDRESS, tokenIds[1], E2E_TX_OPTIONS) + expect(balance1.isZero()).to.be.true + expect(balance2.isZero()).to.be.true + }) + + it(`hrc1155 holder should have ${amounts[0]} token with tokenId ${tokenIds[0]} and ${amounts[1]} tokens with tokenId ${tokenIds[1]} after mint`, async () => { + const mintTx1 = await hrc1155.mint(HMY_OWNER_ADDRESS, tokenIds[0], amounts[0], E2E_TX_OPTIONS) + console.info('HRC1155Mintable mint tx hash: ', mintTx1.id) + const balance1 = await hrc1155.balanceOf(HMY_OWNER_ADDRESS, tokenIds[0], E2E_TX_OPTIONS) + expect(mintTx1.txStatus).eq(TxStatus.CONFIRMED) + expect(balance1.isZero()).to.not.be.true + expect(balance1.eq(new BN(amounts[0]))).to.be.true + + const mintTx2 = await hrc1155.mint(HMY_OWNER_ADDRESS, tokenIds[1], amounts[1], E2E_TX_OPTIONS) + console.info('HRC1155Mintable mint tx hash: ', mintTx2.id) + const balance2 = await hrc1155.balanceOf(HMY_OWNER_ADDRESS, tokenIds[1], E2E_TX_OPTIONS) + expect(mintTx2.txStatus).eq(TxStatus.CONFIRMED) + expect(balance2.isZero()).to.not.be.true + expect(balance2.eq(new BN(amounts[1]))).to.be.true + }) + + it('hrc1155 holder should approve Harmony Manager', async () => { + const approveTx = await ownerHrc1155.setApprovalForAll(hmyManager.address, true, E2E_TX_OPTIONS) + + expect(approveTx.id).to.not.be.undefined + expect(approveTx.txStatus).eq(TxStatus.CONFIRMED) + + console.info('HRC1155 approve tx hash: ', approveTx.id) + }) + + it('Harmony Manager should lock the holder tokens', async () => { + const balanceBeforeLock1 = await hrc1155.balanceOf(HMY_OWNER_ADDRESS, tokenIds[0], E2E_TX_OPTIONS) + const balanceBeforeLock2 = await hrc1155.balanceOf(HMY_OWNER_ADDRESS, tokenIds[1], E2E_TX_OPTIONS) + + expect(balanceBeforeLock1.eq(new BN(amounts[0]))).to.be.true + expect(balanceBeforeLock2.eq(new BN(amounts[1]))).to.be.true + + // This is necessary because the contract can only lock for the msg.sender + const lockTokenTx = await ownerHmyManager.lockHRC1155Tokens( + hrc1155.address, + tokenIds, + ETH_OWNER_ADDRESS, + amounts, + [], + E2E_TX_OPTIONS, + ) + + lockTokenTxHash = lockTokenTx.id + + expect(lockTokenTxHash).to.not.be.undefined + expect(lockTokenTx.receipt?.blockNumber).to.not.be.undefined + expect(lockTokenTx.txStatus).eq(TxStatus.CONFIRMED) + + console.info('HRC1155HmyManager lockTokenFor tx hash: ', lockTokenTxHash) + + await waitForNewBlock( + parseInt(hexToNumber(lockTokenTx.receipt?.blockNumber ?? ''), 10) + 6, + HARMONY_RPC_DEVNET_WS, + ChainType.Harmony, + 4, + ) + + const balanceAfterLock1 = await hrc1155.balanceOf(HMY_OWNER_ADDRESS, tokenIds[0], E2E_TX_OPTIONS) + const balanceAfterLock2 = await hrc1155.balanceOf(HMY_OWNER_ADDRESS, tokenIds[1], E2E_TX_OPTIONS) + const balanceHmyManager1 = await hrc1155.balanceOf(hmyManager.address, tokenIds[0], E2E_TX_OPTIONS) + const balanceHmyManager2 = await hrc1155.balanceOf(hmyManager.address, tokenIds[1], E2E_TX_OPTIONS) + + expect(balanceAfterLock1.isZero()).to.be.true + expect(balanceAfterLock2.isZero()).to.be.true + expect(balanceHmyManager1.eq(new BN(amounts[0]))).to.be.true + expect(balanceHmyManager2.eq(new BN(amounts[1]))).to.be.true + }) + + it(`erc1155 holder should have ${amounts[0]} token with id ${tokenIds[0]} and ${amounts[1]} token with id ${tokenIds[1]} after mint in eth side`, async () => { + const balanceBeforeMint1 = await bridgedToken.balanceOf(ETH_OWNER_ADDRESS, tokenIds[0]) + const balanceBeforeMint2 = await bridgedToken.balanceOf(ETH_OWNER_ADDRESS, tokenIds[1]) + + expect(balanceBeforeMint1.isZero()).to.be.true + expect(balanceBeforeMint2.isZero()).to.be.true + + const mintTokenTx = await ethManager.mintTokens( + erc1155Addr, + tokenIds, + amounts, + ETH_OWNER_ADDRESS, + lockTokenTxHash, + [], + ) + + expect(mintTokenTx.transactionHash).to.not.be.undefined + expect(mintTokenTx.status).eq(1) // The status of a transaction is 1 is successful + + console.info('HRC1155EthManager mintToken tx hash: ', mintTokenTx.transactionHash) + + const balanceAfterLock1 = await bridgedToken.balanceOf(ETH_OWNER_ADDRESS, tokenIds[0]) + const balanceAfterLock2 = await bridgedToken.balanceOf(ETH_OWNER_ADDRESS, tokenIds[1]) + + expect(balanceAfterLock1.eq(amounts[0])).to.be.true + expect(balanceAfterLock2.eq(amounts[1])).to.be.true + }) + }) + + describe('Send an ERC1155 (BridgedToken) from Ethereum to Harmony Network', () => { + it('erc1155 holder should approve Ethereum Manager', async () => { + const approveTx = await bridgedToken.setApprovalForAll(ethManager.address, true) + + expect(approveTx.transactionHash).to.not.be.undefined + expect(approveTx.status).eq(1) // The status of a transaction is 1 is successful + + console.info('HRC1155 approve tx hash: ', approveTx.transactionHash) + }) + + it('erc1155 holder should burn the token through Ethereum Manager', async () => { + const balanceBeforeBurn1 = await bridgedToken.balanceOf(ETH_OWNER_ADDRESS, tokenIds[0]) + const balanceBeforeBurn2 = await bridgedToken.balanceOf(ETH_OWNER_ADDRESS, tokenIds[1]) + + expect(balanceBeforeBurn1.eq(amounts[0])).to.be.true + expect(balanceBeforeBurn2.eq(amounts[1])).to.be.true + + const burnTx = await ownerEthManager.burnTokens(erc1155Addr, tokenIds, HMY_OWNER_ADDRESS, amounts) + + expect(burnTx.transactionHash).to.not.be.undefined + expect(burnTx.status).eq(1) // The status of a transaction is 1 is successful + + burnTokenTxHash = burnTx.transactionHash + + console.info('HRC1155EthManager burnToken tx hash: ', burnTokenTxHash) + + const balanceAfterBurn1 = await bridgedToken.balanceOf(ETH_OWNER_ADDRESS, tokenIds[0]) + const balanceAfterBurn2 = await bridgedToken.balanceOf(ETH_OWNER_ADDRESS, tokenIds[1]) + + expect(balanceAfterBurn1.isZero()).to.be.true + expect(balanceAfterBurn2.isZero()).to.be.true + }) + + it(`hrc1155 holder should have 1 token after unlock in Harmony side`, async () => { + const balanceBeforeUnlock1 = await hrc1155.balanceOf(HMY_OWNER_ADDRESS, tokenIds[0], E2E_TX_OPTIONS) + const balanceBeforeUnlock2 = await hrc1155.balanceOf(HMY_OWNER_ADDRESS, tokenIds[1], E2E_TX_OPTIONS) + + expect(balanceBeforeUnlock1.isZero()).to.be.true + expect(balanceBeforeUnlock2.isZero()).to.be.true + + const unlockTokenTx = await hmyManager.unlockHRC1155Tokens( + hrc1155.address, + tokenIds, + amounts, + HMY_OWNER_ADDRESS, + burnTokenTxHash, + [], + E2E_TX_OPTIONS, + ) + + expect(unlockTokenTx.id).to.not.be.undefined + expect(unlockTokenTx.receipt?.blockNumber).to.not.be.undefined + expect(unlockTokenTx.txStatus).eq(TxStatus.CONFIRMED) + + console.info('HRC1155HmyManager lockTokenFor tx hash: ', lockTokenTxHash) + + const balanceAfterUnLock1 = await hrc1155.balanceOf(HMY_OWNER_ADDRESS, tokenIds[0], E2E_TX_OPTIONS) + const balanceAfterUnLock2 = await hrc1155.balanceOf(HMY_OWNER_ADDRESS, tokenIds[1], E2E_TX_OPTIONS) + + expect(balanceAfterUnLock1.eq(new BN(amounts[0]))).to.be.true + expect(balanceAfterUnLock2.eq(new BN(amounts[1]))).to.be.true + }) + }) +}) diff --git a/src/tests/e2e/bridge-hrc20.e2e-spec.ts b/src/tests/e2e/bridge-hrc20.e2e-spec.ts new file mode 100644 index 0000000..074b52f --- /dev/null +++ b/src/tests/e2e/bridge-hrc20.e2e-spec.ts @@ -0,0 +1,213 @@ +import 'dotenv/config' +import { TxStatus } from '@harmony-js/transaction' +import { ChainType, hexToNumber } from '@harmony-js/utils' +import BN from 'bn.js' +import { expect, use } from 'chai' +import chaiAsPromised from 'chai-as-promised' +import { BridgedHRC20Token, HRC20EthManager, HRC20HmyManager, HRC20TokenManager } from '../../bridge' +import { HARMONY_RPC_DEVNET_WS } from '../../constants' +import { HRC20 } from '../../contracts' +import { waitForNewBlock } from '../../utils' +import { + WALLET_HMY_MASTER, + WALLET_ETH_MASTER, + WALLET_ETH_OWNER, + WALLET_HMY_OWNER, + ETH_MASTER_ADDRESS, + HMY_MASTER_ADDRESS, + HMY_OWNER_ADDRESS, + ETH_OWNER_ADDRESS, + ContractName, + E2E_TX_OPTIONS, +} from '../constants' +import { deployContract, deployEthContract } from '../helpers' + +use(chaiAsPromised) + +describe('Bridge HRC20 Token', () => { + const name = 'Blockcoders' + const symbol = 'BC' + const decimals = 18 + const amount = (500 * 10 ** decimals).toString() // 500 in Gwei + let lockTokenTxHash: string + let burnTokenTxHash: string + let hrc20: HRC20 + let ownerHrc20: HRC20 + let erc20Addr: string + let bridgedToken: BridgedHRC20Token + let ethManager: HRC20EthManager + let ownerEthManager: HRC20EthManager + let hmyManager: HRC20HmyManager + let tokenManager: HRC20TokenManager + + before(async () => { + // Deploy contracts + const [hrc20Options, ethManagerOptions] = await Promise.all([ + deployContract(ContractName.BlockcodersHRC20, WALLET_HMY_MASTER, [name, symbol, decimals]), + deployEthContract(ContractName.HRC20EthManager, WALLET_ETH_MASTER, [ETH_MASTER_ADDRESS]), + ]) + const [hmyManagerOptions, tokenManagerOptions] = await Promise.all([ + deployContract(ContractName.HRC20HmyManager, WALLET_HMY_MASTER, [HMY_MASTER_ADDRESS]), + deployEthContract(ContractName.HRC20TokenManager, WALLET_ETH_MASTER), + ]) + + // Create contract instances + hrc20 = new HRC20(hrc20Options.addr, hrc20Options.abi, WALLET_HMY_MASTER) + ownerHrc20 = new HRC20(hrc20Options.addr, hrc20Options.abi, WALLET_HMY_OWNER) + hmyManager = new HRC20HmyManager(hmyManagerOptions.addr, WALLET_HMY_MASTER) + ethManager = new HRC20EthManager(ethManagerOptions.addr, WALLET_ETH_MASTER) + ownerEthManager = new HRC20EthManager(ethManagerOptions.addr, WALLET_ETH_OWNER) + tokenManager = new HRC20TokenManager(tokenManagerOptions.addr, WALLET_ETH_MASTER) + + // approve HRC20EthManager on HRC20TokenManager + const relyTx = await tokenManager.rely(ethManager.address) + console.info('HRC20TokenManager rely tx hash: ', relyTx.transactionHash) + + // Add token manager + const addTokenTx = await ethManager.addToken(tokenManager.address, hrc20.address, name, symbol, decimals) + console.info('HRC20EthManager addToken tx hash: ', addTokenTx.transactionHash) + + erc20Addr = await ethManager.mappings(hrc20.address) + bridgedToken = new BridgedHRC20Token(erc20Addr, WALLET_ETH_OWNER) + }) + + it('contracts should be defined', () => { + expect(hrc20).to.not.be.undefined + expect(ownerHrc20).to.not.be.undefined + expect(bridgedToken).to.not.be.undefined + expect(ethManager).to.not.be.undefined + expect(hmyManager).to.not.be.undefined + expect(tokenManager).to.not.be.undefined + }) + + it('hrc20 holder should have zero tokens before mint', async () => { + const balance = await hrc20.balanceOf(HMY_OWNER_ADDRESS, E2E_TX_OPTIONS) + + expect(balance.isZero()).to.be.true + }) + + it(`hrc20 holder should have ${amount} tokens after mint`, async () => { + const mintTx = await hrc20.mint(HMY_OWNER_ADDRESS, amount, E2E_TX_OPTIONS) + + console.info('HRC20 mint tx hash: ', mintTx.id) + + const balance = await hrc20.balanceOf(HMY_OWNER_ADDRESS, E2E_TX_OPTIONS) + + expect(mintTx.txStatus).eq(TxStatus.CONFIRMED) + expect(balance.isZero()).to.not.be.true + expect(balance.eq(new BN(amount))).to.be.true + }) + + it('hrc20 holder should approve Harmony Manager', async () => { + const approveTx = await ownerHrc20.approve(hmyManager.address, amount, E2E_TX_OPTIONS) + + expect(approveTx.id).to.not.be.undefined + expect(approveTx.txStatus).eq(TxStatus.CONFIRMED) + + console.info('HRC20 approve tx hash: ', approveTx.id) + }) + + it('Harmony Manager should lock the holder tokens', async () => { + const balanceBeforeLock = await hrc20.balanceOf(HMY_OWNER_ADDRESS, E2E_TX_OPTIONS) + + expect(balanceBeforeLock.eq(new BN(amount))).to.be.true + + const lockTokenTx = await hmyManager.lockTokenFor( + hrc20.address, + HMY_OWNER_ADDRESS, + amount, + HMY_OWNER_ADDRESS, + E2E_TX_OPTIONS, + ) + + lockTokenTxHash = lockTokenTx.id + + expect(lockTokenTxHash).to.not.be.undefined + expect(lockTokenTx.receipt?.blockNumber).to.not.be.undefined + expect(lockTokenTx.txStatus).eq(TxStatus.CONFIRMED) + + console.info('HRC20HmyManager lockTokenFor tx hash: ', lockTokenTxHash) + + await waitForNewBlock( + parseInt(hexToNumber(lockTokenTx.receipt?.blockNumber ?? ''), 10) + 6, + HARMONY_RPC_DEVNET_WS, + ChainType.Harmony, + 4, + ) + + const balanceAfterLock = await hrc20.balanceOf(HMY_OWNER_ADDRESS, E2E_TX_OPTIONS) + const balanceHmyManager = await hrc20.balanceOf(hmyManager.address, E2E_TX_OPTIONS) + + expect(balanceAfterLock.isZero()).to.be.true + expect(balanceHmyManager.eq(new BN(amount))).to.be.true + }) + + it(`erc20 holder should have ${amount} tokens after mint in eth side`, async () => { + const balanceBeforeMint = await bridgedToken.balanceOf(ETH_OWNER_ADDRESS) + + expect(balanceBeforeMint.isZero()).to.be.true + + const mintTokenTx = await ethManager.mintToken(erc20Addr, amount, ETH_OWNER_ADDRESS, lockTokenTxHash) + + expect(mintTokenTx.transactionHash).to.not.be.undefined + expect(mintTokenTx.status).eq(1) // The status of a transaction is 1 is successful + + console.info('HRC20EthManager mintToken tx hash: ', mintTokenTx.transactionHash) + + const balanceAfterLock = await bridgedToken.balanceOf(ETH_OWNER_ADDRESS) + + expect(balanceAfterLock.eq(amount)).to.be.true + }) + + it('erc20 holder should approve Ethereum Manager', async () => { + const approveTx = await bridgedToken.approve(ethManager.address, amount) + + expect(approveTx.transactionHash).to.not.be.undefined + expect(approveTx.status).eq(1) // The status of a transaction is 1 is successful + + console.info('HRC20 approve tx hash: ', approveTx.transactionHash) + }) + + it('erc20 holder should burn the tokens through Ethereum Manager', async () => { + const balanceBeforeBurn = await bridgedToken.balanceOf(ETH_OWNER_ADDRESS) + + expect(balanceBeforeBurn.eq(amount)).to.be.true + + const burnTx = await ownerEthManager.burnToken(erc20Addr, amount, HMY_OWNER_ADDRESS) + + expect(burnTx.transactionHash).to.not.be.undefined + expect(burnTx.status).eq(1) // The status of a transaction is 1 is successful + + burnTokenTxHash = burnTx.transactionHash + + console.info('HRC20EthManager burnToken tx hash: ', burnTokenTxHash) + + const balanceAfterBurn = await bridgedToken.balanceOf(ETH_OWNER_ADDRESS) + + expect(balanceAfterBurn.isZero()).to.be.true + }) + + it(`hrc20 holder should have ${amount} tokens after unlock in Harmony side`, async () => { + const balanceBeforeUnlock = await hrc20.balanceOf(HMY_OWNER_ADDRESS, E2E_TX_OPTIONS) + + expect(balanceBeforeUnlock.isZero()).to.be.true + + const unlockTokenTx = await hmyManager.unlockToken( + hrc20.address, + amount, + HMY_OWNER_ADDRESS, + burnTokenTxHash, + E2E_TX_OPTIONS, + ) + + expect(unlockTokenTx.id).to.not.be.undefined + expect(unlockTokenTx.receipt?.blockNumber).to.not.be.undefined + expect(unlockTokenTx.txStatus).eq(TxStatus.CONFIRMED) + + console.info('HRC20HmyManager unlockTokenFor tx hash: ', unlockTokenTx.id) + + const balanceAfterUnLock = await hrc20.balanceOf(HMY_OWNER_ADDRESS, E2E_TX_OPTIONS) + + expect(balanceAfterUnLock.eq(new BN(amount))).to.be.true + }) +}) diff --git a/src/tests/e2e/bridge-hrc721.e2e-spec.ts b/src/tests/e2e/bridge-hrc721.e2e-spec.ts new file mode 100644 index 0000000..8a470c1 --- /dev/null +++ b/src/tests/e2e/bridge-hrc721.e2e-spec.ts @@ -0,0 +1,214 @@ +import 'dotenv/config' +import { TxStatus } from '@harmony-js/transaction' +import { ChainType, hexToNumber } from '@harmony-js/utils' +import BN from 'bn.js' +import { expect, use } from 'chai' +import chaiAsPromised from 'chai-as-promised' +import { BridgedHRC721Token, HRC721EthManager, HRC721HmyManager, HRC721TokenManager } from '../../bridge' +import { HARMONY_RPC_DEVNET_WS } from '../../constants' +import { HRC721 } from '../../contracts' +import { waitForNewBlock } from '../../utils' +import { + WALLET_HMY_MASTER, + WALLET_ETH_MASTER, + WALLET_ETH_OWNER, + WALLET_HMY_OWNER, + ETH_MASTER_ADDRESS, + HMY_MASTER_ADDRESS, + HMY_OWNER_ADDRESS, + ETH_OWNER_ADDRESS, + ContractName, + E2E_TX_OPTIONS, +} from '../constants' +import { deployContract, deployEthContract } from '../helpers' + +use(chaiAsPromised) + +describe('Bridge HRC721 Token', () => { + const name = 'Blockcoders NFT' + const symbol = 'Blockcoders' + const tokenURI = 'https://fakeURI.com' + const tokenId = 1 + let lockTokenTxHash: string + let burnTokenTxHash: string + let hrc721: HRC721 + let ownerHrc721: HRC721 + let erc721Addr: string + let bridgedToken: BridgedHRC721Token + let ethManager: HRC721EthManager + let ownerEthManager: HRC721EthManager + let hmyManager: HRC721HmyManager + let ownerHmyManager: HRC721HmyManager + let tokenManager: HRC721TokenManager + + before(async () => { + // Deploy contracts + const [hrc721Options, ethManagerOptions] = await Promise.all([ + deployContract(ContractName.BlockcodersHRC721, WALLET_HMY_MASTER, [name, symbol, tokenURI]), + deployEthContract(ContractName.HRC721EthManager, WALLET_ETH_MASTER, [ETH_MASTER_ADDRESS]), + ]) + const [hmyManagerOptions, tokenManagerOptions] = await Promise.all([ + deployContract(ContractName.HRC721HmyManager, WALLET_HMY_MASTER, [HMY_MASTER_ADDRESS]), + deployEthContract(ContractName.HRC721TokenManager, WALLET_ETH_MASTER), + ]) + + // Create contract instances + hrc721 = new HRC721(hrc721Options.addr, hrc721Options.abi, WALLET_HMY_MASTER) + ownerHrc721 = new HRC721(hrc721Options.addr, hrc721Options.abi, WALLET_HMY_OWNER) + hmyManager = new HRC721HmyManager(hmyManagerOptions.addr, WALLET_HMY_MASTER) + ownerHmyManager = new HRC721HmyManager(hmyManagerOptions.addr, WALLET_HMY_OWNER) + ethManager = new HRC721EthManager(ethManagerOptions.addr, WALLET_ETH_MASTER) + ownerEthManager = new HRC721EthManager(ethManagerOptions.addr, WALLET_ETH_OWNER) + tokenManager = new HRC721TokenManager(tokenManagerOptions.addr, WALLET_ETH_MASTER) + + // approve HRC721EthManager on HRC721TokenManager + const relyTx = await tokenManager.rely(ethManager.address) + console.info('HRC721TokenManager rely tx hash: ', relyTx.transactionHash) + + // Add token manager + const addTokenTx = await ethManager.addToken(tokenManager.address, hrc721.address, name, symbol, tokenURI) + console.info('HRC721EthManager addToken tx hash: ', addTokenTx.transactionHash) + + erc721Addr = await ethManager.mappings(hrc721.address) + bridgedToken = new BridgedHRC721Token(erc721Addr, WALLET_ETH_OWNER) + }) + + it('contracts should be defined', () => { + expect(hrc721).to.not.be.undefined + expect(ownerHrc721).to.not.be.undefined + expect(bridgedToken).to.not.be.undefined + expect(ethManager).to.not.be.undefined + expect(hmyManager).to.not.be.undefined + expect(tokenManager).to.not.be.undefined + }) + + describe('Send a HRC721 from Harmony to Ethereum network', () => { + it('hrc721 holder should have zero tokens before mint', async () => { + const balance = await hrc721.balanceOf(HMY_OWNER_ADDRESS, E2E_TX_OPTIONS) + expect(balance.isZero()).to.be.true + }) + + it(`hrc721 holder should have one token after mint`, async () => { + const mintTx = await hrc721.mint(HMY_OWNER_ADDRESS, tokenId, E2E_TX_OPTIONS) + console.info('HRC721 mint tx hash: ', mintTx.id) + + const balance = await hrc721.balanceOf(HMY_OWNER_ADDRESS, E2E_TX_OPTIONS) + + expect(mintTx.txStatus).eq(TxStatus.CONFIRMED) + expect(balance.isZero()).to.not.be.true + expect(balance.eq(new BN(1))).to.be.true + }) + + it('hrc721 holder should approve Harmony Manager', async () => { + const approveTx = await ownerHrc721.approve(hmyManager.address, tokenId, E2E_TX_OPTIONS) + + expect(approveTx.id).to.not.be.undefined + expect(approveTx.txStatus).eq(TxStatus.CONFIRMED) + + console.info('HRC721 approve tx hash: ', approveTx.id) + }) + + it('Harmony Manager should lock the holder tokens', async () => { + const balanceBeforeLock = await hrc721.balanceOf(HMY_OWNER_ADDRESS, E2E_TX_OPTIONS) + expect(balanceBeforeLock.eq(new BN(1))).to.be.true + // This is necessary because the contract can only lock for the msg.sender + const lockTokenTx = await ownerHmyManager.lockNFT721Token( + hrc721.address, + tokenId, + ETH_OWNER_ADDRESS, + E2E_TX_OPTIONS, + ) + lockTokenTxHash = lockTokenTx.id + + expect(lockTokenTxHash).to.not.be.undefined + expect(lockTokenTx.receipt?.blockNumber).to.not.be.undefined + expect(lockTokenTx.txStatus).eq(TxStatus.CONFIRMED) + + console.info('HRC721HmyManager lockNFT721Token tx hash: ', lockTokenTxHash) + + await waitForNewBlock( + parseInt(hexToNumber(lockTokenTx.receipt?.blockNumber ?? ''), 10) + 6, + HARMONY_RPC_DEVNET_WS, + ChainType.Harmony, + 4, + ) + + const balanceAfterLock = await hrc721.balanceOf(HMY_OWNER_ADDRESS, E2E_TX_OPTIONS) + const balanceHmyManager = await hrc721.balanceOf(hmyManager.address, E2E_TX_OPTIONS) + + expect(balanceAfterLock.isZero()).to.be.true + expect(balanceHmyManager.eq(new BN(1))).to.be.true + }) + + it(`erc721 holder should have one token with id ${tokenId} after mint in eth side`, async () => { + const balanceBeforeMint = await bridgedToken.balanceOf(ETH_OWNER_ADDRESS) + + expect(balanceBeforeMint.isZero()).to.be.true + + const mintTokenTx = await ethManager.mintToken(erc721Addr, tokenId, ETH_OWNER_ADDRESS, lockTokenTxHash) + + expect(mintTokenTx.transactionHash).to.not.be.undefined + expect(mintTokenTx.status).eq(1) // The status of a transaction is 1 is successful + + console.info('HRC721EthManager mintToken tx hash: ', mintTokenTx.transactionHash) + + const balanceAfterLock = await bridgedToken.balanceOf(ETH_OWNER_ADDRESS) + + expect(balanceAfterLock.eq(1)).to.be.true + }) + }) + + describe('Send an ERC721 (BridgedToken) from Ethereum to Harmony Network', () => { + it('erc721 holder should approve Ethereum Manager', async () => { + const approveTx = await bridgedToken.approve(ethManager.address, tokenId) + + expect(approveTx.transactionHash).to.not.be.undefined + expect(approveTx.status).eq(1) // The status of a transaction is 1 is successful + + console.info('ERC721 (Bridged Token) approve tx hash: ', approveTx.transactionHash) + }) + + it('erc721 holder should burn the token through Ethereum Manager', async () => { + const balanceBeforeBurn = await bridgedToken.balanceOf(ETH_OWNER_ADDRESS) + + expect(balanceBeforeBurn.eq(1)).to.be.true + + const burnTx = await ownerEthManager.burnToken(erc721Addr, tokenId, HMY_OWNER_ADDRESS) + + expect(burnTx.transactionHash).to.not.be.undefined + expect(burnTx.status).eq(1) // The status of a transaction is 1 is successful + + burnTokenTxHash = burnTx.transactionHash + + console.info('HRC721EthManager burnToken tx hash: ', burnTokenTxHash) + + const balanceAfterBurn = await bridgedToken.balanceOf(ETH_OWNER_ADDRESS) + + expect(balanceAfterBurn.isZero()).to.be.true + }) + + it(`hrc721 holder should have 1 token after unlock in Harmony side`, async () => { + const balanceBeforeUnlock = await hrc721.balanceOf(HMY_OWNER_ADDRESS, E2E_TX_OPTIONS) + + expect(balanceBeforeUnlock.isZero()).to.be.true + + const unlockTokenTx = await hmyManager.unlockToken( + hrc721.address, + tokenId, + HMY_OWNER_ADDRESS, + burnTokenTxHash, + E2E_TX_OPTIONS, + ) + + expect(unlockTokenTx.id).to.not.be.undefined + expect(unlockTokenTx.receipt?.blockNumber).to.not.be.undefined + expect(unlockTokenTx.txStatus).eq(TxStatus.CONFIRMED) + + console.info('HRC721HmyManager unlockTokenFor tx hash: ', unlockTokenTx.id) + + const balanceAfterUnLock = await hrc721.balanceOf(HMY_OWNER_ADDRESS, E2E_TX_OPTIONS) + + expect(balanceAfterUnLock.eq(new BN(1))).to.be.true + }) + }) +}) diff --git a/src/tests/e2e/bridge-token.e2e-spec.ts b/src/tests/e2e/bridge-token.e2e-spec.ts new file mode 100644 index 0000000..1918534 --- /dev/null +++ b/src/tests/e2e/bridge-token.e2e-spec.ts @@ -0,0 +1,331 @@ +import { TxStatus } from '@harmony-js/transaction' +import BN from 'bn.js' +import { expect, use } from 'chai' +import chaiAsPromised from 'chai-as-promised' +import { + BridgedHRC1155Token, + BridgedHRC20Token, + BridgedHRC721Token, + HRC1155EthManager, + HRC1155HmyManager, + HRC20EthManager, + HRC20HmyManager, + HRC721EthManager, + HRC721HmyManager, +} from '../../bridge' +import { BridgeHRC1155Token } from '../../bridge/bridgeHrc1155Token' +import { BridgeHRC20Token } from '../../bridge/bridgeHrc20Token' +import { BridgeHRC721Token } from '../../bridge/bridgeHrc721Token' +import { + BridgeType, + DEVNET_HRC20_CONTRACTS_ADDRESSES, + DEVNET_HRC721_CONTRACTS_ADDRESSES, + DEVNET_HRC1155_CONTRACTS_ADDRESSES, + HARMONY_RPC_DEVNET_WS, + NetworkInfo, +} from '../../constants' +import { HRC1155, HRC20, HRC721 } from '../../contracts' +import { HRC1155Info, HRC20Info, HRC721Info } from '../../interfaces' +import { + WALLET_ETH_MASTER, + WALLET_HMY_MASTER, + WALLET_HMY_OWNER, + WALLET_ETH_OWNER, + HMY_OWNER_ADDRESS, + ETH_OWNER_ADDRESS, + ContractName, + E2E_TX_OPTIONS, +} from '../constants' +import { deployContract } from '../helpers' + +use(chaiAsPromised) + +describe('Bridge Token', () => { + const sender = ETH_OWNER_ADDRESS + const recipient = HMY_OWNER_ADDRESS + const name = 'Blockcoders' + const symbol = 'BC' + + describe('Bridge HRC20 Tokens', () => { + const decimals = 18 + const amount = (500 * 10 ** decimals).toString() // 500 in Gwei + const tokenInfo: HRC20Info = { amount, ws: HARMONY_RPC_DEVNET_WS, waitingFor: 6 } + const hmyManager = new HRC20HmyManager(DEVNET_HRC20_CONTRACTS_ADDRESSES.hmyManagerAddress, WALLET_HMY_MASTER) + let hrc20: HRC20 + let bridge: BridgeHRC20Token + + before(async () => { + const { addr, abi } = await deployContract(ContractName.BlockcodersHRC20, WALLET_HMY_MASTER, [ + name, + symbol, + decimals, + ]) + + const token = new HRC20(addr, abi, WALLET_HMY_MASTER) + + await token.mint(HMY_OWNER_ADDRESS, amount, E2E_TX_OPTIONS) + + hrc20 = new HRC20(addr, abi, WALLET_HMY_OWNER) + bridge = new BridgeHRC20Token(WALLET_HMY_OWNER, WALLET_ETH_OWNER, WALLET_ETH_MASTER.provider, NetworkInfo.DEVNET) + }) + + it('Should send the tokens from Hmy to Eth', async () => { + const balanceBeforeLock = await hrc20.balanceOf(HMY_OWNER_ADDRESS, E2E_TX_OPTIONS) + + expect(balanceBeforeLock.eq(new BN(amount))).to.be.true + + const { addr, receiptId } = await bridge.sendToken( + BridgeType.HMY_TO_ETH, + sender, + recipient, + hrc20, + tokenInfo, + E2E_TX_OPTIONS, + ) + const balanceAfterLock = await hrc20.balanceOf(HMY_OWNER_ADDRESS, E2E_TX_OPTIONS) + const balanceHmyManager = await hrc20.balanceOf(hmyManager.address, E2E_TX_OPTIONS) + + expect(balanceAfterLock.isZero()).to.be.true + expect(balanceHmyManager.eq(new BN(amount))).to.be.true + + const ethManager = new HRC20EthManager(DEVNET_HRC20_CONTRACTS_ADDRESSES.ethManagerAddress, WALLET_ETH_MASTER) + + // Mint tokens on Eth side as validators + const mintTokenTx = await ethManager.mintToken(addr, amount, recipient, receiptId) + + console.info('HRC20EthManager mintToken tx hash: ', mintTokenTx.transactionHash) + + expect(mintTokenTx.transactionHash).to.not.be.undefined + expect(mintTokenTx.status).eq(1) + }) + + it('Should send the tokens from Eth to Hmy', async () => { + const erc20Addr = await bridge.getBridgedTokenAddress(hrc20, E2E_TX_OPTIONS) + const bridgedToken = new BridgedHRC20Token(erc20Addr, WALLET_ETH_OWNER) + const balanceBeforeBurn = await bridgedToken.balanceOf(ETH_OWNER_ADDRESS) + + expect(balanceBeforeBurn.eq(amount)).to.be.true + + const { addr, receiptId } = await bridge.sendToken( + BridgeType.ETH_TO_HMY, + sender, + recipient, + hrc20, + tokenInfo, + E2E_TX_OPTIONS, + ) + + const balanceAfterBurn = await bridgedToken.balanceOf(ETH_OWNER_ADDRESS) + + expect(balanceAfterBurn.isZero()).to.be.true + + // Unlock Tokens on Harmony Netowrk + const unlockTokenTx = await hmyManager.unlockToken(addr, amount, recipient, receiptId, E2E_TX_OPTIONS) + + console.info('HRC20HmyManager unlockToken on Harmony Network. Transaction Hash: ', unlockTokenTx?.id) + + expect(unlockTokenTx.id).to.not.be.undefined + expect(unlockTokenTx.receipt?.blockNumber).to.not.be.undefined + expect(unlockTokenTx.txStatus).eq(TxStatus.CONFIRMED) + }) + }) + + describe('Bridge HRC721 Tokens', () => { + const tokenURI = 'https://fakeURI.com' + const tokenId = 1 + const tokenInfo: HRC721Info = { tokenId, ws: HARMONY_RPC_DEVNET_WS, waitingFor: 6 } + const hmyManager = new HRC721HmyManager(DEVNET_HRC721_CONTRACTS_ADDRESSES.hmyManagerAddress, WALLET_HMY_MASTER) + let hrc721: HRC721 + let bridge: BridgeHRC721Token + + before(async () => { + const { addr, abi } = await deployContract(ContractName.BlockcodersHRC721, WALLET_HMY_MASTER, [ + name, + symbol, + tokenURI, + ]) + const token = new HRC721(addr, abi, WALLET_HMY_MASTER) + + await token.mint(HMY_OWNER_ADDRESS, tokenId, E2E_TX_OPTIONS) + + hrc721 = new HRC721(addr, abi, WALLET_HMY_OWNER) + bridge = new BridgeHRC721Token(WALLET_HMY_OWNER, WALLET_ETH_OWNER, WALLET_ETH_MASTER.provider, NetworkInfo.DEVNET) + }) + + it('Should send the tokens from Hmy to Eth', async () => { + const balanceBeforeLock = await hrc721.balanceOf(HMY_OWNER_ADDRESS, E2E_TX_OPTIONS) + + expect(balanceBeforeLock.eq(new BN(tokenId))).to.be.true + + const { addr, receiptId } = await bridge.sendToken( + BridgeType.HMY_TO_ETH, + sender, + recipient, + hrc721, + tokenInfo, + E2E_TX_OPTIONS, + ) + + const balanceAfterLock = await hrc721.balanceOf(HMY_OWNER_ADDRESS, E2E_TX_OPTIONS) + const balanceHmyManager = await hrc721.balanceOf(hmyManager.address, E2E_TX_OPTIONS) + + expect(balanceAfterLock.isZero()).to.be.true + expect(balanceHmyManager.eq(new BN(tokenId))).to.be.true + + const ethManager = new HRC721EthManager(DEVNET_HRC721_CONTRACTS_ADDRESSES.ethManagerAddress, WALLET_ETH_MASTER) + + // Mint tokens on Eth Network + const mintTokenTx = await ethManager.mintToken(addr, tokenId, recipient, receiptId) + + console.log('Minted tokens on the Ethereum Network. Transaction Hash: ', mintTokenTx?.transactionHash) + + expect(mintTokenTx.transactionHash).to.not.be.undefined + expect(mintTokenTx.status).eq(1) + }) + + it('Should send the tokens from Eth to Hmy', async () => { + const erc721Addr = await bridge.getBridgedTokenAddress(hrc721, tokenId, E2E_TX_OPTIONS) + const bridgedToken = new BridgedHRC721Token(erc721Addr, WALLET_ETH_OWNER) + const balanceBeforeBurn = await bridgedToken.balanceOf(ETH_OWNER_ADDRESS) + + expect(balanceBeforeBurn.eq(tokenId)).to.be.true + + const { addr, receiptId } = await bridge.sendToken( + BridgeType.ETH_TO_HMY, + sender, + recipient, + hrc721, + tokenInfo, + E2E_TX_OPTIONS, + ) + + const balanceAfterBurn = await bridgedToken.balanceOf(ETH_OWNER_ADDRESS) + + expect(balanceAfterBurn.isZero()).to.be.true + + // Unlock tokens after burn + const unlockTokenTx = await hmyManager.unlockToken(addr, tokenId, recipient, receiptId, E2E_TX_OPTIONS) + + console.info('HRC721HmyManager unlockToken on Harmony Network. Transaction Hash: ', unlockTokenTx.id) + + expect(unlockTokenTx.id).to.not.be.undefined + expect(unlockTokenTx.receipt?.blockNumber).to.not.be.undefined + expect(unlockTokenTx.txStatus).eq(TxStatus.CONFIRMED) + }) + }) + + describe('Bridge HRC1155 Tokens', () => { + const tokenURI = 'https://fakeURI.com' + const tokenIds = [0, 1, 2] + const amounts = [10, 20, 30] + const accounts = Array.from({ length: tokenIds.length }, () => HMY_OWNER_ADDRESS) + const tokenInfo: HRC1155Info = { tokenIds, amounts, ws: HARMONY_RPC_DEVNET_WS, waitingFor: 6 } + const hmyManager = new HRC1155HmyManager(DEVNET_HRC1155_CONTRACTS_ADDRESSES.hmyManagerAddress, WALLET_HMY_MASTER) + let hrc1155: HRC1155 + let bridge: BridgeHRC1155Token + + before(async () => { + const { addr, abi } = await deployContract(ContractName.BlockcodersHRC1155, WALLET_HMY_MASTER, [ + name, + symbol, + tokenURI, + ]) + + const token = new HRC1155(addr, abi, WALLET_HMY_MASTER) + + await token.mintBatch(HMY_OWNER_ADDRESS, tokenIds, amounts, E2E_TX_OPTIONS) + + hrc1155 = new HRC1155(addr, abi, WALLET_HMY_OWNER) + bridge = new BridgeHRC1155Token( + WALLET_HMY_OWNER, + WALLET_ETH_OWNER, + WALLET_ETH_MASTER.provider, + NetworkInfo.DEVNET, + ) + }) + + it('Should send the tokens from Hmy to Eth', async () => { + const balancesBeforeLock = await hrc1155.balanceOfBatch(accounts, tokenIds, E2E_TX_OPTIONS) + + balancesBeforeLock.forEach((balanceBeforeLock, i) => { + expect(balanceBeforeLock.eq(new BN(amounts[i]))).to.be.true + }) + + const { addr, receiptId } = await bridge.sendToken( + BridgeType.HMY_TO_ETH, + sender, + recipient, + hrc1155, + tokenInfo, + E2E_TX_OPTIONS, + ) + + const balancesAfterLock = await hrc1155.balanceOfBatch(accounts, tokenIds, E2E_TX_OPTIONS) + const balancesHmyManager = await hrc1155.balanceOfBatch( + Array.from({ length: tokenIds.length }, () => hmyManager.address), + tokenIds, + E2E_TX_OPTIONS, + ) + + balancesAfterLock.forEach((balanceAfterLock) => { + expect(balanceAfterLock.isZero()).to.be.true + }) + + balancesHmyManager.forEach((balanceHmyManager, i) => { + expect(balanceHmyManager.eq(new BN(amounts[i]))).to.be.true + }) + + const ethManager = new HRC1155EthManager(DEVNET_HRC1155_CONTRACTS_ADDRESSES.ethManagerAddress, WALLET_ETH_MASTER) + + // Mint tokens on Eth side + const mintTokenTx = await ethManager.mintTokens(addr, tokenIds, amounts, recipient, receiptId, []) + + console.log('Minted tokens on the Ethereum Network. Transaction Hash: ', mintTokenTx?.transactionHash) + + expect(mintTokenTx.transactionHash).to.not.be.undefined + expect(mintTokenTx.status).eq(1) + }) + + it('Should send the tokens from Eth to Hmy', async () => { + const erc1155Addr = await bridge.getBridgedTokenAddress(hrc1155, tokenIds[0], E2E_TX_OPTIONS) + const bridgedToken = new BridgedHRC1155Token(erc1155Addr, WALLET_ETH_OWNER) + const balancesBeforeBurn = await bridgedToken.balanceOfBatch(accounts, tokenIds) + + balancesBeforeBurn.forEach((balanceBeforeBurn, i) => { + expect(balanceBeforeBurn.eq(amounts[i])).to.be.true + }) + + const { addr, receiptId } = await bridge.sendToken( + BridgeType.ETH_TO_HMY, + sender, + recipient, + hrc1155, + tokenInfo, + E2E_TX_OPTIONS, + ) + + const balancesAfterBurn = await bridgedToken.balanceOfBatch(accounts, tokenIds) + + balancesAfterBurn.forEach((balanceAfterBurn) => { + expect(balanceAfterBurn.isZero()).to.be.true + }) + + // Unlock Tokens on Harmony Netowrk + const unlockTokenTx = await hmyManager.unlockHRC1155Tokens( + addr, + tokenIds, + amounts, + recipient, + receiptId, + [], + E2E_TX_OPTIONS, + ) + + console.info('HRC1155HmyManager unlockHRC1155Tokens on Harmony Network. Transaction Hash: ', unlockTokenTx?.id) + + expect(unlockTokenTx.id).to.not.be.undefined + expect(unlockTokenTx.receipt?.blockNumber).to.not.be.undefined + expect(unlockTokenTx.txStatus).eq(TxStatus.CONFIRMED) + }) + }) +}) diff --git a/src/game-item.spec.ts b/src/tests/e2e/game-item.e2e-spec.ts similarity index 58% rename from src/game-item.spec.ts rename to src/tests/e2e/game-item.e2e-spec.ts index bef0ebc..9bb59a4 100644 --- a/src/game-item.spec.ts +++ b/src/tests/e2e/game-item.e2e-spec.ts @@ -1,33 +1,60 @@ import { ChainID } from '@harmony-js/utils' +import BN from 'bn.js' import { expect, use } from 'chai' import chaiAsPromised from 'chai-as-promised' -import sinon from 'sinon' -import { GameItems } from './game-item' -import { HarmonyShards } from './interfaces' -import { Key } from './key' +import { HRC1155 } from '../../contracts' +import { HarmonyShards } from '../../interfaces' +import { Key } from '../../wallets' import { - HRC1155_CONTRACT_ADDRESS, + ContractName, + WALLET_HMY_MASTER, + E2E_TX_OPTIONS, TOKEN_GOLD, + TOKEN_SHIELD, TOKEN_SILVER, - TOKEN_THORS_HAMMER, TOKEN_SWORD, - TOKEN_SHIELD, -} from './tests/constants' -import { ABI } from './tests/contracts/GameItems/abi' + TOKEN_THORS_HAMMER, +} from '../constants' +import { deployContract } from '../helpers' + +use(chaiAsPromised) -describe('Game Item Provider', () => { - use(chaiAsPromised) +export class GameItems extends HRC1155 { + async getGold(): Promise { + const gold = await this.call('GOLD', [], E2E_TX_OPTIONS) + return gold.toNumber() + } + async getSilver(): Promise { + const silver = await this.call('SILVER', [], E2E_TX_OPTIONS) + return silver.toNumber() + } + + async getThorsHammer(): Promise { + const thors = await this.call('THORS_HAMMER', [], E2E_TX_OPTIONS) + return thors.toNumber() + } + + async getSword(): Promise { + const sword = await this.call('SWORD', [], E2E_TX_OPTIONS) + return sword.toNumber() + } + + async getShield(): Promise { + const shield = await this.call('SHIELD', [], E2E_TX_OPTIONS) + return shield.toNumber() + } +} + +describe('Game Item Contract Extension', () => { let contract: GameItems let provider: Key - before(() => { - provider = new Key(HarmonyShards.SHARD_0_TESTNET, ChainID.HmyTestnet) - contract = new GameItems(HRC1155_CONTRACT_ADDRESS, ABI, provider) - }) + before(async () => { + const { addr, abi } = await deployContract(ContractName.GameItems, WALLET_HMY_MASTER) - afterEach(async () => { - sinon.restore() + provider = new Key(HarmonyShards.SHARD_0_DEVNET, ChainID.HmyPangaea) + contract = new GameItems(addr, abi, provider) }) it('should be defined', () => { @@ -42,10 +69,6 @@ describe('Game Item Provider', () => { expect(gold).to.not.undefined expect(gold).to.be.equals(TOKEN_GOLD) }) - - it('should throw an error if something went wrong', async () => { - expect(contract.getGold()).to.be.rejectedWith(Error) - }) }) describe('getSilver', () => { @@ -56,10 +79,6 @@ describe('Game Item Provider', () => { expect(silver).to.not.undefined expect(silver).to.be.equals(TOKEN_SILVER) }) - - it('should throw an error if something went wrong', async () => { - expect(contract.getSilver()).to.be.rejectedWith(Error) - }) }) describe('getThorsHammer', () => { @@ -70,10 +89,6 @@ describe('Game Item Provider', () => { expect(thors).to.not.undefined expect(thors).to.be.equals(TOKEN_THORS_HAMMER) }) - - it('should throw an error if something went wrong', async () => { - expect(contract.getThorsHammer()).to.be.rejectedWith(Error) - }) }) describe('getSword', () => { @@ -84,10 +99,6 @@ describe('Game Item Provider', () => { expect(sword).to.not.undefined expect(sword).to.be.equals(TOKEN_SWORD) }) - - it('should throw an error if something went wrong', async () => { - expect(contract.getSword()).to.be.rejectedWith(Error) - }) }) describe('getShield', () => { @@ -98,9 +109,5 @@ describe('Game Item Provider', () => { expect(shield).to.not.undefined expect(shield).to.be.equals(TOKEN_SHIELD) }) - - it('should throw an error if something went wrong', async () => { - expect(contract.getShield()).to.be.rejectedWith(Error) - }) }) }) diff --git a/src/hd-key.spec.ts b/src/tests/hd-key.spec.ts similarity index 92% rename from src/hd-key.spec.ts rename to src/tests/hd-key.spec.ts index 043ad3a..55a9ff8 100644 --- a/src/hd-key.spec.ts +++ b/src/tests/hd-key.spec.ts @@ -6,18 +6,17 @@ import { ChainID } from '@harmony-js/utils' import { expect, use } from 'chai' import chaiAsPromised from 'chai-as-promised' import sinon from 'sinon' -import { HARMONY_RPC_SHARD_0_TESTNET_URL } from './constants' -import { HDKey } from './hd-key' -import { Key } from './key' -import { options, FAKE_TX_HRC721, TEST_ADDRESS_1, TEST_PK_1, TEST_ADDRESS_2 } from './tests/constants' +import { HARMONY_RPC_SHARD_0_DEVNET_URL } from '../constants' +import { Key, HDKey } from '../wallets' +import { HD_KEY_OPTIONS, FAKE_TX_HRC721, TEST_ADDRESS_1, TEST_PK_1, TEST_ADDRESS_2 } from './constants' -describe('HD Key Class', () => { - use(chaiAsPromised) +use(chaiAsPromised) +describe('HD Key', () => { let instance: HDKey before(() => { - instance = new HDKey(HARMONY_RPC_SHARD_0_TESTNET_URL, options, ChainID.HmyTestnet) + instance = new HDKey(HARMONY_RPC_SHARD_0_DEVNET_URL, HD_KEY_OPTIONS, ChainID.HmyPangaea) }) afterEach(async () => { @@ -29,7 +28,7 @@ describe('HD Key Class', () => { }) it('should be an instance of Key', () => { - instance = new HDKey(HARMONY_RPC_SHARD_0_TESTNET_URL, options) + instance = new HDKey(HARMONY_RPC_SHARD_0_DEVNET_URL, HD_KEY_OPTIONS) expect(instance).to.not.be.null expect(instance).to.not.be.undefined @@ -155,7 +154,7 @@ describe('HD Key Class', () => { describe('setMessenger', () => { it('should set a messeger', () => { - const http = new HttpProvider(HARMONY_RPC_SHARD_0_TESTNET_URL) + const http = new HttpProvider(HARMONY_RPC_SHARD_0_DEVNET_URL) const messenger = new Messenger(http) const stub = sinon.stub(instance, 'setMessenger').withArgs(messenger) diff --git a/src/tests/helpers.ts b/src/tests/helpers.ts new file mode 100644 index 0000000..6288b2b --- /dev/null +++ b/src/tests/helpers.ts @@ -0,0 +1,76 @@ +import { Signer } from '@ethersproject/abstract-signer' +import { ContractFactory } from '@ethersproject/contracts' +import { parseUnits, formatUnits } from '@ethersproject/units' +import { Transaction } from '@harmony-js/transaction' +import { readFile } from 'fs' +import { join } from 'path' +import { BaseContract } from '../contracts' +import { ContractProviderType } from '../interfaces' +import { ContractName, E2E_TX_OPTIONS } from './constants' + +export interface ContractMetadata { + abi: any[] + bytecode: string +} + +class DeployContract extends BaseContract { + constructor(abi: any[], wallet: ContractProviderType) { + super('0x', abi, wallet) + } + + public deploy(bytecode: string, args: any[] = []): Promise { + return this.send('contractConstructor', [{ data: bytecode, arguments: args }], E2E_TX_OPTIONS) + } +} + +export async function getContractMetadata(contractName: ContractName): Promise { + return new Promise((res, rej) => { + readFile( + `${join(__dirname, `./artifacts/src/tests/contracts/${contractName}.sol`)}/${contractName}.json`, + 'utf8', + (err, data) => { + if (err) rej(err) + + const metadata = JSON.parse(data) + + res({ abi: metadata.abi, bytecode: metadata.bytecode }) + }, + ) + }) +} + +export async function deployContract( + contractName: ContractName, + wallet: ContractProviderType, + args: any[] = [], +): Promise<{ addr: string; abi: any[] }> { + const { abi, bytecode } = await getContractMetadata(contractName) + const contract = new DeployContract(abi, wallet) + + const tx = await contract.deploy(bytecode, args) + const addr = tx?.receipt?.contractAddress?.toLowerCase() ?? '' + + console.info(`${contractName} deployed on address: ${addr}`) + + return { addr, abi } +} + +export async function deployEthContract( + contractName: ContractName, + wallet: Signer, + args: any[] = [], +): Promise<{ addr: string; abi: any[] }> { + const { abi, bytecode } = await getContractMetadata(contractName) + const factory = new ContractFactory(abi, bytecode, wallet) + const fees = await wallet.getFeeData() + const options = { + maxFeePerGas: parseUnits(formatUnits(fees.maxFeePerGas ?? 0, 'gwei'), 'gwei'), + maxPriorityFeePerGas: parseUnits(formatUnits(fees.maxPriorityFeePerGas ?? 0, 'gwei'), 'gwei'), + } + const caller = await factory.deploy(...args, options) + const contract = await caller.deployed() + + console.info(`${contractName} deployed on address: ${contract.address}`) + + return { addr: contract.address, abi } +} diff --git a/src/hrc1155.spec.ts b/src/tests/hrc1155.spec.ts similarity index 59% rename from src/hrc1155.spec.ts rename to src/tests/hrc1155.spec.ts index 80d6451..e6fe267 100644 --- a/src/hrc1155.spec.ts +++ b/src/tests/hrc1155.spec.ts @@ -1,10 +1,9 @@ import { expect, use } from 'chai' import chaiAsPromised from 'chai-as-promised' import sinon from 'sinon' -import { AddressZero } from './constants' -import { HRC1155 } from './hrc1155' +import { AddressZero } from '../constants' +import { HRC1155 } from '../contracts' import { - HRC1155_CONTRACT_ADDRESS, TEST_ADDRESS_1, EMPTY_TEST_ADDRESS, TEST_ADDRESS_2, @@ -13,16 +12,20 @@ import { TX_OPTIONS, FAKE_BALANCE_HRC1155, WALLET_PROVIDER_TEST_1, -} from './tests/constants' -import { ABI } from './tests/contracts/HRC1155/abi' + ContractName, + TOKEN_GOLD_URI, + FAKE_SUPPLY, +} from './constants' +import { getContractMetadata } from './helpers' -describe('HRC1155 Contract Interface', () => { - use(chaiAsPromised) +use(chaiAsPromised) +describe('HRC1155 Contract Interface', () => { let contract: HRC1155 - before(() => { - contract = new HRC1155(HRC1155_CONTRACT_ADDRESS, ABI, WALLET_PROVIDER_TEST_1) + before(async () => { + const { abi } = await getContractMetadata(ContractName.BlockcodersHRC1155) + contract = new HRC1155('0x', abi, WALLET_PROVIDER_TEST_1) }) afterEach(async () => { @@ -268,4 +271,157 @@ describe('HRC1155 Contract Interface', () => { expect(contract.safeBatchTransferFrom('', '', [], [], '')).to.be.rejectedWith(Error) }) }) + + describe('setApprovalForAll', () => { + it('should throw an error if addressOperator is not provided in HRC1155', async () => { + expect(contract.setApprovalForAll('', true)).to.be.rejectedWith(Error) + }) + + it('should throw an error if addressOperator is not provided in HRC1155', async () => { + expect(contract.setApprovalForAll('', true)).to.be.rejectedWith(Error) + }) + }) + + describe('isApprovedForAll', () => { + it('should throw an error if addressOwner is not provided in HRC1155', async () => { + expect(contract.isApprovedForAll('', EMPTY_TEST_ADDRESS)).to.be.rejectedWith(Error) + }) + + it('should throw an error if addressOwner is not provided in HRC1155', async () => { + expect(contract.isApprovedForAll('', EMPTY_TEST_ADDRESS)).to.be.rejectedWith(Error) + }) + + it('should throw an error if addressOperator is not provided in HRC1155', async () => { + expect(contract.isApprovedForAll(TEST_ADDRESS_1, '')).to.be.rejectedWith(Error) + }) + + it('should throw an error if addressOperator is not provided in HRC1155', async () => { + expect(contract.isApprovedForAll(TEST_ADDRESS_1, '')).to.be.rejectedWith(Error) + }) + + it('should throw an error if params are not provided in HRC1155', async () => { + expect(contract.isApprovedForAll('', '')).to.be.rejectedWith(Error) + expect(contract.isApprovedForAll('', '')).to.be.rejectedWith(Error) + }) + + it('should throw an error if params are not provided in HRC1155', async () => { + expect(contract.isApprovedForAll('', '')).to.be.rejectedWith(Error) + }) + }) + + describe('owner', () => { + it('should return the owner', async () => { + const stub = sinon.stub(contract, 'call').withArgs('owner', [], TX_OPTIONS) + stub.resolves().returns(Promise.resolve(TEST_ADDRESS_1)) + + const owner = await contract.owner(TX_OPTIONS) + + expect(stub.calledOnce).to.be.true + expect(stub.callCount).to.be.equals(1) + expect(owner).to.be.equals(await stub.returnValues[0]) + }) + }) + + describe('totalSupply', () => { + it('should return the total supply of the contract', async () => { + const stub = sinon.stub(contract, 'call').withArgs('totalSupply', [TOKEN_GOLD], TX_OPTIONS) + stub.resolves().returns(Promise.resolve(FAKE_SUPPLY)) + + const totalSupply = await contract.totalSupply(TOKEN_GOLD, TX_OPTIONS) + + expect(stub.calledOnce).to.be.true + expect(stub.callCount).to.be.equals(1) + expect(totalSupply).to.be.equals(await stub.returnValues[0]) + }) + }) + + describe('tokenURI', () => { + it('should return the tokenURI for the given tokenId', async () => { + const stub = sinon.stub(contract, 'call').withArgs('uri', [TOKEN_GOLD], TX_OPTIONS) + stub.resolves().returns(Promise.resolve(TOKEN_GOLD_URI)) + + const tokenURI = await contract.tokenURI(TOKEN_GOLD, TX_OPTIONS) + + expect(stub.calledOnce).to.be.true + expect(stub.callCount).to.be.equals(1) + expect(tokenURI).to.be.equals(await stub.returnValues[0]) + }) + + it('should return the tokenURI of the tokenId with tokenId as a string', async () => { + const stub = sinon.stub(contract, 'call').withArgs('uri', [TOKEN_GOLD.toString()], TX_OPTIONS) + stub.resolves().returns(Promise.resolve(TOKEN_GOLD_URI)) + + const tokenURI = await contract.tokenURI(TOKEN_GOLD.toString(), TX_OPTIONS) + + expect(stub.calledOnce).to.be.true + expect(stub.callCount).to.be.equals(1) + expect(tokenURI).to.be.equals(await stub.returnValues[0]) + }) + + it('should throw an error if tokenId is a non existent token', async () => { + expect(contract.tokenURI(6, TX_OPTIONS)).to.be.rejectedWith(Error) + }) + + it('should throw an error if tokenId is not provided', async () => { + expect(contract.tokenURI('')).to.be.rejectedWith(Error) + }) + + it('should throw an error if tokenId is not valid', async () => { + expect(contract.tokenURI('fakeInvalidId')).to.be.rejectedWith(Error) + }) + }) + + describe('symbol', () => { + it('should return the symbol of the NFT', async () => { + const stub = sinon.stub(contract, 'call').withArgs('symbol', [], TX_OPTIONS) + stub.resolves().returns(Promise.resolve('BCFake')) + + const symbol = await contract.symbol(TX_OPTIONS) + + expect(stub.calledOnce).to.be.true + expect(stub.callCount).to.be.equals(1) + expect(symbol).to.be.equals(await stub.returnValues[0]) + }) + }) + + describe('name', () => { + it('should return the name on the NFT', async () => { + const stub = sinon.stub(contract, 'call').withArgs('name', [], TX_OPTIONS) + stub.resolves().returns(Promise.resolve('BlockCodersFake')) + + const name = await contract.name(TX_OPTIONS) + + expect(stub.calledOnce).to.be.true + expect(stub.callCount).to.be.equals(1) + expect(name).to.be.equals(await stub.returnValues[0]) + }) + }) + + describe('mint', () => { + const AMOUNT = 10 + it('should return the transaction', async () => { + const stub = sinon.stub(contract, 'send').withArgs('mint', [TEST_ADDRESS_1, TOKEN_GOLD, AMOUNT, []], TX_OPTIONS) + stub.resolves() + + await contract.mint(TEST_ADDRESS_1, TOKEN_GOLD, AMOUNT, TX_OPTIONS) + expect(stub.calledOnce).to.be.true + expect(stub.callCount).to.be.equals(1) + }) + + it('should throw an error if account is not provided', async () => { + expect(contract.mint('', TOKEN_GOLD, AMOUNT, TX_OPTIONS)).to.be.rejectedWith(Error) + }) + + it('should throw an error if tokenId is not provided', async () => { + expect(contract.mint(TEST_ADDRESS_1, '', AMOUNT, TX_OPTIONS)).to.be.rejectedWith(Error) + }) + + it('should throw an error if tokenId is not provided', async () => { + expect(contract.mint(TEST_ADDRESS_1, TOKEN_GOLD, '', TX_OPTIONS)).to.be.rejectedWith(Error) + }) + + it('should throw an error if params are not provided', async () => { + expect(contract.mint('', '', '')).to.be.rejectedWith(Error) + }) + }) }) diff --git a/src/tests/hrc20.spec.ts b/src/tests/hrc20.spec.ts new file mode 100644 index 0000000..091afcd --- /dev/null +++ b/src/tests/hrc20.spec.ts @@ -0,0 +1,203 @@ +import BN from 'bn.js' +import { expect, use } from 'chai' +import chaiAsPromised from 'chai-as-promised' +import sinon from 'sinon' +import { HRC20 } from '../contracts' +import { + TEST_ADDRESS_1, + TEST_ADDRESS_2, + TOKEN_GOLD, + TX_OPTIONS, + WALLET_PROVIDER_TEST_1, + ContractName, + FAKE_SUPPLY, +} from './constants' +import { getContractMetadata } from './helpers' + +use(chaiAsPromised) + +describe('HRC20 Contract Interface', () => { + let contract: HRC20 + + before(async () => { + const { abi } = await getContractMetadata(ContractName.BlockcodersHRC20) + contract = new HRC20('0x', abi, WALLET_PROVIDER_TEST_1) + }) + + afterEach(async () => { + sinon.restore() + }) + + it('should be defined', () => { + expect(contract).to.not.be.undefined + }) + + describe('balanceOf', () => { + it('should get the number of tokens in the specified account', async () => { + const stub = sinon.stub(contract, 'call').withArgs('balanceOf', [TEST_ADDRESS_1], TX_OPTIONS) + stub.resolves().returns(Promise.resolve(new BN(11))) + + const balance = await contract.balanceOf(TEST_ADDRESS_1, TX_OPTIONS) + + expect(stub.calledOnce).to.be.true + expect(stub.callCount).to.be.equals(1) + expect(balance).to.be.equals(await stub.returnValues[0]) + }) + + it('should throw an error if address is not provided', async () => { + expect(contract.balanceOf('', TX_OPTIONS)).to.be.rejectedWith(Error) + }) + }) + + describe('transferFrom', () => { + it('should transfer the ownership of a token from one address to another', async () => { + const stub = sinon.stub(contract, 'send') + stub.withArgs('transferFrom', [TEST_ADDRESS_2, TEST_ADDRESS_1, TOKEN_GOLD], TX_OPTIONS).onFirstCall().resolves() + + await contract.transferFrom(TEST_ADDRESS_2, TEST_ADDRESS_1, TOKEN_GOLD, TX_OPTIONS) + + expect(stub.calledOnce).to.be.true + expect(stub.callCount).to.be.equals(1) + }) + + it('should throw an error if there is no signer', () => { + expect(contract.transferFrom('', TEST_ADDRESS_1, TOKEN_GOLD, TX_OPTIONS)).to.be.rejectedWith(Error) + }) + + it('should throw an error if there is no receiver', () => { + expect(contract.transferFrom(TEST_ADDRESS_2, '', TOKEN_GOLD, TX_OPTIONS)).to.be.rejectedWith(Error) + }) + + it('should throw an error if there is no tokenId', () => { + expect(contract.transferFrom(TEST_ADDRESS_2, TEST_ADDRESS_1, '', TX_OPTIONS)).to.be.rejectedWith(Error) + }) + }) + + describe('approve', () => { + it('should return the transaction', async () => { + const stub = sinon.stub(contract, 'send').withArgs('approve', [TEST_ADDRESS_1, TOKEN_GOLD], TX_OPTIONS) + stub.resolves() + + await contract.approve(TEST_ADDRESS_1, TOKEN_GOLD, TX_OPTIONS) + expect(stub.calledOnce).to.be.true + expect(stub.callCount).to.be.equals(1) + }) + + it('should throw an error if to is not provided', async () => { + expect(contract.approve('', TOKEN_GOLD, TX_OPTIONS)).to.be.rejectedWith(Error) + }) + + it('should throw an error if tokenId is not provided', async () => { + expect(contract.approve(TEST_ADDRESS_1, '', TX_OPTIONS)).to.be.rejectedWith(Error) + }) + + it('should throw an error if txOptions are not provided', async () => { + expect(contract.approve(TEST_ADDRESS_1, TOKEN_GOLD)).to.be.rejectedWith(Error) + }) + + it('should throw an error if params are not provided', async () => { + expect(contract.approve('', '')).to.be.rejectedWith(Error) + }) + }) + + describe('totalSupply', () => { + it('should return the total supply of the contract', async () => { + const stub = sinon.stub(contract, 'call').withArgs('totalSupply', [], TX_OPTIONS) + stub.resolves().returns(Promise.resolve(FAKE_SUPPLY)) + + const totalSupply = await contract.totalSupply(TX_OPTIONS) + + expect(stub.calledOnce).to.be.true + expect(stub.callCount).to.be.equals(1) + expect(totalSupply).to.be.equals(await stub.returnValues[0]) + }) + }) + + describe('decimals', () => { + it('should return the decimals of the token', async () => { + const stub = sinon.stub(contract, 'call').withArgs('decimals', [], TX_OPTIONS) + stub.resolves().returns(Promise.resolve(18)) + + const decimals = await contract.decimals(TX_OPTIONS) + + expect(stub.calledOnce).to.be.true + expect(stub.callCount).to.be.equals(1) + expect(decimals).to.be.equals(await stub.returnValues[0]) + }) + }) + + describe('symbol', () => { + it('should return the symbol of the NFT', async () => { + const stub = sinon.stub(contract, 'call').withArgs('symbol', [], TX_OPTIONS) + stub.resolves().returns(Promise.resolve('BCFake')) + + const symbol = await contract.symbol(TX_OPTIONS) + + expect(stub.calledOnce).to.be.true + expect(stub.callCount).to.be.equals(1) + expect(symbol).to.be.equals(await stub.returnValues[0]) + }) + }) + + describe('name', () => { + it('should return the name on the NFT', async () => { + const stub = sinon.stub(contract, 'call').withArgs('name', [], TX_OPTIONS) + stub.resolves().returns(Promise.resolve('BlockCodersFake')) + + const name = await contract.name(TX_OPTIONS) + + expect(stub.calledOnce).to.be.true + expect(stub.callCount).to.be.equals(1) + expect(name).to.be.equals(await stub.returnValues[0]) + }) + }) + + describe('mint', () => { + it('should return the transaction', async () => { + const stub = sinon.stub(contract, 'send').withArgs('mint', [TEST_ADDRESS_1, TOKEN_GOLD], TX_OPTIONS) + stub.resolves() + + await contract.mint(TEST_ADDRESS_1, TOKEN_GOLD, TX_OPTIONS) + expect(stub.calledOnce).to.be.true + expect(stub.callCount).to.be.equals(1) + }) + + it('should throw an error if account is not provided', async () => { + expect(contract.mint('', TOKEN_GOLD, TX_OPTIONS)).to.be.rejectedWith(Error) + }) + + it('should throw an error if tokenId is not provided', async () => { + expect(contract.mint(TEST_ADDRESS_1, '', TX_OPTIONS)).to.be.rejectedWith(Error) + }) + + it('should throw an error if params are not provided', async () => { + expect(contract.mint('', '')).to.be.rejectedWith(Error) + }) + }) + + describe('burn', () => { + it('should return the transaction', async () => { + const stub = sinon.stub(contract, 'send').withArgs('burn', [10], TX_OPTIONS) + stub.resolves() + + await contract.burn(10, TX_OPTIONS) + expect(stub.calledOnce).to.be.true + expect(stub.callCount).to.be.equals(1) + }) + }) + + describe('burnFrom', () => { + it('should return the transaction', async () => { + const stub = sinon.stub(contract, 'send').withArgs('burnFrom', [TEST_ADDRESS_1, 10], TX_OPTIONS) + stub.resolves() + + await contract.burnFrom(TEST_ADDRESS_1, 10, TX_OPTIONS) + expect(stub.calledOnce).to.be.true + expect(stub.callCount).to.be.equals(1) + }) + + it('should throw an error if params are not provided', async () => { + expect(contract.burnFrom('', 0)).to.be.rejectedWith(Error) + }) + }) +}) diff --git a/src/hrc721.spec.ts b/src/tests/hrc721.spec.ts similarity index 55% rename from src/hrc721.spec.ts rename to src/tests/hrc721.spec.ts index af65ee9..d01f816 100644 --- a/src/hrc721.spec.ts +++ b/src/tests/hrc721.spec.ts @@ -2,10 +2,9 @@ import BN from 'bn.js' import { expect, use } from 'chai' import chaiAsPromised from 'chai-as-promised' import sinon from 'sinon' -import { AddressZero } from './constants' -import { HRC721 } from './hrc721' +import { AddressZero } from '../constants' +import { HRC721 } from '../contracts' import { - HRC721_CONTRACT_ADDRESS, TEST_ADDRESS_1, TEST_ADDRESS_2, EMPTY_TEST_ADDRESS, @@ -13,16 +12,20 @@ import { TX_OPTIONS, WALLET_PROVIDER_TEST_1, TOKEN_SWORD, -} from './tests/constants' -import { ABI } from './tests/contracts/HRC721/abi' + ContractName, + FAKE_SUPPLY, + TOKEN_GOLD_URI, +} from './constants' +import { getContractMetadata } from './helpers' -describe('HRC721 Contract Interface', () => { - use(chaiAsPromised) +use(chaiAsPromised) +describe('HRC721 Contract Interface', () => { let contract: HRC721 - before(() => { - contract = new HRC721(HRC721_CONTRACT_ADDRESS, ABI, WALLET_PROVIDER_TEST_1) + before(async () => { + const { abi } = await getContractMetadata(ContractName.BlockcodersHRC721) + contract = new HRC721('0x', abi, WALLET_PROVIDER_TEST_1) }) afterEach(async () => { @@ -290,4 +293,223 @@ describe('HRC721 Contract Interface', () => { expect(contract.approve('', '')).to.be.rejectedWith(Error) }) }) + + describe('setApprovalForAll', () => { + it('should throw an error if addressOperator is not provided in HRC1155', async () => { + expect(contract.setApprovalForAll('', true)).to.be.rejectedWith(Error) + }) + + it('should throw an error if addressOperator is not provided in HRC721', async () => { + expect(contract.setApprovalForAll('', true)).to.be.rejectedWith(Error) + }) + }) + + describe('isApprovedForAll', () => { + it('should throw an error if addressOwner is not provided in HRC1155', async () => { + expect(contract.isApprovedForAll('', EMPTY_TEST_ADDRESS)).to.be.rejectedWith(Error) + }) + + it('should throw an error if addressOwner is not provided in HRC721', async () => { + expect(contract.isApprovedForAll('', EMPTY_TEST_ADDRESS)).to.be.rejectedWith(Error) + }) + + it('should throw an error if addressOperator is not provided in HRC1155', async () => { + expect(contract.isApprovedForAll(TEST_ADDRESS_1, '')).to.be.rejectedWith(Error) + }) + + it('should throw an error if addressOperator is not provided in HRC721', async () => { + expect(contract.isApprovedForAll(TEST_ADDRESS_1, '')).to.be.rejectedWith(Error) + }) + + it('should throw an error if params are not provided in HRC1155', async () => { + expect(contract.isApprovedForAll('', '')).to.be.rejectedWith(Error) + expect(contract.isApprovedForAll('', '')).to.be.rejectedWith(Error) + }) + + it('should throw an error if params are not provided in HRC721', async () => { + expect(contract.isApprovedForAll('', '')).to.be.rejectedWith(Error) + }) + }) + + describe('totalSupply', () => { + it('should return the total supply of the contract', async () => { + const stub = sinon.stub(contract, 'call').withArgs('totalSupply', [], TX_OPTIONS) + stub.resolves().returns(Promise.resolve(FAKE_SUPPLY)) + + const totalSupply = await contract.totalSupply(TX_OPTIONS) + + expect(stub.calledOnce).to.be.true + expect(stub.callCount).to.be.equals(1) + expect(totalSupply).to.be.equals(await stub.returnValues[0]) + }) + }) + + describe('tokenURI', () => { + it('should return the tokenURI for the given tokenId', async () => { + const stub = sinon.stub(contract, 'call').withArgs('tokenURI', [TOKEN_GOLD], TX_OPTIONS) + stub.resolves().returns(Promise.resolve(TOKEN_GOLD_URI)) + + const tokenURI = await contract.tokenURI(TOKEN_GOLD, TX_OPTIONS) + + expect(stub.calledOnce).to.be.true + expect(stub.callCount).to.be.equals(1) + expect(tokenURI).to.be.equals(await stub.returnValues[0]) + }) + + it('should return the tokenURI of the tokenId with tokenId as a string', async () => { + const stub = sinon.stub(contract, 'call').withArgs('tokenURI', [TOKEN_GOLD.toString()], TX_OPTIONS) + stub.resolves().returns(Promise.resolve(TEST_ADDRESS_1)) + + const tokenURI = await contract.tokenURI(TOKEN_GOLD.toString(), TX_OPTIONS) + + expect(stub.calledOnce).to.be.true + expect(stub.callCount).to.be.equals(1) + expect(tokenURI).to.be.equals(await stub.returnValues[0]) + }) + + it('should throw an error if tokenId is a non existent token', async () => { + expect(contract.tokenURI(6, TX_OPTIONS)).to.be.rejectedWith(Error) + }) + + it('should throw an error if tokenId is not provided', async () => { + expect(contract.tokenURI('')).to.be.rejectedWith(Error) + }) + + it('should throw an error if tokenId is not valid', async () => { + expect(contract.tokenURI('fakeInvalidId')).to.be.rejectedWith(Error) + }) + }) + + describe('symbol', () => { + it('should return the symbol of the NFT', async () => { + const stub = sinon.stub(contract, 'call').withArgs('symbol', [], TX_OPTIONS) + stub.resolves().returns(Promise.resolve('BCFake')) + + const symbol = await contract.symbol(TX_OPTIONS) + + expect(stub.calledOnce).to.be.true + expect(stub.callCount).to.be.equals(1) + expect(symbol).to.be.equals(await stub.returnValues[0]) + }) + }) + + describe('name', () => { + it('should return the name on the NFT', async () => { + const stub = sinon.stub(contract, 'call').withArgs('name', [], TX_OPTIONS) + stub.resolves().returns(Promise.resolve('BlockCodersFake')) + + const name = await contract.name(TX_OPTIONS) + + expect(stub.calledOnce).to.be.true + expect(stub.callCount).to.be.equals(1) + expect(name).to.be.equals(await stub.returnValues[0]) + }) + }) + + describe('increaseAllowance', () => { + it('should return the transaction', async () => { + const stub = sinon.stub(contract, 'send').withArgs('increaseAllowance', [TEST_ADDRESS_1, TOKEN_GOLD], TX_OPTIONS) + stub.resolves() + + await contract.increaseAllowance(TEST_ADDRESS_1, TOKEN_GOLD, TX_OPTIONS) + expect(stub.calledOnce).to.be.true + expect(stub.callCount).to.be.equals(1) + }) + + it('should throw an error if spender is not provided', async () => { + expect(contract.increaseAllowance('', TOKEN_GOLD, TX_OPTIONS)).to.be.rejectedWith(Error) + }) + + it('should throw an error if value is not provided', async () => { + expect(contract.increaseAllowance(TEST_ADDRESS_1, '', TX_OPTIONS)).to.be.rejectedWith(Error) + }) + + it('should throw an error if params are not provided', async () => { + expect(contract.increaseAllowance('', '')).to.be.rejectedWith(Error) + }) + }) + + describe('decreaseAllowance', () => { + it('should return the transaction', async () => { + const stub = sinon.stub(contract, 'send').withArgs('decreaseAllowance', [TEST_ADDRESS_1, TOKEN_GOLD], TX_OPTIONS) + stub.resolves() + + await contract.decreaseAllowance(TEST_ADDRESS_1, TOKEN_GOLD, TX_OPTIONS) + expect(stub.calledOnce).to.be.true + expect(stub.callCount).to.be.equals(1) + }) + + it('should throw an error if spender is not provided', async () => { + expect(contract.decreaseAllowance('', TOKEN_GOLD, TX_OPTIONS)).to.be.rejectedWith(Error) + }) + + it('should throw an error if value is not provided', async () => { + expect(contract.decreaseAllowance(TEST_ADDRESS_1, '', TX_OPTIONS)).to.be.rejectedWith(Error) + }) + + it('should throw an error if params are not provided', async () => { + expect(contract.decreaseAllowance('', '')).to.be.rejectedWith(Error) + }) + }) + + describe('mint', () => { + it('should return the transaction', async () => { + const stub = sinon.stub(contract, 'send').withArgs('mint', [TEST_ADDRESS_1, TOKEN_GOLD], TX_OPTIONS) + stub.resolves() + + await contract.mint(TEST_ADDRESS_1, TOKEN_GOLD, TX_OPTIONS) + expect(stub.calledOnce).to.be.true + expect(stub.callCount).to.be.equals(1) + }) + + it('should throw an error if account is not provided', async () => { + expect(contract.mint('', TOKEN_GOLD, TX_OPTIONS)).to.be.rejectedWith(Error) + }) + + it('should throw an error if tokenId is not provided', async () => { + expect(contract.mint(TEST_ADDRESS_1, '', TX_OPTIONS)).to.be.rejectedWith(Error) + }) + + it('should throw an error if params are not provided', async () => { + expect(contract.mint('', '')).to.be.rejectedWith(Error) + }) + }) + + describe('safeMint', () => { + it('should return the transaction', async () => { + const stub = sinon.stub(contract, 'send').withArgs('safeMint', [TEST_ADDRESS_1, TOKEN_GOLD], TX_OPTIONS) + stub.resolves() + + await contract.safeMint(TEST_ADDRESS_1, TOKEN_GOLD, TX_OPTIONS) + expect(stub.calledOnce).to.be.true + expect(stub.callCount).to.be.equals(1) + }) + + it('should throw an error if account is not provided', async () => { + expect(contract.safeMint('', TOKEN_GOLD, TX_OPTIONS)).to.be.rejectedWith(Error) + }) + + it('should throw an error if tokenId is not provided', async () => { + expect(contract.safeMint(TEST_ADDRESS_1, '', TX_OPTIONS)).to.be.rejectedWith(Error) + }) + + it('should throw an error if params are not provided', async () => { + expect(contract.safeMint('', '')).to.be.rejectedWith(Error) + }) + }) + + describe('burn', () => { + it('should return the transaction', async () => { + const stub = sinon.stub(contract, 'send').withArgs('burn', [TOKEN_GOLD], TX_OPTIONS) + stub.resolves() + + await contract.burn(TOKEN_GOLD, TX_OPTIONS) + expect(stub.calledOnce).to.be.true + expect(stub.callCount).to.be.equals(1) + }) + + it('should throw an error if tokenId is not provided', async () => { + expect(contract.burn('', TX_OPTIONS)).to.be.rejectedWith(Error) + }) + }) }) diff --git a/src/key.spec.ts b/src/tests/key.spec.ts similarity index 71% rename from src/key.spec.ts rename to src/tests/key.spec.ts index 8e437bd..145eed8 100644 --- a/src/key.spec.ts +++ b/src/tests/key.spec.ts @@ -2,15 +2,15 @@ import { Wallet } from '@harmony-js/account' import { HttpProvider, WSProvider } from '@harmony-js/network' import { ChainID } from '@harmony-js/utils' import { expect } from 'chai' -import { HARMONY_RPC_SHARD_0_TESTNET, HARMONY_RPC_SHARD_1_TESTNET, HARMONY_RPC_TESTNET_WS } from './constants' -import { HarmonyShards } from './interfaces' -import { Key } from './key' +import { HARMONY_RPC_SHARD_0_DEVNET, HARMONY_RPC_DEVNET_WS } from '../constants' +import { HarmonyShards } from '../interfaces' +import { Key } from '../wallets' describe('Key Class', () => { let instance: Key it('should be an instance of Wallet', async () => { - instance = new Key(HARMONY_RPC_SHARD_0_TESTNET.url) + instance = new Key(HARMONY_RPC_SHARD_0_DEVNET.url) expect(instance).to.not.be.null expect(instance).to.not.be.undefined @@ -18,7 +18,7 @@ describe('Key Class', () => { }) it('should instance correctly the key class using url as a string with chain id', async () => { - instance = new Key(HARMONY_RPC_SHARD_0_TESTNET.url, ChainID.HmyTestnet) + instance = new Key(HARMONY_RPC_SHARD_0_DEVNET.url, ChainID.HmyPangaea) expect(instance).to.not.be.null expect(instance).to.not.be.undefined @@ -26,7 +26,7 @@ describe('Key Class', () => { }) it('should instance correctly the key class using url as a string', async () => { - instance = new Key(HARMONY_RPC_SHARD_1_TESTNET.url) + instance = new Key(HARMONY_RPC_SHARD_0_DEVNET.url) expect(instance).to.not.be.null expect(instance).to.not.be.undefined @@ -34,8 +34,8 @@ describe('Key Class', () => { }) it('should instance correctly the key class using url as a HttpProvider', async () => { - const http = new HttpProvider(HARMONY_RPC_SHARD_0_TESTNET.url) - instance = new Key(http, ChainID.HmyTestnet) + const http = new HttpProvider(HARMONY_RPC_SHARD_0_DEVNET.url) + instance = new Key(http, ChainID.HmyPangaea) expect(instance).to.not.be.null expect(instance).to.not.be.undefined @@ -43,8 +43,8 @@ describe('Key Class', () => { }) it('should instance correctly the key class using url as a WSProvider', async () => { - const http = new WSProvider(HARMONY_RPC_TESTNET_WS) - instance = new Key(http, ChainID.HmyTestnet) + const http = new WSProvider(HARMONY_RPC_DEVNET_WS) + instance = new Key(http, ChainID.HmyPangaea) expect(instance).to.not.be.null expect(instance).to.not.be.undefined @@ -52,7 +52,7 @@ describe('Key Class', () => { }) it('should instance correctly the key class using url as a HarmonyShards', async () => { - instance = new Key(HarmonyShards.SHARD_0_TESTNET, ChainID.HmyTestnet) + instance = new Key(HarmonyShards.SHARD_0_DEVNET, ChainID.HmyPangaea) expect(instance).to.not.be.null expect(instance).to.not.be.undefined diff --git a/src/mnemonic-key.spec.ts b/src/tests/mnemonic-key.spec.ts similarity index 71% rename from src/mnemonic-key.spec.ts rename to src/tests/mnemonic-key.spec.ts index c85e65d..a2f77ae 100644 --- a/src/mnemonic-key.spec.ts +++ b/src/tests/mnemonic-key.spec.ts @@ -1,15 +1,14 @@ import { ChainID } from '@harmony-js/utils' import { expect } from 'chai' -import { HARMONY_RPC_SHARD_0_TESTNET } from './constants' -import { Key } from './key' -import { MnemonicKey } from './mnemonic-key' -import { TEST_SEED } from './tests/constants' +import { HARMONY_RPC_SHARD_0_DEVNET } from '../constants' +import { TEST_SEED } from '../tests/constants' +import { Key, MnemonicKey } from '../wallets' describe('Mnemonic Key Class', () => { let instance: MnemonicKey it('should be an instance of Key', () => { - instance = new MnemonicKey(HARMONY_RPC_SHARD_0_TESTNET.url, { + instance = new MnemonicKey(HARMONY_RPC_SHARD_0_DEVNET.url, { mnemonic: TEST_SEED, }) @@ -20,12 +19,12 @@ describe('Mnemonic Key Class', () => { it('should get the private key associated', () => { instance = new MnemonicKey( - HARMONY_RPC_SHARD_0_TESTNET.url, + HARMONY_RPC_SHARD_0_DEVNET.url, { mnemonic: TEST_SEED, index: 0, }, - ChainID.HmyTestnet, + ChainID.HmyPangaea, ) expect(instance).to.not.be.null @@ -34,7 +33,7 @@ describe('Mnemonic Key Class', () => { }) it('should return a default mnemonic key if object is empty', () => { - instance = new MnemonicKey(HARMONY_RPC_SHARD_0_TESTNET.url, {}, ChainID.HmyTestnet) + instance = new MnemonicKey(HARMONY_RPC_SHARD_0_DEVNET.url, {}, ChainID.HmyPangaea) expect(instance).to.not.be.null expect(instance).to.not.be.undefined expect(instance.signer).to.exist @@ -44,11 +43,11 @@ describe('Mnemonic Key Class', () => { it('should throw an error if mnemonic key is not valid', () => { try { new MnemonicKey( - HARMONY_RPC_SHARD_0_TESTNET.url, + HARMONY_RPC_SHARD_0_DEVNET.url, { mnemonic: 'this is an wrong example of seed', }, - ChainID.HmyTestnet, + ChainID.HmyPangaea, ) } catch (error) { expect(error).to.be.exist diff --git a/src/private-key.spec.ts b/src/tests/private-key.spec.ts similarity index 66% rename from src/private-key.spec.ts rename to src/tests/private-key.spec.ts index 5552c4e..81421ba 100644 --- a/src/private-key.spec.ts +++ b/src/tests/private-key.spec.ts @@ -1,15 +1,14 @@ import { ChainID } from '@harmony-js/utils' import { expect } from 'chai' -import { HARMONY_RPC_SHARD_0_TESTNET } from './constants' -import { Key } from './key' -import { PrivateKey } from './private-key' -import { TEST_PK_1, TEST_ADDRESS_1 } from './tests/constants' +import { HARMONY_RPC_SHARD_0_DEVNET } from '../constants' +import { TEST_PK_1, TEST_ADDRESS_1 } from '../tests/constants' +import { Key, PrivateKey } from '../wallets' describe('Private Key Class', () => { let instance: PrivateKey it('should be an instance of Key', async () => { - instance = new PrivateKey(HARMONY_RPC_SHARD_0_TESTNET.url, TEST_PK_1) + instance = new PrivateKey(HARMONY_RPC_SHARD_0_DEVNET.url, TEST_PK_1) expect(instance).to.not.be.null expect(instance).to.not.be.undefined @@ -17,7 +16,7 @@ describe('Private Key Class', () => { }) it('should get the signer associated', async () => { - instance = new PrivateKey(HARMONY_RPC_SHARD_0_TESTNET.url, TEST_PK_1, ChainID.HmyTestnet) + instance = new PrivateKey(HARMONY_RPC_SHARD_0_DEVNET.url, TEST_PK_1, ChainID.HmyPangaea) expect(instance).to.not.be.null expect(instance).to.not.be.undefined @@ -27,7 +26,7 @@ describe('Private Key Class', () => { }) it('should get the private key associated', async () => { - instance = new PrivateKey(HARMONY_RPC_SHARD_0_TESTNET.url, TEST_PK_1, ChainID.HmyTestnet) + instance = new PrivateKey(HARMONY_RPC_SHARD_0_DEVNET.url, TEST_PK_1, ChainID.HmyPangaea) expect(instance).to.not.be.null expect(instance).to.not.be.undefined diff --git a/src/utils.spec.ts b/src/tests/utils.spec.ts similarity index 97% rename from src/utils.spec.ts rename to src/tests/utils.spec.ts index 4c2538d..0fd8285 100644 --- a/src/utils.spec.ts +++ b/src/tests/utils.spec.ts @@ -1,5 +1,5 @@ import { expect } from 'chai' -import { isBNish } from './utils' +import { isBNish } from '../utils' describe('Utils', () => { it('should return true if param is a BNish type, as a number', async () => { diff --git a/src/utils.ts b/src/utils.ts index 35b3518..4ae064c 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -1,4 +1,6 @@ import { isArrayish, isHexString } from '@harmony-js/crypto' +import { Messenger, WSProvider, NewHeaders } from '@harmony-js/network' +import { ChainType, hexToNumber } from '@harmony-js/utils' import BN from 'bn.js' import { BNish } from './interfaces' @@ -13,3 +15,25 @@ export function isBNish(value: any): value is BNish { isArrayish(value)) ) } + +export function waitForNewBlock( + expectedBlockNumber: number, + rpc: string, + chainType: ChainType, + chainId: number, +): Promise { + const wsMessenger = new Messenger(new WSProvider(rpc), chainType, chainId) + const newBlockSubscription = new NewHeaders(wsMessenger) + + return new Promise((res) => { + newBlockSubscription.on('data', (data: any) => { + const blockNumber = parseInt(hexToNumber(data.params.result.number), 10) + + if (blockNumber <= expectedBlockNumber) { + console.log(`Currently at block ${blockNumber}, waiting for block ${expectedBlockNumber} to be confirmed`) + } else { + res() + } + }) + }) +} diff --git a/src/hd-key.ts b/src/wallets/hd-key.ts similarity index 93% rename from src/hd-key.ts rename to src/wallets/hd-key.ts index ea1ea25..79bd20e 100644 --- a/src/hd-key.ts +++ b/src/wallets/hd-key.ts @@ -2,7 +2,7 @@ import { Wallet, HDNode, Account } from '@harmony-js/account' import { Messenger } from '@harmony-js/network' import { Transaction, recover } from '@harmony-js/transaction' import { ChainID, ChainType } from '@harmony-js/utils' -import { RpcProviderType, HDOptions } from './interfaces' +import { RpcProviderType, HDOptions } from '../interfaces' import { Key } from './key' /** @@ -11,8 +11,8 @@ import { Key } from './key' export class HDKey extends Key { private readonly hdNode: HDNode - constructor(url: RpcProviderType, options: HDOptions, chainId?: ChainID) { - super(url, chainId) + constructor(url: RpcProviderType, options: HDOptions, chainId?: ChainID, chainType?: ChainType) { + super(url, chainId, chainType) const { mnemonic = Wallet.generateMnemonic(), diff --git a/src/wallets/index.ts b/src/wallets/index.ts new file mode 100644 index 0000000..ca87568 --- /dev/null +++ b/src/wallets/index.ts @@ -0,0 +1,4 @@ +export * from './key' +export * from './hd-key' +export * from './mnemonic-key' +export * from './private-key' diff --git a/src/key.ts b/src/wallets/key.ts similarity index 90% rename from src/key.ts rename to src/wallets/key.ts index ad8aee2..ac82112 100644 --- a/src/key.ts +++ b/src/wallets/key.ts @@ -1,15 +1,14 @@ import { Wallet } from '@harmony-js/account' import { Messenger, HttpProvider, WSProvider } from '@harmony-js/network' import { ChainID, ChainType, isWs } from '@harmony-js/utils' -import { HARMONY_SHARDS } from './constants' -import { HarmonyRpcConfig, HarmonyShards, RpcProviderType } from './interfaces' +import { HARMONY_SHARDS } from '../constants' +import { HarmonyRpcConfig, HarmonyShards, RpcProviderType } from '../interfaces' /** * Implementation of the Wallet that does not use any pk or mnemonic. */ export class Key extends Wallet { - constructor(url: RpcProviderType, chainId = ChainID.HmyMainnet) { - let chainType: ChainType = ChainType.Harmony + constructor(url: RpcProviderType, chainId = ChainID.HmyMainnet, chainType = ChainType.Harmony) { let chain: ChainID = chainId let provider: HttpProvider | WSProvider diff --git a/src/mnemonic-key.ts b/src/wallets/mnemonic-key.ts similarity index 66% rename from src/mnemonic-key.ts rename to src/wallets/mnemonic-key.ts index 55b29db..527ae79 100644 --- a/src/mnemonic-key.ts +++ b/src/wallets/mnemonic-key.ts @@ -1,14 +1,14 @@ import { Wallet } from '@harmony-js/account' -import { ChainID } from '@harmony-js/utils' -import { MnemonicOptions, RpcProviderType } from './interfaces' +import { ChainID, ChainType } from '@harmony-js/utils' +import { MnemonicOptions, RpcProviderType } from '../interfaces' import { Key } from './key' /** * Implementation of the Wallet that uses a list of words for the mnemonic key. */ export class MnemonicKey extends Key { - constructor(url: RpcProviderType, options: MnemonicOptions, chainId?: ChainID) { - super(url, chainId) + constructor(url: RpcProviderType, options: MnemonicOptions, chainId?: ChainID, chainType?: ChainType) { + super(url, chainId, chainType) const { mnemonic = Wallet.generateMnemonic(), index = 0 } = options diff --git a/src/private-key.ts b/src/wallets/private-key.ts similarity index 57% rename from src/private-key.ts rename to src/wallets/private-key.ts index 0b54543..2ad60f5 100644 --- a/src/private-key.ts +++ b/src/wallets/private-key.ts @@ -1,13 +1,13 @@ -import { ChainID } from '@harmony-js/utils' -import { RpcProviderType } from './interfaces' +import { ChainID, ChainType } from '@harmony-js/utils' +import { RpcProviderType } from '../interfaces' import { Key } from './key' /** * Implementation of the Wallet that uses a private key. */ export class PrivateKey extends Key { - constructor(url: RpcProviderType, privateKey: string, chainId?: ChainID) { - super(url, chainId) + constructor(url: RpcProviderType, privateKey: string, chainId?: ChainID, chainType?: ChainType) { + super(url, chainId, chainType) this.addByPrivateKey(privateKey) }