This repository contains the EVM on-chain backend of the Homebase DAO application. The platform leverages OpenZeppelin's Governor framework for decentralized governance, allowing token holders to propose, vote, and execute changes in the DAO.
-
Governance Token (GovToken): ERC20 token with delegated voting functionality. Token holders can delegate their voting power to themselves or others in order to participate in governance.
-
Governor Contract (DAOContract): This contract manages the DAO's proposal and voting mechanisms. It allows users to propose changes, vote, and monitor the lifecycle of proposals (voting delay, voting period, etc.).
-
TimelockController: Acts as the DAO's treasury and enforces a delay on the execution of successful proposals. This ensures that executed actions are queued and not immediately enforceable, providing a buffer period for any last-minute interventions.
-
Target Contracts: These are the contracts whose functionality the DAO can modify or control via governance proposals.
-
Vote Delegation:
- Users must first delegate their votes to participate in governance. This can be done through the governance token contract by calling
delegate()
.
- Users must first delegate their votes to participate in governance. This can be done through the governance token contract by calling
-
Proposal Creation:
- Users submit a proposal via the
propose()
function on the DAO contract. The proposal includes thetargets
,values
,calldatas
, and adescription
of the actions to be executed on the target contracts.
- Users submit a proposal via the
-
Voting:
- Once the proposal is submitted, there is an initial voting delay. After this period, users can vote on the proposal using the
castVote()
function. The voting period lasts until a majority decision is reached, after which the proposal can either succeed or fail.
- Once the proposal is submitted, there is an initial voting delay. After this period, users can vote on the proposal using the
-
Queueing in Timelock:
- If a proposal succeeds, it is queued in the TimelockController via the
queue()
function. This initiates a delay period before the proposal can be executed.
- If a proposal succeeds, it is queued in the TimelockController via the
-
Execution:
- After the timelock delay, the proposal can be executed by calling
execute()
on the TimelockController. This triggers the actions described in the proposal on the target contracts.
- After the timelock delay, the proposal can be executed by calling
- Node.js: Ensure you have Node.js installed to interact with the repository.
- Hardhat: The project uses Hardhat for local development, testing, and deployment.
-
Clone the repository: ```bash git clone https://github.com/dOrgTech/homebase-evm-contracts ```
-
Install dependencies: ```bash cd homebase-evm-contracts npm install ```
Use the following Hardhat tasks to deploy the contracts:
- Deploy the governance token, DAO contract, and timelock: ```bash npx hardhat run scripts/deploy.js ```
This project is licensed under the MIT License.