diff --git a/packages/contracts/deploy/20_new_version/23_publish.ts b/packages/contracts/deploy/20_new_version/23_publish.ts index 28020a74..5183bcad 100644 --- a/packages/contracts/deploy/20_new_version/23_publish.ts +++ b/packages/contracts/deploy/20_new_version/23_publish.ts @@ -12,7 +12,7 @@ import { isLocal, pluginEnsDomain, } from '../../utils/helpers'; -import {PLUGIN_REPO_PERMISSIONS, uploadToIPFS} from '@aragon/osx-commons-sdk'; +import {PLUGIN_REPO_PERMISSIONS, uploadToPinata} from '@aragon/osx-commons-sdk'; import {writeFile} from 'fs/promises'; import {ethers} from 'hardhat'; import {DeployFunction} from 'hardhat-deploy/types'; @@ -31,14 +31,20 @@ const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) { const {deployments} = hre; const [deployer] = await hre.ethers.getSigners(); - // Upload the metadata to IPFS - const releaseMetadataURI = `ipfs://${await uploadToIPFS( - JSON.stringify(METADATA.release, null, 2) - )}`; - const buildMetadataURI = `ipfs://${await uploadToIPFS( - JSON.stringify(METADATA.build, null, 2) - )}`; + let releaseMetadataURI = '0x'; + let buildMetadataURI = '0x'; + if (!isLocal(hre)) { + // Upload the metadata to IPFS + releaseMetadataURI = await uploadToPinata( + JSON.stringify(METADATA.release, null, 2), + `${PLUGIN_REPO_ENS_SUBDOMAIN_NAME}-release-metadata` + ); + buildMetadataURI = await uploadToPinata( + JSON.stringify(METADATA.build, null, 2), + `${PLUGIN_REPO_ENS_SUBDOMAIN_NAME}-build-metadata` + ); + } console.log(`Uploaded release metadata: ${releaseMetadataURI}`); console.log(`Uploaded build metadata: ${buildMetadataURI}`); diff --git a/packages/contracts/plugin-settings.ts b/packages/contracts/plugin-settings.ts index 981fe31a..3ac73115 100644 --- a/packages/contracts/plugin-settings.ts +++ b/packages/contracts/plugin-settings.ts @@ -8,7 +8,7 @@ export const PLUGIN_CONTRACT_NAME = 'Admin'; export const PLUGIN_SETUP_CONTRACT_NAME = isZkSync(hre.network.name) ? 'AdminSetupZkSync' : 'AdminSetup'; -export const PLUGIN_REPO_ENS_SUBDOMAIN_NAME = 'test-admin-6'; // 'admin.plugin.dao.eth' +export const PLUGIN_REPO_ENS_SUBDOMAIN_NAME = 'admin'; // 'admin.plugin.dao.eth' // Specify the version of your plugin that you are currently working on. The first version is v1.1. // For more details, visit https://devs.aragon.org/docs/osx/how-it-works/framework/plugin-management/plugin-repo. diff --git a/packages/contracts/test/10_unit-testing/11_plugin.ts b/packages/contracts/test/10_unit-testing/11_plugin.ts index 6b6339cb..4dfb2ff3 100644 --- a/packages/contracts/test/10_unit-testing/11_plugin.ts +++ b/packages/contracts/test/10_unit-testing/11_plugin.ts @@ -532,7 +532,7 @@ async function fixture(): Promise { ); if (!isZksync) { - initializedPlugin.initialize(dao.address, targetConfig); + await initializedPlugin.initialize(dao.address, targetConfig); } const dummyActions: DAOStructs.ActionStruct[] = [ diff --git a/packages/contracts/test/20_integration-testing/21_deployment.ts b/packages/contracts/test/20_integration-testing/21_deployment.ts index c2fa3de9..9f463d7a 100644 --- a/packages/contracts/test/20_integration-testing/21_deployment.ts +++ b/packages/contracts/test/20_integration-testing/21_deployment.ts @@ -1,6 +1,5 @@ -import {METADATA, VERSION} from '../../plugin-settings'; +import {VERSION, PLUGIN_SETUP_CONTRACT_NAME} from '../../plugin-settings'; import {getProductionNetworkName, findPluginRepo} from '../../utils/helpers'; -import {loadFixtureCustom} from '../test-utils/fixture'; import {skipTestSuiteIfNetworkIsZkSync} from '../test-utils/skip-functions'; import { getLatestNetworkDeployment, @@ -11,7 +10,6 @@ import { PERMISSION_MANAGER_FLAGS, PLUGIN_REPO_PERMISSIONS, UnsupportedNetworkError, - uploadToIPFS, } from '@aragon/osx-commons-sdk'; import { DAO, @@ -20,6 +18,7 @@ import { PluginRepoRegistry, PluginRepoRegistry__factory, } from '@aragon/osx-ethers'; +import {loadFixture} from '@nomicfoundation/hardhat-network-helpers'; import {SignerWithAddress} from '@nomiclabs/hardhat-ethers/signers'; import {expect} from 'chai'; import env, {deployments, ethers} from 'hardhat'; @@ -30,13 +29,13 @@ skipTestSuiteIfNetworkIsZkSync( `Deployment on network '${productionNetworkName}'`, function () { it('creates the repo', async () => { - const {pluginRepo, pluginRepoRegistry} = await loadFixtureCustom(fixture); + const {pluginRepo, pluginRepoRegistry} = await loadFixture(fixture); expect(await pluginRepoRegistry.entries(pluginRepo.address)).to.be.true; }); it('gives the management DAO permissions over the repo', async () => { - const {pluginRepo, managementDaoProxy} = await loadFixtureCustom(fixture); + const {pluginRepo, managementDaoProxy} = await loadFixture(fixture); expect( await pluginRepo.isGranted( @@ -68,20 +67,16 @@ skipTestSuiteIfNetworkIsZkSync( context('PluginSetup Publication', async () => { it('registers the setup', async () => { - const {pluginRepo} = await loadFixtureCustom(fixture); + const {pluginRepo, pluginSetupAddr} = await loadFixture(fixture); const results = await pluginRepo['getVersion((uint8,uint16))']({ release: VERSION.release, build: VERSION.build, }); - const buildMetadataURI = `ipfs://${await uploadToIPFS( - JSON.stringify(METADATA.build, null, 2) - )}`; - - expect(results.buildMetadata).to.equal( - ethers.utils.hexlify(ethers.utils.toUtf8Bytes(buildMetadataURI)) - ); + expect(results.pluginSetup).to.equal(pluginSetupAddr); + expect(results.tag.build).to.equal(VERSION.build); + expect(results.tag.release).to.equal(VERSION.release); }); }); } @@ -92,6 +87,7 @@ type FixtureResult = { pluginRepo: PluginRepo; pluginRepoRegistry: PluginRepoRegistry; managementDaoProxy: DAO; + pluginSetupAddr: string; }; async function fixture(): Promise { @@ -128,5 +124,14 @@ async function fixture(): Promise { deployer ); - return {deployer, pluginRepo, pluginRepoRegistry, managementDaoProxy}; + const pluginSetupAddr = (await deployments.get(PLUGIN_SETUP_CONTRACT_NAME)) + .address; + + return { + deployer, + pluginRepo, + pluginRepoRegistry, + managementDaoProxy, + pluginSetupAddr, + }; } diff --git a/packages/contracts/test/test-utils/wrapper/index.ts b/packages/contracts/test/test-utils/wrapper/index.ts index 6d8fd5e1..b345150b 100644 --- a/packages/contracts/test/test-utils/wrapper/index.ts +++ b/packages/contracts/test/test-utils/wrapper/index.ts @@ -92,7 +92,7 @@ export class Wrapper { const deployRes = await this.network.deploy(artifactName, constructorArgs); const artifact = deployRes.artifact; - const contract = deployRes.contract; + let contract = deployRes.contract; if (isProxy) { const {contract: proxyFactoryContract} = await this.network.deploy( diff --git a/packages/contracts/utils/zkSync.ts b/packages/contracts/utils/zkSync.ts index c3f2295f..4d3cc58c 100644 --- a/packages/contracts/utils/zkSync.ts +++ b/packages/contracts/utils/zkSync.ts @@ -1,8 +1,9 @@ -export const ZK_SYNC_NETWORKS = ['zkMainnet', 'zkLocalTestnet', 'zkTestnet']; +export const ZK_SYNC_NETWORKS = [ + 'zkMainnet', + 'zkLocalTestnet', + 'zkTestnet', + 'zksyncSepolia', +]; export function isZkSync(networkName: string): boolean { - return ( - networkName === 'zksyncSepolia' || - networkName === 'zkLocalTestnet' || - networkName === 'zksyncMainnet' - ); + return ZK_SYNC_NETWORKS.includes(networkName); }