Skip to content

Commit 6306e75

Browse files
committed
Simplify regex
1 parent a34c9cf commit 6306e75

File tree

1 file changed

+1
-1
lines changed
  • packages/cli/src/command-helpers

1 file changed

+1
-1
lines changed

packages/cli/src/command-helpers/abi.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ export const getContractNameForAddress = async (
153153
const contractSourceCode = await fetchSourceCodeFromEtherscan(network, address);
154154
let contractName = contractSourceCode.result[0].ContractName;
155155
// Some explorers will return the full path of the contract instead of just the name
156-
const regex = /^contracts\/(?<contract>.+)\.sol:\1$/;
156+
const regex = /(?<contract>.+)\.sol:\1$/;
157157

158158
if (regex.test(contractName)) contractName = regex.exec(contractName)?.groups?.contract;
159159

0 commit comments

Comments
 (0)