Skip to content

Latest commit

Β 

History

History
103 lines (82 loc) Β· 5.95 KB

File metadata and controls

103 lines (82 loc) Β· 5.95 KB

🌟 Project Title: Pattern SubDAO Plugin

πŸ“œ Introduction

πŸ” This plugin is designed to enable the creation of sub-DAOs within a parent DAO, effectively allowing one decentralized autonomous organization (DAO) to act as a sub-entity of another. It's built on the Aragon platform, leveraging its robust framework for DAO operations. This functionality is crucial for complex governance structures, enabling hierarchical management and modular organization of decentralized communities or projects.

πŸŽ₯ Watch our tiny Demo Here: Watch the Demo

πŸš€ Features

πŸ”₯ The Pattern SubDAO Plugin offers a range of functionalities tailored for efficient DAO management and integration. Key features include:

  • Create New DAO: Facilitates the creation of new DAOs .
  • SubDAO Integration: Enables one DAO to become a subdao of another.
  • Compatibility with Plugins: Works in conjunction with both the official token voting plugin and the multisig plugin.
  • Plugin Settings Management: Allows for the update and management of settings in the mentioned plugins.
  • Integration Tests as Examples: Comes with integration tests that not only ensure reliability but also serve as practical examples for developers during coding.

βš™οΈ Installation

πŸ‘£ Follow these steps to install and set up the Pattern SubDAO Plugin:

  1. Navigate to the Scripts Directory: Change your current directory to ./scripts in your terminal.

    cd ./scripts
  2. Environment Setup: Rename the .env.example file to .env and update it with your specific details.

    mv .env.example .env
    # Edit the .env file with your detail
  3. Install Dependencies: Use bun to install necessary dependencies.

    bun install
  4. Run Plugin Installation: Execute the plugin installation command with the required parameters.

    bun plugininstall -n [NETWORK] -c [CHILD_DAO_ADDRESS_OR_ENS] -p [PARENT_DAO_ADDRESS_OR_ENS]

    Replace [NETWORK], [CHILD_DAO_ADDRESS_OR_ENS], and [PARENT_DAO_ADDRESS_OR_ENS] with the appropriate values for your setup. The pluginRepo has already been registered on Goerli, Mumbai and Polygon networks and you can use these network without any additonal steps.

    Network Plugin Repo Address
    goerli 0x44B7C01C5101bb94B4fA9A7f72c42bcAA87979Ca
    polygon 0x927273f4a0f1eb268c6a11c63882a57ce404f1c0
    polygonMumbai 0x1a8A1fcF888bB053da7baeF3F4c1C8129987CeCc

    To use the contract on other networks take the following steps:

    1. Navigate to the subdao-plugin directory
    2. Run yarn install
    3. Rename .env.example to .env
    4. Update the .env file with your credentials
    5. Add hardhat config per your need
    6. Add your plugin repo and rpc details to /src/lib/constants.ts
    7. Run yarn deploy --network [NETWORK_NAME]

πŸ“š How to Use

  1. Creating a DAO: Find the test script that demonstrates how to create a new DAO or simply create your DAO through Aragon interface.

  2. Making a DAO SubDAO of Another DAO: Run plugininstallation as mentioned in the Installation section.

  3. Add Approver to Multisig Plugin:

    bun changevotingsetting -c [CHILD_DAO_ADDRESS_OR_ENS] -p [PARENT_DAO_ADDRESS_OR_ENS] -n [NETWORK] -s [SUB_DAO_PLUGIN_ADDRESS] -f multisigAddAddresses '["NEW_MEMBER_ADDRESS_1","NEW_MEMBER_ADDRESS_2,...]'
  4. Remove Approvers from Multisig Plugin:

    bun changevotingsetting -c [CHILD_DAO_ADDRESS_OR_ENS] -p [PARENT_DAO_ADDRESS_OR_ENS] -n [NETWORK] -s [SUB_DAO_PLUGIN_ADDRESS] -f multisigRemoveAddresses '[NEW_MEMBER_ADDRESS_1,NEW_MEMBER_ADDRESS_2,...]'

    Replace [NETWORK], [CHILD_DAO_ADDRESS_OR_ENS], [PARENT_DAO_ADDRESS_OR_ENS], [SUB_DAO_PLUGIN_ADDRESS] and NEW_MEMBER_ADDRESS_$ with the appropriate values for your setup.

  5. Add Approver to Token Voting Plugin:

    bun changevotingsetting -c [CHILD_DAO_ADDRESS_OR_ENS] -p [PARENT_DAO_ADDRESS_OR_ENS] -n [NETWORK] -s [SUB_DAO_PLUGIN_ADDRESS] -f tokenVotingIncreaseAddressVotingPower '[NEW_MEMBER_ADDRESS_1,NEW_MEMBER_ADDRESS_2,...]' '[AMOUNT_1, AMOUNT_2,...]'

    Replace [NETWORK], [CHILD_DAO_ADDRESS_OR_ENS], [PARENT_DAO_ADDRESS_OR_ENS], [SUB_DAO_PLUGIN_ADDRESS], NEW_MEMBER_ADDRESS_$ and AMOUNT_$ with the appropriate values for your setup.

βœ… Test Scenarios

To understand how to interact with the contracts, navigate to the ./scripts/tests directory. Each test script serves as a practical guide, providing real code examples for these operations. Make sure to read through these scripts to get a clear understanding of how to effectively use the Pattern SubDAO Plugin's contract functionalities.

To execute the tests, run the following command:

   bun test

This test case encompasses the creation of a parent DAO and two child DAOs. The child DAOs are uniquely configured with distinct plugins: one child DAO is equipped with a Token Voting plugin, while the other has a Multisig plugin.

Additionally, the test case involves installing the SubDAO plugin on the child DAOs, enabling them to be effectively managed by the parent DAO.

  1. Add New Multisig Admin: This test case adds a new address as an admin to the Multisig plugin of one of the child DAOs. It ensures that the address is successfully added as a multisig admin.

  2. Remove Old Multisig Admin: This test case removes an existing address from the admin list of the Multisig plugin in one of the child DAOs. It checks that the address is no longer a multisig admin after removal.

  3. Mint New Token Voting: This test case mints new tokens for specified addresses in the Token Voting plugin of one of the child DAOs. It verifies that the balances of the specified addresses are updated accordingly.