Skip to content

EdsonAlcala/decentralized-governance-initiation

Repository files navigation

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

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published