From b54719f1bc69782b947b23c563b0de172d842ce4 Mon Sep 17 00:00:00 2001 From: Claudia Date: Tue, 4 Feb 2025 16:24:15 +0100 Subject: [PATCH 1/2] feat: add data to the output file --- .../deploy/20_new_version/23_publish.ts | 35 +++++++++++++------ 1 file changed, 24 insertions(+), 11 deletions(-) diff --git a/packages/contracts/deploy/20_new_version/23_publish.ts b/packages/contracts/deploy/20_new_version/23_publish.ts index 7701df98..b789c636 100644 --- a/packages/contracts/deploy/20_new_version/23_publish.ts +++ b/packages/contracts/deploy/20_new_version/23_publish.ts @@ -9,12 +9,12 @@ import {PluginRepo} from '../../typechain'; import { findPluginRepo, getPastVersionCreatedEvents, - impersonatedManagementDaoSigner, isLocal, pluginEnsDomain, } from '../../utils/helpers'; import {getLatestContractAddress} from '../helpers'; import {PLUGIN_REPO_PERMISSIONS, uploadToPinata} from '@aragon/osx-commons-sdk'; +import {PluginRepo__factory} from '@aragon/osx-ethers'; import {SignerWithAddress} from '@nomiclabs/hardhat-ethers/signers'; import {writeFile} from 'fs/promises'; import {ethers} from 'hardhat'; @@ -182,6 +182,26 @@ const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) { } else { // The deployer does not have `MAINTAINER_PERMISSION_ID` permission and we are not deploying to a production network, // so we write the data into a file for a management DAO member to create a proposal from it. + + const pluginRepoInterface = PluginRepo__factory.createInterface(); + const versionData = { + _release: VERSION.release, + _pluginSetup: setup.address, + _buildMetadata: ethers.utils.hexlify( + ethers.utils.toUtf8Bytes(buildMetadataURI) + ), + _releaseMetadata: ethers.utils.hexlify( + ethers.utils.toUtf8Bytes(releaseMetadataURI) + ), + }; + + const calldata = pluginRepoInterface.encodeFunctionData('createVersion', [ + versionData._release, + versionData._pluginSetup, + versionData._buildMetadata, + versionData._releaseMetadata, + ]); + const data = { proposalTitle: `Publish '${PLUGIN_CONTRACT_NAME}' plugin v${VERSION.release}.${VERSION.build}`, proposalSummary: `Publishes v${VERSION.release}.${VERSION.build} of the '${PLUGIN_CONTRACT_NAME}' plugin in the '${ensDomain}' plugin repo.`, @@ -191,16 +211,9 @@ const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) { actions: [ { to: pluginRepo.address, - createVersion: { - _release: VERSION.release, - _pluginSetup: setup.address, - _buildMetadata: ethers.utils.hexlify( - ethers.utils.toUtf8Bytes(buildMetadataURI) - ), - _releaseMetadata: ethers.utils.hexlify( - ethers.utils.toUtf8Bytes(releaseMetadataURI) - ), - }, + value: 0, + data: calldata, + createVersion: versionData, }, ], }; From d839904e4db77c1a9b95fcbaffc62fd6ac5bd8df Mon Sep 17 00:00:00 2001 From: Claudia Date: Thu, 6 Feb 2025 13:08:38 +0100 Subject: [PATCH 2/2] feat: add needed import --- packages/contracts/deploy/20_new_version/23_publish.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/contracts/deploy/20_new_version/23_publish.ts b/packages/contracts/deploy/20_new_version/23_publish.ts index b789c636..c8d2cb54 100644 --- a/packages/contracts/deploy/20_new_version/23_publish.ts +++ b/packages/contracts/deploy/20_new_version/23_publish.ts @@ -11,6 +11,7 @@ import { getPastVersionCreatedEvents, isLocal, pluginEnsDomain, + impersonatedManagementDaoSigner, } from '../../utils/helpers'; import {getLatestContractAddress} from '../helpers'; import {PLUGIN_REPO_PERMISSIONS, uploadToPinata} from '@aragon/osx-commons-sdk';