Utilizing a Chain Fusion Governance Module (CGM)
This section serves as a follow-along guide to utilizing the CGM. For easier reading, two separate guides are provided for the two Archetypes, the ICP Treasury and the Chain Fusion Treasury Hub. However the general user flow is very similar. To follow this guide, no prior experience with creating proposals within DAOs on Q is assumed. However, there are some prerequisites to be able to follow this quide.
- You should have deployed, or be involved in an existing DAO with either an ICP treasury, or a Chain Fusion Treasury Hub. If this is not the case, please refer to the guide for setting up such DAO.
- You should have been onboarded as a DAO member to this DAO and have the permission to create proposals regarding the CGM. This means that you at least own some (fraction of) DAO Tokens.
- You should own some Q Tokens for gas.
Step-by-step Demo
Preparation: Getting Proposal Permissions
If you already have some voting power in the DAO, you can skip this step.
Make sure that you are connected with the address, that holds the DAO token.
Approve & deposit theDAO tokens to get voting power
(This step requires signing two transactions. If your DAO already has a Constitution, you will also have to sign the constitution)You are now the proud member of a DAO that utilizes a CGM, or deployed one just for yourself. Let's get started!
Demo “ICP Treasury”
The following steps will take place in the "Governance" section of your DAO. You can navigate to this section on the left side in the DAO HQ
- Create a “ICP Treasury Module Voting” Proposal. When creating the proposal, select if you want to transfer native ICP tokens, or another ICRC token. Provide the following information: (This step requires signing one transaction)
- Token ID of the token you want to send (pre-set when choosing to transfer ICP tokens)
- The recipient’s principal ID when transferring ICRC tokens or the recipient account’s address for native ICP transfers.
- The amount of tokens to transfer (without decimals, so for transferring 1 ICP, enter 100000000 (10^8)).
- Click on the proposal you just created and make sure to vote on the proposal on time. To Vote, click on the green "Vote" button in the top right. You will see the remaining time in the "Voting" block. (Voting requires signing one transaction)
- Wait for the proposal to pass, then execute the proposal on Q to finalize it. The "Execute" button will appear at the same place the "Vote" button was. If you don't see the button, refresh the page and make sure that both the Voting, and the Veto Period are over. (Proposal Execution requires signing one transaction)
- Execute the transaction on ICP. Therefore, just klick on the "Execute on ICP" button that appeared where the "Execute" and "Vote" buttons were. This executes the last proposal.
- If you for some reason forgot to "Execute on ICP" and multiple ICP Treasury Proposals have passed in the meantime, you can execute a specific proposal on the Canister Interface (Candid UI). To go to this interface, open the menu with the three little dots to the left of the Button and click on "See all Canister Functions".
- Then “CALL” icp_execute_message with the respective message ID. Be aware, that only successful proposals can be executed by the canister. Hence, the canister side message ID can differ from the DAO proposal ID.
- To check if a message was executed correctly, you can check the new balance of the recipient or the ICP Treasury canister on the token ledger canister or in the ICP explorer. You can see which token was sent, when looking at the proposal details in the DAO HQ. The Screenshots below are taken from the token canister.
Demo “Foreign Chain Treasury via Chain Fusion Treasury Hub”
At this stage, we assume the user is already onboarded to the DAO and knows how to create a proposal. Hence, this demo focusses on the differences to the demo above and omits redundancies like acquiring voting power and voting on the proposal.
Again, this guide starts in the "Governance" section of your DAO. You can navigate to this section on the left side in the DAO HQ
Create a Chain Fusion Treasury Hub Proposal and select whether you want to transfer the foreign-chain’s native token or specific ERC20 token. The Picture below demonstrates an ERC20 transfer, but the flow to transfer native tokens will be identical with the sole difference, that no token address needs to be provided. (This step requires signing a transaction)
- Note: When creating the proposal, pay attention to the Decimals of the token you want to send and add the matching number of trailing zeros. (i.e. 18 decimals for most tokens, including ETH, but 8 for USDC and 6 for WBTC)
- Note: When creating the proposal, pay attention to the Decimals of the token you want to send and add the matching number of trailing zeros. (i.e. 18 decimals for most tokens, including ETH, but 8 for USDC and 6 for WBTC)
Click on the proposal you just created and make sure to vote on the proposal on time. To Vote, click on the green "Vote" button in the top right. You will see the remaining time in the "Voting" block. (Voting requires signing one transaction)
Wait for the proposal to pass, then execute the proposal on Q to finalize it. The "Execute" button will appear at the same place the "Vote" button was. If you don't see the button, refresh the page and make sure that both the Voting, and the Veto Period are over. (Proposal Execution requires signing one transaction)
Execute the transaction on ICP to transmit the proposal result onto the foreign chain. Therefore, just klick on the "Execute on ICP" button that appeared where the "Execute" and "Vote" buttons were. This executes the last proposal.
- If you for some reason forgot to "Execute on ICP" and multiple ICP Treasury Proposals have passed in the meantime, you can execute a specific proposal on the Canister Interface (Candid UI). To go to this interface, open the menu with the three little dots to the left of the Button and click on "See all Canister Functions".
- Then “CALL” evm_execute_message with the respective message ID. Be aware, that only successful proposals can be executed by the canister. Hence, the canister side message ID can differ from the DAO proposal ID.
To check if a message was executed correctly, you can look for the transaction on the foreign chain. There is multiple equivalent ways to do this. One is to check the latest transactions of the Token you sent. Another is checking the new balance of the recipient on the foreign chain or directly on the foreign-chain. To do this, you can use your preferred explorer of the foreign-chain.
- You can get the token or recipient address from the proposal. The foreign-chain treasury address is best found from your initial configuration proposal from setting up the CGM. You can also check the EVM address of the Chain Fusion Treasury Hub canister, when calling eth_address on the canister.