From 25a05b229676e1888a4b8606a9ea1d59e84a34b5 Mon Sep 17 00:00:00 2001 From: josemarinas <36479864+josemarinas@users.noreply.github.com> Date: Mon, 5 Feb 2024 17:48:13 +0100 Subject: [PATCH] fix: wrong environment variable and contract naming in contracts test (#529) * rename MANAGEMENTDAO to MANAGEMENT_DAO * fix: naming issues and deploy test problems --------- Co-authored-by: Michael Heuer --- .github/workflows/contract-tests.yml | 8 ++++---- DEPLOYMENT_CHECKLIST.md | 8 ++++---- packages/contracts/test/deploy/managing-dao.ts | 12 +++++++----- packages/contracts/test/deploy/updateTo1_3_0.ts | 6 +++--- packages/contracts/test/test-utils/fixture.ts | 3 ++- packages/contracts/types/hardhat.d.ts | 2 +- 6 files changed, 21 insertions(+), 18 deletions(-) diff --git a/.github/workflows/contract-tests.yml b/.github/workflows/contract-tests.yml index 3bd19c671..107df87da 100644 --- a/.github/workflows/contract-tests.yml +++ b/.github/workflows/contract-tests.yml @@ -35,10 +35,10 @@ jobs: REPORT_GAS: true HARDHAT_DAO_ENS_DOMAIN: 'dao.eth' HARDHAT_PLUGIN_ENS_DOMAIN: 'plugin.dao.eth' - MANAGEMENTDAO_SUBDOMAIN: 'management' - MANAGEMENTDAO_MULTISIG_LISTEDONLY: ${{ vars.MANAGEMENTDAO_MULTISIG_LISTEDONLY }} - MANAGEMENTDAO_MULTISIG_APPROVERS: ${{ vars.MANAGEMENTDAO_MULTISIG_APPROVERS }} - MANAGEMENTDAO_MULTISIG_MINAPPROVALS: ${{ vars.MANAGEMENTDAO_MULTISIG_MINAPPROVALS }} + MANAGEMENT_DAO_SUBDOMAIN: 'management' + MANAGEMENT_DAO_MULTISIG_LISTEDONLY: ${{ vars.MANAGEMENT_DAO_MULTISIG_LISTEDONLY }} + MANAGEMENT_DAO_MULTISIG_APPROVERS: ${{ vars.MANAGEMENT_DAO_MULTISIG_APPROVERS }} + MANAGEMENT_DAO_MULTISIG_MINAPPROVALS: ${{ vars.MANAGEMENT_DAO_MULTISIG_MINAPPROVALS }} run: yarn run test - name: Run solidity-docgen run: yarn run docgen diff --git a/DEPLOYMENT_CHECKLIST.md b/DEPLOYMENT_CHECKLIST.md index 6ad176c59..a17077ca5 100644 --- a/DEPLOYMENT_CHECKLIST.md +++ b/DEPLOYMENT_CHECKLIST.md @@ -27,9 +27,9 @@ This checklist is seen as a guide to deploy the stack to a new chain. - [ ] Set the right API key for the chains blockchain explorer in `.env` (e.g. for mainnet it is `ETHERSCAN_KEY`) - [ ] Set the chosen DAO ENS domain (in step 1) to `NETWORK_DAO_ENS_DOMAIN` in `.env` and replace `NETWORK` with the correct network name (e.g. for mainnet it is `MAINNET_DAO_ENS_DOMAIN`) - [ ] Set the chosen Plugin ENS domain (in step 2) to `NETWORK_PLUGIN_ENS_DOMAIN` in `.env` and replace `NETWORK` with the correct network name (e.g. for mainnet it is `MAINNET_PLUGIN_ENS_DOMAIN`) -- [ ] Set the subdomain to be used of the management DAO to `MANAGEMENTDAO_SUBDOMAIN` in `.env`. If you want to use `management.dao.eth` put only `management` -- [ ] Set the multisig members of the management DAO as a comma (`,`) separated list to `MANAGEMENTDAO_MULTISIG_APPROVERS` in `.env` -- [ ] Set the amount of minimum approvals the management DAO needs to `MANAGEMENTDAO_MULTISIG_MINAPPROVALS` in `.env` +- [ ] Set the subdomain to be used of the management DAO to `MANAGEMENT_DAO_SUBDOMAIN` in `.env`. If you want to use `management.dao.eth` put only `management` +- [ ] Set the multisig members of the management DAO as a comma (`,`) separated list to `MANAGEMENT_DAO_MULTISIG_APPROVERS` in `.env` +- [ ] Set the amount of minimum approvals the management DAO needs to `MANAGEMENT_DAO_MULTISIG_MINAPPROVALS` in `.env` - [ ] If new plugin builds are released - [ ] Double-check that the build- and release-metadata is published correctly by the deploy script and contracts @@ -44,7 +44,7 @@ To deploy run `yarn deploy --network NETWORK` in `packages/contracts` and replac - [ ] Take the addresses from this file `packages/contracts/deployed_contracts.json` - [ ] Add the new deployment to the `@aragon/osx-commons-config` package found here: [https://github.com/aragon/osx-commons/tree/develop/configs](https://github.com/aragon/osx-commons/tree/develop/configs) - [ ] Update `packages/contracts/Releases.md` with the new deployed addresses -- [ ] Add the management DAOs' multisig address to `packages/contracts/.env.example` in the format `{NETWORK}_MANAGEMENTDAO_MULTISIG` +- [ ] Add the management DAOs' multisig address to `packages/contracts/.env.example` in the format `{NETWORK}_MANAGEMENT_DAO_MULTISIG` - [ ] Add a Github Release with the version number as tag and the defined content (check previous releases for reference) ### Verification diff --git a/packages/contracts/test/deploy/managing-dao.ts b/packages/contracts/test/deploy/managing-dao.ts index 11fc15c83..e042109bb 100644 --- a/packages/contracts/test/deploy/managing-dao.ts +++ b/packages/contracts/test/deploy/managing-dao.ts @@ -97,21 +97,23 @@ describe('Management DAO', function () { ); // ManagementDAO - managementDaoDeployment = await deployments.get('DAO'); + managementDaoDeployment = await deployments.get('ManagementDAOProxy'); managementDao = DAO__factory.connect( managementDaoDeployment.address, deployer ); // DAORegistry - daoRegistryDeployment = await deployments.get('DAORegistry'); + daoRegistryDeployment = await deployments.get('DAORegistryProxy'); daoRegistry = DAORegistry__factory.connect( daoRegistryDeployment.address, deployer ); // PluginRepoRegistry - pluginRepoRegistryDeployment = await deployments.get('PluginRepoRegistry'); + pluginRepoRegistryDeployment = await deployments.get( + 'PluginRepoRegistryProxy' + ); pluginRepoRegistry = PluginRepoRegistry__factory.connect( pluginRepoRegistryDeployment.address, deployer @@ -120,11 +122,11 @@ describe('Management DAO', function () { // ENSSubdomainRegistrar ensSubdomainRegistrars = { daoRegistrar: ENSSubdomainRegistrar__factory.connect( - (await deployments.get('DAO_ENSSubdomainRegistrar')).address, + (await deployments.get('DAOENSSubdomainRegistrarProxy')).address, deployer ), pluginRegistrar: ENSSubdomainRegistrar__factory.connect( - (await deployments.get('Plugin_ENSSubdomainRegistrar')).address, + (await deployments.get('PluginENSSubdomainRegistrarProxy')).address, deployer ), }; diff --git a/packages/contracts/test/deploy/updateTo1_3_0.ts b/packages/contracts/test/deploy/updateTo1_3_0.ts index c37051379..64e70ffd6 100644 --- a/packages/contracts/test/deploy/updateTo1_3_0.ts +++ b/packages/contracts/test/deploy/updateTo1_3_0.ts @@ -3,7 +3,7 @@ import { initForkForOsxVersion, initializeDeploymentFixture, } from '../test-utils/fixture'; -import {activeContractsList as v1_2_0_activeContracts} from '@aragon/osx-ethers-v1.2.0'; +import {activeContractsList as v1_0_0_activeContracts} from '@aragon/osx-ethers-v1.2.0'; import {expect} from 'chai'; import {deployments} from 'hardhat'; @@ -15,7 +15,7 @@ if (enableTest) { before(async () => { const previousOsxVersion: ForkOsxVersion = { version: 'v1.0.1', - activeContracts: v1_2_0_activeContracts, + activeContracts: v1_0_0_activeContracts, forkBlockNumber: 16722881, }; @@ -37,7 +37,7 @@ if (enableTest) { const allDeployments = await deployments.all(); changedContracts.forEach((contractName: string) => { - const previous = (v1_2_0_activeContracts as any)[network][contractName]; + const previous = (v1_0_0_activeContracts as any)[network][contractName]; const current = allDeployments[contractName].address; expect(previous).to.not.be.empty; diff --git a/packages/contracts/test/test-utils/fixture.ts b/packages/contracts/test/test-utils/fixture.ts index c29deca0c..54b5ac409 100644 --- a/packages/contracts/test/test-utils/fixture.ts +++ b/packages/contracts/test/test-utils/fixture.ts @@ -1,4 +1,5 @@ import networks from '../../networks'; +import {getNetworkByNameOrAlias} from '@aragon/osx-commons-configs'; import hre, {network, deployments} from 'hardhat'; export interface ForkOsxVersion { @@ -11,7 +12,7 @@ export async function initializeFork( forkNetwork: string, blockNumber: number ): Promise { - if (!networks[forkNetwork]) { + if (getNetworkByNameOrAlias(forkNetwork) === null) { throw new Error(`No info found for network '${forkNetwork}'.`); } diff --git a/packages/contracts/types/hardhat.d.ts b/packages/contracts/types/hardhat.d.ts index 02f91797f..4a36ad57d 100644 --- a/packages/contracts/types/hardhat.d.ts +++ b/packages/contracts/types/hardhat.d.ts @@ -33,7 +33,7 @@ declare module 'hardhat/types' { interface HardhatRuntimeEnvironment { aragonPluginRepos: AragonPluginRepos; aragonToVerifyContracts: AragonVerifyEntry[]; - managingDAOMultisigPluginAddress: string; + managementDAOMultisigPluginAddress: string; placeholderBuildCIDPath: string; managementDAOActions: { to: string;