Skip to content

Demion-L/web3-dao-app

Repository files navigation

DAO Voting Frontend

This project implements a frontend for a DAO (Decentralized Autonomous Organization) voting system, built on top of OpenZeppelin's governance contracts.

Overview

The system is built using OpenZeppelin's modular governance system, which allows for flexible and customizable on-chain voting protocols. The implementation includes:

Core Components

  1. Governor Contract

    • Core contract containing all governance logic and primitives
    • Abstract contract that requires implementation of specific modules
    • Handles proposal creation, voting, and execution
  2. Voting Modules

    • GovernorVotes: Extracts voting weight from an IVotes contract
    • GovernorVotesQuorumFraction: Sets quorum as a fraction of total token supply
    • GovernorVotesSuperQuorumFraction: Implements super quorum functionality
  3. Counting Modules

    • GovernorCountingSimple: Basic voting with 3 options (Against, For, Abstain)
    • GovernorCountingFractional: Advanced voting allowing partial voting power allocation
    • GovernorCountingOverridable: Extended version allowing delegate overrides

Key Features

  1. Voting System

    • Configurable voting delay and period
    • Flexible quorum requirements
    • Support for different voting mechanisms
    • Vote delegation capabilities
  2. Security Features

    • Reentrancy protection
    • Access control mechanisms
    • Timelock functionality for proposal execution
  3. Token Integration

    • ERC-20 token support for voting power
    • Token delegation system
    • Vote tracking and history

Technical Details

Voting Process

  1. Proposal Creation

    • Proposals can be created by token holders
    • Each proposal includes targets, values, and calldata
    • Proposals require a minimum threshold of voting power
  2. Voting Period

    • Configurable delay before voting starts
    • Set duration for voting period
    • Quorum requirements must be met
  3. Execution

    • Successful proposals can be executed after voting period
    • Optional timelock delay for execution
    • Execution through timelock controller

Configuration Options

  • votingDelay(): Time between proposal submission and voting start
  • votingPeriod(): Duration of the voting period
  • quorum(): Required voting power for proposal success
  • proposalThreshold(): Minimum voting power to create proposals

Development

Prerequisites

  • Node.js
  • Foundry
  • Solidity ^0.8.20

Setup

  1. Install dependencies:
npm install
  1. Configure environment variables in foundry folder (LOCAL_PRIVATE_KEY):
cp .env.example .env
  1. Run tests:
forge test

Security Considerations

  • All governance functions require proper access control
  • Timelock delays should be carefully configured
  • Quorum requirements should be set appropriately
  • Consider using OpenZeppelin's security features

License

MIT License

Getting Started

First, run the development server:

npm run dev


Open [http://localhost:3000](http://localhost:3000) with your browser to see the result.


## Learn More
npx -y @upstash/context7-mcp@latest

## Deployed to Vercel

https://web3-dao-app.vercel.app/

###Initial Distribution Strategy:

Keep 40% for DAO treasury Distribute 30% to founding members Reserve 20% for future contributors Use 10% for incentives/rewards

###Governance Participation:

Require token delegation for voting Set minimum proposal thresholds Create discussion forums Regular community calls

About

Decentalized vouting application

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors