# DAOFactory Contract Source: https://docs.createdao.org/contracts/dao-factory Reference for the DAOFactory.sol contract in CreateDAO v2. Source: [`contracts/DAOFactory.sol`](https://github.com/createDAO/v2-core) The `DAOFactory` is the central deployment contract for CreateDAO v2. It deploys complete DAO governance systems using the **EIP-1167 minimal proxy (Clones) pattern** for gas efficiency. ## Overview The factory contains implementation contracts for **DAOToken**, **DAOGovernor**, and **DAOTimelock**, deployed once. When creating a new DAO, it clones these implementations (EIP-1167) and initializes them so the three contracts work together as a complete governance system. ## Key Concepts ### EIP-1167 Minimal Proxies (Clones) Instead of deploying full contract bytecode for each DAO, the factory uses OpenZeppelin's `Clones` library to create minimal proxy contracts (only 45 bytes each!) that delegate all calls to shared implementation contracts. **Benefits:** * **Massive Gas Savings**: Each proxy is only 45 bytes vs \~15KB+ for full contracts * **Factory Size**: Keeps factory under the 24KB contract size limit * **Immutable**: Proxies are not upgradeable - they permanently point to their implementation * **Identical Behavior**: Function identically to full contracts ### Deterministic Deployment (CREATE2) The factory itself is deployed using Arachnid's deterministic CREATE2 deployer, which means: * **Same address across chains** when using the same salt * **Predictable addresses** before deployment * **Easy multi-chain deployment** ## Architecture ```mermaid theme={null} flowchart TD Factory[DAOFactory] subgraph Constructor["Constructor (runs once)"] direction LR TokenImpl[tokenImplementation = new DAOToken] GovImpl[governorImplementation = new DAOGovernor] end subgraph CreateDAO["createDAO()"] direction TB CloneToken[Clone DAOToken → 45 bytes proxy] CloneTimelock[Clone DAOTimelock → 45 bytes proxy] CloneGovernor[Clone DAOGovernor → 45 bytes proxy] ConfigRoles[Configure roles and permissions] DistributeTokens[Distribute tokens: 1% creator, 99% treasury] CloneToken --> CloneTimelock CloneTimelock --> CloneGovernor CloneGovernor --> ConfigRoles ConfigRoles --> DistributeTokens end Factory --> Constructor Factory --> CreateDAO ``` ## Key Functions ### `createDAO` ```solidity theme={null} function createDAO( string memory daoName, string memory tokenName, string memory tokenSymbol, uint256 totalSupply, uint48 votingDelay, uint32 votingPeriod ) external returns ( address token, address timelock, address governor ); ``` Deploys a complete DAO system in a single transaction. **Parameters:** * `daoName`: Name of the DAO (used for Governor) * `tokenName`: Name of the governance token (e.g., "My DAO Token") * `tokenSymbol`: Token symbol (e.g., "MYD") * `totalSupply`: Total token supply in wei (e.g., `1000000 * 10^18` for 1M tokens) * `votingDelay`: Delay before voting starts (seconds, e.g., `86400` = 1 day) * `votingPeriod`: Duration of voting period (seconds, e.g., `604800` = 1 week) **Returns:** * `token`: Address of the DAOToken proxy * `timelock`: Address of the DAOTimelock proxy (treasury) * `governor`: Address of the DAOGovernor proxy **Process:** 1. **Clone DAOToken** (EIP-1167) * Creates minimal proxy pointing to `tokenImplementation` * Initializes with name, symbol, and total supply * Mints all tokens to the factory temporarily 2. **Clone DAOTimelock** (EIP-1167) * Creates minimal proxy pointing to `timelockImplementation` * Initializes the timelock delay and admin * Executors: `address(0)` (anyone can execute after delay) * Admin: factory (temporarily, revoked later) 3. **Clone DAOGovernor** (EIP-1167) * Creates minimal proxy pointing to `governorImplementation` * Initializes with name, token address, and timelock address * Sets initial manager to `msg.sender` (DAO creator) * Configures voting delay, voting period, quorum (1%), and proposal threshold (1%) 4. **Configure Roles** * Grants `PROPOSER_ROLE` to Governor (only Governor can propose timelock actions) * Grants `CANCELLER_ROLE` to Governor * Revokes `ADMIN_ROLE` from factory (Governor becomes sole admin via timelock) 5. **Distribute Tokens** * Transfers 1% to `msg.sender` (creator) - auto-delegated * Transfers 99% to timelock (treasury) 6. **Record & Emit** * Stores DAO info in `daos` array * Emits `DAOCreated` event ### View Functions #### `getDAOCount` ```solidity theme={null} function getDAOCount() external view returns (uint256); ``` Returns the total number of DAOs created by this factory. #### `getDAOByIndex` ```solidity theme={null} function getDAOByIndex(uint256 index) external view returns (DAOInfo memory); ``` Returns information about a specific DAO by its index. **Returns:** `DAOInfo` struct containing: * `name`: DAO name * `token`: Token address * `governor`: Governor address * `timelock`: Timelock address * `creator`: Address that created the DAO * `createdAt`: Timestamp of creation #### `getImplementations` ```solidity theme={null} function getImplementations() external view returns ( address tokenImpl, address governorImpl ); ``` Returns the addresses of the implementation contracts used for cloning. :::note The current factory version also exposes `timelockImplementation()`. ::: ## Events ### `DAOCreated` ```solidity theme={null} event DAOCreated( address indexed creator, address indexed token, address indexed governor, address timelock, string name, uint256 totalSupply ); ``` Emitted when a new DAO is successfully created. ## Token Distribution When a DAO is created, tokens are distributed as follows: | Recipient | Percentage | Purpose | | ---------------------- | ---------- | ---------------------------------------------------------------------------- | | Creator (`msg.sender`) | 1% | Bootstrap governance - enables meeting quorum and creating initial proposals | | Treasury (DAOTimelock) | 99% | Secure storage - distributed through governance proposals | The 1% allocation is carefully chosen because: * OpenZeppelin's `GovernorVotesQuorumFraction` requires minimum 1% quorum * Creator needs exactly 1% to meet quorum and pass initial proposals * After initial setup, creator can propose token distribution to other members ## Auto-Delegation DAOToken implements auto-delegation, which means: * When an address receives tokens **for the first time**, they automatically delegate to themselves * Voting power is immediately active - no manual `delegate()` call needed * This applies to the creator and all future token recipients ## Manager Role The DAOGovernor contract includes a special `manager` address: * **Initial Value**: Set to the DAO creator (`msg.sender`) * **Purpose**: On-chain authorization for off-chain operations * **How to Change**: Only through governance proposals (timelock-protected) * **Use Case**: Integration with DAO management platforms like [OpenBook](https://openbook.so) Backend systems can query the manager address: ```solidity theme={null} address currentManager = governor.manager(); ``` And verify authorization: ```javascript theme={null} if (requestingWallet !== currentManager) { throw new Error("Not authorized"); } ``` ## Gas Optimization The Clones pattern provides significant gas savings: | Component | Traditional Deployment | With Clones | Savings | | ------------- | ---------------------- | -------------- | ------- | | DAOToken | \~2.5M gas | \~150K gas | **94%** | | DAOGovernor | \~4M gas | \~200K gas | **95%** | | **Total DAO** | **\~8M gas** | **\~2.5M gas** | **69%** | ## Example Usage ```javascript theme={null} import { ethers } from 'ethers'; // Connect to factory const factory = await ethers.getContractAt( "DAOFactory", "0x742236f55a5e43B1AAec404527cE6986E02cD700" // Ethereum mainnet ); // Create a DAO const tx = await factory.createDAO( "My Community DAO", // daoName "My Community Token", // tokenName "MCT", // tokenSymbol ethers.parseEther("1000000"), // 1M tokens 86400, // 1 day voting delay 604800 // 1 week voting period ); const receipt = await tx.wait(); // Parse the DAOCreated event const event = receipt.logs.find( log => log.fragment?.name === 'DAOCreated' ); console.log("Token:", event.args.token); console.log("Governor:", event.args.governor); console.log("Timelock:", event.args.timelock); ``` ## Security Considerations 1. **Immutable Proxies**: The clones are not upgradeable. Once deployed, they always point to the same implementation. 2. **Implementation Protection**: Implementation contracts call `_disableInitializers()` in their constructor, preventing anyone from initializing them directly. 3. **Role Configuration**: The factory carefully configures timelock roles and revokes its own admin access, ensuring only the Governor can control the timelock. 4. **Deterministic Addresses**: Using CREATE2 for factory deployment enables verification of factory authenticity across chains. ## Deployed Addresses See the [Deployed Contracts](/deployed-contracts) page for factory addresses on all supported networks. ## Source Code View the complete source code on GitHub: * [DAOFactory.sol](https://github.com/createDAO/v2-core/blob/main/contracts/DAOFactory.sol) * [DAOToken.sol](https://github.com/createDAO/v2-core/blob/main/contracts/DAOToken.sol) * [DAOGovernor.sol](https://github.com/createDAO/v2-core/blob/main/contracts/DAOGovernor.sol) # Deployed Contracts Source: https://docs.createdao.org/deployed-contracts Addresses of the CreateDAO v2 contracts on supported networks. # Deployed Contracts This page lists the official addresses for CreateDAO v2 contracts on supported blockchain networks. All contracts use deterministic CREATE2 deployment for consistent addresses across networks. CreateDAO v2 is a complete rewrite using OpenZeppelin Governor. These addresses are NOT compatible with v1 contracts. ## Contract Architecture Each network has: 1. **DAOFactory** - The main factory contract for creating new DAOs 2. **DAOToken Implementation** - Shared implementation for all DAO tokens (EIP-1167 clones) 3. **DAOGovernor Implementation** - Shared implementation for all governors (EIP-1167 clones) 4. **DAOTimelock Implementation** - Shared implementation for all DAO timelocks (EIP-1167 clones) When you create a DAO, the factory creates minimal proxies (45 bytes each) that delegate to these implementations. *** ## Mainnet Deployments ### Ethereum (Mainnet) | Contract | Address | Explorer Link | | -------------------------- | -------------------------------------------- | -------------------------------------------------------------------------------------------- | | **DAOFactory** | `0xc852E5Cb44C50614a82050163aB7170cB88EB5F9` | [View on Etherscan](https://etherscan.io/address/0xc852E5Cb44C50614a82050163aB7170cB88EB5F9) | | DAOToken Implementation | `0x4516F43c475A4c469367A1AfD2998FC30CF8C3B6` | [View on Etherscan](https://etherscan.io/address/0x4516F43c475A4c469367A1AfD2998FC30CF8C3B6) | | DAOGovernor Implementation | `0xC6Ee7F3D2D3BbA67d0a2a6562d5b6A416e390141` | [View on Etherscan](https://etherscan.io/address/0xC6Ee7F3D2D3BbA67d0a2a6562d5b6A416e390141) | | DAOTimelock Implementation | `0xf8354d8F218cE905ddf3a24c88F3358ece319373` | [View on Etherscan](https://etherscan.io/address/0xf8354d8F218cE905ddf3a24c88F3358ece319373) | **Example DAO on Ethereum:** | Contract | Address | Explorer Link | | ----------------------------- | -------------------------------------------- | -------------------------------------------------------------------------------------------- | | DAOToken (Proxy) | `0x819b17cd5df5F9F9d99a28e800FFB32699c66C62` | [View on Etherscan](https://etherscan.io/address/0x819b17cd5df5F9F9d99a28e800FFB32699c66C62) | | DAOGovernor (Proxy) | `0x39Ff10A0eb805695fdA6f3BacD17eF6B01C17294` | [View on Etherscan](https://etherscan.io/address/0x39Ff10A0eb805695fdA6f3BacD17eF6B01C17294) | | TimelockController (Treasury) | `0x1dD03B88D166694073308685F8a2c57b46987300` | [View on Etherscan](https://etherscan.io/address/0x1dD03B88D166694073308685F8a2c57b46987300) | ### Arbitrum One | Contract | Address | Explorer Link | | -------------------------- | -------------------------------------------- | ------------------------------------------------------------------------------------------ | | **DAOFactory** | `0xc852E5Cb44C50614a82050163aB7170cB88EB5F9` | [View on Arbiscan](https://arbiscan.io/address/0xc852E5Cb44C50614a82050163aB7170cB88EB5F9) | | DAOToken Implementation | `0x4516F43c475A4c469367A1AfD2998FC30CF8C3B6` | [View on Arbiscan](https://arbiscan.io/address/0x4516F43c475A4c469367A1AfD2998FC30CF8C3B6) | | DAOGovernor Implementation | `0xC6Ee7F3D2D3BbA67d0a2a6562d5b6A416e390141` | [View on Arbiscan](https://arbiscan.io/address/0xC6Ee7F3D2D3BbA67d0a2a6562d5b6A416e390141) | | DAOTimelock Implementation | `0xf8354d8F218cE905ddf3a24c88F3358ece319373` | [View on Arbiscan](https://arbiscan.io/address/0xf8354d8F218cE905ddf3a24c88F3358ece319373) | **Example DAO on Arbitrum:** | Contract | Address | Explorer Link | | ----------------------------- | -------------------------------------------- | ------------------------------------------------------------------------------------------ | | DAOToken (Proxy) | `0x0E737CDfa20F404d76A0D7fB0c657bbe1027cbA5` | [View on Arbiscan](https://arbiscan.io/address/0x0E737CDfa20F404d76A0D7fB0c657bbe1027cbA5) | | DAOGovernor (Proxy) | `0x857566729C7a1633d4BFEEfeaCC93ea91EC2D530` | [View on Arbiscan](https://arbiscan.io/address/0x857566729C7a1633d4BFEEfeaCC93ea91EC2D530) | | TimelockController (Treasury) | `0x01Ac081d687041541Bb0C14F90Ab1a40f7090040` | [View on Arbiscan](https://arbiscan.io/address/0x01Ac081d687041541Bb0C14F90Ab1a40f7090040) | *** ## Testnet Deployments ### Sepolia (Ethereum Testnet) | Contract | Address | Explorer Link | | -------------------------- | -------------------------------------------- | ---------------------------------------------------------------------------------------------------- | | **DAOFactory** | `0xc852E5Cb44C50614a82050163aB7170cB88EB5F9` | [View on Etherscan](https://sepolia.etherscan.io/address/0xc852E5Cb44C50614a82050163aB7170cB88EB5F9) | | DAOToken Implementation | `0x4516F43c475A4c469367A1AfD2998FC30CF8C3B6` | [View on Etherscan](https://sepolia.etherscan.io/address/0x4516F43c475A4c469367A1AfD2998FC30CF8C3B6) | | DAOGovernor Implementation | `0xC6Ee7F3D2D3BbA67d0a2a6562d5b6A416e390141` | [View on Etherscan](https://sepolia.etherscan.io/address/0xC6Ee7F3D2D3BbA67d0a2a6562d5b6A416e390141) | | DAOTimelock Implementation | `0xf8354d8F218cE905ddf3a24c88F3358ece319373` | [View on Etherscan](https://sepolia.etherscan.io/address/0xf8354d8F218cE905ddf3a24c88F3358ece319373) | **Example DAO on Sepolia:** | Contract | Address | Explorer Link | | ----------------------------- | -------------------------------------------- | ---------------------------------------------------------------------------------------------------- | | DAOToken (Proxy) | `0xe7B56A39C430B9F993cf7954e1EeFA83a9d154dF` | [View on Etherscan](https://sepolia.etherscan.io/address/0xe7B56A39C430B9F993cf7954e1EeFA83a9d154dF) | | DAOGovernor (Proxy) | `0x944B6217582B731c27890Df7Af52Ad8eA8a934e2` | [View on Etherscan](https://sepolia.etherscan.io/address/0x944B6217582B731c27890Df7Af52Ad8eA8a934e2) | | TimelockController (Treasury) | `0xA11828FD53c4ca7Fa54a1ECbfef88EAFAe3906C1` | [View on Etherscan](https://sepolia.etherscan.io/address/0xA11828FD53c4ca7Fa54a1ECbfef88EAFAe3906C1) | *** ## Deterministic Deployment Details All CreateDAO v2 contracts use CREATE2 for deterministic deployment, ensuring consistent addresses across networks. **CREATE2 Configuration:** ``` CREATE2 Deployer: 0x4e59b44847b379578588920cA78FbF26c0B4956C Salt Label: production_1 ``` This means the DAOFactory address is **identical across all supported networks** when deployed with the same salt. *** ## Verifying Contract Authenticity ### Method 1: Check Factory Address The official Ethereum DAOFactory address is: ``` 0xc852E5Cb44C50614a82050163aB7170cB88EB5F9 ``` Always verify you're interacting with this address on the correct network. ### Method 2: Query Implementation Addresses You can verify the implementation addresses programmatically: ```javascript theme={null} import { ethers } from 'ethers'; const factory = await ethers.getContractAt( "DAOFactory", "0xc852E5Cb44C50614a82050163aB7170cB88EB5F9" ); const tokenImpl = await factory.tokenImplementation(); const governorImpl = await factory.governorImplementation(); const timelockImpl = await factory.timelockImplementation(); console.log("Token Implementation:", tokenImpl); console.log("Governor Implementation:", governorImpl); console.log("Timelock Implementation:", timelockImpl); ``` Expected results: * Token: `0x4516F43c475A4c469367A1AfD2998FC30CF8C3B6` * Governor: `0xC6Ee7F3D2D3BbA67d0a2a6562d5b6A416e390141` * Timelock: `0xf8354d8F218cE905ddf3a24c88F3358ece319373` ### Method 3: Verify Source Code All contracts have verified source code on block explorers: 1. Visit the contract on the explorer 2. Click the **"Contract"** tab 3. Verify source code is visible and matches the [GitHub repository](https://github.com/createDAO/v2-core) *** ## Understanding Your DAO's Contracts When you create a DAO using the factory, you get three contracts: ### 1. DAOToken (EIP-1167 Proxy) * **Type**: Minimal proxy (45 bytes) * **Delegates to**: DAOToken Implementation * **Functionality**: ERC20 governance token with auto-delegation * **Your Instance**: Each DAO gets its own isolated proxy ### 2. DAOGovernor (EIP-1167 Proxy) * **Type**: Minimal proxy (45 bytes) * **Delegates to**: DAOGovernor Implementation * **Functionality**: Governance with OpenZeppelin extensions + Manager role * **Your Instance**: Each DAO gets its own isolated proxy ### 3. DAOTimelock (EIP-1167 Proxy) * **Type**: Minimal proxy (45 bytes) * **Delegates to**: DAOTimelock Implementation * **Functionality**: Treasury + execution delay * **Holds**: 99% of your DAO's token supply *** ## Integration Examples ### Connect to Factory ```javascript theme={null} import { createPublicClient, http } from 'viem'; import { mainnet } from 'viem/chains'; const client = createPublicClient({ chain: mainnet, transport: http() }); const FACTORY_ADDRESS = '0xc852E5Cb44C50614a82050163aB7170cB88EB5F9'; // Read DAO count const daoCount = await client.readContract({ address: FACTORY_ADDRESS, abi: DAOFactoryABI, functionName: 'getDAOCount' }); ``` ### Verify Manager ```javascript theme={null} // Check who the current manager is for a DAO const managerAddress = await client.readContract({ address: GOVERNOR_ADDRESS, abi: DAOGovernorABI, functionName: 'manager' }); console.log("Current Manager:", managerAddress); ``` *** ## Network Information ### Ethereum (Mainnet) * **Chain ID**: 1 * **Explorer**: [https://etherscan.io](https://etherscan.io) * **Currency**: ETH * **Type**: L1 ### Arbitrum One * **Chain ID**: 42161 * **Explorer**: [https://arbiscan.io](https://arbiscan.io) * **Currency**: ETH * **Type**: L2 (Optimistic Rollup) ### Sepolia (Testnet) * **Chain ID**: 11155111 * **RPC**: `https://rpc.ankr.com/eth_sepolia` * **Explorer**: [https://sepolia.etherscan.io](https://sepolia.etherscan.io) * **Currency**: SepoliaETH (testnet) * **Faucet**: [sepoliafaucet.com](https://sepoliafaucet.com) *** ## Coming Soon CreateDAO v2 will expand to additional networks. Stay tuned for announcements on: * Polygon * Optimism * Other EVM-compatible chains Follow us on [Twitter](https://x.com/createdao) for deployment announcements. *** ## Security Notice **Always verify contract addresses** from official CreateDAO sources before interacting with them. Do not trust addresses provided by third parties. If you discover a contract claiming to be CreateDAO but not listed here, please report it immediately: * **Discord**: [discord.gg/HnRmtP2fph](https://discord.gg/HnRmtP2fph) * **Email**: [security@createdao.org](mailto:security@createdao.org) * **GitHub**: [github.com/createDAO/v2-core/issues](https://github.com/createDAO/v2-core/issues) *** ## Source Code & Verification * **Contracts Repository**: [github.com/createDAO/v2-core](https://github.com/createDAO/v2-core) * **License**: MIT * **Audits**: Coming soon All contracts are verified on their respective block explorers with matching source code from the GitHub repository. # Getting Started Source: https://docs.createdao.org/getting-started Quick start guide for CreateDAO v2 # Getting Started Welcome to CreateDAO v2! This guide will help you understand the basics and get you ready to create your first DAO. ## What You'll Need Before creating a DAO, make sure you have: 1. **A Web3 Wallet** * MetaMask (recommended) * Coinbase Wallet * WalletConnect-compatible wallets * Any EVM-compatible wallet 2. **Cryptocurrency for Gas Fees** * **Ethereum Mainnet**: varies by network conditions * **Arbitrum One**: low gas fees (paid in ETH) * **Sepolia Testnet**: Free SepoliaETH from [faucets](https://sepoliafaucet.com) 3. **Basic Understanding** * What a DAO is * How blockchain transactions work * Gas fees and wallet confirmation **First time?** We recommend starting on Sepolia testnet to familiarize yourself with the process before deploying to mainnet. *** ## Quick Overview: What is CreateDAO v2? CreateDAO v2 is a platform for deploying complete DAO governance systems using **OpenZeppelin Governor** - the industry-standard framework for on-chain governance. ### What You Get When you create a DAO, you deploy three smart contracts in one transaction: ERC20 governance token with automatic voting power activation Proposal and voting system with OpenZeppelin extensions Secure treasury holding 99% of tokens with 1-day execution delay ### Key Features **Auto-Delegation** * No manual delegation required * Voting power activates automatically when you receive tokens * Ready to vote immediately **Secure Treasury** * 99% of tokens held in timelock * All treasury actions require governance approval * 1-day delay before execution for security **Manager Role** * On-chain authorization for DAO management * Changeable only through governance * Designed for integration with platforms like OpenBook **Gas Efficient** * Uses EIP-1167 minimal proxies (clones) * Token and Governor proxies are only 45 bytes each * \~69% gas savings vs traditional deployment *** ## Understanding the Architecture ``` Your DAO = Token + Governor + Treasury ``` ### 1. DAOToken (ERC20Votes) Your governance token gives holders voting power: * **Standard**: ERC20 with 18 decimals * **Voting Power**: Built-in checkpoint system * **Auto-Delegation**: Automatically activates when tokens are received * **Distribution**: 1% to creator, 99% to treasury ### 2. DAOGovernor (OpenZeppelin Governor) The governance contract manages your DAO: * **Proposals**: Any token holder with 1%+ can propose * **Voting**: FOR, AGAINST, or ABSTAIN * **Quorum**: Minimum 1% participation required * **Extensions**: Includes all standard OZ Governor features * **Manager Role**: Special address for off-chain authorization ### 3. TimelockController (Treasury) The secure treasury holds DAO assets: * **Holds**: 99% of token supply * **Delay**: 1 day between proposal passing and execution * **Security**: Prevents rushed or malicious actions * **Control**: Only governance can move funds *** ## The Governance Process ### Creating a Proposal 1. You need **1% of token supply** to propose 2. Proposal includes: target contracts, values, calldata, and description 3. Voting delay starts (default: 1 day) ### Voting Period 1. After delay, voting opens for a set period (default: 1 week) 2. Token holders cast votes: FOR, AGAINST, or ABSTAIN 3. Voting power = token balance at proposal creation time ### Execution 1. If quorum met (1%+) and majority votes FOR, proposal succeeds 2. Proposal is queued in the timelock 3. After 1-day delay, anyone can execute 4. Actions are executed on-chain *** ## Common Use Cases ### Community Organization Perfect for: * Online communities wanting shared decision-making * Content creator DAOs * Gaming guilds * Social clubs going on-chain ### Business Operations Ideal for: * RWA (Real World Asset) management * Transparent business operations * Multi-stakeholder companies * Service cooperatives **Integration**: Use with [OpenBook](https://openbook.so) for full ERP/CRM/POS with radical transparency. ### Investment Groups Great for: * Collective investment decisions * Treasury management * Fund allocation * Grant programs *** ## Token Distribution Strategy When you create a DAO: * **You get 1%** - Enough to meet quorum and create initial proposals * **Treasury gets 99%** - Distributed through governance ### Why 1%? The 1% allocation is carefully chosen because: * OpenZeppelin Governor requires minimum 1% quorum * You need exactly 1% to bootstrap governance * After setup, you can propose distributing tokens to members ### Distributing to Members After creating your DAO, create proposals to: 1. Transfer tokens from treasury to founding members 2. Set up vesting schedules (via custom contracts) 3. Reward contributors 4. Build your community *** ## Governance Parameters You'll choose these when creating your DAO: | Parameter | Recommended | Description | | ---------------------- | ------------- | ------------------------------- | | **Voting Delay** | 1 day | Time before voting starts | | **Voting Period** | 1 week | How long voting lasts | | **Quorum** | 1% (fixed) | Minimum participation | | **Proposal Threshold** | 1% (fixed) | Tokens needed to propose | | **Timelock Delay** | 1 day (fixed) | Security delay before execution | Voting Delay and Voting Period can be customized during creation. Other parameters are set to optimal defaults and can be changed later through governance. *** ## Supported Networks CreateDAO v2 is currently deployed on: Chain ID: 1 Production-ready deployment Chain ID: 42161 Low-cost L2 deployment Chain ID: 11155111 Test your DAO for free More networks coming soon! Follow us on [Twitter](https://x.com/createdao) for announcements. *** ## Next Steps Ready to create your DAO? Follow our step-by-step tutorial: Complete walkthrough with screenshots and troubleshooting Or dive into the technical details: Technical reference Contract addresses *** ## Getting Help Need assistance? We're here to help: * **Discord**: [discord.gg/HnRmtP2fph](https://discord.gg/HnRmtP2fph) * **Telegram**: [t.me/createdao\_org](https://t.me/createdao_org) * **Twitter**: [@createdao](https://x.com/createdao) * **GitHub**: [github.com/createDAO](https://github.com/createDAO) *** ## Additional Resources ### Learn About Governance * [OpenZeppelin Governor Documentation](https://docs.openzeppelin.com/contracts/5.x/governance) * [Tally Governance Platform](https://tally.xyz) * [Governance Parameter Guide](/governance/parameters) ### Integration * [OpenBook](https://openbook.so) - Transparent ERP for DAOs managing real world assets * Build your own tools using our open-source contracts ### Community Examples Check out DAOs built with CreateDAO: * Browse on [Tally](https://tally.xyz) * View on block explorers (Ethereum, Arbitrum, Sepolia) * Learn from existing governance proposals *** **Ready to get started?** [Create your DAO now →](https://createdao.org) # Governance Parameters Source: https://docs.createdao.org/governance/parameters Understanding voting delay, voting period, quorum, and other governance settings # Governance Parameters **Coming Soon**: This page will contain detailed information about all governance parameters in CreateDAO v2. CreateDAO v2 uses OpenZeppelin Governor with carefully chosen default parameters to balance security, participation, and efficiency. ## Quick Reference | Parameter | Default Value | Can Be Changed? | | ---------------------- | ----------------------- | --------------------------------- | | **Voting Delay** | 1 day (86400 seconds) | Yes, at creation & via governance | | **Voting Period** | 1 week (604800 seconds) | Yes, at creation & via governance | | **Quorum** | 1% of total supply | Yes, via governance only | | **Proposal Threshold** | 1% of total supply | Yes, via governance only | | **Timelock Delay** | 1 day (86400 seconds) | Fixed at deployment | *** ## Parameters Overview ### Voting Delay **What it is**: Time between proposal creation and the start of voting **Default**: 1 day (86400 seconds) **Purpose**: * Gives community members time to review proposals * Allows token holders to acquire tokens if they want to vote * Prevents rushed governance attacks **When to change**: * Increase for major decisions requiring careful review * Decrease for routine or time-sensitive proposals ### Voting Period **What it is**: Duration of the active voting window **Default**: 1 week (604800 seconds) **Purpose**: * Provides sufficient time for community participation * Balances urgency with inclusivity * Accounts for different time zones and schedules **When to change**: * Increase for controversial or complex proposals * Decrease for routine maintenance ### Quorum **What it is**: Minimum percentage of token supply that must participate for a vote to be valid **Default**: 1% of total supply **Purpose**: * Ensures minimum community engagement * Prevents decisions made by tiny minorities * Set at 1% to enable bootstrap governance by creator **When to change**: * Increase as your community grows and becomes more active * Must be done carefully via governance proposal ### Proposal Threshold **What it is**: Minimum tokens required to create a proposal **Default**: 1% of total supply **Purpose**: * Prevents spam proposals * Ensures proposers have meaningful stake * Matches creator's allocation **When to change**: * Lower to encourage more participation * Raise to filter for more serious proposals ### Timelock Delay **What it is**: Time between proposal execution approval and actual execution **Default**: 1 day (86400 seconds) **Purpose**: * Security mechanism to prevent malicious proposals * Gives community time to react * Allows for emergency response if needed **Fixed at deployment**: Cannot be changed *** ## Detailed Guides Detailed guides for each parameter will be added soon. Check back for in-depth explanations, examples, and best practices. ### Topics Coming Soon: * **Choosing Voting Parameters**: How to select optimal values for your DAO * **Changing Parameters**: Step-by-step guide to updating governance settings * **Advanced Scenarios**: Handling different types of proposals * **Security Considerations**: Protecting your DAO from governance attacks * **Best Practices**: Lessons learned from successful DAOs *** ## Related Resources Learn how to set these parameters when deploying Technical details of parameter initialization ### External Resources * [OpenZeppelin Governor Documentation](https://docs.openzeppelin.com/contracts/5.x/governance) * [Tally Governance Guide](https://docs.tally.xyz) *** ## Need Help? Questions about governance parameters? Reach out: * **Discord**: [discord.gg/HnRmtP2fph](https://discord.gg/HnRmtP2fph) * **Telegram**: [t.me/createdao\_org](https://t.me/createdao_org) * **GitHub Discussions**: [github.com/createDAO/v2-core/discussions](https://github.com/createDAO/v2-core/discussions) # Introduction Source: https://docs.createdao.org/introduction Welcome to the CreateDAO v2 documentation. ## What is CreateDAO? CreateDAO is an open-source platform for deploying complete, independent DAO governance systems on EVM-compatible blockchains. Built on battle-tested **OpenZeppelin Governor** contracts, CreateDAO v2 provides a secure, standardized foundation for decentralized organizations. Each DAO deployment includes three core components: * **DAOToken** - ERC20 governance token with voting power (ERC20Votes) * **DAOGovernor** - Proposal and voting management with OpenZeppelin extensions * **TimelockController** - Secure treasury with execution delay All three contracts are deployed in a single transaction via the **DAOFactory**, using the gas-efficient EIP-1167 minimal proxy (Clones) pattern. ## Why OpenZeppelin Governor? Version 2 is a complete rewrite, rebuilt from the ground up using OpenZeppelin's industry-standard governance contracts instead of custom implementations. This brings: * **Security**: Battle-tested, audited contracts trusted by the ecosystem * **Compatibility**: Works seamlessly with existing governance tools (Tally, Defender) * **Simplicity**: Proven patterns instead of custom logic * **Standards**: Full compliance with governance standards (ERC-6372, ERC-5805) ## Key Features ### Auto-Delegation Token holders automatically receive voting power when they receive tokens for the first time. No manual delegation step required - your tokens are ready to vote immediately. ### Secure Treasury The TimelockController holds 99% of the token supply and acts as the DAO's treasury. All fund movements require governance approval and include a 1-day execution delay for security. ### Manager Role Each DAO has an on-chain **Manager** address that can be queried via RPC. This role is designed for integration with DAO management platforms like **OpenBook** - providing on-chain authorization for off-chain operations. The Manager address: * Is set to the DAO creator at deployment * Can only be changed through governance proposals * Serves as the "on-chain source of truth" for operational authority * Enables trusted individuals to manage day-to-day operations while maintaining transparency **OpenBook Integration**: [OpenBook](https://openbook.so) is a transparent ERP/CRM/POS platform built specifically for DAOs managing Real World Assets. It uses the Manager role to verify authorization while providing complete financial transparency - all accounting data is public, ensuring accountability without voting fatigue. ### Gas Efficient Using EIP-1167 minimal proxies, each new DAO costs significantly less gas to deploy. Token and Governor contracts are only 45 bytes each, with all logic delegated to shared implementation contracts. ### Token Distribution * **1% to Creator**: Enables the creator to meet quorum and create initial proposals * **99% to Treasury**: Held securely in the TimelockController, distributed through governance ## Architecture Overview ```mermaid theme={null} flowchart TD Factory["DAOFactory
- Deploys implementations once in constructor
- Creates complete DAO systems via Clones (EIP-1167)
- Tracks all deployed DAOs"] Token["DAOToken (Proxy)
EIP-1167

ERC20Votes
ERC20Permit
Auto-delegate

1% → Creator
99% → Treasury"] Timelock["TimelockController
(Treasury)

Holds 99% tokens
1-day delay"] Governor["DAOGovernor (Proxy)
EIP-1167

Governor
+ Extensions
+ Manager role

Quorum: 1%
Threshold: 1%"] Factory -->|"createDAO()"| Token Factory -->|"createDAO()"| Timelock Factory -->|"createDAO()"| Governor ``` ## Default Governance Settings | Setting | Value | Description | | ------------------- | ------ | ------------------------------------------------- | | Creator Allocation | 1% | Tokens sent to DAO creator (auto-delegated) | | Treasury Allocation | 99% | Tokens held in TimelockController | | Quorum | 1% | Minimum participation for valid proposals | | Proposal Threshold | 1% | Tokens required to create proposals | | Voting Delay | 1 day | Time before voting starts after proposal creation | | Voting Period | 1 week | Duration of the voting period | | Timelock Delay | 1 day | Execution delay after proposal passes | All governance parameters can be updated later through governance proposals. ## Supported Networks CreateDAO v2 is deployed on: * **Ethereum** (Mainnet) * **Arbitrum One** (L2) * **Sepolia** (Testnet) The DAOFactory uses deterministic CREATE2 deployment, enabling identical addresses across networks. ## Who is This Documentation For? This documentation is intended for: * **Community Leaders & Founders**: Launch a DAO for your project or organization * **Developers**: Integrate with CreateDAO or build on top of it * **DAO Members**: Understand how your CreateDAO-based organization functions * **Anyone Curious About DAOs**: Learn about DAO architecture and the OpenZeppelin Governor pattern ## Open Source All code is publicly available and open source: * **Contracts Repository**: [createDAO/v2-core](https://github.com/createDAO/v2-core) * **Interface Repository**: [createDAO/interface](https://github.com/createDAO/interface) * **License**: MIT License ## Next Steps Learn the basics and create your first DAO Technical reference for the factory contract Step-by-step tutorial Contract addresses on all networks # Creating a DAO Source: https://docs.createdao.org/tutorials/creating-dao Step-by-step tutorial for creating a DAO using CreateDAO v2 # Creating a DAO **New to DAOs?** Start with the [step-by-step guide on createdao.org](https://createdao.org/how-to-create-a-dao) — it covers the same process with more context, examples, and FAQs. This page is the technical reference for developers. This tutorial will guide you through the process of creating a Decentralized Autonomous Organization (DAO) using CreateDAO v2. By the end, you'll have deployed a fully functional DAO with: * **Governance token** with automatic voting power * **Governor contract** for proposals and voting * **Secure treasury** with timelock protection ## Prerequisites Before you begin, make sure you have: * A Web3 wallet (like MetaMask) installed and set up * Cryptocurrency in your wallet for gas fees (ETH on Ethereum/Sepolia) * Basic understanding of blockchain and DAO concepts ## Step 1: Connect Your Wallet 1. Go to [CreateDAO.org](https://createdao.org) 2. Click on the **"Create DAO"** button 3. Click **"Connect Wallet"** in the top-right corner 4. Select your wallet provider (MetaMask, WalletConnect, Coinbase Wallet, etc.) 5. Approve the connection request in your wallet Your wallet address will become the initial **Manager** of the DAO and receive 1% of the tokens to bootstrap governance. ## Step 2: Select a Network 1. Choose the blockchain network where you want to deploy your DAO: * **Ethereum** (Mainnet) - For production DAOs * **Arbitrum One** (L2) - For low-cost production DAOs * **Sepolia** (Testnet) - For testing (recommended first) 2. If you're not already connected to that network, your wallet will prompt you to switch 3. Confirm the network switch in your wallet **Testing First?** We strongly recommend deploying on Sepolia testnet first to familiarize yourself with the process. You can get free Sepolia ETH from faucets like [sepoliafaucet.com](https://sepoliafaucet.com). ## Step 3: Enter DAO Details Fill in the following information for your DAO: ### Basic Information **DAO Name** * The name of your organization (e.g., "Community Coffee DAO") * This will be displayed in governance interfaces **Token Name** * The full name of your governance token (e.g., "Community Coffee Token") **Token Symbol** * A short symbol for your token, 2-6 characters (e.g., "CCT") * Will be displayed in wallets and explorers **Total Supply** * The total number of tokens to create (e.g., "1000000" for 1 million tokens) * Entered as whole numbers - the system automatically handles the 18 decimals * **Distribution**: 1% goes to you (the creator), 99% to the DAO treasury **Total supply is permanent!** Once created, the total supply cannot be increased. Choose carefully based on your community size and tokenomics needs. ### Governance Parameters **Voting Delay** * Time before voting starts after a proposal is created * Recommended: **1 day** (86400 seconds) * Gives members time to review proposals before voting begins **Voting Period** * How long members can vote on a proposal * Recommended: **1 week** (604800 seconds) * Balances urgency with member participation All governance parameters can be changed later through governance proposals if your DAO decides to adjust them. ## Step 4: Review and Deploy 1. **Review** all the information you've entered 2. **Estimated costs** will be displayed: * Gas fee: varies by network conditions on Ethereum * No protocol fees - CreateDAO is free to use! 3. Click the **"Create DAO"** button 4. Your wallet will prompt you to confirm the transaction 5. **Review the gas fee** and confirm Creating a DAO deploys three smart contracts (Token, Governor, Treasury) in a single transaction using gas-efficient proxies. ## Step 5: Wait for Deployment 1. The deployment process will begin 2. You'll see a progress indicator 3. Typical deployment time: **30-90 seconds** depending on network conditions 4. **Do not close** the browser window during deployment ## Step 6: Save Your DAO Information Once deployment is complete, you'll see a success message with important information: ### Contract Addresses * **Token Address**: Your governance token (ERC20) * **Governor Address**: Your governance contract * **Timelock Address**: Your treasury contract ### What to Save 1. **Copy all three addresses** and store them securely 2. **Bookmark the governance page** for easy access 3. **Note your token symbol** for finding it in wallets **Important!** Save these addresses immediately. While they're recorded on the blockchain, having them handy makes managing your DAO much easier. ## Step 7: Verify Your DAO ### Check Your Wallet 1. Open your wallet (MetaMask, etc.) 2. You should see **1% of your total supply** in your wallet 3. Your tokens are **automatically delegated** - ready to vote immediately! ### View on Block Explorer 1. Click the explorer links to view your contracts 2. Verify the token name and symbol are correct 3. Check that 99% of tokens are in the Timelock (treasury) ## Understanding Your DAO ### Token Distribution * **You (Creator)**: 1% of total supply * Enables you to meet quorum (1% minimum) * Allows you to create and pass initial proposals * Already delegated - voting power is active * **Treasury (Timelock)**: 99% of total supply * Held securely in the TimelockController * Can only be moved through governance proposals * 1-day execution delay for security ### Governance Process 1. **Create Proposal**: Requires 1% of tokens (you qualify!) 2. **Voting Delay**: Proposal enters voting after your set delay 3. **Active Voting**: Members vote FOR, AGAINST, or ABSTAIN 4. **Quorum Check**: Needs 1% participation minimum 5. **Timelock Queue**: Passed proposals wait 1 day 6. **Execution**: Anyone can execute after delay ### Manager Role * **You are the Manager**: Your wallet address is set as the initial manager * **Purpose**: On-chain authorization for DAO management platforms * **Changing Manager**: Only through governance proposals * **Use Case**: Integration with tools like [OpenBook](https://openbook.so) for transparent business operations ## Next Steps ### Distribute Tokens to Members Create your first proposal to distribute tokens: ```javascript theme={null} // Example: Transfer 10,000 tokens from treasury const token = await ethers.getContractAt("DAOToken", TOKEN_ADDRESS); const governor = await ethers.getContractAt("DAOGovernor", GOVERNOR_ADDRESS); // Encode the transfer call const transferCalldata = token.interface.encodeFunctionData('transfer', [ recipientAddress, ethers.parseEther("10000") ]); // Create proposal await governor.propose( [TOKEN_ADDRESS], // targets [0], // values (no ETH) [transferCalldata], // calldatas "Proposal #1: Distribute tokens to founding team members" ); ``` ### Manage Your DAO Visit these platforms to manage your DAO: * **[Tally](https://tally.xyz)**: Create proposals, vote, view history * **[OpenBook](https://openbook.so)**: Transparent business management (if applicable) * **Block Explorer**: View all on-chain activity ### Create Proposals You can propose any on-chain action: * Transfer tokens from treasury * Change governance parameters * Update the Manager address * Execute smart contract calls * Anything the DAO's treasury can do! ## Troubleshooting ### Transaction Failed **Insufficient Gas** * Ensure you have enough ETH for gas fees * Try increasing gas limit or gas price **Network Congestion** * Wait a few minutes and try again * Check network status on the block explorer ### Tokens Not Appearing in Wallet **Manual Token Import** 1. Open your wallet 2. Click "Import Token" or "Add Token" 3. Select "Custom Token" 4. Paste your **Token Address** 5. Token name and symbol should auto-fill ### Can't Create Proposals **Need 1% of Supply** * Ensure you have at least 1% of tokens * Check that your tokens are delegated (should be automatic) * Try refreshing the governance interface ### Voting Power Shows Zero **Delegation Issue** * CreateDAO v2 has auto-delegation, but if needed: * Call `token.delegate(yourAddress)` to activate voting power * Voting power updates at the next block ## Security Best Practices 1. **Verify Contract Addresses**: Always check addresses on the official [Deployed Contracts](/deployed-contracts) page 2. **Test First**: Deploy on Sepolia testnet before mainnet 3. **Secure Your Wallet**: Use hardware wallets for high-value DAOs 4. **Review Proposals**: Always review proposal calldata before voting 5. **Timelock Protection**: The 1-day delay protects against harmful proposals ## Need Help? If you encounter any issues: * **Discord**: Join our [Discord community](https://discord.gg/HnRmtP2fph) * **Telegram**: Ask in [Telegram group](https://t.me/createdao_org) * **GitHub**: Report issues on [GitHub](https://github.com/createDAO/v2-core) * **Twitter**: Follow [@createdao](https://x.com/createdao) ## Learn More Technical details of the factory contract Contract addresses on all networks Learn about the underlying governance system Understanding voting delay, period, and quorum *** **Congratulations!** 🎉 You've successfully created a DAO using CreateDAO v2. Your organization is now ready for decentralized governance!