Factory contracts for deploying the Hats DAO, using Aragon OSx Vote Escrow (VE) governance and configurable SubDAOs.
This repository contains:
- Main DAO Factory: Deploys Aragon OSx DAO with VE token governance and Hats Protocol integration
- SubDAO Factory: Deploys configurable SubDAOs with staged proposal processing (veto or approval mode)
- Install Foundry
- Clone the repository and install dependencies:
forge install
Compile all contracts:
forge buildRun all tests:
forge test --summary --jobs 1Important: Tests must be run with --jobs 1 (sequential execution) to ensure proper test isolation.
Run specific test suites:
# SubDAO tests
forge test --match-path "test/subdao/**/*.sol"
# Fork tests
forge test --match-path "test/fork/**/*.sol"
# Unit tests
forge test --match-path "test/unit/**/*.sol"Run with detailed output:
forge test --summary --jobs 1 -vvGenerate coverage report:
forge coverageConfiguration files are located in config/:
config/deployment-config.json- Main DAO configurationconfig/subdaos/- SubDAO configurations
Individual deployment scripts in script/:
DeployDao.s.sol- Main DAO deploymentDeploySubDao.s.sol- SubDAO deployment
For safe production deployments with manual verification checkpoints, use the orchestrator in script/orchestrator/:
01_DeployMainDao.s.sol- Step 1: Deploy Main DAO02_DeploySubDaos.s.sol- Step 2: Deploy SubDAOs
The orchestrator provides a two-step deployment process with a verification checkpoint between main DAO and SubDAO deployments. For complete instructions, see script/orchestrator/README.md.
├── src/ # Smart contracts
│ ├── VETokenVotingDaoFactory.sol
│ └── SubDaoFactory.sol
├── script/ # Deployment scripts
│ ├── DeployDao.s.sol
│ ├── DeploySubDao.s.sol
│ └── orchestrator/ # Production deployment orchestrator
├── test/ # Test files
│ ├── fork/ # Fork tests
│ ├── unit/ # Unit tests
│ ├── subdao/ # SubDAO tests
│ └── orchestrator/ # Integration tests
├── config/ # Configuration files
└── docs/ # Documentation
- Production Deployment Orchestrator - Safe two-step deployment guide
- Permissions Analysis - Permission structure analysis