Skip to content

Commit

Permalink
feat: early revert if the plugin repo env var is not an address
Browse files Browse the repository at this point in the history
  • Loading branch information
clauBv23 committed Jan 27, 2025
1 parent cfeedfc commit 7101b93
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions packages/contracts/utils/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 7101b93

Please sign in to comment.