Skip to content

Commit

Permalink
fix: wrong environment variable and contract naming in contracts test (
Browse files Browse the repository at this point in the history
…#529)

* rename MANAGEMENTDAO to MANAGEMENT_DAO

* fix: naming issues and deploy test problems

---------

Co-authored-by: Michael Heuer <michael.heuer@rwth-aachen.de>
  • Loading branch information
josemarinas and heueristik authored Feb 5, 2024
1 parent c4c0bcb commit 25a05b2
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 18 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/contract-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
8 changes: 4 additions & 4 deletions DEPLOYMENT_CHECKLIST.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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
Expand Down
12 changes: 7 additions & 5 deletions packages/contracts/test/deploy/managing-dao.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
),
};
Expand Down
6 changes: 3 additions & 3 deletions packages/contracts/test/deploy/updateTo1_3_0.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';

Expand All @@ -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,
};

Expand All @@ -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;
Expand Down
3 changes: 2 additions & 1 deletion packages/contracts/test/test-utils/fixture.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import networks from '../../networks';
import {getNetworkByNameOrAlias} from '@aragon/osx-commons-configs';
import hre, {network, deployments} from 'hardhat';

export interface ForkOsxVersion {
Expand All @@ -11,7 +12,7 @@ export async function initializeFork(
forkNetwork: string,
blockNumber: number
): Promise<void> {
if (!networks[forkNetwork]) {
if (getNetworkByNameOrAlias(forkNetwork) === null) {
throw new Error(`No info found for network '${forkNetwork}'.`);
}

Expand Down
2 changes: 1 addition & 1 deletion packages/contracts/types/hardhat.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ declare module 'hardhat/types' {
interface HardhatRuntimeEnvironment {
aragonPluginRepos: AragonPluginRepos;
aragonToVerifyContracts: AragonVerifyEntry[];
managingDAOMultisigPluginAddress: string;
managementDAOMultisigPluginAddress: string;
placeholderBuildCIDPath: string;
managementDAOActions: {
to: string;
Expand Down

0 comments on commit 25a05b2

Please sign in to comment.