From 1611ebd4a64114b657cfe73700b3a68d970989a1 Mon Sep 17 00:00:00 2001 From: Lukas Date: Tue, 5 Nov 2024 10:31:39 +0100 Subject: [PATCH] fix: make ci work on testnets (#681) * fix: make ci work on testnets * fix: cleanup deps * fix: handle throwing on rpc-env-side * fix: tksync casing --- package-lock.json | 174 +++++---------------- package.json | 4 +- scripts/clients.ts | 104 ++---------- scripts/configs/governance/arbitrum.ts | 2 +- scripts/configs/governance/avalanche.ts | 2 +- scripts/configs/governance/base.ts | 2 +- scripts/configs/governance/bnb.ts | 2 +- scripts/configs/governance/ethereum.ts | 2 +- scripts/configs/governance/gnosis.ts | 2 +- scripts/configs/governance/metis.ts | 2 +- scripts/configs/governance/optimism.ts | 2 +- scripts/configs/governance/polygon.ts | 2 +- scripts/configs/governance/polygonZkEvm.ts | 2 +- scripts/configs/governance/scroll.ts | 2 +- scripts/configs/governance/zksync.ts | 4 +- scripts/configs/networks/arbitrum.ts | 2 +- scripts/configs/networks/avalanche.ts | 2 +- scripts/configs/networks/base.ts | 2 +- scripts/configs/networks/bnb.ts | 2 +- scripts/configs/networks/ethereum.ts | 2 +- scripts/configs/networks/fantom.ts | 2 +- scripts/configs/networks/gnosis.ts | 2 +- scripts/configs/networks/metis.ts | 2 +- scripts/configs/networks/optimism.ts | 2 +- scripts/configs/networks/polygon.ts | 2 +- scripts/configs/networks/polygonZkEvm.ts | 2 +- scripts/configs/networks/scroll.ts | 2 +- scripts/configs/networks/zksync.ts | 4 +- scripts/configs/pools/arbitrum.ts | 2 +- scripts/configs/pools/avalanche.ts | 2 +- scripts/configs/pools/base.ts | 4 +- scripts/configs/pools/bnb.ts | 2 +- scripts/configs/pools/ethereum.ts | 2 +- scripts/configs/pools/fantom.ts | 2 +- scripts/configs/pools/gnosis.ts | 2 +- scripts/configs/pools/harmony.ts | 2 +- scripts/configs/pools/metis.ts | 2 +- scripts/configs/pools/optimism.ts | 2 +- scripts/configs/pools/polygon.ts | 2 +- scripts/configs/pools/scroll.ts | 2 +- scripts/configs/pools/zksync.ts | 4 +- scripts/generator/governanceV2Generator.ts | 2 +- scripts/generator/protocolV1Generator.ts | 2 +- scripts/generator/safetyModuleGenerator.ts | 2 +- scripts/verifyVerified.ts | 6 +- src/AaveV3BaseSepoliaLido.sol | 4 - ui/package.json | 1 - ui/src/app/page.tsx | 10 +- 48 files changed, 102 insertions(+), 291 deletions(-) diff --git a/package-lock.json b/package-lock.json index 0d801b11..fb7922a4 100644 --- a/package-lock.json +++ b/package-lock.json @@ -12,8 +12,8 @@ "ui" ], "devDependencies": { - "@bgd-labs/js-utils": "1.4.2", "@bgd-labs/react-web3-icons": "^1.5.3", + "@bgd-labs/rpc-env": "^1.0.3", "@types/node": "^22.4.1", "@uniswap/token-lists": "^1.0.0-beta.33", "ajv": "^8.12.0", @@ -66,23 +66,6 @@ "node": ">=6.9.0" } }, - "node_modules/@bgd-labs/js-utils": { - "version": "1.4.2", - "resolved": "https://registry.npmjs.org/@bgd-labs/js-utils/-/js-utils-1.4.2.tgz", - "integrity": "sha512-hKiorNIyEApdH1w7laYQ+sGkrCGZTem9kD5Ud7YP/ZKtkoPx12FcTAp+P+JZ42BerPEqzGLZMDRJDB2ZGKeAJw==", - "dependencies": { - "@supercharge/promise-pool": "^3.1.1", - "bs58": "^5.0.0", - "gray-matter": "^4.0.3", - "tsx": "^4.7.1" - }, - "engines": { - "node": ">=18.0.0" - }, - "peerDependencies": { - "viem": "^2.0.3" - } - }, "node_modules/@bgd-labs/react-web3-icons": { "version": "1.6.0", "resolved": "https://registry.npmjs.org/@bgd-labs/react-web3-icons/-/react-web3-icons-1.6.0.tgz", @@ -98,6 +81,12 @@ "node": ">=18" } }, + "node_modules/@bgd-labs/rpc-env": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/@bgd-labs/rpc-env/-/rpc-env-1.0.3.tgz", + "integrity": "sha512-9Irh5zOra0UBeFNvtTuweIeb4Y9lTgHvLJnORJ/iLGqPjuTJZpjD1bPqjHyLZb9mhC5sqbaVUqM8WAt5SsKNsg==", + "dev": true + }, "node_modules/@esbuild/aix-ppc64": { "version": "0.23.0", "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.23.0.tgz", @@ -105,6 +94,7 @@ "cpu": [ "ppc64" ], + "dev": true, "optional": true, "os": [ "aix" @@ -120,6 +110,7 @@ "cpu": [ "arm" ], + "dev": true, "optional": true, "os": [ "android" @@ -135,6 +126,7 @@ "cpu": [ "arm64" ], + "dev": true, "optional": true, "os": [ "android" @@ -150,6 +142,7 @@ "cpu": [ "x64" ], + "dev": true, "optional": true, "os": [ "android" @@ -165,6 +158,7 @@ "cpu": [ "arm64" ], + "dev": true, "optional": true, "os": [ "darwin" @@ -180,6 +174,7 @@ "cpu": [ "x64" ], + "dev": true, "optional": true, "os": [ "darwin" @@ -195,6 +190,7 @@ "cpu": [ "arm64" ], + "dev": true, "optional": true, "os": [ "freebsd" @@ -210,6 +206,7 @@ "cpu": [ "x64" ], + "dev": true, "optional": true, "os": [ "freebsd" @@ -225,6 +222,7 @@ "cpu": [ "arm" ], + "dev": true, "optional": true, "os": [ "linux" @@ -240,6 +238,7 @@ "cpu": [ "arm64" ], + "dev": true, "optional": true, "os": [ "linux" @@ -255,6 +254,7 @@ "cpu": [ "ia32" ], + "dev": true, "optional": true, "os": [ "linux" @@ -270,6 +270,7 @@ "cpu": [ "loong64" ], + "dev": true, "optional": true, "os": [ "linux" @@ -285,6 +286,7 @@ "cpu": [ "mips64el" ], + "dev": true, "optional": true, "os": [ "linux" @@ -300,6 +302,7 @@ "cpu": [ "ppc64" ], + "dev": true, "optional": true, "os": [ "linux" @@ -315,6 +318,7 @@ "cpu": [ "riscv64" ], + "dev": true, "optional": true, "os": [ "linux" @@ -330,6 +334,7 @@ "cpu": [ "s390x" ], + "dev": true, "optional": true, "os": [ "linux" @@ -345,6 +350,7 @@ "cpu": [ "x64" ], + "dev": true, "optional": true, "os": [ "linux" @@ -360,6 +366,7 @@ "cpu": [ "x64" ], + "dev": true, "optional": true, "os": [ "netbsd" @@ -375,6 +382,7 @@ "cpu": [ "arm64" ], + "dev": true, "optional": true, "os": [ "openbsd" @@ -390,6 +398,7 @@ "cpu": [ "x64" ], + "dev": true, "optional": true, "os": [ "openbsd" @@ -405,6 +414,7 @@ "cpu": [ "x64" ], + "dev": true, "optional": true, "os": [ "sunos" @@ -420,6 +430,7 @@ "cpu": [ "arm64" ], + "dev": true, "optional": true, "os": [ "win32" @@ -435,6 +446,7 @@ "cpu": [ "ia32" ], + "dev": true, "optional": true, "os": [ "win32" @@ -450,6 +462,7 @@ "cpu": [ "x64" ], + "dev": true, "optional": true, "os": [ "win32" @@ -1208,14 +1221,6 @@ "dev": true, "license": "MIT" }, - "node_modules/@supercharge/promise-pool": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/@supercharge/promise-pool/-/promise-pool-3.1.1.tgz", - "integrity": "sha512-TgCm6jVqMPv+OgD5uBNND/CkCwNDdXPQlcprtnXsWSBpTCy0q5CI6vRj+jsUiXE1xeRaKIX4UeaYJqzZBL92sg==", - "engines": { - "node": ">=8" - } - }, "node_modules/@swc/counter": { "version": "0.1.3", "resolved": "https://registry.npmjs.org/@swc/counter/-/counter-0.1.3.tgz", @@ -1802,11 +1807,6 @@ "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", "dev": true }, - "node_modules/base-x": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/base-x/-/base-x-4.0.0.tgz", - "integrity": "sha512-FuwxlW4H5kh37X/oW59pwTzzTKRzfrrQwhmyspRM7swOEZcHtDZSCt45U6oKgtuFE+WYPblePMVIPR4RZrh/hw==" - }, "node_modules/binary-extensions": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.2.0.tgz", @@ -1870,14 +1870,6 @@ "node": "^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7" } }, - "node_modules/bs58": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/bs58/-/bs58-5.0.0.tgz", - "integrity": "sha512-r+ihvQJvahgYT50JD05dyJNKlmmSlMoOGwn1lCcEzanPglg7TxYjioQUYehQ9mAR/+hOSd2jRc/Z2y5UxBymvQ==", - "dependencies": { - "base-x": "^4.0.0" - } - }, "node_modules/bundle-require": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/bundle-require/-/bundle-require-5.0.0.tgz", @@ -2395,6 +2387,7 @@ "version": "0.23.0", "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.23.0.tgz", "integrity": "sha512-1lvV17H2bMYda/WaFb2jLPeHU3zml2k4/yagNMG8Q/YtfMjCwEUZa2eXXMgZTVSL5q1n4H7sQ0X6CdJDqqeCFA==", + "dev": true, "hasInstallScript": true, "bin": { "esbuild": "bin/esbuild" @@ -2853,18 +2846,6 @@ "url": "https://opencollective.com/eslint" } }, - "node_modules/esprima": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", - "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", - "bin": { - "esparse": "bin/esparse.js", - "esvalidate": "bin/esvalidate.js" - }, - "engines": { - "node": ">=4" - } - }, "node_modules/esquery": { "version": "1.5.0", "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.5.0.tgz", @@ -2907,17 +2888,6 @@ "node": ">=0.10.0" } }, - "node_modules/extend-shallow": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", - "integrity": "sha512-zCnTtlxNoAiDc3gqY2aYAWFx7XWWiasuF2K8Me5WbN8otHKTUKBwjPtNpRs/rbUZm7KxWAaNj7P1a/p52GbVug==", - "dependencies": { - "is-extendable": "^0.1.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/fast-deep-equal": { "version": "3.1.3", "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", @@ -3089,6 +3059,7 @@ "version": "2.3.3", "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz", "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==", + "dev": true, "hasInstallScript": true, "optional": true, "os": [ @@ -3174,6 +3145,7 @@ "version": "4.7.6", "resolved": "https://registry.npmjs.org/get-tsconfig/-/get-tsconfig-4.7.6.tgz", "integrity": "sha512-ZAqrLlu18NbDdRaHq+AKXzAmqIUPswPWKUchfytdAjiRFnCe5ojG2bstg6mRiZabkKfCoL/e98pbBELIV/YCeA==", + "dev": true, "dependencies": { "resolve-pkg-maps": "^1.0.0" }, @@ -3312,40 +3284,6 @@ "integrity": "sha512-EtKwoO6kxCL9WO5xipiHTZlSzBm7WLT627TqC/uVRd0HKmq8NXyebnNYxDoBi7wt8eTWrUrKXCOVaFq9x1kgag==", "dev": true }, - "node_modules/gray-matter": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/gray-matter/-/gray-matter-4.0.3.tgz", - "integrity": "sha512-5v6yZd4JK3eMI3FqqCouswVqwugaA9r4dNZB1wwcmrD02QkV5H0y7XBQW8QwQqEaZY1pM9aqORSORhJRdNK44Q==", - "dependencies": { - "js-yaml": "^3.13.1", - "kind-of": "^6.0.2", - "section-matter": "^1.0.0", - "strip-bom-string": "^1.0.0" - }, - "engines": { - "node": ">=6.0" - } - }, - "node_modules/gray-matter/node_modules/argparse": { - "version": "1.0.10", - "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", - "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", - "dependencies": { - "sprintf-js": "~1.0.2" - } - }, - "node_modules/gray-matter/node_modules/js-yaml": { - "version": "3.14.1", - "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.14.1.tgz", - "integrity": "sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g==", - "dependencies": { - "argparse": "^1.0.7", - "esprima": "^4.0.0" - }, - "bin": { - "js-yaml": "bin/js-yaml.js" - } - }, "node_modules/has-bigints": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/has-bigints/-/has-bigints-1.0.2.tgz", @@ -3609,14 +3547,6 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/is-extendable": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-0.1.1.tgz", - "integrity": "sha512-5BMULNob1vgFX6EjQw5izWDxrecWK9AM72rugNr0TFldMOi0fj6Jk+zeKIt0xGj4cEfQIJth4w3OKWOJ4f+AFw==", - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/is-extglob": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", @@ -3993,14 +3923,6 @@ "json-buffer": "3.0.1" } }, - "node_modules/kind-of": { - "version": "6.0.3", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.3.tgz", - "integrity": "sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw==", - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/language-subtag-registry": { "version": "0.3.22", "resolved": "https://registry.npmjs.org/language-subtag-registry/-/language-subtag-registry-0.3.22.tgz", @@ -4967,6 +4889,7 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/resolve-pkg-maps/-/resolve-pkg-maps-1.0.0.tgz", "integrity": "sha512-seS2Tj26TBVOC2NIc2rOe2y2ZO7efxITtLZcGSOnHHNOQ7CkiUBfw0Iw2ck6xkIhPwLhKNLS8BO+hEpngQlqzw==", + "dev": true, "funding": { "url": "https://github.com/privatenumber/resolve-pkg-maps?sponsor=1" } @@ -5120,18 +5043,6 @@ "loose-envify": "^1.1.0" } }, - "node_modules/section-matter": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/section-matter/-/section-matter-1.0.0.tgz", - "integrity": "sha512-vfD3pmTzGpufjScBh50YHKzEu2lxBWhVEHsNGoEXmCmn2hKGfeNLYMzCJpe8cD7gqX7TJluOVpBkAequ6dgMmA==", - "dependencies": { - "extend-shallow": "^2.0.1", - "kind-of": "^6.0.0" - }, - "engines": { - "node": ">=4" - } - }, "node_modules/semver": { "version": "7.6.0", "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.0.tgz", @@ -5271,11 +5182,6 @@ "node": ">=0.10.0" } }, - "node_modules/sprintf-js": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", - "integrity": "sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g==" - }, "node_modules/streamsearch": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/streamsearch/-/streamsearch-1.1.0.tgz", @@ -5448,14 +5354,6 @@ "node": ">=4" } }, - "node_modules/strip-bom-string": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/strip-bom-string/-/strip-bom-string-1.0.0.tgz", - "integrity": "sha512-uCC2VHvQRYu+lMh4My/sFNmF2klFymLX1wHJeXnbEJERpV/ZsVuonzerjfrGpIGF7LBVa1O7i9kjiWvJiFck8g==", - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/strip-json-comments": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", @@ -6334,6 +6232,7 @@ "version": "4.17.0", "resolved": "https://registry.npmjs.org/tsx/-/tsx-4.17.0.tgz", "integrity": "sha512-eN4mnDA5UMKDt4YZixo9tBioibaMBpoxBkD+rIPAjVmYERSG0/dWEY1CEFuV89CgASlKL499q8AhmkMnnjtOJg==", + "dev": true, "dependencies": { "esbuild": "~0.23.0", "get-tsconfig": "^4.7.5" @@ -6833,7 +6732,6 @@ "ui": { "version": "0.1.0", "dependencies": { - "@bgd-labs/js-utils": "^1.4.2", "@bgd-labs/react-web3-icons": "^1.4.7", "@leeoniya/ufuzzy": "^1.0.14", "clsx": "^2.1.1", diff --git a/package.json b/package.json index 89ea9a0a..e5933782 100644 --- a/package.json +++ b/package.json @@ -78,7 +78,7 @@ }, "homepage": "https://github.com/bgd-labs/aave-address-book#readme", "devDependencies": { - "@bgd-labs/js-utils": "1.4.2", + "@bgd-labs/rpc-env": "^1.0.3", "@bgd-labs/react-web3-icons": "^1.5.3", "@types/node": "^22.4.1", "@uniswap/token-lists": "^1.0.0-beta.33", @@ -94,4 +94,4 @@ "viem": "^2.21.19" }, "packageManager": "^npm@10.0.0" -} \ No newline at end of file +} diff --git a/scripts/clients.ts b/scripts/clients.ts index 3254e504..81707153 100644 --- a/scripts/clients.ts +++ b/scripts/clients.ts @@ -25,90 +25,11 @@ import { zksync, } from 'viem/chains'; import {Client} from 'viem'; -import {ChainId} from '@bgd-labs/js-utils'; +import {ChainId, getRPCUrl} from '@bgd-labs/rpc-env'; const commonConfig: HttpTransportConfig = {timeout: 30_000, batch: true}; const batchConfig = {batch: {multicall: true}}; -// @notice: fetched from alchemy private trpc api -// const data = await(await fetch('https://app-api.alchemy.com/trpc/config.getNetworkConfig')).json(); -// data.result.data.reduce((acc,val) => { -// acc[val.networkChainId] = val.kebabCaseId; -// return acc; -// },{}) -const alchemyNetworks: Record = { - 1: 'eth-mainnet', - 3: 'eth-ropsten', - 4: 'eth-rinkeby', - 5: 'eth-goerli', - 10: 'opt-mainnet', - 42: 'eth-kovan', - 56: 'bnb-mainnet', - 69: 'opt-kovan', - 97: 'bnb-testnet', - 100: 'gnosis-mainnet', - 137: 'polygon-mainnet', - 204: 'opbnb-mainnet', - 250: 'fantom-mainnet', - 252: 'frax-mainnet', - 300: 'zksync-sepolia', - 324: 'zksync-mainnet', - 420: 'opt-goerli', - 592: 'astar-mainnet', - 747: 'flow-mainnet', - 1088: 'metis-mainnet', - 1101: 'polygonzkevm-mainnet', - 1301: 'unichain-sepolia', - 1442: 'polygonzkevm-testnet', - 1946: 'soneium-minato', - 2442: 'polygonzkevm-cardona', - 2522: 'frax-sepolia', - 4002: 'fantom-testnet', - 5611: 'opbnb-testnet', - 7000: 'zetachain-mainnet', - 7001: 'zetachain-testnet', - 8453: 'base-mainnet', - 10200: 'gnosis-chiado', - 11011: 'shape-sepolia', - 42161: 'arb-mainnet', - 42170: 'arbnova-mainnet', - 43113: 'avax-fuji', - 43114: 'avax-mainnet', - 59141: 'linea-sepolia', - 59144: 'linea-mainnet', - 80001: 'polygon-mumbai', - 80002: 'polygon-amoy', - 80084: 'berachain-bartio', - 81457: 'blast-mainnet', - 84531: 'base-goerli', - 84532: 'base-sepolia', - 421611: 'arb-rinkeby', - 421613: 'arb-goerli', - 421614: 'arb-sepolia', - 534351: 'scroll-sepolia', - 534352: 'scroll-mainnet', - 7777777: 'zora-mainnet', - 11155111: 'eth-sepolia', - 11155420: 'opt-sepolia', - 168587773: 'blast-sepolia', - 999999999: 'zora-sepolia', -}; - -const networkEnv: Record = { - [ChainId.mainnet]: 'RPC_MAINNET', - [ChainId.optimism]: 'RPC_OPTIMISM', - [ChainId.bnb]: 'RPC_BNB', - [ChainId.gnosis]: 'RPC_GNOSIS', - [ChainId.polygon]: 'RPC_POLYGON', - [ChainId.fantom]: 'RPC_FANTOM', - [ChainId.zkSync]: 'RPC_ZKSYNC', - [ChainId.metis]: 'RPC_METIS', - [ChainId.base]: 'RPC_BASE', - [ChainId.arbitrum_one]: 'RPC_ARBITRUM', - [ChainId.avalanche]: 'RPC_AVALANCHE', - [ChainId.scroll]: 'RPC_SCROLL', -}; - export const CHAIN_ID_CHAIN_MAP: Record = { [ChainId.mainnet]: mainnet, [ChainId.sepolia]: sepolia, @@ -119,7 +40,7 @@ export const CHAIN_ID_CHAIN_MAP: Record = { [ChainId.polygon]: polygon, [ChainId.fantom]: fantom, [ChainId.fantom_testnet]: fantomTestnet, - [ChainId.zkSync]: zksync, + [ChainId.zksync]: zksync, [ChainId.metis]: metis, [ChainId.base]: base, [ChainId.base_sepolia]: baseSepolia, @@ -134,24 +55,21 @@ export const CHAIN_ID_CHAIN_MAP: Record = { [ChainId.celo]: celo, }; -/** - * Selects a rpc based on a predefined priorization: - * 1. env.RPC_URL_ - * 2. alchemy if available - */ -function getRPCUrl(chainId: number): string | undefined { - if (process.env[networkEnv[chainId]]) return process.env[networkEnv[chainId]]; - if (alchemyNetworks[chainId] && process.env.ALCHEMY_API_KEY) - return `https://${alchemyNetworks[chainId]}.g.alchemy.com/v2/${process.env.ALCHEMY_API_KEY}`; -} - const clientCache: Record = {}; export function getClient(chainId: number) { if (!clientCache[chainId]) { + let rpcURL; + try { + rpcURL = getRPCUrl(chainId as any); + } catch (e) { + // if we cannot find an rpc in env we'll pass undefined + // which will select the most reliable public rpc + } + console.log(chainId); clientCache[chainId] = createClient({ chain: CHAIN_ID_CHAIN_MAP[chainId], - transport: http(getRPCUrl(chainId), commonConfig), + transport: http(rpcURL, commonConfig), ...batchConfig, }); } diff --git a/scripts/configs/governance/arbitrum.ts b/scripts/configs/governance/arbitrum.ts index dd5ae211..1ca94c92 100644 --- a/scripts/configs/governance/arbitrum.ts +++ b/scripts/configs/governance/arbitrum.ts @@ -1,4 +1,4 @@ -import {ChainId} from '@bgd-labs/js-utils'; +import {ChainId} from '@bgd-labs/rpc-env'; import {GovernanceConfig} from '../types'; export const governanceConfigArbitrum: GovernanceConfig = { diff --git a/scripts/configs/governance/avalanche.ts b/scripts/configs/governance/avalanche.ts index e36c2fd5..0c5249e0 100644 --- a/scripts/configs/governance/avalanche.ts +++ b/scripts/configs/governance/avalanche.ts @@ -1,4 +1,4 @@ -import {ChainId} from '@bgd-labs/js-utils'; +import {ChainId} from '@bgd-labs/rpc-env'; import {GovernanceConfig} from '../types'; export const governanceConfigFuji: GovernanceConfig = { diff --git a/scripts/configs/governance/base.ts b/scripts/configs/governance/base.ts index ef8b7eb7..4d188a1e 100644 --- a/scripts/configs/governance/base.ts +++ b/scripts/configs/governance/base.ts @@ -1,5 +1,5 @@ import {GovernanceConfig} from '../types'; -import {ChainId} from '@bgd-labs/js-utils'; +import {ChainId} from '@bgd-labs/rpc-env'; export const governanceConfigBase: GovernanceConfig = { name: 'Base', diff --git a/scripts/configs/governance/bnb.ts b/scripts/configs/governance/bnb.ts index bcb107b2..97d3e387 100644 --- a/scripts/configs/governance/bnb.ts +++ b/scripts/configs/governance/bnb.ts @@ -1,5 +1,5 @@ import {GovernanceConfig} from '../types'; -import {ChainId} from '@bgd-labs/js-utils'; +import {ChainId} from '@bgd-labs/rpc-env'; export const governanceConfigBNB: GovernanceConfig = { name: 'BNB', diff --git a/scripts/configs/governance/ethereum.ts b/scripts/configs/governance/ethereum.ts index 7f186e0a..a6b6e85b 100644 --- a/scripts/configs/governance/ethereum.ts +++ b/scripts/configs/governance/ethereum.ts @@ -1,4 +1,4 @@ -import {ChainId} from '@bgd-labs/js-utils'; +import {ChainId} from '@bgd-labs/rpc-env'; import {GovernanceConfig} from '../types'; // OUTDATED ABI diff --git a/scripts/configs/governance/gnosis.ts b/scripts/configs/governance/gnosis.ts index 29bd5987..5c2ccf08 100644 --- a/scripts/configs/governance/gnosis.ts +++ b/scripts/configs/governance/gnosis.ts @@ -1,5 +1,5 @@ import {GovernanceConfig} from '../types'; -import {ChainId} from '@bgd-labs/js-utils'; +import {ChainId} from '@bgd-labs/rpc-env'; export const governanceConfigGnosis: GovernanceConfig = { name: 'Gnosis', diff --git a/scripts/configs/governance/metis.ts b/scripts/configs/governance/metis.ts index 2f3af571..4901ed5c 100644 --- a/scripts/configs/governance/metis.ts +++ b/scripts/configs/governance/metis.ts @@ -1,5 +1,5 @@ import {GovernanceConfig} from '../types'; -import {ChainId} from '@bgd-labs/js-utils'; +import {ChainId} from '@bgd-labs/rpc-env'; export const governanceConfigMetis: GovernanceConfig = { name: 'Metis', diff --git a/scripts/configs/governance/optimism.ts b/scripts/configs/governance/optimism.ts index 5759c297..ce6d453f 100644 --- a/scripts/configs/governance/optimism.ts +++ b/scripts/configs/governance/optimism.ts @@ -1,4 +1,4 @@ -import {ChainId} from '@bgd-labs/js-utils'; +import {ChainId} from '@bgd-labs/rpc-env'; import {GovernanceConfig} from '../types'; export const governanceConfigOptimism: GovernanceConfig = { diff --git a/scripts/configs/governance/polygon.ts b/scripts/configs/governance/polygon.ts index 4cf40212..00193e9c 100644 --- a/scripts/configs/governance/polygon.ts +++ b/scripts/configs/governance/polygon.ts @@ -1,4 +1,4 @@ -import {ChainId} from '@bgd-labs/js-utils'; +import {ChainId} from '@bgd-labs/rpc-env'; import {GovernanceConfig} from '../types'; export const governanceConfigPolygon: GovernanceConfig = { diff --git a/scripts/configs/governance/polygonZkEvm.ts b/scripts/configs/governance/polygonZkEvm.ts index cb04f265..e44a9087 100644 --- a/scripts/configs/governance/polygonZkEvm.ts +++ b/scripts/configs/governance/polygonZkEvm.ts @@ -1,4 +1,4 @@ -import {ChainId} from '@bgd-labs/js-utils'; +import {ChainId} from '@bgd-labs/rpc-env'; import {GovernanceConfig} from '../types'; export const governanceConfigPolygonZkEvm: GovernanceConfig = { diff --git a/scripts/configs/governance/scroll.ts b/scripts/configs/governance/scroll.ts index 9ebac6a0..998a64f2 100644 --- a/scripts/configs/governance/scroll.ts +++ b/scripts/configs/governance/scroll.ts @@ -1,4 +1,4 @@ -import {ChainId} from '@bgd-labs/js-utils'; +import {ChainId} from '@bgd-labs/rpc-env'; import {GovernanceConfig} from '../types'; export const governanceConfigScroll: GovernanceConfig = { diff --git a/scripts/configs/governance/zksync.ts b/scripts/configs/governance/zksync.ts index a8ddac9f..e322130f 100644 --- a/scripts/configs/governance/zksync.ts +++ b/scripts/configs/governance/zksync.ts @@ -1,9 +1,9 @@ -import {ChainId} from '@bgd-labs/js-utils'; +import {ChainId} from '@bgd-labs/rpc-env'; import {GovernanceConfig} from '../types'; export const governanceConfigZkSync: GovernanceConfig = { name: 'ZkSync', - CHAIN_ID: ChainId.zkSync, + CHAIN_ID: ChainId.zksync, ADDRESSES: { CROSS_CHAIN_CONTROLLER: '0x800813f4714BC7A0a95310e3fB9e4f18872CA92C', PAYLOADS_CONTROLLER: '0x2E79349c3F5e4751E87b966812C9E65E805996F1', diff --git a/scripts/configs/networks/arbitrum.ts b/scripts/configs/networks/arbitrum.ts index 7b70e4c1..2150333c 100644 --- a/scripts/configs/networks/arbitrum.ts +++ b/scripts/configs/networks/arbitrum.ts @@ -1,5 +1,5 @@ import {Hex} from 'viem'; -import {ChainId} from '@bgd-labs/js-utils'; +import {ChainId} from '@bgd-labs/rpc-env'; import {NetworkAddresses} from '../types'; export const arbitrumAddresses: NetworkAddresses<{ diff --git a/scripts/configs/networks/avalanche.ts b/scripts/configs/networks/avalanche.ts index 13452e4d..6cc34a20 100644 --- a/scripts/configs/networks/avalanche.ts +++ b/scripts/configs/networks/avalanche.ts @@ -1,4 +1,4 @@ -import {ChainId} from '@bgd-labs/js-utils'; +import {ChainId} from '@bgd-labs/rpc-env'; import {NetworkAddresses} from '../types'; export const avalancheAddresses: NetworkAddresses = { diff --git a/scripts/configs/networks/base.ts b/scripts/configs/networks/base.ts index 57540901..a43ee5c5 100644 --- a/scripts/configs/networks/base.ts +++ b/scripts/configs/networks/base.ts @@ -1,5 +1,5 @@ import {Hex} from 'viem'; -import {ChainId} from '@bgd-labs/js-utils'; +import {ChainId} from '@bgd-labs/rpc-env'; import {NetworkAddresses} from '../types'; export const baseAddresses: NetworkAddresses<{ diff --git a/scripts/configs/networks/bnb.ts b/scripts/configs/networks/bnb.ts index a85e1322..1abd1647 100644 --- a/scripts/configs/networks/bnb.ts +++ b/scripts/configs/networks/bnb.ts @@ -1,4 +1,4 @@ -import {ChainId} from '@bgd-labs/js-utils'; +import {ChainId} from '@bgd-labs/rpc-env'; import {NetworkAddresses} from '../types'; export const bnbAddresses: NetworkAddresses = { diff --git a/scripts/configs/networks/ethereum.ts b/scripts/configs/networks/ethereum.ts index 62b5cbdc..45e0e262 100644 --- a/scripts/configs/networks/ethereum.ts +++ b/scripts/configs/networks/ethereum.ts @@ -1,5 +1,5 @@ import {Hex} from 'viem'; -import {ChainId} from '@bgd-labs/js-utils'; +import {ChainId} from '@bgd-labs/rpc-env'; import {AddressInfo, NetworkAddresses} from '../types'; export const ethereumAddresses: NetworkAddresses<{ diff --git a/scripts/configs/networks/fantom.ts b/scripts/configs/networks/fantom.ts index 8cb75944..94b6c026 100644 --- a/scripts/configs/networks/fantom.ts +++ b/scripts/configs/networks/fantom.ts @@ -1,4 +1,4 @@ -import {ChainId} from '@bgd-labs/js-utils'; +import {ChainId} from '@bgd-labs/rpc-env'; import {NetworkAddresses} from '../types'; export const fantomAddresses: NetworkAddresses = { diff --git a/scripts/configs/networks/gnosis.ts b/scripts/configs/networks/gnosis.ts index 933f798f..bfaeef69 100644 --- a/scripts/configs/networks/gnosis.ts +++ b/scripts/configs/networks/gnosis.ts @@ -1,5 +1,5 @@ import {Hex} from 'viem'; -import {ChainId} from '@bgd-labs/js-utils'; +import {ChainId} from '@bgd-labs/rpc-env'; import {NetworkAddresses} from '../types'; export const gnosisAddresses: NetworkAddresses<{wstETH_stETH_AGGREGATOR: Hex}> = { diff --git a/scripts/configs/networks/metis.ts b/scripts/configs/networks/metis.ts index f0bb0369..34bdcae9 100644 --- a/scripts/configs/networks/metis.ts +++ b/scripts/configs/networks/metis.ts @@ -1,4 +1,4 @@ -import {ChainId} from '@bgd-labs/js-utils'; +import {ChainId} from '@bgd-labs/rpc-env'; import {NetworkAddresses} from '../types'; import {Hex} from 'viem'; diff --git a/scripts/configs/networks/optimism.ts b/scripts/configs/networks/optimism.ts index fa5ebd27..01e2f079 100644 --- a/scripts/configs/networks/optimism.ts +++ b/scripts/configs/networks/optimism.ts @@ -1,5 +1,5 @@ import {Hex} from 'viem'; -import {ChainId} from '@bgd-labs/js-utils'; +import {ChainId} from '@bgd-labs/rpc-env'; import {NetworkAddresses} from '../types'; export const optimismAddresses: NetworkAddresses<{ diff --git a/scripts/configs/networks/polygon.ts b/scripts/configs/networks/polygon.ts index a9ccbd28..d4515085 100644 --- a/scripts/configs/networks/polygon.ts +++ b/scripts/configs/networks/polygon.ts @@ -1,5 +1,5 @@ import {Hex} from 'viem'; -import {ChainId} from '@bgd-labs/js-utils'; +import {ChainId} from '@bgd-labs/rpc-env'; import {NetworkAddresses} from '../types'; export const polygonAddresses: NetworkAddresses<{ diff --git a/scripts/configs/networks/polygonZkEvm.ts b/scripts/configs/networks/polygonZkEvm.ts index 55ea22d7..6904fae1 100644 --- a/scripts/configs/networks/polygonZkEvm.ts +++ b/scripts/configs/networks/polygonZkEvm.ts @@ -1,5 +1,5 @@ import {NetworkAddresses} from '../types'; -import {ChainId} from '@bgd-labs/js-utils'; +import {ChainId} from '@bgd-labs/rpc-env'; export const polygonZkEvmAddresses: NetworkAddresses = { name: 'PolygonZkEvm', diff --git a/scripts/configs/networks/scroll.ts b/scripts/configs/networks/scroll.ts index 3facff54..26c01c19 100644 --- a/scripts/configs/networks/scroll.ts +++ b/scripts/configs/networks/scroll.ts @@ -1,5 +1,5 @@ import {Hex} from 'viem'; -import {ChainId} from '@bgd-labs/js-utils'; +import {ChainId} from '@bgd-labs/rpc-env'; import {NetworkAddresses} from '../types'; export const scrollAddresses: NetworkAddresses<{ diff --git a/scripts/configs/networks/zksync.ts b/scripts/configs/networks/zksync.ts index 66719530..e83a9f01 100644 --- a/scripts/configs/networks/zksync.ts +++ b/scripts/configs/networks/zksync.ts @@ -1,10 +1,10 @@ import {Hex} from 'viem'; -import {ChainId} from '@bgd-labs/js-utils'; +import {ChainId} from '@bgd-labs/rpc-env'; import {NetworkAddresses} from '../types'; export const zkSyncAddresses: NetworkAddresses = { name: 'ZkSync', - chainId: ChainId.zkSync, + chainId: ChainId.zksync, addresses: { TRANSPARENT_PROXY_FACTORY: '0x903A3228c4C58e94787CB33EE83e087bCFcF0a91', PROXY_ADMIN: '0x158d6c497317367CEa3CBAb0BD84E6de236F060D', diff --git a/scripts/configs/pools/arbitrum.ts b/scripts/configs/pools/arbitrum.ts index dba6c69d..c6143c4e 100644 --- a/scripts/configs/pools/arbitrum.ts +++ b/scripts/configs/pools/arbitrum.ts @@ -1,4 +1,4 @@ -import {ChainId} from '@bgd-labs/js-utils'; +import {ChainId} from '@bgd-labs/rpc-env'; import {PoolConfig} from '../types'; export const arbitrumProtoV3: PoolConfig = { diff --git a/scripts/configs/pools/avalanche.ts b/scripts/configs/pools/avalanche.ts index 6e819f49..424824d0 100644 --- a/scripts/configs/pools/avalanche.ts +++ b/scripts/configs/pools/avalanche.ts @@ -1,4 +1,4 @@ -import {ChainId} from '@bgd-labs/js-utils'; +import {ChainId} from '@bgd-labs/rpc-env'; import {PoolConfig} from '../types'; export const fujiProtoV2: PoolConfig = { diff --git a/scripts/configs/pools/base.ts b/scripts/configs/pools/base.ts index cf121db3..99647947 100644 --- a/scripts/configs/pools/base.ts +++ b/scripts/configs/pools/base.ts @@ -1,4 +1,4 @@ -import {ChainId} from '@bgd-labs/js-utils'; +import {ChainId} from '@bgd-labs/rpc-env'; import {PoolConfig} from '../types'; export const baseProtoV3: PoolConfig = { @@ -59,5 +59,5 @@ export const baseSepoliaLidoProtoV3: PoolConfig = { UI_POOL_DATA_PROVIDER: '0x912D4A80f8cA3959eB49Ce38f060c46323D1e3A4', WALLET_BALANCE_PROVIDER: '0x2a5208950631917efE7EbE969eC1be68EE46AB16', WETH_GATEWAY: '0x63bBa35193cB5E061E8F0318F8A1788EA34E5198', - } + }, }; diff --git a/scripts/configs/pools/bnb.ts b/scripts/configs/pools/bnb.ts index da73f15f..9ce64fba 100644 --- a/scripts/configs/pools/bnb.ts +++ b/scripts/configs/pools/bnb.ts @@ -1,4 +1,4 @@ -import {ChainId} from '@bgd-labs/js-utils'; +import {ChainId} from '@bgd-labs/rpc-env'; import {PoolConfig} from '../types'; export const bnbProtoV3: PoolConfig = { diff --git a/scripts/configs/pools/ethereum.ts b/scripts/configs/pools/ethereum.ts index aed1e3c3..b3638544 100644 --- a/scripts/configs/pools/ethereum.ts +++ b/scripts/configs/pools/ethereum.ts @@ -1,4 +1,4 @@ -import {ChainId} from '@bgd-labs/js-utils'; +import {ChainId} from '@bgd-labs/rpc-env'; import {PoolConfig} from '../types'; export const sepoliaProtoV3: PoolConfig = { diff --git a/scripts/configs/pools/fantom.ts b/scripts/configs/pools/fantom.ts index 7c0fa88f..5e96759e 100644 --- a/scripts/configs/pools/fantom.ts +++ b/scripts/configs/pools/fantom.ts @@ -1,4 +1,4 @@ -import {ChainId} from '@bgd-labs/js-utils'; +import {ChainId} from '@bgd-labs/rpc-env'; import {PoolConfig} from '../types'; export const fantomTestnetProtoV3: PoolConfig = { diff --git a/scripts/configs/pools/gnosis.ts b/scripts/configs/pools/gnosis.ts index a26bc3e3..e0df84c0 100644 --- a/scripts/configs/pools/gnosis.ts +++ b/scripts/configs/pools/gnosis.ts @@ -1,4 +1,4 @@ -import {ChainId} from '@bgd-labs/js-utils'; +import {ChainId} from '@bgd-labs/rpc-env'; import {PoolConfig} from '../types'; export const gnosisProtoV3: PoolConfig = { diff --git a/scripts/configs/pools/harmony.ts b/scripts/configs/pools/harmony.ts index 2d82587d..62c71d00 100644 --- a/scripts/configs/pools/harmony.ts +++ b/scripts/configs/pools/harmony.ts @@ -1,4 +1,4 @@ -import {ChainId} from '@bgd-labs/js-utils'; +import {ChainId} from '@bgd-labs/rpc-env'; import {PoolConfig} from '../types'; export const harmonyProtoV3: PoolConfig = { diff --git a/scripts/configs/pools/metis.ts b/scripts/configs/pools/metis.ts index 9b1a0fbb..8454519d 100644 --- a/scripts/configs/pools/metis.ts +++ b/scripts/configs/pools/metis.ts @@ -1,4 +1,4 @@ -import {ChainId} from '@bgd-labs/js-utils'; +import {ChainId} from '@bgd-labs/rpc-env'; import {PoolConfig} from '../types'; export const metisProtoV3: PoolConfig = { diff --git a/scripts/configs/pools/optimism.ts b/scripts/configs/pools/optimism.ts index 4fad6386..466af569 100644 --- a/scripts/configs/pools/optimism.ts +++ b/scripts/configs/pools/optimism.ts @@ -1,4 +1,4 @@ -import {ChainId} from '@bgd-labs/js-utils'; +import {ChainId} from '@bgd-labs/rpc-env'; import {PoolConfig} from '../types'; export const optimismProtoV3: PoolConfig = { diff --git a/scripts/configs/pools/polygon.ts b/scripts/configs/pools/polygon.ts index 7dcc5e4b..cf396641 100644 --- a/scripts/configs/pools/polygon.ts +++ b/scripts/configs/pools/polygon.ts @@ -1,4 +1,4 @@ -import {ChainId} from '@bgd-labs/js-utils'; +import {ChainId} from '@bgd-labs/rpc-env'; import {PoolConfig} from '../types'; export const polygonProtoV2: PoolConfig = { diff --git a/scripts/configs/pools/scroll.ts b/scripts/configs/pools/scroll.ts index ae391584..5acaf30c 100644 --- a/scripts/configs/pools/scroll.ts +++ b/scripts/configs/pools/scroll.ts @@ -1,4 +1,4 @@ -import {ChainId} from '@bgd-labs/js-utils'; +import {ChainId} from '@bgd-labs/rpc-env'; import {PoolConfig} from '../types'; export const scrollSepoliaProtoV3: PoolConfig = { diff --git a/scripts/configs/pools/zksync.ts b/scripts/configs/pools/zksync.ts index 06fac0f2..3d120191 100644 --- a/scripts/configs/pools/zksync.ts +++ b/scripts/configs/pools/zksync.ts @@ -1,9 +1,9 @@ -import {ChainId} from '@bgd-labs/js-utils'; +import {ChainId} from '@bgd-labs/rpc-env'; import {PoolConfig} from '../types'; export const zkSyncProtoV3: PoolConfig = { name: 'ZkSync', - chainId: ChainId.zkSync, + chainId: ChainId.zksync, POOL_ADDRESSES_PROVIDER: '0x2A3948BB219D6B2Fa83D64100006391a96bE6cb7', additionalAddresses: { CONFIG_ENGINE: '0x54965A9c830DCEEa6BeEa77642C6A78C3df1C957', diff --git a/scripts/generator/governanceV2Generator.ts b/scripts/generator/governanceV2Generator.ts index 0d728251..7aaa55fe 100644 --- a/scripts/generator/governanceV2Generator.ts +++ b/scripts/generator/governanceV2Generator.ts @@ -7,7 +7,7 @@ import { prefixWithPragma, wrapIntoSolidityLibrary, } from './utils'; -import {ChainId} from '@bgd-labs/js-utils'; +import {ChainId} from '@bgd-labs/rpc-env'; const govV2Addresses: Addresses = { SHORT_EXECUTOR: '0xEE56e2B3D491590B5b31738cC34d5232F378a8D5', diff --git a/scripts/generator/protocolV1Generator.ts b/scripts/generator/protocolV1Generator.ts index bb17e421..f78121b7 100644 --- a/scripts/generator/protocolV1Generator.ts +++ b/scripts/generator/protocolV1Generator.ts @@ -7,7 +7,7 @@ import { prefixWithPragma, wrapIntoSolidityLibrary, } from './utils'; -import {ChainId} from '@bgd-labs/js-utils'; +import {ChainId} from '@bgd-labs/rpc-env'; const v1Addresses: Addresses = { ADDRESSES_PROVIDER: '0x24a42fD28C976A61Df5D00D0599C34c4f90748c8', diff --git a/scripts/generator/safetyModuleGenerator.ts b/scripts/generator/safetyModuleGenerator.ts index 37749e16..d5fc804b 100644 --- a/scripts/generator/safetyModuleGenerator.ts +++ b/scripts/generator/safetyModuleGenerator.ts @@ -6,7 +6,7 @@ import { prefixWithPragma, wrapIntoSolidityLibrary, } from './utils'; -import {ChainId} from '@bgd-labs/js-utils'; +import {ChainId} from '@bgd-labs/rpc-env'; export const SAFETY_MODULE = { STK_AAVE: '0x4da27a545c0c5B758a6BA100e3a049001de870f5', diff --git a/scripts/verifyVerified.ts b/scripts/verifyVerified.ts index d4e3a0dc..2571203d 100644 --- a/scripts/verifyVerified.ts +++ b/scripts/verifyVerified.ts @@ -1,4 +1,4 @@ -import {ChainId} from '@bgd-labs/js-utils'; +import {ChainId} from '@bgd-labs/rpc-env'; import {ListItem, flattenedAddresses} from '../ui/src/utils/getAddresses'; import {writeFileSync, readFileSync, existsSync, mkdirSync} from 'fs'; import {Address, zeroAddress} from 'viem'; @@ -30,7 +30,7 @@ function sleep(ms) { return new Promise((resolve) => setTimeout(resolve, ms)); } -async function checkProxyVerfication(item: ListItem, guid: string) { +async function checkProxyVerification(item: ListItem, guid: string) { const params = { apikey: CHAIN_ID_API_KEY_MAP[item.chainId] || '', module: 'contract', @@ -67,7 +67,7 @@ async function verifyProxy(item: ListItem) { const {status, result} = await request.json(); await sleep(1000); - if (status === '1') checkProxyVerfication(item, result); + if (status === '1') checkProxyVerification(item, result); } catch (e) { console.error(e); process.exit(1); diff --git a/src/AaveV3BaseSepoliaLido.sol b/src/AaveV3BaseSepoliaLido.sol index 25edaba4..2914d503 100644 --- a/src/AaveV3BaseSepoliaLido.sol +++ b/src/AaveV3BaseSepoliaLido.sol @@ -4,7 +4,6 @@ pragma solidity >=0.6.0; import {IPoolAddressesProvider, IPool, IPoolConfigurator, IAaveOracle, IPoolDataProvider, IACLManager} from './AaveV3.sol'; import {ICollector} from './common/ICollector.sol'; - library AaveV3BaseSepoliaLido { // https://sepolia.basescan.org/address/0x6f7E694fe5250Ce638fFE95524760422E6e41997 IPoolAddressesProvider internal constant POOL_ADDRESSES_PROVIDER = @@ -76,7 +75,6 @@ library AaveV3BaseSepoliaLido { // https://sepolia.basescan.org/address/0x63bBa35193cB5E061E8F0318F8A1788EA34E5198 address internal constant WETH_GATEWAY = 0x63bBa35193cB5E061E8F0318F8A1788EA34E5198; } - library AaveV3BaseSepoliaLidoAssets { // https://sepolia.basescan.org/address/0x31DeecB1f03D68154fB7d86EA54F3276afDC33e3 address internal constant USDC_UNDERLYING = 0x31DeecB1f03D68154fB7d86EA54F3276afDC33e3; @@ -167,13 +165,11 @@ library AaveV3BaseSepoliaLidoAssets { address internal constant cbETH_INTEREST_RATE_STRATEGY = 0x25286160e24a8567B24649AD230f581BC9DC1a66; } - library AaveV3BaseSepoliaLidoEModes { uint8 internal constant NONE = 0; uint8 internal constant ETH_CORRELATED = 1; } - library AaveV3BaseSepoliaLidoExternalLibraries { // https://sepolia.basescan.org/address/0xb32381feFFF45eE9F47fD2f2cF83C832637d6EF0 address internal constant FLASHLOAN_LOGIC = 0xb32381feFFF45eE9F47fD2f2cF83C832637d6EF0; diff --git a/ui/package.json b/ui/package.json index 699a31e8..be359945 100644 --- a/ui/package.json +++ b/ui/package.json @@ -9,7 +9,6 @@ "lint": "next lint" }, "dependencies": { - "@bgd-labs/js-utils": "^1.4.2", "@bgd-labs/react-web3-icons": "^1.4.7", "@leeoniya/ufuzzy": "^1.0.14", "clsx": "^2.1.1", diff --git a/ui/src/app/page.tsx b/ui/src/app/page.tsx index e3945d3f..07f63b34 100644 --- a/ui/src/app/page.tsx +++ b/ui/src/app/page.tsx @@ -1,6 +1,6 @@ import { Suspense } from 'react'; import { flattenedAddresses } from '../utils/getAddresses'; -import { CHAIN_ID_CLIENT_MAP } from '@bgd-labs/js-utils'; +import { CHAIN_ID_CHAIN_MAP } from '../../../scripts/clients'; import Image from 'next/image'; import { Search } from '@/components/Search'; import { SearchSkeleton } from '@/components/SearchSkeleton'; @@ -31,7 +31,7 @@ const TAG_MAP: Record = { const addresses = flattenedAddresses.map((item) => ({ ...item, - link: `${CHAIN_ID_CLIENT_MAP[item.chainId]?.chain?.blockExplorers?.default.url.replace(/\/$/, '')}/address/${item.value}`, + link: `${CHAIN_ID_CHAIN_MAP[item.chainId]?.blockExplorers?.default.url.replace(/\/$/, '')}/address/${item.value}`, searchPath: [ ...item.path, item.value, @@ -40,8 +40,8 @@ const addresses = flattenedAddresses.map((item) => ({ })); const sortedAddresses = addresses.sort((a, b) => { - const aInProduction = !CHAIN_ID_CLIENT_MAP[a.chainId].chain?.testnet; - const bInProduction = !CHAIN_ID_CLIENT_MAP[b.chainId].chain?.testnet; + const aInProduction = !CHAIN_ID_CHAIN_MAP[a.chainId].testnet; + const bInProduction = !CHAIN_ID_CHAIN_MAP[b.chainId].testnet; if (aInProduction && !bInProduction) { return -1; @@ -61,7 +61,7 @@ const sortedAddresses = addresses.sort((a, b) => { return pathLengthDiff; } - // A dirty hack to sligthly prioritize mainnet addresses + // A dirty hack to slightly prioritize mainnet addresses const aSearchPathLength = a.chainId === 1 ? a.searchPath.length - 6 : a.searchPath.length; const bSearchPathLength =