From 8fa7f93f5b64103a182aa0c07ca6eaacdfbed106 Mon Sep 17 00:00:00 2001 From: Etienne Donneger Date: Wed, 2 Oct 2024 14:48:05 -0400 Subject: [PATCH 1/9] Replace Etherscan ABI lookups with Sourcify Etherscan requires an API key for ABI lookup and other operations. Sourcify (https://sourcify.dev) is an open-source decentralized alternative. --- packages/cli/src/command-helpers/abi.ts | 45 ++++++++++++++++++++----- packages/cli/src/commands/init.ts | 28 ++++++--------- 2 files changed, 48 insertions(+), 25 deletions(-) diff --git a/packages/cli/src/command-helpers/abi.ts b/packages/cli/src/command-helpers/abi.ts index 365f50039..491bd2ee4 100644 --- a/packages/cli/src/command-helpers/abi.ts +++ b/packages/cli/src/command-helpers/abi.ts @@ -7,6 +7,30 @@ import { withSpinner } from './spinner'; const logger = debugFactory('graph-cli:abi-helpers'); +export const loadAbiFromSourcify = async ( + ABICtor: typeof ABI, + network: string, + address: string, +): Promise => + await withSpinner( + `Fetching ABI from Sourcify`, + `Failed to fetch ABI from Sourcify`, + `Warnings while fetching ABI from Sourcify`, + async () => { + const chainId = await getSourcifyChainId(network); + const result = await fetch(`https://repo.sourcify.dev/contracts/full_match/${chainId}/${address}/metadata.json`); + const json = await result.json(); + + // Etherscan returns a JSON object that has a `status`, a `message` and + // a `result` field. The `status` is '0' in case of errors and '1' in + // case of success + if (result.ok) { + return new ABICtor('Contract', undefined, immutable.fromJS(json.output.abi)); + } + throw new Error('ABI not found, try loading it from a local file'); + }, + ); + export const loadAbiFromEtherscan = async ( ABICtor: typeof ABI, network: string, @@ -200,6 +224,19 @@ export const loadAbiFromBlockScout = async ( }, ); +const getSourcifyChainId = async (network: string) => { + const result = await fetch('https://sourcify.dev/server/chains'); + const json = await result.json(); + + // Can fail if network name doesn't follow https://chainlist.org name convention + const match = json.find((e: any) => e.name.toLowerCase().includes(network.replace('-', ' '))); + + if (match) + return match.chainId; + else + throw new Error(`Could not find chain id for "${network}"`); +}; + const getEtherscanLikeAPIUrl = (network: string) => { switch (network) { case 'mainnet': @@ -334,8 +371,6 @@ const getEtherscanLikeAPIUrl = (network: string) => { return 'https://api.routescan.io/v2/network/testnet/evm/9728/etherscan/api'; case 'fuse-testnet': return 'https://explorer.fusespark.io/api'; - case 'rootstock-testnet': - return 'https://rootstock-testnet.blockscout.com/api'; default: return `https://api-${network}.etherscan.io/api`; } @@ -484,12 +519,6 @@ const getPublicRPCEndpoint = (network: string) => { return 'https://testnet.bnb.boba.network'; case 'fuse-testnet': return 'https://rpc.fusespark.io'; - case 'rootstock-testnet': - return 'https://public-node.testnet.rsk.co'; - case 'kaia': - return 'https://public-en.node.kaia.io'; - case 'kaia-testnet': - return 'https://public-en.kairos.node.kaia.io'; default: throw new Error(`Unknown network: ${network}`); } diff --git a/packages/cli/src/commands/init.ts b/packages/cli/src/commands/init.ts index 2712d78db..17c960d20 100644 --- a/packages/cli/src/commands/init.ts +++ b/packages/cli/src/commands/init.ts @@ -6,7 +6,7 @@ import { filesystem, prompt, system } from 'gluegun'; import { Args, Command, Flags, ux } from '@oclif/core'; import { loadAbiFromBlockScout, - loadAbiFromEtherscan, + loadAbiFromSourcify, loadContractNameForAddress, loadStartBlockForContract, } from '../command-helpers/abi'; @@ -292,7 +292,7 @@ export default class InitCommand extends Command { if (network === 'poa-core') { abi = await loadAbiFromBlockScout(ABI, network, fromContract); } else { - abi = await loadAbiFromEtherscan(ABI, network, fromContract); + abi = await loadAbiFromSourcify(ABI, network, fromContract); } } catch (e) { process.exitCode = 1; @@ -544,7 +544,7 @@ async function processInitForm( } | undefined > { - let abiFromEtherscan: EthereumABI | undefined = undefined; + let abiFromSourcify: EthereumABI | undefined = undefined; try { const { protocol } = await prompt.ask<{ protocol: ProtocolName }>({ @@ -705,17 +705,11 @@ async function processInitForm( const ABI = protocolInstance.getABI(); - // Try loading the ABI from Etherscan, if none was provided + // Try loading the ABI from Sourcify, if none was provided if (protocolInstance.hasABIs() && !initAbi) { - if (network === 'poa-core') { - abiFromEtherscan = await retryWithPrompt(() => - loadAbiFromBlockScout(ABI, network, value), - ); - } else { - abiFromEtherscan = await retryWithPrompt(() => - loadAbiFromEtherscan(ABI, network, value), - ); - } + abiFromSourcify = await retryWithPrompt(() => + loadAbiFromSourcify(ABI, network, value), + ); } // If startBlock is not set, try to load it. if (!initStartBlock) { @@ -765,11 +759,11 @@ async function processInitForm( skip: () => !protocolInstance.hasABIs() || initFromExample !== undefined || - abiFromEtherscan !== undefined || + abiFromSourcify !== undefined || isSubstreams || !!initAbiPath, validate: async (value: string) => { - if (initFromExample || abiFromEtherscan || !protocolInstance.hasABIs()) { + if (initFromExample || abiFromSourcify || !protocolInstance.hasABIs()) { return true; } @@ -791,7 +785,7 @@ async function processInitForm( } }, result: async (value: string) => { - if (initFromExample || abiFromEtherscan || !protocolInstance.hasABIs()) { + if (initFromExample || abiFromSourcify || !protocolInstance.hasABIs()) { return null; } const ABI = protocolInstance.getABI(); @@ -853,7 +847,7 @@ async function processInitForm( ]); return { - abi: abiFromEtherscan || abiFromFile, + abi: abiFromSourcify || abiFromFile, protocolInstance, subgraphName, directory, From b247c456bd70adf87c0ef2fa427ec2d18d0c0b4a Mon Sep 17 00:00:00 2001 From: Etienne Donneger Date: Wed, 2 Oct 2024 15:07:16 -0400 Subject: [PATCH 2/9] Remove Etherscan comments in Sourcify method --- packages/cli/src/command-helpers/abi.ts | 3 --- 1 file changed, 3 deletions(-) diff --git a/packages/cli/src/command-helpers/abi.ts b/packages/cli/src/command-helpers/abi.ts index 491bd2ee4..539ca7087 100644 --- a/packages/cli/src/command-helpers/abi.ts +++ b/packages/cli/src/command-helpers/abi.ts @@ -21,9 +21,6 @@ export const loadAbiFromSourcify = async ( const result = await fetch(`https://repo.sourcify.dev/contracts/full_match/${chainId}/${address}/metadata.json`); const json = await result.json(); - // Etherscan returns a JSON object that has a `status`, a `message` and - // a `result` field. The `status` is '0' in case of errors and '1' in - // case of success if (result.ok) { return new ABICtor('Contract', undefined, immutable.fromJS(json.output.abi)); } From 69df461224b238a7cbdf5ecf77d831bade80fef8 Mon Sep 17 00:00:00 2001 From: Etienne Donneger Date: Wed, 2 Oct 2024 15:10:15 -0400 Subject: [PATCH 3/9] Fix lint --- packages/cli/src/command-helpers/abi.ts | 10 +++++----- packages/cli/src/commands/init.ts | 4 +--- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/packages/cli/src/command-helpers/abi.ts b/packages/cli/src/command-helpers/abi.ts index 539ca7087..8362214d9 100644 --- a/packages/cli/src/command-helpers/abi.ts +++ b/packages/cli/src/command-helpers/abi.ts @@ -18,7 +18,9 @@ export const loadAbiFromSourcify = async ( `Warnings while fetching ABI from Sourcify`, async () => { const chainId = await getSourcifyChainId(network); - const result = await fetch(`https://repo.sourcify.dev/contracts/full_match/${chainId}/${address}/metadata.json`); + const result = await fetch( + `https://repo.sourcify.dev/contracts/full_match/${chainId}/${address}/metadata.json`, + ); const json = await result.json(); if (result.ok) { @@ -228,10 +230,8 @@ const getSourcifyChainId = async (network: string) => { // Can fail if network name doesn't follow https://chainlist.org name convention const match = json.find((e: any) => e.name.toLowerCase().includes(network.replace('-', ' '))); - if (match) - return match.chainId; - else - throw new Error(`Could not find chain id for "${network}"`); + if (match) return match.chainId; + throw new Error(`Could not find chain id for "${network}"`); }; const getEtherscanLikeAPIUrl = (network: string) => { diff --git a/packages/cli/src/commands/init.ts b/packages/cli/src/commands/init.ts index 17c960d20..2f68ee723 100644 --- a/packages/cli/src/commands/init.ts +++ b/packages/cli/src/commands/init.ts @@ -707,9 +707,7 @@ async function processInitForm( // Try loading the ABI from Sourcify, if none was provided if (protocolInstance.hasABIs() && !initAbi) { - abiFromSourcify = await retryWithPrompt(() => - loadAbiFromSourcify(ABI, network, value), - ); + abiFromSourcify = await retryWithPrompt(() => loadAbiFromSourcify(ABI, network, value)); } // If startBlock is not set, try to load it. if (!initStartBlock) { From 477ee26cbd7deb7bf38883341fd9c3ef6a46e5aa Mon Sep 17 00:00:00 2001 From: Etienne Donneger Date: Thu, 3 Oct 2024 12:38:41 -0400 Subject: [PATCH 4/9] Use Sourcify for Contract name and remove replaced Etherscan methods --- packages/cli/src/command-helpers/abi.ts | 48 ++++++------------------- packages/cli/src/commands/add.ts | 4 +-- 2 files changed, 12 insertions(+), 40 deletions(-) diff --git a/packages/cli/src/command-helpers/abi.ts b/packages/cli/src/command-helpers/abi.ts index 63c10991d..9a0fb49c3 100644 --- a/packages/cli/src/command-helpers/abi.ts +++ b/packages/cli/src/command-helpers/abi.ts @@ -17,43 +17,15 @@ export const loadAbiFromSourcify = async ( `Failed to fetch ABI from Sourcify`, `Warnings while fetching ABI from Sourcify`, async () => { - const chainId = await getSourcifyChainId(network); - const result = await fetch( - `https://repo.sourcify.dev/contracts/full_match/${chainId}/${address}/metadata.json`, - ); - const json = await result.json(); + const json = await fetchMetadataFromSourcify(network, address); - if (result.ok) { + if (json) { return new ABICtor('Contract', undefined, immutable.fromJS(json.output.abi)); } throw new Error('ABI not found, try loading it from a local file'); }, ); -export const loadAbiFromEtherscan = async ( - ABICtor: typeof ABI, - network: string, - address: string, -): Promise => - await withSpinner( - `Fetching ABI from Etherscan`, - `Failed to fetch ABI from Etherscan`, - `Warnings while fetching ABI from Etherscan`, - async () => { - const scanApiUrl = getEtherscanLikeAPIUrl(network); - const result = await fetch(`${scanApiUrl}?module=contract&action=getabi&address=${address}`); - const json = await result.json(); - - // Etherscan returns a JSON object that has a `status`, a `message` and - // a `result` field. The `status` is '0' in case of errors and '1' in - // case of success - if (json.status === '1') { - return new ABICtor('Contract', undefined, immutable.fromJS(JSON.parse(json.result))); - } - throw new Error('ABI not found, try loading it from a local file'); - }, - ); - export const loadStartBlockForContract = async ( network: string, address: string, @@ -74,7 +46,7 @@ export const loadContractNameForAddress = async ( await withSpinner( `Fetching Contract Name`, `Failed to fetch Contract Name`, - `Warnings while fetching contract name from Etherscan`, + `Warnings while fetching contract name from Sourcify`, async () => { return getContractNameForAddress(network, address); }, @@ -147,19 +119,19 @@ export const fetchTransactionByHashFromRPC = async ( } }; -export const fetchSourceCodeFromEtherscan = async ( +export const fetchMetadataFromSourcify = async ( network: string, address: string, ): Promise => { - const scanApiUrl = getEtherscanLikeAPIUrl(network); + const chainId = await getSourcifyChainId(network); const result = await fetch( - `${scanApiUrl}?module=contract&action=getsourcecode&address=${address}`, + `https://repo.sourcify.dev/contracts/full_match/${chainId}/${address}/metadata.json`, ); const json = await result.json(); - if (json.status === '1') { + if (result.ok) { return json; } - throw new Error('Failed to fetch contract source code'); + throw new Error('Failed to fetch metadata for address'); }; export const getContractNameForAddress = async ( @@ -167,8 +139,8 @@ export const getContractNameForAddress = async ( address: string, ): Promise => { try { - const contractSourceCode = await fetchSourceCodeFromEtherscan(network, address); - const contractName = contractSourceCode.result[0].ContractName; + const json = await fetchMetadataFromSourcify(network, address); + const contractName = Object.values(json.settings.compilationTarget)[0] as string; logger('Successfully getContractNameForAddress. contractName: %s', contractName); return contractName; } catch (error) { diff --git a/packages/cli/src/commands/add.ts b/packages/cli/src/commands/add.ts index 2bbd5f9cd..494b7867f 100644 --- a/packages/cli/src/commands/add.ts +++ b/packages/cli/src/commands/add.ts @@ -4,7 +4,7 @@ import { Args, Command, Flags } from '@oclif/core'; import { CLIError } from '@oclif/core/lib/errors'; import { loadAbiFromBlockScout, - loadAbiFromEtherscan, + loadAbiFromSourcify, loadContractNameForAddress, loadStartBlockForContract, } from '../command-helpers/abi'; @@ -96,7 +96,7 @@ export default class AddCommand extends Command { } else if (network === 'poa-core') { ethabi = await loadAbiFromBlockScout(EthereumABI, network, address); } else { - ethabi = await loadAbiFromEtherscan(EthereumABI, network, address); + ethabi = await loadAbiFromSourcify(EthereumABI, network, address); } try { From f02ea66ae48d7bed0452638846b033b06a466c19 Mon Sep 17 00:00:00 2001 From: AK Date: Wed, 9 Oct 2024 14:28:47 -0400 Subject: [PATCH 5/9] added new chain (#1740) * added new chain: unichain testnet * Create fair-suns-pay.md --- .changeset/fair-suns-pay.md | 5 +++++ packages/cli/src/command-helpers/abi.ts | 12 ++++++++++++ 2 files changed, 17 insertions(+) create mode 100644 .changeset/fair-suns-pay.md diff --git a/.changeset/fair-suns-pay.md b/.changeset/fair-suns-pay.md new file mode 100644 index 000000000..ac212d2a4 --- /dev/null +++ b/.changeset/fair-suns-pay.md @@ -0,0 +1,5 @@ +--- +"@graphprotocol/graph-cli": minor +--- + +added new chain diff --git a/packages/cli/src/command-helpers/abi.ts b/packages/cli/src/command-helpers/abi.ts index 9a0fb49c3..2e043d775 100644 --- a/packages/cli/src/command-helpers/abi.ts +++ b/packages/cli/src/command-helpers/abi.ts @@ -340,6 +340,10 @@ const getEtherscanLikeAPIUrl = (network: string) => { return 'https://api.routescan.io/v2/network/testnet/evm/9728/etherscan/api'; case 'fuse-testnet': return 'https://explorer.fusespark.io/api'; + case 'rootstock-testnet': + return 'https://rootstock-testnet.blockscout.com/api'; + case 'unichain-testnet': + return 'https://unichain-sepolia.blockscout.com/api'; default: return `https://api-${network}.etherscan.io/api`; } @@ -488,6 +492,14 @@ const getPublicRPCEndpoint = (network: string) => { return 'https://testnet.bnb.boba.network'; case 'fuse-testnet': return 'https://rpc.fusespark.io'; + case 'rootstock-testnet': + return 'https://public-node.testnet.rsk.co'; + case 'kaia': + return 'https://public-en.node.kaia.io'; + case 'kaia-testnet': + return 'https://public-en.kairos.node.kaia.io'; + case 'unichain-testnet': + return 'http://beta-u-Proxy-9QsHxlNJa4es-1179015898.us-east-2.elb.amazonaws.com:8545'; default: throw new Error(`Unknown network: ${network}`); } From 68f504bda6da2508ae8e6c95a48b871de3005103 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Wed, 9 Oct 2024 19:49:26 +0000 Subject: [PATCH 6/9] chore(release): update monorepo packages versions (#1741) Co-authored-by: github-actions[bot] --- .changeset/fair-suns-pay.md | 5 ----- packages/cli/CHANGELOG.md | 8 ++++++++ packages/cli/package.json | 2 +- 3 files changed, 9 insertions(+), 6 deletions(-) delete mode 100644 .changeset/fair-suns-pay.md diff --git a/.changeset/fair-suns-pay.md b/.changeset/fair-suns-pay.md deleted file mode 100644 index ac212d2a4..000000000 --- a/.changeset/fair-suns-pay.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@graphprotocol/graph-cli": minor ---- - -added new chain diff --git a/packages/cli/CHANGELOG.md b/packages/cli/CHANGELOG.md index 25b65ec6d..0b9b761e2 100644 --- a/packages/cli/CHANGELOG.md +++ b/packages/cli/CHANGELOG.md @@ -1,5 +1,13 @@ # @graphprotocol/graph-cli +## 0.86.0 + +### Minor Changes + +- [#1740](https://github.com/graphprotocol/graph-tooling/pull/1740) + [`7b4f787`](https://github.com/graphprotocol/graph-tooling/commit/7b4f787ebe4f65dbb233d3dda02f179f75ef21d9) + Thanks [@alinobrasil](https://github.com/alinobrasil)! - added new chain + ## 0.85.0 ### Minor Changes diff --git a/packages/cli/package.json b/packages/cli/package.json index dc44d84c7..0e8b1b4f6 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -1,6 +1,6 @@ { "name": "@graphprotocol/graph-cli", - "version": "0.85.0", + "version": "0.86.0", "description": "CLI for building for and deploying to The Graph", "license": "(Apache-2.0 OR MIT)", "engines": { From 04bf8d3ec44d99a516a22c873cdd7bf048f7d169 Mon Sep 17 00:00:00 2001 From: AK Date: Wed, 23 Oct 2024 15:48:09 -0400 Subject: [PATCH 7/9] updated public rpc (#1746) * updated public rpc * Create itchy-colts-clap.md --- .changeset/itchy-colts-clap.md | 5 +++++ packages/cli/src/command-helpers/abi.ts | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) create mode 100644 .changeset/itchy-colts-clap.md diff --git a/.changeset/itchy-colts-clap.md b/.changeset/itchy-colts-clap.md new file mode 100644 index 000000000..ae49a8551 --- /dev/null +++ b/.changeset/itchy-colts-clap.md @@ -0,0 +1,5 @@ +--- +"@graphprotocol/graph-cli": minor +--- + +updated public rpc diff --git a/packages/cli/src/command-helpers/abi.ts b/packages/cli/src/command-helpers/abi.ts index 2e043d775..2b808f525 100644 --- a/packages/cli/src/command-helpers/abi.ts +++ b/packages/cli/src/command-helpers/abi.ts @@ -499,7 +499,7 @@ const getPublicRPCEndpoint = (network: string) => { case 'kaia-testnet': return 'https://public-en.kairos.node.kaia.io'; case 'unichain-testnet': - return 'http://beta-u-Proxy-9QsHxlNJa4es-1179015898.us-east-2.elb.amazonaws.com:8545'; + return 'https://sepolia.unichain.org'; default: throw new Error(`Unknown network: ${network}`); } From 946f9f061148b4e2647b5c34f9b68b5a58f4c05e Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Wed, 23 Oct 2024 19:50:03 +0000 Subject: [PATCH 8/9] chore(release): update monorepo packages versions (#1747) Co-authored-by: github-actions[bot] --- .changeset/itchy-colts-clap.md | 5 ----- packages/cli/CHANGELOG.md | 8 ++++++++ packages/cli/package.json | 2 +- 3 files changed, 9 insertions(+), 6 deletions(-) delete mode 100644 .changeset/itchy-colts-clap.md diff --git a/.changeset/itchy-colts-clap.md b/.changeset/itchy-colts-clap.md deleted file mode 100644 index ae49a8551..000000000 --- a/.changeset/itchy-colts-clap.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@graphprotocol/graph-cli": minor ---- - -updated public rpc diff --git a/packages/cli/CHANGELOG.md b/packages/cli/CHANGELOG.md index 0b9b761e2..505ce79b3 100644 --- a/packages/cli/CHANGELOG.md +++ b/packages/cli/CHANGELOG.md @@ -1,5 +1,13 @@ # @graphprotocol/graph-cli +## 0.87.0 + +### Minor Changes + +- [#1746](https://github.com/graphprotocol/graph-tooling/pull/1746) + [`fef2e05`](https://github.com/graphprotocol/graph-tooling/commit/fef2e05c07d5f99f01834c4a6b9e063992d4bc2d) + Thanks [@alinobrasil](https://github.com/alinobrasil)! - updated public rpc + ## 0.86.0 ### Minor Changes diff --git a/packages/cli/package.json b/packages/cli/package.json index 0e8b1b4f6..1bb35f56b 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -1,6 +1,6 @@ { "name": "@graphprotocol/graph-cli", - "version": "0.86.0", + "version": "0.87.0", "description": "CLI for building for and deploying to The Graph", "license": "(Apache-2.0 OR MIT)", "engines": { From 23d6a9cba3db345cf2ecef3eeaeaff9b7c97afa6 Mon Sep 17 00:00:00 2001 From: Etienne Donneger Date: Wed, 2 Oct 2024 14:48:05 -0400 Subject: [PATCH 9/9] Replace Etherscan ABI lookups with Sourcify Etherscan requires an API key for ABI lookup and other operations. Sourcify (https://sourcify.dev) is an open-source decentralized alternative. --- packages/cli/src/command-helpers/abi.ts | 30 +++++++++++++++++++++++-- packages/cli/src/commands/init.ts | 4 +++- 2 files changed, 31 insertions(+), 3 deletions(-) diff --git a/packages/cli/src/command-helpers/abi.ts b/packages/cli/src/command-helpers/abi.ts index 2b808f525..2709929f0 100644 --- a/packages/cli/src/command-helpers/abi.ts +++ b/packages/cli/src/command-helpers/abi.ts @@ -11,6 +11,30 @@ export const loadAbiFromSourcify = async ( ABICtor: typeof ABI, network: string, address: string, +): Promise => + await withSpinner( + `Fetching ABI from Sourcify`, + `Failed to fetch ABI from Sourcify`, + `Warnings while fetching ABI from Sourcify`, + async () => { + const chainId = await getSourcifyChainId(network); + const result = await fetch(`https://repo.sourcify.dev/contracts/full_match/${chainId}/${address}/metadata.json`); + const json = await result.json(); + + // Etherscan returns a JSON object that has a `status`, a `message` and + // a `result` field. The `status` is '0' in case of errors and '1' in + // case of success + if (result.ok) { + return new ABICtor('Contract', undefined, immutable.fromJS(json.output.abi)); + } + throw new Error('ABI not found, try loading it from a local file'); + }, + ); + +export const loadAbiFromEtherscan = async ( + ABICtor: typeof ABI, + network: string, + address: string, ): Promise => await withSpinner( `Fetching ABI from Sourcify`, @@ -202,8 +226,10 @@ const getSourcifyChainId = async (network: string) => { // Can fail if network name doesn't follow https://chainlist.org name convention const match = json.find((e: any) => e.name.toLowerCase().includes(network.replace('-', ' '))); - if (match) return match.chainId; - throw new Error(`Could not find chain id for "${network}"`); + if (match) + return match.chainId; + else + throw new Error(`Could not find chain id for "${network}"`); }; const getEtherscanLikeAPIUrl = (network: string) => { diff --git a/packages/cli/src/commands/init.ts b/packages/cli/src/commands/init.ts index 2f68ee723..17c960d20 100644 --- a/packages/cli/src/commands/init.ts +++ b/packages/cli/src/commands/init.ts @@ -707,7 +707,9 @@ async function processInitForm( // Try loading the ABI from Sourcify, if none was provided if (protocolInstance.hasABIs() && !initAbi) { - abiFromSourcify = await retryWithPrompt(() => loadAbiFromSourcify(ABI, network, value)); + abiFromSourcify = await retryWithPrompt(() => + loadAbiFromSourcify(ABI, network, value), + ); } // If startBlock is not set, try to load it. if (!initStartBlock) {