@q-dev/gdk-contracts

1.4.12 • Public • Published

Q Governance SDK

These are the basic contracts of the GDK, a system with which you can build your own DAO.

Overview

You can use the Q GDK to set up your DAO in a simple and quick fashion. As it has already been battle-tested for the governance of the Q blockchain itself, you can establish your organization around a community, assign dedicated roles and responsibilities, and define the rules that govern your DAO.

GDK Purpose

Simply put, the GDK allows you to create a one-click DAO in which you can create your tokens, voting rules, contract infrastructure, etc.

The GDK will enable you to organize any Governance over the DAO as you wish, distribute responsibilities among Expert Panels (there can be zero or as many as you wish), release your tokens, both ERC20 and ERC721, have voting in which those tokens are considered voting rights, and much more.

With this system, you will have options such as:

  • Setting up governance with a Permission Manager
  • Deploying your own ERC20, ERC721, and/or SBT upgradable tokens
  • Deploying Expert Panels responsible for specific areas (DeFi, Bridge, Incentives, etc.)
  • Managing your own contracts through the DAO Registry and much more.

Architecture

In this section, we will look at the features of the GDK core and how all the above has been achieved.

For this journey, you should remember the following:

All contracts in the system are resources.

Over each resource, you can perform actions.

We will encounter this concept many times during our review of contracts.

How it Works

In this section, we will discuss key aspects of the GDK, its successes, and its potential now and in the future.

The Starting Point

It all starts with the MasterContractsRegistry and MasterAccessManagement contracts. These contracts help us keep the DAO-building contracts in one place.

These are the accessory contracts:

  • MasterDAOFactory.
  • MasterDAORegistry.
  • TokenFactory.

The MasterDAORegistry contract stores all the building blocks (contract implementations) of the DAO.

Basically, during the preparation (the initial deployment of GDK contracts), all contracts used in the creation of the DAO are deployed and stored in the Master DAO Registry.

And MasterDAOFactory uses these blocks to deploy the entire DAO simultaneously.

In the initial deployment phase, you will have contracts such as:

  1. A Contract Registry through which you can manage your own DAO contracts.
    • Contracts: DAORegistry.
  2. Permission Manager, the heart of the DAO, through which you will set up your own roles for the DAO (who can vote, mine, burn tokens, etc.).
    • Contracts: PermissionManager.
  3. Vault, a contract used by voting contracts to lock the user's deposited tokens for the voting period.
    • Contracts: DAOVault.
  4. Parameter and Member Storage, where the parameters and members of a particular panel are stored.
    • Contracts: DAOMemberStorage and DAOParameterStorage.

Usage

To deploy the whole system, you could run the following command:

npx hardhat migrate --network <network>

Where <network> is the network name where you want to deploy the contracts.

To learn more about the migrate command, please refer to the @dl-solarity/hardhat-migrate documentation.

Also, you could see the integration tests in the GDK SDK repository for interaction with the GDK contracts.

Thanks for Creating a DAO with Q!

Package Sidebar

Install

npm i @q-dev/gdk-contracts

Weekly Downloads

9

Version

1.4.12

License

LGPL-3.0-or-later

Unpacked Size

346 kB

Total Files

58

Last publish

Collaborators

  • aostrun
  • tynuk
  • misterzett
  • tbltzk