Overview
Agora DAO uses a factory pattern to create and manage DAOs on Ethereum. TheAgoraDaoFactory contract deploys individual AgoraDao instances, each with its own governance structure and role-based access control system.
Factory pattern architecture
The factory pattern provides several benefits:- Standardized deployment: All DAOs follow the same deployment process and structure
- Centralized tracking: The factory maintains a registry of all created DAOs
- User management: Global user counter across all DAOs in the ecosystem
- Category system: Built-in categorization for different DAO types
The factory contract is deployed once and used by all users to create their DAOs. Each new DAO gets its own independent contract address.
The createDao function
The core function for creating a DAO iscreateDao() in the AgoraDaoFactory contract:
AgoraDaoFactory.sol:53-88
Parameters
The name of your DAO (1-50 characters)
A description of your DAO’s purpose (1-500 characters)
The category index for your DAO (must be valid)
IPFS CID or URI for the DAO’s logo image
DAO categories
Agora DAO includes a predefined set of categories to classify DAOs. The default categories are:Only the contract owner can add new categories using
addDaoCategory(). Category IDs start at 0.Input validation
The factory validates all inputs before deploying:Validation.sol:5-19
Frontend integration
The frontend uses a React form with validation to create DAOs:DAO data structure
Each DAO is stored with the following information:AgoraDaoFactory.sol:17-27
Querying DAOs
The factory provides several view functions to query DAO data:getAllDaos
Returns an array of all DAOs created through the factory
daosByUser
Mapping to retrieve all DAOs created by a specific address
getTotalDaoCount
Returns the total number of DAOs created
isDao
Checks if an address is a valid DAO created by the factory
Initial configuration
When a DAO is created:- Factory deployment: A new
AgoraDaocontract is deployed - Admin role: The creator receives
DEFAULT_ADMIN_ROLEautomatically - User counter: Creator is added to both factory and DAO user counters
- Registry: DAO is added to global registry and creator’s DAO list
- Event emission:
DaoCreatedevent is emitted with DAO details
AgoraDao.sol:27-32
Next steps
DAO membership
Learn how users can join your DAO
Role management
Configure roles and permissions
Task management
Set up tasks for your DAO members
Rewards
Implement reward systems