Skip to content

Commit

Permalink
feat: get the plugin ens subdomain from commons config function
Browse files Browse the repository at this point in the history
  • Loading branch information
clauBv23 committed Oct 14, 2024
1 parent 61168ea commit 507468b
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions packages/contracts/utils/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import {
SupportedNetworks,
getLatestNetworkDeployment,
getNetworkNameByAlias,
getPluginEnsDomain,
} from '@aragon/osx-commons-configs';
import {UnsupportedNetworkError, findEvent} from '@aragon/osx-commons-sdk';
import {
Expand Down Expand Up @@ -54,12 +55,13 @@ export function getProductionNetworkName(
}

export function pluginEnsDomain(hre: HardhatRuntimeEnvironment): string {
const network = getProductionNetworkName(hre);
if (network === SupportedNetworks.SEPOLIA) {
return `${PLUGIN_REPO_ENS_SUBDOMAIN_NAME}.plugin.aragon-dao.eth`;
} else {
return `${PLUGIN_REPO_ENS_SUBDOMAIN_NAME}.plugin.dao.eth`;
const network = getNetworkNameByAlias(getProductionNetworkName(hre));
if (network === null) {
throw new UnsupportedNetworkError(getProductionNetworkName(hre));
}

const pluginEnsDomain = getPluginEnsDomain(network);
return `${PLUGIN_REPO_ENS_SUBDOMAIN_NAME}.${pluginEnsDomain}`;
}

export async function findPluginRepo(
Expand Down

0 comments on commit 507468b

Please sign in to comment.