npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

gdk-contracts

v1.1.0

Published

Smart Contracts for GDK

Downloads

43

Readme

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 already battle tested for the governance of the Q blockchain itself, you can set up your organization around a community, set dedicated roles and responsibilities and define the rules that govern your DAO.

GDK Purpose

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

The GDK will give you the ability to organize any Governance over the DAO as you want, 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:

  • Set up governance with a Permission Manager
  • Deploy your own ERC20 or/and ERC721 tokens
  • Deploy Expert Panels responsible for specific areas (DeFi, Bridge, Incentives, etc.)
  • Manage 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 of 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 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.

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 is 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.
  5. Token Factory, where you can deploy your own ERC20 and/or ERC721 tokens.
    • Contracts: TokenFactory and TokenRegistry.
  6. Voting Factory, with which you can deploy voting contracts, where the voting token can be ERC20 or Native Q, or ERC721.
    • Contracts: VotingFactory and Registry.

Token and voting implementations are registered during DAO deployment.


When any contract is deployed through the factory, it is registered in the corresponding registry contract(i.e., if a new token is deployed through the Token Factory contract, it will be registered in the TokenRegistry contract); also, by default, only the BeaconProxy contract is deployed, which looks at implementations in the DAO main registry contracts.

Usage

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

npx hardhat migrate --network <network>

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

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

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

Thanks for creating a DAO with Q!