diff --git a/packages/cli/src/command-helpers/abi.ts b/packages/cli/src/command-helpers/abi.ts index c69781b56..fa0f0ed25 100644 --- a/packages/cli/src/command-helpers/abi.ts +++ b/packages/cli/src/command-helpers/abi.ts @@ -153,7 +153,7 @@ export const getContractNameForAddress = async ( const contractSourceCode = await fetchSourceCodeFromEtherscan(network, address); let contractName = contractSourceCode.result[0].ContractName; // Some explorers will return the full path of the contract instead of just the name - const regex = /^contracts\/(?.+)\.sol:\1$/; + const regex = /(?.+)\.sol:\1$/; if (regex.test(contractName)) contractName = regex.exec(contractName)?.groups?.contract;