Skip to main content

Setting up the CGM

Each journey starts with a first step. The prerequisite to utilizing the Chain Fusion Governance Module (CGM) is adding it to a DAO that needs it, or even creating a new DAO that shall manage the CGM. The guide below explains how to get started from scratch You can find links to the source code of all utilized components in the CGM Architecture section.

Guide

  1. Deploy a DAO with the ICP Treasury Module or the Chain Fusion Treasury Hub Module on Q
    1. It is possible to deploy a DAO Manually using the GDK-SDK, or via https://factory.q-dao.tools/
    2. The modules can be added during DAO deployment, no matter which path you chose. When going through the factory, you need to deploy the respective DAO Module Smart Contracts first and then during the step 'Add Modules to your DAO', select 'I already deployed my own module' provide the address of the deployed contract. When deploying through the GDK CLI you can deploy the module directly with the DAO in one go.
    3. It's also possible to add the DAO Module to any existing DAO. Therefore, you need to deploy the DAO Module Smart Contract and create multiple proposals. A tool to guide through this process will be provided soon.
  1. Deploy the backend-canisters on ICP and initialize them. For each canister, the init.did file needs to be modified to inlude:
    1. The respective DAO Module Smart Contract address on Q
    2. initial RPCs to use for communication to Q
    3. initial principal IDs allowed to configure the canisters (your own, or of contributors.)
  1. Add, or update the DAO Parameters "ICP Treasury Module Voting.DAO Token Holder.canisterId" and "Chain Fusion Treasury Hub Module Voting.DAO Token Holder.canisterId" with a link to each respective Canister. On ICP, each canister has it's own link which you will see in the console when deploying the canisters. You can do so via a Constituiton Update Proposal in your DAO. These parameters are neededfor the DAO Dashbord, but do not impact any functionality of smart contracts or canisters on Q and ICP respectively. In addition, the parameters also improve transparency to the DAO members with respect to the DAO components.

  2. If deploying the Chain Fusion Treasury Hub, deploy the treasury contract on the foreign chain. If you're following this guide, to deploy an ICP Treasury, you can skip this step. Note: The Chain Fusion Treasury Hub Module and Chain Fusion Treasury Hub canister are configured to allow multiple treasuries on multiple EVM-Chains being controlled via the same CGM. To add additional treasuries, repeat the following steps:

    1. Deploy the treasury smart contract on the foreign chain
    2. Configure the treasury smart contract to accept calls from the Chain Fusion Treasury Hub canister. To do this, add the Chain Fusion Treasury Hub canister's EVM address as an owner, by using the 'addOwners' function of the contract. You can get the canister’s EVM address by calling “eth_address” on the canister. Make sure to remove your personal address that you used for deloyment through the 'removeOwners' function to fully decentralize your DAO.
    3. In the DAO’s Chain Fusion Treasury Hub Module, register the treasury you deployed through a Chain Fusion Treasury Hub Module Vote (Creating a DAO Proposal). Chose “setDestinationChainData” as the function to call and provide a chain identifier for the foreign-chain (text), the chain’s RPC you intend to use and the address of the treasury contract on the foreign-chain. Make sure to use a stable RPC, that supports IPv6. For example Alchemy.
    4. Execute the Proposal on Q and again on ICP to also register the new treasury to on the Chain Fusion Treasury Hub canister. This calls the “sync_foreign_chain_data” function on the canister.
  3. Fund the relevant contracts on the foreign chain and the canister on ICP to pay for transaction fees. Depending on the amount you fund each contract and the usage of the CGM, this step needs to be repeated periodically.

    1. Fund the ICP Treasury canister or the Chain Fusion Treasury Hub canister on ICP with cycles for gas.
    2. Fund the Chain Fusion Treasury Hub canister ‘s EVM address on each foreign-chain with the respective gas tokens.
    3. Fund each treasury with tokens to transfer (Native or ERC20 for EVM foreign-chain treasuries, ICP tokens or other ICRC tokens for the ICP Treasury canister). For the case you are using a local deployment of ICP for testing, you can use this guide to create a token on ICP
  4. Onboard users to the DAO

  5. Ready to use!