🚨 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:
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
$ git clone --recurse-submodules -j8 https://github.com/EdsonAlcala/decentralized-governance-initiation.git
$ forge build
$ nvm use
$ yarn
$ yarn compile
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.
Requirement: genhtml
(e.g. sudo apt-get install lcov
)
./coverage.sh
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 |