A complete DAO (Decentralized Autonomous Organization) implementation built with Solidity, Hardhat, and React. This project demonstrates governance mechanisms, certificate management, and voting systems on the blockchain.
This DAO consists of:
- GovToken (GT): ERC20 governance token with voting capabilities
- MyGovernor: OpenZeppelin-based governor contract for proposal management
- TimeLock: Time-delayed execution controller for security
- Certificate (Cert): Certificate management system controlled by the DAO
βββββββββββββββ ββββββββββββββββ βββββββββββββββ
β GovToken ββββββ MyGovernor ββββββ TimeLock β
β (ERC20) β β (Governance) β β (Security) β
βββββββββββββββ ββββββββββββββββ βββββββββββββββ
β
βΌ
βββββββββββββββ
β Certificate β
β (Managed) β
βββββββββββββββ
- Node.js (v18+)
- npm or pnpm
-
Clone the repository
git clone <repository-url> cd dao-1
-
Install dependencies
npm install # or pnpm install -
Compile contracts
npx hardhat compile
-
Run tests
npx hardhat test
# Compile contracts
npx hardhat compile
# Run tests
npx hardhat test
# Start local node
npx hardhat node
# Deploy to local network
npx hardhat run scripts/deploy.js --network localhost
# Deploy to Sepolia testnet
npx hardhat run scripts/deploy.js --network sepolia# Navigate to UI directory
cd ui
# Install dependencies
npm install
# Start development server
npm run dev
# Build for production
npm run build- Symbol: GT
- Type: ERC20 + ERC20Permit + ERC20Votes
- Features: Governance voting, delegation, minting (owner only)
- Initial Supply: 1,000 GT tokens
- Voting Period: 45818 blocks (~1 week)
- Voting Delay: 7200 blocks (~1 day)
- Quorum: 4% of total supply
- Features: Proposal creation, voting, execution via TimeLock
- Min Delay: 0 seconds (configurable)
- Purpose: Secure execution of governance proposals
- Roles: Proposer, Executor, Admin
- Purpose: Certificate management system
- Owner: TimeLock contract (DAO-controlled)
- Features: Issue and manage certificates
- Token Distribution: Deploy GovToken and distribute to stakeholders
- Delegation: Token holders delegate voting power to themselves or others
- Proposal Creation: Create proposals to modify the Certificate contract
- Voting Period: Community votes on proposals
- Execution: Successful proposals are executed via TimeLock
The test suite covers:
- Token deployment and delegation
- Proposal creation and voting
- TimeLock execution
- Certificate management
- Full governance workflow
Run tests with detailed logs:
npx hardhat test --verboseThe UI folder contains a Vite + React application with:
- Material-UI components
- Web3 integration
- DAO interaction interface
npm install @mui/material @mui/icons-material @emotion/styled @emotion/react- TimeLock Controller: Prevents immediate execution of proposals
- Quorum Requirements: Ensures minimum participation
- Voting Delays: Allows time for community review
- Role-based Access: Secure permission management
- Localhost: Local Hardhat node
- Sepolia: Ethereum testnet
- Hardhat: Built-in test network
See hardhat.config.js for network settings and compiler configuration.
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests for new functionality
- Submit a pull request
This project is licensed under the ISC License.
# Generate SSH key
ssh-keygen -t ed25519 -C "your_email@example.com"
# Start SSH agent
eval "$(ssh-agent -s)"
# Add SSH key
ssh-add ~/.ssh/id_ed25519
# Copy public key
cat ~/.ssh/id_ed25519.pubBuilt with β€οΈ using OpenZeppelin, Hardhat, and React