DAO Factory and Registry

Two framework contracts manage the DAO contract creation process, the DAOFactory and the DAORegistry.

Find detailed contract documentation at DAOFactory API and DAORegistry API

DAO Factory

The DAOFactory creates and sets up a DAO for you with the createDao function.

function createDao(
  DAOSettings calldata _daoSettings,
  PluginSettings[] calldata _pluginSettings
) external returns (DAO createdDao, InstalledPlugin[] memory installedPlugins);

This function requires the DAOSettings including:

as well as an array of PluginSettings containing:

  • The PluginSetup contract reference

    • The version tag of the plugin setup

    • The plugin setup repository address

  • The bytes-encoded data needed for the plugin installation.

The DAOFactory create the DAO in four steps and interacts with the DAORegistry and being also part of the Aragon OSx framework:

  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.

This function returns the DAO address and an array of InstalledPlugin structs each containing:

  • The new created plugin address

  • The list of plugin helpers

  • The list of the permissions applied during the plugin installation

DAO Registry

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

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

requiring the REGISTER_DAO_PERMISSION_ID permission currently held only by the DAOFactory.

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, the DAO name, contract and creator addresses are emitted in an event.