From 369eb185cc226c34d89477e2fe74955fff33e69c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B8r=E2=88=82=C2=A1?= Date: Fri, 31 May 2024 18:00:31 +0200 Subject: [PATCH] Cleaning the unused json files --- README.md | 37 ----------- packages/contracts/plugin-setup-params.ts | 23 ------- .../governance/governance-build-metadata.json | 64 ------------------- .../governance-release-metadata.json | 5 -- .../personal-space-admin-build-metadata.json | 22 ------- ...personal-space-admin-release-metadata.json | 5 -- .../src/space/space-build-metadata.json | 38 ----------- .../src/space/space-release-metadata.json | 5 -- 8 files changed, 199 deletions(-) delete mode 100644 packages/contracts/src/governance/governance-build-metadata.json delete mode 100644 packages/contracts/src/governance/governance-release-metadata.json delete mode 100644 packages/contracts/src/personal/personal-space-admin-build-metadata.json delete mode 100644 packages/contracts/src/personal/personal-space-admin-release-metadata.json delete mode 100644 packages/contracts/src/space/space-build-metadata.json delete mode 100644 packages/contracts/src/space/space-release-metadata.json diff --git a/README.md b/README.md index 4fca101..51f719b 100644 --- a/README.md +++ b/README.md @@ -632,35 +632,6 @@ function encodeUninstallationParams( ) public pure returns (bytes memory) ``` -The JSON encoded ABI definition can also be found at the corresponding `src//-build-metadata.json` file: - -```json -{ - // ... - "pluginSetup": { - "prepareInstallation": { - // ... - "inputs": [ - { - "name": "firstBlockContentUri", - "type": "string", - "internalType": "string", - "description": "The inital contents of the first block item." - }, - { - "internalType": "address", - "name": "predecessorAddress", - "type": "address" - }, - { - "internalType": "address", - "name": "pluginUpgrader", - "type": "address" - } - ] - }, -``` - The same also applies to `prepareUpdate` (if present) and to `prepareUninstallation`. ### Available setup contracts @@ -701,14 +672,6 @@ In the example, the code is making use of the existing JS client for [Aragon's T - The deployments made will populate data to the `packages/contracts/plugin-repo-info.json` and `packages/contracts/plugin-repo-info-dev.json`. - You need to copy `.env.template` into `.env` and provide your Infura API key -### Plugin metadata - -Plugins need some basic metadata in order for JS clients to be able to handle installations and updates. Beyond a simple title and description, every contract's build metadata contains the ABI of the parameters that need to be encoded in order to prepare the plugin installation. - -Every plugin has an `initialize()` methos, which acts as the constructor for UUPS upgradeable contracts. This method will be passed its DAO's address, as well as a `bytes memory data` parameter, with all the settings encoded. - -The format of these settings is defined in the `packages/contracts/src/*-build.metadata.json` file. See the `pluginSetup` > `prepareInstallation` section. - ## DO's and DONT's - Never grant `ROOT_PERMISSION` unless you are just trying things out diff --git a/packages/contracts/plugin-setup-params.ts b/packages/contracts/plugin-setup-params.ts index 43284cc..e3ed83c 100644 --- a/packages/contracts/plugin-setup-params.ts +++ b/packages/contracts/plugin-setup-params.ts @@ -1,10 +1,3 @@ -import governanceBuildMetadata from './src/governance/governance-build-metadata.json'; -import governanceReleaseMetadata from './src/governance/governance-release-metadata.json'; -import personalSpaceAdminBuildMetadata from './src/personal/personal-space-admin-build-metadata.json'; -import personalSpaceAdminReleaseMetadata from './src/personal/personal-space-admin-release-metadata.json'; -import spaceBuildMetadata from './src/space/space-build-metadata.json'; -import spaceReleaseMetadata from './src/space/space-release-metadata.json'; - export const SpacePluginSetupParams: PluginSetupParams = { PLUGIN_REPO_ENS_NAME: 'geo-browser-space', PLUGIN_CONTRACT_NAME: 'SpacePlugin', @@ -13,10 +6,6 @@ export const SpacePluginSetupParams: PluginSetupParams = { release: 1, // Increment this number ONLY if breaking/incompatible changes were made. Updates between releases are NOT possible. build: 1, // Increment this number if non-breaking/compatible changes were made. Updates to newer builds are possible. }, - METADATA: { - build: spaceBuildMetadata, - release: spaceReleaseMetadata, - }, }; export const PersonalSpaceAdminPluginSetupParams: PluginSetupParams = { @@ -27,10 +16,6 @@ export const PersonalSpaceAdminPluginSetupParams: PluginSetupParams = { release: 1, // Increment this number ONLY if breaking/incompatible changes were made. Updates between releases are NOT possible. build: 1, // Increment this number if non-breaking/compatible changes were made. Updates to newer builds are possible. }, - METADATA: { - build: personalSpaceAdminBuildMetadata, - release: personalSpaceAdminReleaseMetadata, - }, }; export const GovernancePluginsSetupParams: PluginSetupParams = { @@ -41,10 +26,6 @@ export const GovernancePluginsSetupParams: PluginSetupParams = { release: 1, // Increment this number ONLY if breaking/incompatible changes were made. Updates between releases are NOT possible. build: 1, // Increment this number if non-breaking/compatible changes were made. Updates to newer builds are possible. }, - METADATA: { - build: governanceBuildMetadata, - release: governanceReleaseMetadata, - }, }; // Types @@ -57,8 +38,4 @@ export type PluginSetupParams = { release: number; build: number; }; - METADATA: { - build: {[k: string]: any}; - release: {[k: string]: any}; - }; }; diff --git a/packages/contracts/src/governance/governance-build-metadata.json b/packages/contracts/src/governance/governance-build-metadata.json deleted file mode 100644 index 88d6766..0000000 --- a/packages/contracts/src/governance/governance-build-metadata.json +++ /dev/null @@ -1,64 +0,0 @@ -{ - "ui": {}, - "change": "Initial build.", - "pluginSetup": { - "prepareInstallation": { - "description": "The information required for the installation of build 1.", - "inputs": [ - { - "components": [ - { - "internalType": "enum MajorityVotingBase.VotingMode", - "name": "votingMode", - "type": "uint8" - }, - { - "internalType": "uint32", - "name": "supportThreshold", - "type": "uint32" - }, - { - "internalType": "uint32", - "name": "minParticipation", - "type": "uint32" - }, - { - "internalType": "uint64", - "name": "duration", - "type": "uint64" - } - ], - "internalType": "struct MajorityVotingBase.VotingSettings", - "name": "votingSettings", - "type": "tuple" - }, - { - "internalType": "address[]", - "name": "initialEditors", - "type": "address[]" - }, - { - "internalType": "uint64", - "name": "memberAccessProposalDuration", - "type": "uint64" - }, - { - "internalType": "address", - "name": "pluginUpgrader", - "type": "address" - } - ] - }, - "prepareUpdate": {}, - "prepareUninstallation": { - "description": "The information required for the uninstallation of build 1.", - "inputs": [ - { - "internalType": "address", - "name": "pluginUpgrader", - "type": "address" - } - ] - } - } -} diff --git a/packages/contracts/src/governance/governance-release-metadata.json b/packages/contracts/src/governance/governance-release-metadata.json deleted file mode 100644 index 9de523c..0000000 --- a/packages/contracts/src/governance/governance-release-metadata.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "name": "Main Voting Plugin and Member Access Plugin", - "description": "", - "images": {} -} diff --git a/packages/contracts/src/personal/personal-space-admin-build-metadata.json b/packages/contracts/src/personal/personal-space-admin-build-metadata.json deleted file mode 100644 index 94cc6ea..0000000 --- a/packages/contracts/src/personal/personal-space-admin-build-metadata.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "ui": {}, - "change": "Initial build.", - "pluginSetup": { - "prepareInstallation": { - "description": "The information required for the installation of build 1.", - "inputs": [ - { - "name": "_initialEditorAddress", - "type": "address", - "internalType": "address", - "description": "The address of the first address to be granted the editor permission." - } - ] - }, - "prepareUpdate": {}, - "prepareUninstallation": { - "description": "The information required for the uninstallation of build 1.", - "inputs": [] - } - } -} diff --git a/packages/contracts/src/personal/personal-space-admin-release-metadata.json b/packages/contracts/src/personal/personal-space-admin-release-metadata.json deleted file mode 100644 index c5f3aba..0000000 --- a/packages/contracts/src/personal/personal-space-admin-release-metadata.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "name": "Personal Space Voting Plugin", - "description": "", - "images": {} -} diff --git a/packages/contracts/src/space/space-build-metadata.json b/packages/contracts/src/space/space-build-metadata.json deleted file mode 100644 index 086c58d..0000000 --- a/packages/contracts/src/space/space-build-metadata.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "ui": {}, - "change": "Initial build.", - "pluginSetup": { - "prepareInstallation": { - "description": "The information required for the installation of build 1.", - "inputs": [ - { - "name": "firstBlockContentUri", - "type": "string", - "internalType": "string", - "description": "The inital contents of the first block item." - }, - { - "internalType": "address", - "name": "predecessorAddress", - "type": "address" - }, - { - "internalType": "address", - "name": "pluginUpgrader", - "type": "address" - } - ] - }, - "prepareUpdate": {}, - "prepareUninstallation": { - "description": "The information required for the uninstallation of build 1.", - "inputs": [ - { - "internalType": "address", - "name": "pluginUpgrader", - "type": "address" - } - ] - } - } -} diff --git a/packages/contracts/src/space/space-release-metadata.json b/packages/contracts/src/space/space-release-metadata.json deleted file mode 100644 index 5a6b0ce..0000000 --- a/packages/contracts/src/space/space-release-metadata.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "name": "Space Plugin", - "description": "", - "images": {} -}