Skip to content

Commit

Permalink
Merge pull request #20 from aragon/fix/deploy-script
Browse files Browse the repository at this point in the history
fix: deploy script
  • Loading branch information
novaknole authored Nov 5, 2024
2 parents 4a3cbb9 + ad38b94 commit a2db578
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 7 deletions.
5 changes: 5 additions & 0 deletions packages/contracts/deploy/30_upgrade_repo/_common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import {
import {UnsupportedNetworkError} from '@aragon/osx-commons-sdk';
import {PluginRepo, PluginRepo__factory} from '@aragon/osx-ethers';
import {SignerWithAddress} from '@nomiclabs/hardhat-ethers/signers';
import {DeployFunction} from 'hardhat-deploy/types';
import {HardhatRuntimeEnvironment} from 'hardhat/types';
import path from 'path';

Expand Down Expand Up @@ -104,3 +105,7 @@ export const skipUpgrade = async (hre: HardhatRuntimeEnvironment) => {

return false;
};

const func: DeployFunction = async function () {};
export default func;
func.tags = ['UpgradeRepo'];
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import path from 'path';
* @param {HardhatRuntimeEnvironment} hre
*/
const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) {
hre.aragonToVerifyContracts.forEach(async contract => {
for (const contract of hre.aragonToVerifyContracts) {
console.log(
`Verifying address ${contract.address} with constructor argument ${contract.args}.`
);
Expand All @@ -21,7 +21,7 @@ const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) {
`Delaying 6s, so we don't reach Etherscan's Max rate limit of 1/5s.`
);
await new Promise(resolve => setTimeout(resolve, 6000));
});
}

console.log(`\n${'-'.repeat(60)}\n`);
};
Expand Down
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 @@ -55,12 +56,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 a2db578

Please sign in to comment.