From 06fd483236f1c6862d460e571bfa150a294274f4 Mon Sep 17 00:00:00 2001 From: Mathias Scherer Date: Thu, 1 Jun 2023 13:03:55 +0200 Subject: [PATCH 1/7] feat: updates networks to use v1.3.0 update scripts fix: changes mumbai rpc url to use the same infura endpoint as the others --- packages/contracts/networks.json | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/packages/contracts/networks.json b/packages/contracts/networks.json index 82f105d64..49ce0229a 100644 --- a/packages/contracts/networks.json +++ b/packages/contracts/networks.json @@ -3,13 +3,13 @@ "url": "https://goerli.infura.io/v3/481a4cdc7c774286b8627f21c6827f48", "isTestnet": true, "chainId": 5, - "deploy": ["./deploy/update/to_v1.2.0", "./deploy/verification"] + "deploy": ["./deploy/update/to_v1.3.0", "./deploy/verification"] }, "mainnet": { "url": "https://mainnet.infura.io/v3/481a4cdc7c774286b8627f21c6827f48", "isTestnet": false, "chainId": 1, - "deploy": ["./deploy/update/to_v1.2.0", "./deploy/verification"] + "deploy": ["./deploy/update/to_v1.3.0", "./deploy/verification"] }, "arbitrum": { "url": "https://arbitrum-mainnet.infura.io/v3/481a4cdc7c774286b8627f21c6827f48", @@ -21,13 +21,13 @@ "isTestnet": false, "chainId": 137, "feesUrl": "https://gasstation-mainnet.matic.network/v2", - "deploy": ["./deploy/update/to_v1.2.0", "./deploy/verification"] + "deploy": ["./deploy/update/to_v1.3.0", "./deploy/verification"] }, "mumbai": { - "url": "https://rpc.ankr.com/polygon_mumbai", + "url": "https://polygon-mumbai.infura.io/v3/481a4cdc7c774286b8627f21c6827f48", "isTestnet": true, "chainId": 80001, "feesUrl": "https://gasstation-mumbai.matic.today/v2", - "deploy": ["./deploy/update/to_v1.2.0", "./deploy/verification"] + "deploy": ["./deploy/update/to_v1.3.0", "./deploy/verification"] } } From 3f0fe361e643573c4748c5f79ae59f58a7e14594 Mon Sep 17 00:00:00 2001 From: Mathias Scherer Date: Thu, 1 Jun 2023 13:04:45 +0200 Subject: [PATCH 2/7] feat(OS-429): replaces old ipfs endpoint with new one switches ipfs-0.aragon.network with the load balances prod.ipfs.aragon.network endpoint --- .github/helpers/contracts/dummy-dao/createDao.js | 2 +- .github/helpers/contracts/dummy-dao/proposal.js | 2 +- packages/contracts/deploy/helpers.ts | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/helpers/contracts/dummy-dao/createDao.js b/.github/helpers/contracts/dummy-dao/createDao.js index 6c4b282f6..705741678 100644 --- a/.github/helpers/contracts/dummy-dao/createDao.js +++ b/.github/helpers/contracts/dummy-dao/createDao.js @@ -44,7 +44,7 @@ async function createDao() { ], }; const client = IPFS.create({ - url: 'https://ipfs-0.aragon.network/api/v0', + url: 'https://prod.ipfs.aragon.network/api/v0', headers: { 'X-API-KEY': 'yRERPRwFAb5ZiV94XvJdgvDKoGEeFerfFsAQ65', }, diff --git a/.github/helpers/contracts/dummy-dao/proposal.js b/.github/helpers/contracts/dummy-dao/proposal.js index 345aff0e5..a53f7cd09 100644 --- a/.github/helpers/contracts/dummy-dao/proposal.js +++ b/.github/helpers/contracts/dummy-dao/proposal.js @@ -45,7 +45,7 @@ async function proposal() { ], }; const client = IPFS.create({ - url: 'https://ipfs-0.aragon.network/api/v0', + url: 'https://prod.ipfs.aragon.network/api/v0', headers: { 'X-API-KEY': 'yRERPRwFAb5ZiV94XvJdgvDKoGEeFerfFsAQ65', }, diff --git a/packages/contracts/deploy/helpers.ts b/packages/contracts/deploy/helpers.ts index ba52c05a7..8b64606ec 100644 --- a/packages/contracts/deploy/helpers.ts +++ b/packages/contracts/deploy/helpers.ts @@ -57,7 +57,7 @@ export async function uploadToIPFS( networkName: string ): Promise { const client = IPFS.create({ - url: 'https://ipfs-0.aragon.network/api/v0', + url: 'https://prod.ipfs.aragon.network/api/v0', headers: { 'X-API-KEY': 'yRERPRwFAb5ZiV94XvJdgvDKoGEeFerfFsAQ65', }, @@ -81,7 +81,7 @@ export async function getContractAddress( let networkName = network.name; - if (hre.testingFork) { + if (hre.testingFork.network) { networkName = hre.testingFork.network; } From 39858aea8da7e7885a224417268e5047d37ab36c Mon Sep 17 00:00:00 2001 From: Mathias Scherer Date: Thu, 1 Jun 2023 13:18:51 +0200 Subject: [PATCH 3/7] fix(OS-429): replaces old api keys with valid ones --- .github/helpers/contracts/dummy-dao/createDao.js | 2 +- .github/helpers/contracts/dummy-dao/proposal.js | 2 +- packages/contracts/deploy/helpers.ts | 3 ++- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/helpers/contracts/dummy-dao/createDao.js b/.github/helpers/contracts/dummy-dao/createDao.js index 705741678..80936b805 100644 --- a/.github/helpers/contracts/dummy-dao/createDao.js +++ b/.github/helpers/contracts/dummy-dao/createDao.js @@ -46,7 +46,7 @@ async function createDao() { const client = IPFS.create({ url: 'https://prod.ipfs.aragon.network/api/v0', headers: { - 'X-API-KEY': 'yRERPRwFAb5ZiV94XvJdgvDKoGEeFerfFsAQ65', + 'X-API-KEY': 'b477RhECf8s8sdM7XrkLBs2wHc4kCMwpbcFC55Kt', }, }); const cid = await client.add(JSON.stringify(metadataObj)); diff --git a/.github/helpers/contracts/dummy-dao/proposal.js b/.github/helpers/contracts/dummy-dao/proposal.js index a53f7cd09..6e7939306 100644 --- a/.github/helpers/contracts/dummy-dao/proposal.js +++ b/.github/helpers/contracts/dummy-dao/proposal.js @@ -47,7 +47,7 @@ async function proposal() { const client = IPFS.create({ url: 'https://prod.ipfs.aragon.network/api/v0', headers: { - 'X-API-KEY': 'yRERPRwFAb5ZiV94XvJdgvDKoGEeFerfFsAQ65', + 'X-API-KEY': 'b477RhECf8s8sdM7XrkLBs2wHc4kCMwpbcFC55Kt', }, }); const cid = await client.add(JSON.stringify(metadataObj)); diff --git a/packages/contracts/deploy/helpers.ts b/packages/contracts/deploy/helpers.ts index 8b64606ec..c0db3cefc 100644 --- a/packages/contracts/deploy/helpers.ts +++ b/packages/contracts/deploy/helpers.ts @@ -59,7 +59,7 @@ export async function uploadToIPFS( const client = IPFS.create({ url: 'https://prod.ipfs.aragon.network/api/v0', headers: { - 'X-API-KEY': 'yRERPRwFAb5ZiV94XvJdgvDKoGEeFerfFsAQ65', + 'X-API-KEY': 'b477RhECf8s8sdM7XrkLBs2wHc4kCMwpbcFC55Kt', }, }); @@ -70,6 +70,7 @@ export async function uploadToIPFS( const cid = await client.add(metadata); await client.pin.add(cid.cid); + console.log(`Uploaded to IPFS with cid ${cid.cid}`); return cid.path; } From e395baac248cfc5d148560ebfa198a6ac64a9be3 Mon Sep 17 00:00:00 2001 From: Mathias Scherer Date: Thu, 1 Jun 2023 14:45:17 +0200 Subject: [PATCH 4/7] fix: reverts active_contracts.json to old state the values in active_contracts.json for mumbai were already the non applied update addresses --- active_contracts.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/active_contracts.json b/active_contracts.json index 0abef7ffe..20e269491 100644 --- a/active_contracts.json +++ b/active_contracts.json @@ -60,11 +60,11 @@ "PluginRepoRegistry": "0xc796bB1AfEBc56daDF6CAcD2aDa78055e5381971", "PluginRepoFactory": "0xDcC5933bc3567E7798Ff00Ab3413cF5f5801BD41", "PluginSetupProcessor": "0x9227b311C5cecB416707F1C8B7Ca1b52649AabEc", - "DAOFactory": "0x3ff1681f31f68Ff2723d25Cf839bA7500FE5d218", + "DAOFactory": "0x5bDBaAfd90B908058567080513635f560F896918", "AddresslistVotingSetup": "0xD1CE76c26bc20255157C8ef478276eb115eC02a7", "TokenVotingSetup": "0x76D3795Df5acF2e2141557BA1Cf094fd54d4e10C", "AdminSetup": "0x40a3EF0f0780e044EbDDEdAa9AB225158f315afd", - "MultisigSetup": "0x2C233F09CaB08BC66b750CB80da401Bd700B74a0", + "MultisigSetup": "0x8b2361C65E898F40372a0DD5E1BfEE9895A676B3", "address-list-voting-repo": "0x71570268A86A80B5cCa3F5e430c2BAa3F4b26278", "token-voting-repo": "0xaCa70D8c462940B839DE386BcDD4CACf745632cA", "admin-repo": "0x0DF9b15550fF39149e491dDD154b28f587e0cD16", From 4fd910e98311df5305799ff64e85cc76a447d0da Mon Sep 17 00:00:00 2001 From: Mathias Scherer Date: Thu, 1 Jun 2023 14:45:30 +0200 Subject: [PATCH 5/7] feat: adds node version requirement to checklists --- DEPLOYMENT_CHECKLIST.md | 1 + UPDATE_CHECKLIST.md | 1 + 2 files changed, 2 insertions(+) diff --git a/DEPLOYMENT_CHECKLIST.md b/DEPLOYMENT_CHECKLIST.md index 4ee8cebb4..e559370a8 100644 --- a/DEPLOYMENT_CHECKLIST.md +++ b/DEPLOYMENT_CHECKLIST.md @@ -4,6 +4,7 @@ This checklist is seen as a guide to deploy the stack to a new chain. ## Pre-Deployment +- [ ] Make sure you are using Node v16 - [ ] Bump the OSx protocol version in the `ProtocolVersion.sol` file. - [ ] Choose an ENS domain for DAOs - [ ] Choose an ENS domain for plugins diff --git a/UPDATE_CHECKLIST.md b/UPDATE_CHECKLIST.md index 8003351ba..29ed14d71 100644 --- a/UPDATE_CHECKLIST.md +++ b/UPDATE_CHECKLIST.md @@ -4,6 +4,7 @@ This checklist is seen as a guide to update the existing deployment. ## Pre-Update +- [ ] Make sure you are using Node v16 - [ ] Make sure that the `deploy` property in `packages/contracts/networks.json` points to the correct update - [ ] Run `yarn` in the repository root to install the dependencies - [ ] Run `yarn build` in `packages/contracts` to make sure the contracts compile From 9f8eb365a618049c8f87ef8be912b58963dcc2c0 Mon Sep 17 00:00:00 2001 From: Mathias Scherer Date: Thu, 1 Jun 2023 14:46:06 +0200 Subject: [PATCH 6/7] feat: adds new functions to deploy helpers fix: uses correct addresses during DAOFactory v1.3.0 update --- packages/contracts/deploy/helpers.ts | 20 +++++++++++++++++++ .../deploy/update/to_v1.3.0/01_DAOFactory.ts | 13 +++++++----- 2 files changed, 28 insertions(+), 5 deletions(-) diff --git a/packages/contracts/deploy/helpers.ts b/packages/contracts/deploy/helpers.ts index c0db3cefc..a912dd467 100644 --- a/packages/contracts/deploy/helpers.ts +++ b/packages/contracts/deploy/helpers.ts @@ -105,6 +105,26 @@ export async function getContractAddress( } } catch (e) {} + return getActiveContractAddressInNetwork(contractName, networkName); +} + +export async function getActiveContractAddress( + contractName: string, + hre: HardhatRuntimeEnvironment +): Promise { + let networkName = hre.network.name; + + if (hre.testingFork.network) { + networkName = hre.testingFork.network; + } + + return getActiveContractAddressInNetwork(contractName, networkName); +} + +export async function getActiveContractAddressInNetwork( + contractName: string, + networkName: string +): Promise { const activeContracts = await getActiveContractsJSON(); try { return activeContracts[networkName][contractName]; diff --git a/packages/contracts/deploy/update/to_v1.3.0/01_DAOFactory.ts b/packages/contracts/deploy/update/to_v1.3.0/01_DAOFactory.ts index ba30e197b..7057318f3 100644 --- a/packages/contracts/deploy/update/to_v1.3.0/01_DAOFactory.ts +++ b/packages/contracts/deploy/update/to_v1.3.0/01_DAOFactory.ts @@ -1,7 +1,7 @@ import {DeployFunction} from 'hardhat-deploy/types'; import {HardhatRuntimeEnvironment} from 'hardhat/types'; import {Operation} from '../../../utils/types'; -import {getContractAddress} from '../../helpers'; +import {getActiveContractAddress} from '../../helpers'; import {DAO__factory} from '../../../typechain'; import {UPDATE_INFOS} from '../../../utils/updates'; @@ -13,13 +13,16 @@ const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) { const {deploy} = deployments; const [deployer] = await ethers.getSigners(); - const managingDAOAddress = await getContractAddress('managingDAO', hre); - const pluginSetupProcessorAddress = await getContractAddress( + const managingDAOAddress = await getActiveContractAddress('managingDAO', hre); + const pluginSetupProcessorAddress = await getActiveContractAddress( 'PluginSetupProcessor', hre ); - const daoRegistryAddress = await getContractAddress('DAORegistry', hre); - const previousDAOFactoryAddress = await getContractAddress('DAOFactory', hre); + const daoRegistryAddress = await getActiveContractAddress('DAORegistry', hre); + const previousDAOFactoryAddress = await getActiveContractAddress( + 'DAOFactory', + hre + ); console.log(`Using managingDAO ${managingDAOAddress}`); console.log(`Using PluginSetupProcessor ${pluginSetupProcessorAddress}`); console.log(`Using DAORegistry ${daoRegistryAddress}`); From 440850c8fc37becdb15d9d71fc2eed53d7dea133 Mon Sep 17 00:00:00 2001 From: Michael Heuer <20623991+Michael-A-Heuer@users.noreply.github.com> Date: Thu, 1 Jun 2023 15:36:58 +0200 Subject: [PATCH 7/7] fix: add initializeFrom call to the managing DAO proposal (#395) * fix: add initializeFrom call to the managing DAO proposal * fix: empty data --- packages/contracts/deploy/update/to_v1.3.0/99_ManagingDAO.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/packages/contracts/deploy/update/to_v1.3.0/99_ManagingDAO.ts b/packages/contracts/deploy/update/to_v1.3.0/99_ManagingDAO.ts index 71a9b827d..a630b8982 100644 --- a/packages/contracts/deploy/update/to_v1.3.0/99_ManagingDAO.ts +++ b/packages/contracts/deploy/update/to_v1.3.0/99_ManagingDAO.ts @@ -18,8 +18,9 @@ const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) { managingDAOAddress, hre.ethers.provider ); - const upgradeTX = await daoInterface.populateTransaction.upgradeTo( - daoImplementation + const upgradeTX = await daoInterface.populateTransaction.upgradeToAndCall( + daoImplementation, + daoInterface.interface.encodeFunctionData('initializeFrom', [[1, 0, 0], '']) ); if (!upgradeTX.to || !upgradeTX.data) {