From 7101b932db9e65819b47968f848737017423f67a Mon Sep 17 00:00:00 2001 From: Claudia Date: Mon, 27 Jan 2025 11:44:12 +0100 Subject: [PATCH] feat: early revert if the plugin repo env var is not an address --- packages/contracts/utils/helpers.ts | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/packages/contracts/utils/helpers.ts b/packages/contracts/utils/helpers.ts index 8c4a17c3..cdb1dd8f 100644 --- a/packages/contracts/utils/helpers.ts +++ b/packages/contracts/utils/helpers.ts @@ -72,10 +72,11 @@ export async function findPluginRepo( ): Promise<{pluginRepo: PluginRepo | null; ensDomain: string}> { const [deployer] = await hre.ethers.getSigners(); - if ( - process.env.PLUGIN_REPO_ADDRESS && - ethers.utils.isAddress(process.env.PLUGIN_REPO_ADDRESS) - ) { + if (process.env.PLUGIN_REPO_ADDRESS) { + if (!ethers.utils.isAddress(process.env.PLUGIN_REPO_ADDRESS)) { + throw new Error('Plugin Repo in .env is not of type Address'); + } + return { pluginRepo: PluginRepo__factory.connect( process.env.PLUGIN_REPO_ADDRESS,