Skip to main content
Version: 1.4.0-alpha

Dao Creation

Two framework contracts manage the DAO contract creation process:

The DAOFactory is the contract that creates and sets up a DAO for you. The DAORegistry is used by the DAOFactory to register the DAOs that are created. Plugins are installed in the DAO by the PluginSetupProcessor.

Creation Schema

DAOFactory

The DAOFactory creates and sets up a DAO for you in four steps with the createDao function. The function requires the DAOSettings including:

The DAO also requires an array of PluginSettings containing PluginSetup and its respective setup data for the plugins to be installed in the DAO.

When the createDao function is called in the DAOFactory this triggers a four step process for creating a DAO:

  1. Creates a new DAO by deploying an ERC-1967 proxy pointing to the latest Aragon OSx DAO implementation and becomes the initial owner.
  2. Registers the new contract in the DAORegistry.
  3. Installs the plugins using the PluginSetupProcessor (see also the section about the plugin setup process).
  4. Sets the native permissions of the DAO and revokes its own ownership.

Plugins

When calling createDao an array of PluginSettings are requested. A DAO cannot be created without at least one plugin. The DAO contract works as a permission manager system but it is agnostic to the type of governance that you want to use to manage the DAO. We currently provide two plugins that can be used for governing your DAO:

  • Multisig
  • TokenVoting

If none of this options meet your requirements you can also build your own governance plugin, check our tutorial on "How to build a plugin?" to get started.

DAORegistry

The DAORegistry is used by the DAOFactory and contains the register function

@aragon/framework/dao/DAORegistry.sol

function register(
IDAO dao,
address creator,
string calldata subdomain
) external auth(REGISTER_DAO_PERMISSION_ID);

the register function requires the REGISTER_DAO_PERMISSION_ID, this permission currently held only by the DAOFactory. This implies that the only way of creating DAOs that get registered in our DAORegistry is via the createDao function in the DaoFactory contract.

If the requested ENS subdomain name is valid and not taken, the DAORegistry registers the subdomain and adds the DAO contract address to the DAORegistry. If the subdomain parameter is non-empty (not "") and still available, the ENS name will be registered. If the registration was successful, an event a DAORegistered event is emitted. This event contains the DAO address, the creator address and the subdomain.

In case you want to verify that you DAO got registered in the DAORegistry you can call entries(address) and it will return true if the DAO is registered

For more details visit the DAORegistry reference guide entry.

Events

When creating a DAO there is two main events that you'll be looking for:

  • DAORegistered
  • InstallationApplied

When the createDao function is called in the DAORegistry emits the DaoRegistered event. This event contains the DAO address, the creator address and the subdomain.

event DAORegistered(
address indexed dao,
address indexed creator,
string subdomain
);

The InstallationApplied event is emitted when the PluginSetupProcessor finishes installing the plugins in the DAO.

event InstallationApplied(
address indexed dao,
address indexed plugin,
bytes32 preparedSetupId,
bytes32 appliedSetupId
);

There are a set of events emitted by the DAO contract itself, you can find more information about them in the DAO reference guide entry.

© 2024