Skip to content

Commit

Permalink
feat: get plugin ens subdomain from commons config
Browse files Browse the repository at this point in the history
  • Loading branch information
clauBv23 committed Oct 14, 2024
1 parent 8246d27 commit 198a8d3
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 @@ -53,12 +54,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 198a8d3

Please sign in to comment.