Skip to content

Commit

Permalink
feat: add readme describing how using the script
Browse files Browse the repository at this point in the history
  • Loading branch information
clauBv23 committed Feb 12, 2025
1 parent 927eec3 commit cccd6af
Show file tree
Hide file tree
Showing 2 changed files with 58 additions and 11 deletions.
58 changes: 58 additions & 0 deletions packages/contracts/scripts/management-dao-proposal/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
## Description

This script merges the plugin proposal actions defined in the files inside the `files-to-merge` folder and the `deployed_contracts.json` file into the `merged-proposals.json` file.

## How it works

Before running this script, you need to deploy the plugins and the framework.

To deploy the framework, run the deploy script in the `packages/contracts` folder:

```
yarn deploy --network <network> --tags <the tags>
```

For deploying version `1.4.0` on Sepolia, you can run:

```
yarn deploy --network sepolia --tags v1.4.0,VerifyEnd,ConcludeEnd
```

This will generate a `deployed_contracts.json` file in the `packages/contracts` folder that will be used by this script to merge proposal actions. The proposal information will be included (for more details, check the first deployment step in the `01_Info.ts` file). You can modify this information as needed (elements like the proposal end date might need modification).

After deploying the framework, go to each plugin repository and run the deploy script:

```
yarn deploy --network <network> --tags <the tags>
```

For deploying and publishing a new version on Sepolia, you can run:

```
yarn deploy --network sepolia --tags NewVersion,Verification
```

This deployment will generate a `createVersionProposalData-network.json` file that you need to copy to the `./files-to-merge` folder.

Once you have both the `deployed_contracts.json` file and the plugin deployment json files, you can run this script to merge the proposal actions:

```
yarn generate-proposal-json
```

This will generate two files in the `./generated` folder:

- A `merged-proposals.json` file with all the proposal and deployment details
- A `calldata.json` file with the proposal information and the raw calldata

## Steps

1. Deploy the framework
2. Deploy the plugins
3. Copy the deployment json files to the `./files-to-merge` folder
4. Run the script to merge the proposal actions
5. The `./generated` folder will be created with the `merged-proposals.json` file and the `calldata.json` file

## Note

To test the deployment and the generated calldata, you can check the tests in the `test/deploy/deployment-1.4.0.ts` file. It will attempt to create, approve, and execute the proposal with the calldata generated by this script. This file is specific for checking the deployment of version `1.4.0`; you might need to modify it for other versions. Also, note that the test is forking the network, so you might need to adjust the network name and the fork block number.
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,6 @@ import * as path from 'path';

dotenv.config({path: path.resolve(__dirname, '../../.env')});

/**
* This script merges the plugin proposals actions inside the `proposalActionsPath` (./plugin-proposals-data) folder
* into the `mergedProposalActionsPath` (./merged-proposals.json) file.
*
* Steps
* 1- deploy all needed plugins
* 2- copy their deployment json files to the `scripts/plugin-proposals-data` folder
* 3- deploy the new osx version (this can be done before deploy the plugins) => this will create a `deployed_contracts.json` file
* 4- run this script to merge the calldata from each plugin and the framework deployment into a single file
*/

interface Action {
to: string;
value: number;
Expand Down

0 comments on commit cccd6af

Please sign in to comment.