From 321990d757f8a276337d13691cf4e9c2451cc420 Mon Sep 17 00:00:00 2001 From: Nikola Divic Date: Thu, 5 Dec 2024 12:35:46 +0400 Subject: [PATCH] test: implement smoke & e2e tests Smoke tests atm just check the health of a target bundler instance, e2e tests actually require a private key and funds to perform the full user opration flow. Refer to the docstrings and .env to see how to use them --- .env-example | 40 ++-- config/test.json | 44 +--- package.json | 5 +- src/test/e2e/nativeTransfer.test.ts | 306 ++++++++++++++++++++++++++++ src/test/smoke/health.test.ts | 28 ++- yarn.lock | 154 +++++++++++++- 6 files changed, 512 insertions(+), 65 deletions(-) create mode 100644 src/test/e2e/nativeTransfer.test.ts diff --git a/.env-example b/.env-example index 3ebcff1e..eb230d48 100644 --- a/.env-example +++ b/.env-example @@ -1,16 +1,28 @@ +# - Core bundler environment variables - + BUNDLER_CONFIG_PASSPHRASE= -BUNDLER_NODE_PATH_INDEX=0 -BUNDLER_CHAIN_ID=80001 -BUNDLER_MIN_RELAYER_COUNT=5 -BUNDLER_MAX_RELAYER_COUNT=10 -BUNDLER_FUNDING_BALANCE_THRESHOLD=0.1 -BUNDLER_FUNDING_RELAYER_AMOUNT=0.2 -BUNDLER_SLACK_JSON='{"token": "","channel": ""}' -BUNDLER_PROVIDER_JSON='{"137": "", "42161": "", "56": "", "10": "", "43114": "", "8453": "", "80001": ""}' -BUNDLER_DATASOURCES_JSON= '{"mongoUrl": "", "redisUrl": ""}' -BUNDLER_QUEUE_URL="" -BUNDLER_IS_TRUSTWALLET_SETUP=true -BUNDLER_FALLBACK_PROVIDER_JSON='{"137": ["", ""], "42161": ["", ""], "56": ["", ""], "10": ["", ""], "43114": ["", ""], "8453": ["", ""], "80001": ["", ""]}' +NODE_PATH_INDEX=0 +# 🔥 make sure this is never development when deploying to production 🔥 +NODE_ENV=development + +# - Smoke tests environment variables - + +# You can set the folloowing to a production deployment if you want to run smoke tests against the production environment +SMOKE_TEST_BUNDLER_HOSTNAME=https://bundler.biconomy.io + +# - E2E tests environment variables - + +# Following are the environment variables required for e2e tests, see the docstrings inside src/test/e2e/nativeTransfer.test.ts for more information +# Set this to the private key of the EOA account that will be used to derive the smart account +PRIVATE_KEY= + +# Set this to https://bundler.biconomy.io if you want to test against the production environment +BUNDLER_HOSTNAME=http://localhost:3000 -// make sure this is never development when deploying to production, and delete this line -NODE_ENV= +# You don't have to set all of the paymasters, just the ones you want to test e2e +BASE_MAINNET_PAYMASTER_URL= +AVALANCHE_MAINNET_PAYMASTER_URL= +OPTIMISM_MAINNET_PAYMASTER_URL= +POLYGON_MAINNET_PAYMASTER_URL= +BSC_MAINNET_PAYMASTER_URL= +ARBITRUM_MAINNET_PAYMASTER_URL= diff --git a/config/test.json b/config/test.json index 5d5d76bf..ff7c7c3a 100644 --- a/config/test.json +++ b/config/test.json @@ -1,50 +1,12 @@ { - "supportedNetworks": [1], + "config": { + "validate": false + }, "relayer": { "nodePathIndex": 0 }, - "dataSources": { - "redisUrl": "test" - }, "clearStaleMessages": { "supportedNetworks": [1], "ttlSeconds": 1 - }, - "chains": { - "providers": { - "1": [ - { - "url": "https://thislinkdoesnotexist.rs", - "type": "private" - } - ], - "10": [ - { - "url": "https://thislinkdoesnotexist.rs", - "type": "private" - } - ], - "137": [ - { - "url": "https://thislinkdoesnotexist.rs", - "type": "private" - } - ], - "11155111": [ - { - "url": "https://thislinkdoesnotexist.rs", - "type": "private" - }, - { - "url": "https://thislinkdoesnotexist.rs", - "type": "mev-protected" - } - ] - } - }, - "EVMNetworkService": { - "waitForTransaction": { - "timeoutMs": 2000 - } } } diff --git a/package.json b/package.json index 0a72a0d7..7fb8f687 100644 --- a/package.json +++ b/package.json @@ -7,7 +7,9 @@ "build": "tsc -p .", "start": "node --max_old_space_size=6000 dist/server/index.js", "start:production": "NODE_ENV=production node --max_old_space_size=6000 dist/server/index.js", - "test": "jest --testPathIgnorePatterns smoke --setupFiles dotenv/config --verbose" + "test": "jest --testPathIgnorePatterns='/smoke|e2e/' --setupFiles dotenv/config --verbose", + "test:smoke": "jest -t smoke --setupFiles dotenv/config --verbose", + "test:e2e": "jest --testPathIgnorePatterns='smoke' -t e2e --setupFiles dotenv/config --verbose" }, "dependencies": { "@arbitrum/sdk": "^3.1.3", @@ -60,6 +62,7 @@ "viem": "^2.21.28" }, "devDependencies": { + "@biconomy/account": "^4.5.7", "@eslint/js": "^9.13.0", "@types/amqplib": "^0.8.2", "@types/big.js": "^6.1.5", diff --git a/src/test/e2e/nativeTransfer.test.ts b/src/test/e2e/nativeTransfer.test.ts new file mode 100644 index 00000000..a0ca9f07 --- /dev/null +++ b/src/test/e2e/nativeTransfer.test.ts @@ -0,0 +1,306 @@ +import { Chain, createWalletClient, http, PrivateKeyAccount } from "viem"; +import { privateKeyToAccount } from "viem/accounts"; +import { base, avalanche, optimism, polygon, bsc, arbitrum } from "viem/chains"; +import { + BiconomySmartAccountV2, + createSmartAccountClient, + PaymasterMode, +} from "@biconomy/account"; + +/** + * This file contains end-to-end tests that can run against a local or production bundler instance. + * The tests are disabled by default because they send real transactions and require real keys, URLs and balance in the smart account. + * To run the tests, you need to set the following environment variables: + * - PRIVATE_KEY: the private key of the account that will send the transactions + * - BUNDLER_HOSTNAME: the hostname of the bundler instance + * + * If you want to test any of the chains you have to delete the 'skip' statement + * and provide any of the following environment variables, depending on the chain you want to test: + * - BASE_MAINNET_PAYMASTER_URL: the paymaster URL for the base chain + * - OPTIMISM_MAINNET_PAYMASTER_URL: the paymaster URL for the optimism chain + * - AVALANCHE_MAINNET_PAYMASTER_URL: the paymaster URL for the avalanche chain + * - POLYGON_MAINNET_PAYMASTER_URL: the paymaster URL for the polygon chain + * - BSC_MAINNET_PAYMASTER_URL: the paymaster URL for the bsc chain + * - ARBITRUM_MAINNET_PAYMASTER_URL: the paymaster URL for the arbitrum chain + * + * You can refer to .env.example file for the environment variables. + * + * To run the tests, you can use the following command: + * - yarn test:e2e + * + * 🔥 Don't commit un-skipped e2e tests so someone doesn't run them by accident 🔥 + */ +describe("e2e", () => { + const privateKey = process.env.PRIVATE_KEY; + if (!privateKey) { + throw new Error("PRIVATE_KEY is not defined"); + } + const bundlerHostname = process.env.BUNDLER_HOSTNAME; + if (!bundlerHostname) { + throw new Error("BUNDLER_HOSTNAME is not defined"); + } + + const valueToSend = 1n; // send only 1 wei + + describe.skip("base-mainnet", () => { + const chainId = 8453; + const bundlerUrl = `${bundlerHostname}/api/v2/${chainId}/test`; + + const paymasterUrl = process.env.BASE_MAINNET_PAYMASTER_URL; + if (!paymasterUrl) { + throw new Error("BASE_MAINNET_PAYMASTER_URL is not defined"); + } + + it("should perform a native transfer using a paymaster", async () => { + const account = privateKeyToAccount(`0x${privateKey}`); + + logConfig(bundlerUrl, paymasterUrl, account); + + const smartAccount = await buildSmartAccount( + base, + account, + bundlerUrl, + paymasterUrl, + valueToSend, + ); + + const receipt = await sendUserOperation(account, smartAccount); + console.log(receipt); + + expect(receipt.success).toBe("true"); + }); + }); + + describe.skip("optimism-mainnet", () => { + const chainId = 10; + + const bundlerUrl = `${bundlerHostname}/api/v2/${chainId}/test`; + + const paymasterUrl = process.env.OPTIMISM_MAINNET_PAYMASTER_URL; + if (!paymasterUrl) { + throw new Error("OPTIMISM_MAINNET_PAYMASTER_URL is not defined"); + } + + it("should perform a native transfer using a paymaster", async () => { + const account = privateKeyToAccount(`0x${privateKey}`); + + logConfig(bundlerUrl, paymasterUrl, account); + + const smartAccount = await buildSmartAccount( + optimism, + account, + bundlerUrl, + paymasterUrl, + valueToSend, + ); + + const receipt = await sendUserOperation(account, smartAccount); + console.log(receipt); + + expect(receipt.success).toBe("true"); + }); + }); + + describe.skip("avalanche-mainnet", () => { + const chainId = 43114; + + const bundlerUrl = `${bundlerHostname}/api/v2/${chainId}/test`; + + const paymasterUrl = process.env.AVALANCHE_MAINNET_PAYMASTER_URL; + if (!paymasterUrl) { + throw new Error("AVALANCHE_MAINNET_PAYMASTER_URL is not defined"); + } + + it("should perform a native transfer using a paymaster", async () => { + const account = privateKeyToAccount(`0x${privateKey}`); + + logConfig(bundlerUrl, paymasterUrl, account); + + const smartAccount = await buildSmartAccount( + avalanche, + account, + bundlerUrl, + paymasterUrl, + valueToSend, + ); + + const receipt = await sendUserOperation(account, smartAccount); + console.log(receipt); + + expect(receipt.success).toBe("true"); + }); + }); + + describe.skip("polygon-mainnet", () => { + const chainId = 137; + + const bundlerUrl = `${bundlerHostname}/api/v2/${chainId}/test`; + + const paymasterUrl = process.env.POLYGON_MAINNET_PAYMASTER_URL; + if (!paymasterUrl) { + throw new Error("POLYGON_MAINNET_PAYMASTER_URL is not defined"); + } + + it("should perform a native transfer using a paymaster", async () => { + const account = privateKeyToAccount(`0x${privateKey}`); + + logConfig(bundlerUrl, paymasterUrl, account); + + const smartAccount = await buildSmartAccount( + polygon, + account, + bundlerUrl, + paymasterUrl, + valueToSend, + ); + + const receipt = await sendUserOperation(account, smartAccount); + console.log(receipt); + + expect(receipt.success).toBe("true"); + }); + }); + + describe.skip("bsc-mainnet", () => { + const chainId = 56; + + const bundlerUrl = `${bundlerHostname}/api/v2/${chainId}/test`; + + const paymasterUrl = process.env.BSC_MAINNET_PAYMASTER_URL; + if (!paymasterUrl) { + throw new Error("BSC_MAINNET_PAYMASTER_URL is not defined"); + } + + it("should perform a native transfer using a paymaster", async () => { + const account = privateKeyToAccount(`0x${privateKey}`); + + logConfig(bundlerUrl, paymasterUrl, account); + + const smartAccount = await buildSmartAccount( + bsc, + account, + bundlerUrl, + paymasterUrl, + valueToSend, + ); + + const receipt = await sendUserOperation(account, smartAccount); + console.log(receipt); + + expect(receipt.success).toBe("true"); + }); + }); + + describe.skip("arbitrum-mainnet", () => { + const chainId = 42161; + + const bundlerUrl = `${bundlerHostname}/api/v2/${chainId}/test`; + + const paymasterUrl = process.env.ARBITRUM_MAINNET_PAYMASTER_URL; + if (!paymasterUrl) { + throw new Error("ARBITRUM_MAINNET_PAYMASTER_URL is not defined"); + } + + it("should perform a native transfer using a paymaster", async () => { + const account = privateKeyToAccount(`0x${privateKey}`); + + logConfig(bundlerUrl, paymasterUrl, account); + + const smartAccount = await buildSmartAccount( + arbitrum, + account, + bundlerUrl, + paymasterUrl, + valueToSend, + ); + + const receipt = await sendUserOperation(account, smartAccount); + console.log(receipt); + + expect(receipt.success).toBe("true"); + }); + }); +}); + +/** + * A helper function to send a sponsored native transfer user operation + * @param account viem account + * @param smartAccount biconomy smart account + * @returns receipt + */ +async function sendUserOperation( + account: PrivateKeyAccount, + smartAccount: BiconomySmartAccountV2, +) { + const tx = { + to: account.address, + value: 1n, + }; + + const userOpResponse = await smartAccount.sendTransaction(tx, { + paymasterServiceData: { mode: PaymasterMode.SPONSORED }, + }); + + return userOpResponse.wait(); +} + +/** + * A helper function to build a biconomy smart account for a given chain + * @param chain viem chain + * @param account viem account + * @param bundlerUrl biconomy bundler url + * @param paymasterUrl biconomy paymaster url + * @param valueToSend value in wei + * @returns biconomy smart account + */ +async function buildSmartAccount( + chain: Chain, + account: PrivateKeyAccount, + bundlerUrl: string, + paymasterUrl: string | undefined, + valueToSend: bigint, +) { + const client = createWalletClient({ + account, + chain, + transport: http(), + }); + + const smartAccount = await createSmartAccountClient({ + signer: client, + bundlerUrl, + paymasterUrl, + }); + await requireBalance(smartAccount, valueToSend); + + return smartAccount; +} + +function logConfig( + bundlerUrl: string, + paymasterUrl: string, + account: PrivateKeyAccount, +) { + console.log(`Bundler URL: ${bundlerUrl}`); + console.log(`Paymaster URL: ${paymasterUrl}`); + console.log(`EOA Address: ${account.address}`); +} + +async function requireBalance( + smartAccount: BiconomySmartAccountV2, + valueToSend: bigint, +) { + const balances = await smartAccount.getBalances(); + const nativeBalance = balances[balances.length - 1]; + + console.log( + `smartAccount=${await smartAccount.getAddress()} native balance is ${nativeBalance.amount} wei`, + ); + + if (nativeBalance.amount < valueToSend) { + throw new Error( + `Insufficient balance in smart account with address ${await smartAccount.getAddress()} +Balance: ${nativeBalance.amount} wei, required: ${valueToSend} wei`, + ); + } +} diff --git a/src/test/smoke/health.test.ts b/src/test/smoke/health.test.ts index 83340730..83c8bf9c 100644 --- a/src/test/smoke/health.test.ts +++ b/src/test/smoke/health.test.ts @@ -1,11 +1,25 @@ -import fs from "fs"; +import config from "config"; +/** + * Smoke test to check if the server is running and healthy. + * This can be run on a local environment or on a deployed environment. + * If you're testing locally, make sure you have the server running before running this test. + * If you want to target production, edit the SMOKE_TEST_BUNDLER_HOSTNAME environment variable in the .env file. + * + * To make sure smoke tests pass on a local environment you can use config/smoke.json + * and disable funding & checking of relayers because you don't want to acrquire funds + * for every mainnet & testnet we support. + */ describe("smoke-test", () => { + const bundlerHostname = process.env.SMOKE_TEST_BUNDLER_HOSTNAME; + if (!bundlerHostname) { + throw new Error("SMOKE_TEST_BUNDLER_HOSTNAME not set"); + } + describe("health", () => { - // get supported networks from development.json - const developmentJson = fs.readFileSync("config/default.json", "utf8"); - const parsed = JSON.parse(developmentJson); - const supportedNetworks: number[] = parsed.supportedNetworks; + const supportedNetworks: number[] = config.get("supportedNetworks"); + + console.log(`Smoke test target bundler: ${bundlerHostname}`); for (const chainId of supportedNetworks) { it(`/admin/health/${chainId}`, async () => { @@ -15,11 +29,11 @@ describe("smoke-test", () => { }; const response = await fetch( - `http://localhost:3000/admin/health/${chainId}`, + `${bundlerHostname}/admin/health/${chainId}`, ); expect(response.status).toBe(200); - const data = JSON.parse(await response.json()); + const data = await response.json(); expect(data).toMatchObject(expected); }); diff --git a/yarn.lock b/yarn.lock index 9543cd37..77f1bcdf 100644 --- a/yarn.lock +++ b/yarn.lock @@ -780,6 +780,13 @@ resolved "https://registry.yarnpkg.com/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz#75a2e8b51cb758a7553d6804a5932d7aace75c39" integrity sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw== +"@biconomy/account@^4.5.7": + version "4.5.7" + resolved "https://registry.yarnpkg.com/@biconomy/account/-/account-4.5.7.tgz#e615f718433205d65887f4178b7a9f55fa818dda" + integrity sha512-hJjbCJNanwDzXprKCCrHB1iV+MdQagt79Zuyv3+j1EojseWmFPXAvZagS2rcYJu1XPFlt65nckQLtW8I/eutnw== + dependencies: + merkletreejs "^0.4.0" + "@commitlint/config-validator@^19.5.0": version "19.5.0" resolved "https://registry.yarnpkg.com/@commitlint/config-validator/-/config-validator-19.5.0.tgz#f0a4eda2109fc716ef01bb8831af9b02e3a1e568" @@ -1097,6 +1104,20 @@ dependencies: levn "^0.4.1" +"@ethereumjs/rlp@^4.0.1": + version "4.0.1" + resolved "https://registry.yarnpkg.com/@ethereumjs/rlp/-/rlp-4.0.1.tgz#626fabfd9081baab3d0a3074b0c7ecaf674aaa41" + integrity sha512-tqsQiBQDQdmPWE1xkkBq4rlSW5QZpLOUJ5RJh2/9fug+q9tnUhuZoVLk7s0scUIKTOzEtR72DFBXI4WiZcMpvw== + +"@ethereumjs/util@^8.1.0": + version "8.1.0" + resolved "https://registry.yarnpkg.com/@ethereumjs/util/-/util-8.1.0.tgz#299df97fb6b034e0577ce9f94c7d9d1004409ed4" + integrity sha512-zQ0IqbdX8FZ9aw11vP+dZkKDkS+kgIvQPHnSAXzP9pLu+Rfu3D3XEeLbicvoXJTYnhZiPmsZUxgdzXwNKxRPbA== + dependencies: + "@ethereumjs/rlp" "^4.0.1" + ethereum-cryptography "^2.0.0" + micro-ftch "^0.3.1" + "@ethersproject/abi@5.7.0", "@ethersproject/abi@^5.7.0": version "5.7.0" resolved "https://registry.yarnpkg.com/@ethersproject/abi/-/abi-5.7.0.tgz#b3f3e045bbbeed1af3947335c247ad625a44e449" @@ -1744,6 +1765,13 @@ dependencies: sparse-bitfield "^3.0.3" +"@noble/curves@1.4.2", "@noble/curves@~1.4.0": + version "1.4.2" + resolved "https://registry.yarnpkg.com/@noble/curves/-/curves-1.4.2.tgz#40309198c76ed71bc6dbf7ba24e81ceb4d0d1fe9" + integrity sha512-TavHr8qycMChk8UwMld0ZDRvatedkzWfH8IiaeGCfymOP5i0hSCozz9vHOL0nkwk7HRMlFnAiKpS2jrUmSybcw== + dependencies: + "@noble/hashes" "1.4.0" + "@noble/curves@1.6.0", "@noble/curves@~1.6.0": version "1.6.0" resolved "https://registry.yarnpkg.com/@noble/curves/-/curves-1.6.0.tgz#be5296ebcd5a1730fccea4786d420f87abfeb40b" @@ -1758,6 +1786,11 @@ dependencies: "@noble/hashes" "1.6.0" +"@noble/hashes@1.4.0", "@noble/hashes@~1.4.0": + version "1.4.0" + resolved "https://registry.yarnpkg.com/@noble/hashes/-/hashes-1.4.0.tgz#45814aa329f30e4fe0ba49426f49dfccdd066426" + integrity sha512-V1JJ1WTRUqHHrOSh597hURcMqVKVGL/ea3kv0gSnEdsEZ0/+VyPghM1lMNGc00z7CIQorSvbKpuJkxvuHbvdbg== + "@noble/hashes@1.5.0", "@noble/hashes@~1.5.0": version "1.5.0" resolved "https://registry.yarnpkg.com/@noble/hashes/-/hashes-1.5.0.tgz#abadc5ca20332db2b1b2aa3e496e9af1213570b0" @@ -1913,7 +1946,7 @@ resolved "https://registry.yarnpkg.com/@rtsao/scc/-/scc-1.1.0.tgz#927dd2fae9bc3361403ac2c7a00c32ddce9ad7e8" integrity sha512-zt6OdqaDoOnJ1ZYsCYGt9YmWzDXl4vQdKTyJev62gFhRGKdx7mcT54V9KIjg+d2wi9EXsPvAPKe7i7WjfVWB8g== -"@scure/base@~1.1.7", "@scure/base@~1.1.8": +"@scure/base@~1.1.6", "@scure/base@~1.1.7", "@scure/base@~1.1.8": version "1.1.9" resolved "https://registry.yarnpkg.com/@scure/base/-/base-1.1.9.tgz#e5e142fbbfe251091f9c5f1dd4c834ac04c3dbd1" integrity sha512-8YKhl8GHiNI/pU2VMaofa2Tor7PJRAjwQLBBuilkJ9L5+13yVbC7JO/wS7piioAvPSwR3JKM1IJ/u4xQzbcXKg== @@ -1923,6 +1956,15 @@ resolved "https://registry.yarnpkg.com/@scure/base/-/base-1.2.1.tgz#dd0b2a533063ca612c17aa9ad26424a2ff5aa865" integrity sha512-DGmGtC8Tt63J5GfHgfl5CuAXh96VF/LD8K9Hr/Gv0J2lAoRGlPOMpqMpMbCTOoOJMZCk2Xt+DskdDyn6dEFdzQ== +"@scure/bip32@1.4.0": + version "1.4.0" + resolved "https://registry.yarnpkg.com/@scure/bip32/-/bip32-1.4.0.tgz#4e1f1e196abedcef395b33b9674a042524e20d67" + integrity sha512-sVUpc0Vq3tXCkDGYVWGIZTRfnvu8LoTDaev7vbwh0omSvVORONr960MQWdKqJDCReIEmTj3PAr73O3aoxz7OPg== + dependencies: + "@noble/curves" "~1.4.0" + "@noble/hashes" "~1.4.0" + "@scure/base" "~1.1.6" + "@scure/bip32@1.5.0": version "1.5.0" resolved "https://registry.yarnpkg.com/@scure/bip32/-/bip32-1.5.0.tgz#dd4a2e1b8a9da60e012e776d954c4186db6328e6" @@ -1941,6 +1983,14 @@ "@noble/hashes" "~1.6.0" "@scure/base" "~1.2.1" +"@scure/bip39@1.3.0": + version "1.3.0" + resolved "https://registry.yarnpkg.com/@scure/bip39/-/bip39-1.3.0.tgz#0f258c16823ddd00739461ac31398b4e7d6a18c3" + integrity sha512-disdg7gHuTDZtY+ZdkmLpPCk7fxZSu3gBiEGuoC1XYxv9cGx3Z6cpTggCgW6odSOOIXCiDjuGejW+aJKCY/pIQ== + dependencies: + "@noble/hashes" "~1.4.0" + "@scure/base" "~1.1.6" + "@scure/bip39@1.4.0": version "1.4.0" resolved "https://registry.yarnpkg.com/@scure/bip39/-/bip39-1.4.0.tgz#664d4f851564e2e1d4bffa0339f9546ea55960a6" @@ -3220,6 +3270,11 @@ big.js@^6.2.1: resolved "https://registry.yarnpkg.com/big.js/-/big.js-6.2.2.tgz#be3bb9ac834558b53b099deef2a1d06ac6368e1a" integrity sha512-y/ie+Faknx7sZA5MfGA2xKlu0GDv8RWrXGsmlteyJQ2lvoKv9GBK/fpRMc2qlSoBAgNxrixICFCBefIq8WCQpQ== +bignumber.js@^9.0.1: + version "9.1.2" + resolved "https://registry.yarnpkg.com/bignumber.js/-/bignumber.js-9.1.2.tgz#b7c4242259c008903b13707983b5f4bbd31eda0c" + integrity sha512-2/mKyZH9K85bzOEfhXDBFZTGd1CTs+5IHpeFQo9luiBG7hghdC851Pj2WAhb6E3R6b9tZj/XKhbg4fum+Kepug== + binary-extensions@^2.0.0: version "2.3.0" resolved "https://registry.yarnpkg.com/binary-extensions/-/binary-extensions-2.3.0.tgz#f6e14a97858d327252200242d4ccfe522c445522" @@ -3249,6 +3304,11 @@ bluebird@^3.7.2: resolved "https://registry.yarnpkg.com/bluebird/-/bluebird-3.7.2.tgz#9f229c15be272454ffa973ace0dbee79a1b0c36f" integrity sha512-XpNj6GDQzdfW+r2Wnn7xiSAd7TM3jzkxGXBGTtWKuSXv1xUV+azxAm8jdWZN06QTQk+2N2XB9jRDkvbmQmcRtg== +bn.js@4.11.6: + version "4.11.6" + resolved "https://registry.yarnpkg.com/bn.js/-/bn.js-4.11.6.tgz#53344adb14617a13f6e8dd2ce28905d1c0ba3215" + integrity sha512-XWwnNNFCuuSQ0m3r3C4LE3EiORltHd9M05pq6FOlVeiophzRbMo50Sbz1ehl8K3Z+jw9+vmgnXefY1hz8X+2wA== + bn.js@^4.11.9: version "4.12.1" resolved "https://registry.yarnpkg.com/bn.js/-/bn.js-4.12.1.tgz#215741fe3c9dba2d7e12c001d0cfdbae43975ba7" @@ -3383,6 +3443,11 @@ buffer-more-ints@~1.0.0: resolved "https://registry.yarnpkg.com/buffer-more-ints/-/buffer-more-ints-1.0.0.tgz#ef4f8e2dddbad429ed3828a9c55d44f05c611422" integrity sha512-EMetuGFz5SLsT0QTnXzINh4Ksr+oo4i+UGTXEshiGCQWnsgSs7ZhJ8fzlwQ+OzEMs0MpDAMr1hxnblp5a4vcHg== +buffer-reverse@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/buffer-reverse/-/buffer-reverse-1.0.1.tgz#49283c8efa6f901bc01fa3304d06027971ae2f60" + integrity sha512-M87YIUBsZ6N924W57vDwT/aOu8hw7ZgdByz6ijksLjmHJELBASmYTTlNHRgjE+pTsT9oJXGaDSgqqwfdHotDUg== + buffer-xor@^1.0.3: version "1.0.3" resolved "https://registry.yarnpkg.com/buffer-xor/-/buffer-xor-1.0.3.tgz#26e61ed1422fb70dd42e6e36729ed51d855fe8d9" @@ -3799,7 +3864,7 @@ cross-spawn@^7.0.3, cross-spawn@^7.0.5: shebang-command "^2.0.0" which "^2.0.1" -crypto-js@^4.1.1: +crypto-js@^4.1.1, crypto-js@^4.2.0: version "4.2.0" resolved "https://registry.yarnpkg.com/crypto-js/-/crypto-js-4.2.0.tgz#4d931639ecdfd12ff80e8186dba6af2c2e856631" integrity sha512-KALDyEYgpY+Rlob/iriUtjV6d5Eq+Y191A5g4UqLAi8CyGP9N1+FdVbkc1SxKc2r4YAYqG8JzO2KGL+AizD70Q== @@ -4530,6 +4595,13 @@ etag@~1.8.1: resolved "https://registry.yarnpkg.com/etag/-/etag-1.8.1.tgz#41ae2eeb65efa62268aebfea83ac7d79299b0887" integrity sha512-aIL5Fx7mawVa300al2BnEE4iNvo1qETxLrPI/o05L7z6go7fCw1J6EQmbK4FmJ2AS7kgVF/KEZWufBfdClMcPg== +ethereum-bloom-filters@^1.0.6: + version "1.2.0" + resolved "https://registry.yarnpkg.com/ethereum-bloom-filters/-/ethereum-bloom-filters-1.2.0.tgz#8294f074c1a6cbd32c39d2cc77ce86ff14797dab" + integrity sha512-28hyiE7HVsWubqhpVLVmZXFd4ITeHi+BUu05o9isf0GUpMtzBUi+8/gFrGaGYzvGAJQmJ3JKj77Mk9G98T84rA== + dependencies: + "@noble/hashes" "^1.4.0" + ethereum-cryptography@^0.1.3: version "0.1.3" resolved "https://registry.yarnpkg.com/ethereum-cryptography/-/ethereum-cryptography-0.1.3.tgz#8d6143cfc3d74bf79bbd8edecdf29e4ae20dd191" @@ -4551,6 +4623,16 @@ ethereum-cryptography@^0.1.3: secp256k1 "^4.0.1" setimmediate "^1.0.5" +ethereum-cryptography@^2.0.0, ethereum-cryptography@^2.1.2: + version "2.2.1" + resolved "https://registry.yarnpkg.com/ethereum-cryptography/-/ethereum-cryptography-2.2.1.tgz#58f2810f8e020aecb97de8c8c76147600b0b8ccf" + integrity sha512-r/W8lkHSiTLxUxW8Rf3u4HGB0xQweG2RyETjywylKZSzLWoWAijRz8WCuOtJ6wah+avllXBqZuk29HCCvhEIRg== + dependencies: + "@noble/curves" "1.4.2" + "@noble/hashes" "1.4.0" + "@scure/bip32" "1.4.0" + "@scure/bip39" "1.3.0" + ethereumjs-util@^7.1.5: version "7.1.5" resolved "https://registry.yarnpkg.com/ethereumjs-util/-/ethereumjs-util-7.1.5.tgz#9ecf04861e4fbbeed7465ece5f23317ad1129181" @@ -4598,6 +4680,14 @@ ethers@^5.1.0: "@ethersproject/web" "5.7.1" "@ethersproject/wordlists" "5.7.0" +ethjs-unit@0.1.6: + version "0.1.6" + resolved "https://registry.yarnpkg.com/ethjs-unit/-/ethjs-unit-0.1.6.tgz#c665921e476e87bce2a9d588a6fe0405b2c41699" + integrity sha512-/Sn9Y0oKl0uqQuvgFk/zQgR7aw1g36qX/jzSQ5lSwlO0GigPymk4eGQfeNTD03w1dPOqfz8V77Cy43jH56pagw== + dependencies: + bn.js "4.11.6" + number-to-bn "1.7.0" + event-lite@^0.1.1: version "0.1.3" resolved "https://registry.yarnpkg.com/event-lite/-/event-lite-0.1.3.tgz#3dfe01144e808ac46448f0c19b4ab68e403a901d" @@ -5560,6 +5650,11 @@ is-glob@^4.0.0, is-glob@^4.0.1, is-glob@^4.0.3, is-glob@~4.0.1: dependencies: is-extglob "^2.1.1" +is-hex-prefixed@1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-hex-prefixed/-/is-hex-prefixed-1.0.0.tgz#7d8d37e6ad77e5d127148913c573e082d777f554" + integrity sha512-WvtOiug1VFrE9v1Cydwm+FnXd3+w9GaeVUss5W4v/SLy3UW00vP+6iNF2SdnfiBoLy4bTqVdkftNGTUeOFVsbA== + is-interactive@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/is-interactive/-/is-interactive-1.0.0.tgz#cea6e6ae5c870a7b0a0004070b7b587e0252912e" @@ -6453,11 +6548,27 @@ merge@^2.1.1: resolved "https://registry.yarnpkg.com/merge/-/merge-2.1.1.tgz#59ef4bf7e0b3e879186436e8481c06a6c162ca98" integrity sha512-jz+Cfrg9GWOZbQAnDQ4hlVnQky+341Yk5ru8bZSe6sIDTCIg8n9i/u7hSQGSVOF3C7lH6mGtqjkiT9G4wFLL0w== +merkletreejs@^0.4.0: + version "0.4.0" + resolved "https://registry.yarnpkg.com/merkletreejs/-/merkletreejs-0.4.0.tgz#40514dd8b5f511b3f136aeea3ff90d74d5604112" + integrity sha512-a48Ta5kWiVNBgeEbZVMm6FB1hBlp6vEuou/XnZdlkmd2zq6NZR6Sh2j+kR1B0iOZIXrTMcigBYzZ39MLdYhm1g== + dependencies: + bignumber.js "^9.0.1" + buffer-reverse "^1.0.1" + crypto-js "^4.2.0" + treeify "^1.1.0" + web3-utils "^1.3.4" + methods@^1.1.2, methods@~1.1.2: version "1.1.2" resolved "https://registry.yarnpkg.com/methods/-/methods-1.1.2.tgz#5529a4d67654134edcc5266656835b0f851afcee" integrity sha512-iclAHeNqNm68zFtnZ0e+1L2yUIdvzNoauKU4WBA3VvH/vPFieF7qfRlwUZU+DA9P9bPXIS90ulxoUoCH23sV2w== +micro-ftch@^0.3.1: + version "0.3.1" + resolved "https://registry.yarnpkg.com/micro-ftch/-/micro-ftch-0.3.1.tgz#6cb83388de4c1f279a034fb0cf96dfc050853c5f" + integrity sha512-/0LLxhzP0tfiR5hcQebtudP56gUurs2CLkGarnCiB/OqEyUFQ6U3paQi/tgLv0hBJYt2rnr9MNpxz4fiiugstg== + micromatch@^4.0.2, micromatch@^4.0.4: version "4.0.8" resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-4.0.8.tgz#d66fa18f3a47076789320b9b1af32bd86d9fa202" @@ -6747,6 +6858,14 @@ npm-run-path@^4.0.1: dependencies: path-key "^3.0.0" +number-to-bn@1.7.0: + version "1.7.0" + resolved "https://registry.yarnpkg.com/number-to-bn/-/number-to-bn-1.7.0.tgz#bb3623592f7e5f9e0030b1977bd41a0c53fe1ea0" + integrity sha512-wsJ9gfSz1/s4ZsJN01lyonwuxA1tml6X1yBDnfpMglypcBRFZZkus26EdPSlqS5GJfYddVZa22p3VNb3z5m5Ig== + dependencies: + bn.js "4.11.6" + strip-hex-prefix "1.0.0" + numeral@^2.0.6: version "2.0.6" resolved "https://registry.yarnpkg.com/numeral/-/numeral-2.0.6.tgz#4ad080936d443c2561aed9f2197efffe25f4e506" @@ -7933,6 +8052,13 @@ strip-final-newline@^2.0.0: resolved "https://registry.yarnpkg.com/strip-final-newline/-/strip-final-newline-2.0.0.tgz#89b852fb2fcbe936f6f4b3187afb0a12c1ab58ad" integrity sha512-BrpvfNAE3dcvq7ll3xVumzjKjZQ5tI1sEUIKr3Uoks0XUl45St3FlatVqef9prk4jRDzhW6WZg+3bk93y6pLjA== +strip-hex-prefix@1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/strip-hex-prefix/-/strip-hex-prefix-1.0.0.tgz#0c5f155fef1151373377de9dbb588da05500e36f" + integrity sha512-q8d4ue7JGEiVcypji1bALTos+0pWtyGlivAWyPuTkHzuTCJqrK9sWxYQZUq6Nq3cuyv3bm734IhHvHtGGURU6A== + dependencies: + is-hex-prefixed "1.0.0" + strip-indent@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/strip-indent/-/strip-indent-3.0.0.tgz#c32e1cee940b6b3432c771bc2c54bcce73cd3001" @@ -8065,6 +8191,11 @@ tr46@^4.1.1: dependencies: punycode "^2.3.0" +treeify@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/treeify/-/treeify-1.1.0.tgz#4e31c6a463accd0943879f30667c4fdaff411bb8" + integrity sha512-1m4RA7xVAJrSGrrXGs0L3YTwyvBs2S8PbRHaLZAkFw7JR8oIFwYtysxlBZhYIa7xSyiYJKZ3iGrrk55cGA3i9A== + ts-api-utils@^1.3.0: version "1.4.3" resolved "https://registry.yarnpkg.com/ts-api-utils/-/ts-api-utils-1.4.3.tgz#bfc2215fe6528fecab2b0fba570a2e8a4263b064" @@ -8291,6 +8422,11 @@ url-value-parser@^2.0.0: resolved "https://registry.yarnpkg.com/url-value-parser/-/url-value-parser-2.2.0.tgz#f38ae8cd24604ec69bc219d66929ddbbd93a2b32" integrity sha512-yIQdxJpgkPamPPAPuGdS7Q548rLhny42tg8d4vyTNzFqvOnwqrgHXvgehT09U7fwrzxi3RxCiXjoNUNnNOlQ8A== +utf8@3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/utf8/-/utf8-3.0.0.tgz#f052eed1364d696e769ef058b183df88c87f69d1" + integrity sha512-E8VjFIQ/TyQgp+TZfS6l8yp/xWppSAHzidGiRrqe4bK4XP9pTRyKFgGJpO3SN7zdX4DeomTrwaseCHovfpFcqQ== + util-deprecate@^1.0.1: version "1.0.2" resolved "https://registry.yarnpkg.com/util-deprecate/-/util-deprecate-1.0.2.tgz#450d4dc9fa70de732762fbd2d4a28981419a0ccf" @@ -8362,6 +8498,20 @@ wcwidth@^1.0.1: dependencies: defaults "^1.0.3" +web3-utils@^1.3.4: + version "1.10.4" + resolved "https://registry.yarnpkg.com/web3-utils/-/web3-utils-1.10.4.tgz#0daee7d6841641655d8b3726baf33b08eda1cbec" + integrity sha512-tsu8FiKJLk2PzhDl9fXbGUWTkkVXYhtTA+SmEFkKft+9BgwLxfCRpU96sWv7ICC8zixBNd3JURVoiR3dUXgP8A== + dependencies: + "@ethereumjs/util" "^8.1.0" + bn.js "^5.2.1" + ethereum-bloom-filters "^1.0.6" + ethereum-cryptography "^2.1.2" + ethjs-unit "0.1.6" + number-to-bn "1.7.0" + randombytes "^2.1.0" + utf8 "3.0.0" + webauthn-p256@0.0.10: version "0.0.10" resolved "https://registry.yarnpkg.com/webauthn-p256/-/webauthn-p256-0.0.10.tgz#877e75abe8348d3e14485932968edf3325fd2fdd"