From 53e2082ea8a20445382b1dfa4a228887536890a6 Mon Sep 17 00:00:00 2001 From: Corantin Date: Mon, 4 Dec 2023 13:15:00 -0500 Subject: [PATCH] Check for exact path segment for inheritedFunctions sources (#643) --- packages/hardhat/deploy/99_generateTsAbis.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/hardhat/deploy/99_generateTsAbis.ts b/packages/hardhat/deploy/99_generateTsAbis.ts index 9bae1eb89..765e6a930 100644 --- a/packages/hardhat/deploy/99_generateTsAbis.ts +++ b/packages/hardhat/deploy/99_generateTsAbis.ts @@ -60,7 +60,7 @@ function getInheritedFunctions(sources: Record, contractName: strin const inheritedFunctions = {} as Record; for (const sourceContractName of actualSources) { - const sourcePath = Object.keys(sources).find(key => key.includes(sourceContractName)); + const sourcePath = Object.keys(sources).find(key => key.includes(`/${sourceContractName}`)); if (sourcePath) { const sourceName = sourcePath?.split("/").pop()?.split(".sol")[0]; const { abi } = JSON.parse(fs.readFileSync(`${ARTIFACTS_DIR}/${sourcePath}/${sourceName}.json`).toString());