Giter Club home page Giter Club logo

decentralized-governance-initiation's Introduction

Decentralized Governance Initiation

๐Ÿšจ Disclaimer: I'm not a lawyer and if you want to launch your governance using this approach, I recommend consulting with a lawyer.

Inspired by Tornado Cash's Governance Initiation

This repository contains a community driven governance initiation set of smart contracts. The project is developed with Foundry + Hardhat.

Most of the unit test are done using Foundry and some E2E scenarios with Hardhat. The project also contains some Hardhat tasks to generate the file required by the UI.

Essentially the community comes together and each party can deploy one of the smart contracts and once all the smart contracts are deployed, you will have full governance for your project.

The contracts are intended to be used in a user interface similar to:

Governance Initiation UI

The project includes:

  • Governance token
  • Governor contract
  • Timelock controller
  • Cross chain governance relayer (to propagate DAO decisions to other chains)
  • Vesting contracts
  • Airdrop with deadline contract
  • Treasury bootstrapping contract

Pre requisites

Getting started

$ git clone --recurse-submodules -j8 https://github.com/EdsonAlcala/decentralized-governance-initiation.git

$ forge build

$ nvm use

$ yarn

$ yarn compile

How it works

All the contracts are deployed using the CREATE2 opcode, which gives the ability to predict the final address of the contract. However, the smart contracts require certain parameters during creation. That leads to a chicken an egg problem with dependencies.

For instance, the Cora token requires a set of recipients, which includes the governor contract (the DAO), and the governor contract requires the token contract address. In order to solve the problem we use an intermediate contract that works as a registry (GovernanceInitiationData). Then, we simply populate the GovernanceInitiationData and pass that to all the contracts. In that way, all the contracts depend only on the GovernanceInitiationData dependency and their addresses can be calculated before they are deployed.

You can learn the full process in the deploy/deploy_all.ts file.

Code coverage

Requirement: genhtml (e.g. sudo apt-get install lcov)

./coverage.sh

Projects using it

Deployed addresses

The deployed addresses of the Cora project can be found at:

Name Address (Arbiscan Link)
Cora Token Arbiscan Link
Cora Governor Arbiscan Link
Cora Timelock Arbiscan Link
Message Relayer Arbiscan Link
TreasuryBootstrapping Arbiscan Link
DAO Vesting Arbiscan Link
Team Vesting Arbiscan Link
MerkleDistributorWithDeadline Arbiscan Link
GovernanceInitiationData Arbiscan Link

decentralized-governance-initiation's People

Contributors

edsonalcala avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.