From 5547fd08f64ef0c8095b9a1c73bbc16dec23a9bd Mon Sep 17 00:00:00 2001 From: ctrlc03 <93448202+ctrlc03@users.noreply.github.com> Date: Sun, 14 Dec 2025 19:23:50 +0000 Subject: [PATCH] feat: verify external contracts --- packages/enclave-contracts/scripts/verify.ts | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/packages/enclave-contracts/scripts/verify.ts b/packages/enclave-contracts/scripts/verify.ts index 9b6c9bf0c1..81c608a158 100644 --- a/packages/enclave-contracts/scripts/verify.ts +++ b/packages/enclave-contracts/scripts/verify.ts @@ -36,25 +36,24 @@ const findContractPath = ( if (artifact.sourceName && artifact.contractName === contractName) { const sourceName = artifact.sourceName; - // Skip external packages - return undefined so they won't be verified + // Normalize the source name by removing leading './' if present + let normalizedPath = sourceName; + if (normalizedPath.startsWith("./")) { + normalizedPath = normalizedPath.slice(2); + } + + // Handle external packages (from node_modules or @ packages) if ( sourceName.startsWith("./@") || sourceName.startsWith("@") || sourceName.includes("node_modules") ) { console.log( - `⏭️ Skipping external contract: ${contractName} (from ${sourceName})`, + `📦 Found external contract: ${contractName} (from ${normalizedPath})`, ); - return undefined; - } - - // For local contracts, remove leading './' and return the path - let localPath = sourceName; - if (localPath.startsWith("./")) { - localPath = localPath.slice(2); } - return `${localPath}:${contractName}`; + return `${normalizedPath}:${contractName}`; } } catch (error) { console.warn(`Failed to parse artifact at ${fullPath}:`, error);