Skip to content

Commit

Permalink
Merge pull request #16 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 83ca1ee + 507468b commit 5f7632a
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 9 deletions.
4 changes: 2 additions & 2 deletions packages/contracts/deploy/20_new_version/23_publish.ts
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,8 @@ const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) {
.createVersion(
VERSION.release,
setup.address,
ethers.utils.hexlify(ethers.utils.toUtf8Bytes(buildMetadataURI)),
ethers.utils.hexlify(ethers.utils.toUtf8Bytes(releaseMetadataURI))
buildMetadataURI,
releaseMetadataURI
);

await tx.wait();
Expand Down
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 @@ -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 5f7632a

Please sign in to comment.