From 6306e75f258a01973365fed3702640b718a0cace Mon Sep 17 00:00:00 2001 From: Etienne Donneger Date: Mon, 25 Nov 2024 15:48:18 -0500 Subject: [PATCH] Simplify regex --- packages/cli/src/command-helpers/abi.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/cli/src/command-helpers/abi.ts b/packages/cli/src/command-helpers/abi.ts index c69781b5..fa0f0ed2 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;