From 2002f78bb098dd9ab7287527097d2fb3b5de8264 Mon Sep 17 00:00:00 2001 From: thomas-waite Date: Mon, 13 Jun 2022 17:19:35 +0100 Subject: [PATCH 01/12] feat: add metadata registration into proposal registration --- scripts/utils/getProposalCalldata.ts | 4 +++ scripts/utils/simulateTimelockProposal.ts | 39 ++++++++++++++++++----- types/types.ts | 3 ++ 3 files changed, 38 insertions(+), 8 deletions(-) diff --git a/scripts/utils/getProposalCalldata.ts b/scripts/utils/getProposalCalldata.ts index bc0a45f8d..e97cd690c 100644 --- a/scripts/utils/getProposalCalldata.ts +++ b/scripts/utils/getProposalCalldata.ts @@ -3,6 +3,10 @@ import { constructProposalCalldata } from './constructProposalCalldata'; dotenv.config(); +// GOAL: +// 1. When generating calldata for a TC proposal, automatically make the call to the metadata registry +// 2. Have it output as one of the steps in the calldata + /** * Take in a hardhat proposal object and output the proposal calldatas * See `proposals/utils/getProposalCalldata.js` on how to construct the proposal calldata diff --git a/scripts/utils/simulateTimelockProposal.ts b/scripts/utils/simulateTimelockProposal.ts index 3aeb9b7f4..c3a47c882 100644 --- a/scripts/utils/simulateTimelockProposal.ts +++ b/scripts/utils/simulateTimelockProposal.ts @@ -1,14 +1,14 @@ import { ethers } from 'hardhat'; -import { - MainnetContracts, - NamedAddresses, - ProposalDescription, - TemplatedProposalDescription -} from '@custom-types/types'; +import { MainnetContracts, NamedAddresses, TemplatedProposalDescription } from '@custom-types/types'; import { OptimisticTimelock } from '@custom-types/contracts'; import { getImpersonatedSigner, time } from '@test/helpers'; import { Contract } from '@ethersproject/contracts'; import { forceEth } from '@test/integration/setup/utils'; +import { TRIBAL_COUNCIL_POD_ID } from '@protocol/optimisticGovernance'; + +type PodConfig = { + podId: number; +}; export async function simulateOAProposal( proposalInfo: TemplatedProposalDescription, @@ -29,7 +29,19 @@ export async function simulateTCProposal( ) { const timelockTC = contracts.tribalCouncilTimelock as OptimisticTimelock; const multisigAddressTC = contractAddresses.tribalCouncilSafe as string; - await simulateTimelockProposal(timelockTC, multisigAddressTC, proposalInfo, contracts, contractAddresses, logging); + const podConfig = { + podId: TRIBAL_COUNCIL_POD_ID + }; + // Need to also register the metadata. Need podID. + await simulateTimelockProposal( + timelockTC, + multisigAddressTC, + proposalInfo, + contracts, + contractAddresses, + logging, + podConfig + ); } export async function simulateTimelockProposal( @@ -38,7 +50,8 @@ export async function simulateTimelockProposal( proposalInfo: TemplatedProposalDescription, contracts: MainnetContracts, contractAddresses: NamedAddresses, - logging = false + logging = false, + podConfig?: PodConfig ) { await forceEth(multisigAddress); const signer = await getImpersonatedSigner(multisigAddress); @@ -88,6 +101,16 @@ export async function simulateTimelockProposal( if (!proposalId || !(await timelock.isOperation(proposalId))) { const schedule = await timelock.connect(signer).scheduleBatch(targets, values, datas, predecessor, salt, delay); console.log('Calldata:', schedule.data); + + // If this proposal is for a pod, then register the metadata + if (podConfig) { + console.log(`Registering proposal ${proposalId} of pod ${podConfig.podId}`); + await contracts.governanceMetadataRegistry.registerProposal( + podConfig.podId, + proposalId, + proposalInfo.description + ); + } } else { console.log('Already scheduled proposal'); } diff --git a/types/types.ts b/types/types.ts index 84334c5c5..ee2ff5507 100644 --- a/types/types.ts +++ b/types/types.ts @@ -16,6 +16,7 @@ import { EthCompoundPCVDeposit, Fei, FeiDAO, + GovernanceMetadataRegistry, GovernorAlpha, IAaveIncentivesController, IERC20, @@ -267,6 +268,7 @@ export interface MainnetContracts { rewardsDistributorAdmin: RewardsDistributorAdmin; restrictedPermissions: RestrictedPermissions; tribalCouncilTimelock: TimelockController; + governanceMetadataRegistry: GovernanceMetadataRegistry; } export interface MainnetContractAddresses { @@ -302,6 +304,7 @@ export interface MainnetContractAddresses { rariRewardsDistributorDelegator: string; restrictedPermissions: string; tribalCouncilTimelock: string; + governanceMetadataRegistry: string; } export type ContractAccessRights = { From 402c3d2c8e56b090b5c71c1a7e1420487fb4884f Mon Sep 17 00:00:00 2001 From: thomas-waite Date: Mon, 13 Jun 2022 17:37:33 +0100 Subject: [PATCH 02/12] feat: add metadata generation into calldata --- scripts/utils/constructProposalCalldata.ts | 43 +++++++++++++++++++--- scripts/utils/simulateTimelockProposal.ts | 12 ++---- 2 files changed, 41 insertions(+), 14 deletions(-) diff --git a/scripts/utils/constructProposalCalldata.ts b/scripts/utils/constructProposalCalldata.ts index a78bff35c..243655991 100644 --- a/scripts/utils/constructProposalCalldata.ts +++ b/scripts/utils/constructProposalCalldata.ts @@ -6,6 +6,7 @@ import { utils } from 'ethers'; import { getAllContractAddresses, getAllContracts } from '@test/integration/setup/loadContracts'; import { ProposalCategory, ProposalDescription, TemplatedProposalDescription } from '@custom-types/types'; import proposals from '@protocol/proposalsConfig'; +import { TRIBAL_COUNCIL_POD_ID } from '@protocol/optimisticGovernance'; type ExtendedAlphaProposal = { targets: string[]; @@ -15,6 +16,10 @@ type ExtendedAlphaProposal = { description: string; }; +type PodConfig = { + id: number; +}; + /** * Take in a hardhat proposal object and output the proposal calldatas * See `proposals/utils/getProposalCalldata.js` on how to construct the proposal calldata @@ -28,10 +33,10 @@ export async function constructProposalCalldata(proposalName: string): Promise Date: Tue, 14 Jun 2022 23:29:03 +0100 Subject: [PATCH 03/12] test: add test for calldata --- scripts/utils/constructProposalCalldata.ts | 4 +- scripts/utils/simulateTimelockProposal.ts | 7 +++- test/unit/scriptUtils/calcProposalId.ts | 44 ++++++++++++++++++++++ 3 files changed, 52 insertions(+), 3 deletions(-) create mode 100644 test/unit/scriptUtils/calcProposalId.ts diff --git a/scripts/utils/constructProposalCalldata.ts b/scripts/utils/constructProposalCalldata.ts index 243655991..dbe6355c3 100644 --- a/scripts/utils/constructProposalCalldata.ts +++ b/scripts/utils/constructProposalCalldata.ts @@ -109,13 +109,13 @@ function getTimelockCalldata( proposalId, proposal.description ]); - return `Calldata: ${calldata}\nRegister Metadata Calldata: ${registerMetadataCalldata}\nExecute Calldata: ${executeCalldata}`; + return `Calldata: ${calldata}\nMetadata Calldata: ${registerMetadataCalldata}\nExecute Calldata: ${executeCalldata}`; } else { return `Calldata: ${calldata}\nExecute Calldata: ${executeCalldata}`; } } -function calcProposalId( +export function calcProposalId( targets: string[], values: BigNumber[], payloads: string[], diff --git a/scripts/utils/simulateTimelockProposal.ts b/scripts/utils/simulateTimelockProposal.ts index 61188cef9..48d7d9d18 100644 --- a/scripts/utils/simulateTimelockProposal.ts +++ b/scripts/utils/simulateTimelockProposal.ts @@ -105,7 +105,12 @@ export async function simulateTimelockProposal( // If this proposal is for a pod, then register the metadata if (podConfig) { console.log(`Registering proposal ${proposalId} of pod ${podConfig.id}`); - await contracts.governanceMetadataRegistry.registerProposal(podConfig.id, proposalId, proposalInfo.description); + const registerTx = await contracts.governanceMetadataRegistry.registerProposal( + podConfig.id, + proposalId, + proposalInfo.description + ); + console.log('Metadata tx: ', registerTx.data); } } else { console.log('Already scheduled proposal'); diff --git a/test/unit/scriptUtils/calcProposalId.ts b/test/unit/scriptUtils/calcProposalId.ts new file mode 100644 index 000000000..bb77c1a85 --- /dev/null +++ b/test/unit/scriptUtils/calcProposalId.ts @@ -0,0 +1,44 @@ +import { ethers } from 'hardhat'; +import { calcProposalId } from '@scripts/utils/getProposalCalldata/calcProposalId'; +import { expect } from 'chai'; + +const toBN = ethers.BigNumber.from; + +describe('Compute proposal ID off-chain', () => { + it('should compute proposalId for single transaction', () => { + // Fixture is a real-transaction submitted on-chain + const expectedProposalId = '0x81c419dbb3c44645493c214eee0ceaf273ba870d1e7e1c48422e2762f60e0db4'; + const targets = [ + '0x02435948F84d7465FB71dE45ABa6098Fc6eC2993', + '0x02435948F84d7465FB71dE45ABa6098Fc6eC2993', + '0x02435948F84d7465FB71dE45ABa6098Fc6eC2993', + '0xF7991f4698ffb6716982aec7F78964Dd731C4A54', + '0xFF6f59333cfD8f4Ebc14aD0a0E181a83e655d257', + '0xFF6f59333cfD8f4Ebc14aD0a0E181a83e655d257', + '0x98E5F5706897074a4664DD3a32eB80242d6E694B' + ]; + const values = ['0', '0', '0', '0', '0', '0', '0']; + const payloads = [ + '0x8320357d00000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000001000000000000000000000000f7991f4698ffb6716982aec7f78964dd731c4a54', + '0xfe68d76e0000000000000000000000005b86887e171bae0c2c826e87e34df8d558c079b9000000000000000000000000f7991f4698ffb6716982aec7f78964dd731c4a5400000000000000000000000000000000000000000000043c33c193756480000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000', + '0xfe68d76e000000000000000000000000e0f73b8d76d2ad33492f995af218b03564b8ce20000000000000000000000000f7991f4698ffb6716982aec7f78964dd731c4a54000000000000000000000000000000000000000000027b46536c66c8e300000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000', + '0x8119c065', + '0xdea02892000000000000000000000000df9ff5c077d9f3427ade67ac2d27a864be6f3187', + '0xdea02892000000000000000000000000f24401f6992faeacbc5d6c6991db15b5f8364a1b', + '0x5d841af5000000000000000000000000000000000000000000000000000000000000003c' + ]; + const predecessor = '0x0000000000000000000000000000000000000000000000000000000000000000'; + const salt = '0x0d0c2b4e41c5fdf9375f2b1601caf0af18e81d6257ea3abb3b72a989fc3698da'; + + const proposalId = calcProposalId(targets, values, payloads, predecessor, salt); + expect(proposalId).to.be.equal(expectedProposalId); + }); + + it('should compute proposalId for batched transactions', () => { + const expectedProposalId = '0xbc8600cbb0c0316c5598c66e8f5dc4995f75863259939b3509fd2865da3f98aa'; + const target = ''; + const value = '0'; + const predecessor = ''; + const salt = ''; + }); +}); From 1af9c1df6d350687013b8107bb6bb1bc7b6c99b5 Mon Sep 17 00:00:00 2001 From: thomas-waite Date: Wed, 15 Jun 2022 14:20:44 +0100 Subject: [PATCH 04/12] refactor: get interface from compiled ABI --- scripts/utils/constructProposalCalldata.ts | 29 ++++++++++------------ scripts/utils/simulateTimelockProposal.ts | 6 +---- 2 files changed, 14 insertions(+), 21 deletions(-) diff --git a/scripts/utils/constructProposalCalldata.ts b/scripts/utils/constructProposalCalldata.ts index dbe6355c3..647ade0b6 100644 --- a/scripts/utils/constructProposalCalldata.ts +++ b/scripts/utils/constructProposalCalldata.ts @@ -4,9 +4,12 @@ import { ethers } from 'hardhat'; import { Interface } from '@ethersproject/abi'; import { utils } from 'ethers'; import { getAllContractAddresses, getAllContracts } from '@test/integration/setup/loadContracts'; -import { ProposalCategory, ProposalDescription, TemplatedProposalDescription } from '@custom-types/types'; +import { ProposalCategory, TemplatedProposalDescription } from '@custom-types/types'; import proposals from '@protocol/proposalsConfig'; import { TRIBAL_COUNCIL_POD_ID } from '@protocol/optimisticGovernance'; +import { abi as TimelockControllerABI } from '../../artifacts/@openzeppelin/contracts/governance/TimelockController.sol/TimelockController.json'; +import { abi as FeiDAOABI } from '../../artifacts/contracts/dao/governor/FeiDAO.sol/FeiDAO.json'; +import { abi as MetadataRegistryABI } from '../../artifacts/contracts/pods/GovernanceMetadataRegistry.sol/GovernanceMetadataRegistry.json'; type ExtendedAlphaProposal = { targets: string[]; @@ -16,9 +19,9 @@ type ExtendedAlphaProposal = { description: string; }; -type PodConfig = { +export interface PodConfig { id: number; -}; +} /** * Take in a hardhat proposal object and output the proposal calldatas @@ -44,9 +47,7 @@ export async function constructProposalCalldata(proposalName: string): Promise Date: Wed, 15 Jun 2022 15:31:02 +0100 Subject: [PATCH 05/12] feat: implement computeBatchProposalId --- scripts/utils/constructProposalCalldata.ts | 10 +++++++--- ...roposalId.ts => computeBatchProposalId.ts} | 20 ++++++------------- 2 files changed, 13 insertions(+), 17 deletions(-) rename test/unit/scriptUtils/{calcProposalId.ts => computeBatchProposalId.ts} (76%) diff --git a/scripts/utils/constructProposalCalldata.ts b/scripts/utils/constructProposalCalldata.ts index 647ade0b6..d00740ed0 100644 --- a/scripts/utils/constructProposalCalldata.ts +++ b/scripts/utils/constructProposalCalldata.ts @@ -100,7 +100,7 @@ function getTimelockCalldata( ]); if (podConfig) { - const proposalId = calcProposalId(proposal.targets, proposal.values, combinedCalldatas, predecessor, salt); + const proposalId = computeBatchProposalId(proposal.targets, proposal.values, combinedCalldatas, predecessor, salt); const registerMetadataCalldata = metadataRegistryInterface.encodeFunctionData('registerProposal', [ podConfig.id, proposalId, @@ -112,12 +112,16 @@ function getTimelockCalldata( } } -export function calcProposalId( +export function computeBatchProposalId( targets: string[], values: BigNumber[], payloads: string[], predecessor: string, salt: string ): string { - return '0x123'; + const dataToHash = ethers.utils.defaultAbiCoder.encode( + ['address[]', 'uint256[]', 'bytes[]', 'bytes32', 'bytes32'], + [targets, values.map((x) => x.toString()), payloads, predecessor, salt] + ); + return ethers.utils.keccak256(dataToHash); } diff --git a/test/unit/scriptUtils/calcProposalId.ts b/test/unit/scriptUtils/computeBatchProposalId.ts similarity index 76% rename from test/unit/scriptUtils/calcProposalId.ts rename to test/unit/scriptUtils/computeBatchProposalId.ts index bb77c1a85..71e77fc64 100644 --- a/test/unit/scriptUtils/calcProposalId.ts +++ b/test/unit/scriptUtils/computeBatchProposalId.ts @@ -1,11 +1,11 @@ -import { ethers } from 'hardhat'; -import { calcProposalId } from '@scripts/utils/getProposalCalldata/calcProposalId'; +import { computeBatchProposalId } from '@scripts/utils/constructProposalCalldata'; import { expect } from 'chai'; +import { BigNumber } from 'ethers'; -const toBN = ethers.BigNumber.from; +const toBN = BigNumber.from; describe('Compute proposal ID off-chain', () => { - it('should compute proposalId for single transaction', () => { + it('should compute proposalId for a batched proposal', () => { // Fixture is a real-transaction submitted on-chain const expectedProposalId = '0x81c419dbb3c44645493c214eee0ceaf273ba870d1e7e1c48422e2762f60e0db4'; const targets = [ @@ -17,7 +17,7 @@ describe('Compute proposal ID off-chain', () => { '0xFF6f59333cfD8f4Ebc14aD0a0E181a83e655d257', '0x98E5F5706897074a4664DD3a32eB80242d6E694B' ]; - const values = ['0', '0', '0', '0', '0', '0', '0']; + const values = [toBN(0), toBN(0), toBN(0), toBN(0), toBN(0), toBN(0), toBN(0)]; const payloads = [ '0x8320357d00000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000001000000000000000000000000f7991f4698ffb6716982aec7f78964dd731c4a54', '0xfe68d76e0000000000000000000000005b86887e171bae0c2c826e87e34df8d558c079b9000000000000000000000000f7991f4698ffb6716982aec7f78964dd731c4a5400000000000000000000000000000000000000000000043c33c193756480000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000', @@ -30,15 +30,7 @@ describe('Compute proposal ID off-chain', () => { const predecessor = '0x0000000000000000000000000000000000000000000000000000000000000000'; const salt = '0x0d0c2b4e41c5fdf9375f2b1601caf0af18e81d6257ea3abb3b72a989fc3698da'; - const proposalId = calcProposalId(targets, values, payloads, predecessor, salt); + const proposalId = computeBatchProposalId(targets, values, payloads, predecessor, salt); expect(proposalId).to.be.equal(expectedProposalId); }); - - it('should compute proposalId for batched transactions', () => { - const expectedProposalId = '0xbc8600cbb0c0316c5598c66e8f5dc4995f75863259939b3509fd2865da3f98aa'; - const target = ''; - const value = '0'; - const predecessor = ''; - const salt = ''; - }); }); From 31e82ae81ffe7cc7f1e7124593c9fffcf181a877 Mon Sep 17 00:00:00 2001 From: thomas-waite Date: Wed, 15 Jun 2022 15:35:36 +0100 Subject: [PATCH 06/12] style: clearup comments --- scripts/utils/getProposalCalldata.ts | 4 ---- 1 file changed, 4 deletions(-) diff --git a/scripts/utils/getProposalCalldata.ts b/scripts/utils/getProposalCalldata.ts index e97cd690c..bc0a45f8d 100644 --- a/scripts/utils/getProposalCalldata.ts +++ b/scripts/utils/getProposalCalldata.ts @@ -3,10 +3,6 @@ import { constructProposalCalldata } from './constructProposalCalldata'; dotenv.config(); -// GOAL: -// 1. When generating calldata for a TC proposal, automatically make the call to the metadata registry -// 2. Have it output as one of the steps in the calldata - /** * Take in a hardhat proposal object and output the proposal calldatas * See `proposals/utils/getProposalCalldata.js` on how to construct the proposal calldata From 46f7ce6c04b20da4415541abcedce8105ce42904 Mon Sep 17 00:00:00 2001 From: thomas-waite Date: Wed, 15 Jun 2022 15:50:00 +0100 Subject: [PATCH 07/12] refactor: pull description correctly from proposalInfo --- scripts/utils/constructProposalCalldata.ts | 2 +- scripts/utils/simulateTimelockProposal.ts | 8 +++----- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/scripts/utils/constructProposalCalldata.ts b/scripts/utils/constructProposalCalldata.ts index d00740ed0..0aa5d4072 100644 --- a/scripts/utils/constructProposalCalldata.ts +++ b/scripts/utils/constructProposalCalldata.ts @@ -104,7 +104,7 @@ function getTimelockCalldata( const registerMetadataCalldata = metadataRegistryInterface.encodeFunctionData('registerProposal', [ podConfig.id, proposalId, - proposal.description + proposalInfo.description ]); return `Calldata: ${calldata}\nMetadata Calldata: ${registerMetadataCalldata}\nExecute Calldata: ${executeCalldata}`; } else { diff --git a/scripts/utils/simulateTimelockProposal.ts b/scripts/utils/simulateTimelockProposal.ts index ab310c111..7ff9c15bb 100644 --- a/scripts/utils/simulateTimelockProposal.ts +++ b/scripts/utils/simulateTimelockProposal.ts @@ -101,11 +101,9 @@ export async function simulateTimelockProposal( // If this proposal is for a pod, then register the metadata if (podConfig) { console.log(`Registering proposal ${proposalId} of pod ${podConfig.id}`); - const registerTx = await contracts.governanceMetadataRegistry.registerProposal( - podConfig.id, - proposalId, - proposalInfo.description - ); + const registerTx = await contracts.governanceMetadataRegistry + .connect(signer) + .registerProposal(podConfig.id, proposalId, proposalInfo.description); console.log('Metadata tx: ', registerTx.data); } } else { From 5f113faf3f49c933ac8e9dbeca7870fe093ffac4 Mon Sep 17 00:00:00 2001 From: thomas-waite Date: Tue, 28 Jun 2022 14:51:24 +0100 Subject: [PATCH 08/12] deps: clear out proposals config --- block.txt | 2 +- protocol-configuration/proposalsConfig.ts | 36 ++--------------------- 2 files changed, 3 insertions(+), 35 deletions(-) diff --git a/block.txt b/block.txt index cee98f713..b143baff3 100644 --- a/block.txt +++ b/block.txt @@ -1 +1 @@ -15018600 \ No newline at end of file +15039959 \ No newline at end of file diff --git a/protocol-configuration/proposalsConfig.ts b/protocol-configuration/proposalsConfig.ts index cbbafd706..595a785d4 100644 --- a/protocol-configuration/proposalsConfig.ts +++ b/protocol-configuration/proposalsConfig.ts @@ -1,37 +1,5 @@ -import { ProposalCategory, TemplatedProposalsConfigMap } from '@custom-types/types'; +import { TemplatedProposalsConfigMap } from '@custom-types/types'; -import tip_117 from '@proposals/description/tip_117'; -import pod_exec_v2 from '@proposals/description/pod_exec_v2'; -import tip_115 from '@proposals/description/tip_115'; - -const proposals: TemplatedProposalsConfigMap = { - tip_117: { - deploy: false, // deploy flag for whether to run deploy action during e2e tests or use mainnet state - totalValue: 0, // amount of ETH to send to DAO execution - proposal: tip_117, // full proposal file, imported from '@proposals/description/fip_xx.ts' - proposalId: '', - affectedContractSignoff: [], - deprecatedContractSignoff: [], - category: ProposalCategory.DAO - }, - tip_115: { - deploy: false, // deploy flag for whether to run deploy action during e2e tests or use mainnet state - totalValue: 0, // amount of ETH to send to DAO execution - proposal: tip_115, // full proposal file, imported from '@proposals/description/fip_xx.ts' - proposalId: '', - affectedContractSignoff: [], - deprecatedContractSignoff: [], - category: ProposalCategory.TC - }, - pod_exec_v2: { - deploy: false, // deploy flag for whether to run deploy action during e2e tests or use mainnet state - totalValue: 0, // amount of ETH to send to DAO execution - proposal: pod_exec_v2, // full proposal file, imported from '@proposals/description/fip_xx.ts' - proposalId: '', - affectedContractSignoff: [], - deprecatedContractSignoff: [], - category: ProposalCategory.TC - } -}; +const proposals: TemplatedProposalsConfigMap = {}; export default proposals; From 0e877013ee23361b75950b4072b21ff36a7d6034 Mon Sep 17 00:00:00 2001 From: thomas-waite Date: Tue, 28 Jun 2022 14:58:58 +0100 Subject: [PATCH 09/12] feat: remove OA simulation rename to podCalldata rather than timelockCalldata --- scripts/utils/constructProposalCalldata.ts | 4 ++-- scripts/utils/simulateTimelockProposal.ts | 22 ++++++---------------- 2 files changed, 8 insertions(+), 18 deletions(-) diff --git a/scripts/utils/constructProposalCalldata.ts b/scripts/utils/constructProposalCalldata.ts index e8920c355..f071817bc 100644 --- a/scripts/utils/constructProposalCalldata.ts +++ b/scripts/utils/constructProposalCalldata.ts @@ -42,7 +42,7 @@ export async function constructProposalCalldata(proposalName: string): Promise Date: Tue, 28 Jun 2022 15:06:36 +0100 Subject: [PATCH 10/12] refactor: all escape characters to fip text, remove optional podConfig --- proposals/description/fip_x.ts | 5 ++++- scripts/utils/simulateTimelockProposal.ts | 14 ++++++-------- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/proposals/description/fip_x.ts b/proposals/description/fip_x.ts index 3268649dd..d4fee96e4 100644 --- a/proposals/description/fip_x.ts +++ b/proposals/description/fip_x.ts @@ -11,7 +11,10 @@ const fip_x: ProposalDescription = { description: '' } ], - description: 'fip_x will change the game!' + description: ` + [TITLE] /n/n + [BODY OF PROPOSAL] \n\n + ` }; export default fip_x; diff --git a/scripts/utils/simulateTimelockProposal.ts b/scripts/utils/simulateTimelockProposal.ts index a52cd5946..537fd3409 100644 --- a/scripts/utils/simulateTimelockProposal.ts +++ b/scripts/utils/simulateTimelockProposal.ts @@ -88,14 +88,12 @@ export async function simulatePodProposal( const schedule = await timelock.connect(signer).scheduleBatch(targets, values, datas, predecessor, salt, delay); console.log('Calldata:', schedule.data); - // If this proposal is for a pod, then register the metadata - if (podConfig) { - console.log(`Registering proposal ${proposalId} of pod ${podConfig.id}`); - const registerTx = await contracts.governanceMetadataRegistry - .connect(signer) - .registerProposal(podConfig.id, proposalId, proposalInfo.description); - console.log('Metadata tx: ', registerTx.data); - } + // Register the pod's metadata + console.log(`Registering proposal ${proposalId} of pod ${podConfig.id}`); + const registerTx = await contracts.governanceMetadataRegistry + .connect(signer) + .registerProposal(podConfig.id, proposalId, proposalInfo.description); + console.log('Metadata tx: ', registerTx.data); } else { console.log('Already scheduled proposal'); } From a32cd249aa0849d91f91f1311c55fed6950ea1a3 Mon Sep 17 00:00:00 2001 From: thomas-waite Date: Tue, 28 Jun 2022 15:10:33 +0100 Subject: [PATCH 11/12] feat: re-add proposal category --- protocol-configuration/proposalsConfig.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/protocol-configuration/proposalsConfig.ts b/protocol-configuration/proposalsConfig.ts index 595a785d4..c782a96d7 100644 --- a/protocol-configuration/proposalsConfig.ts +++ b/protocol-configuration/proposalsConfig.ts @@ -1,4 +1,4 @@ -import { TemplatedProposalsConfigMap } from '@custom-types/types'; +import { ProposalCategory, TemplatedProposalsConfigMap } from '@custom-types/types'; const proposals: TemplatedProposalsConfigMap = {}; From 3d67709b7f80155b5571f1a955c4a65a7f9759a9 Mon Sep 17 00:00:00 2001 From: thomas-waite Date: Tue, 28 Jun 2022 15:53:26 +0100 Subject: [PATCH 12/12] fix: remove wrong import --- test/integration/setup/index.ts | 2 -- 1 file changed, 2 deletions(-) diff --git a/test/integration/setup/index.ts b/test/integration/setup/index.ts index 9acc6aae3..687d09f77 100644 --- a/test/integration/setup/index.ts +++ b/test/integration/setup/index.ts @@ -5,7 +5,6 @@ import { ContractAccessRights, TestCoordinator, ContractsAndAddresses, - ProposalConfig, TemplatedProposalConfig, namedContractsToNamedAddresses, NamedAddresses, @@ -21,7 +20,6 @@ import { sudo } from '@scripts/utils/sudo'; import constructProposal from '@scripts/utils/constructProposal'; import '@nomiclabs/hardhat-ethers'; import { resetFork } from '@test/helpers'; -import { simulateOAProposal } from '@scripts/utils/simulateTimelockProposal'; import { simulateTCProposal } from '@scripts/utils/simulateTimelockProposal'; import { simulateDEBUGProposal } from '@scripts/utils/simulateDEBUGProposal'; import { forceEth } from '@test/integration/setup/utils';