Plugin Repo Factory and Registry
To be available for installation in the Aragon OSx framework, a PluginRepo
must be created for each plugin. The PluginRepo
creation process is handled by the PluginRepoFactory
contract who creates the PluginRepo
instance for each plugin to hold all plugin versions and the PluginRepoRegistry
contract who registers the Plugin in the framework for DAOs to install.
Plugin Repo Factory
The PluginRepoFactory
is the contract in charge of creating the first version of a plugin. It does this through
the createPluginRepoWithFirstVersion
function which creates a PluginRepo
instance for the plugin with the first release
and first build (v1.1
).
/// @notice Creates and registers a `PluginRepo` with an ENS subdomain and publishes an initial version `1.1`.
/// @param _subdomain The plugin repository subdomain.
/// @param _pluginSetup The plugin factory contract associated with the plugin version.
/// @param _maintainer The plugin maintainer address.
/// @param _releaseMetadata The release metadata URI.
/// @param _buildMetadata The build metadata URI.
/// @dev After the creation of the `PluginRepo` and release of the first version by the factory, ownership is transferred to the `_maintainer` address.
function createPluginRepoWithFirstVersion(
string calldata _subdomain,
address _pluginSetup,
address _maintainer,
bytes memory _releaseMetadata,
bytes memory _buildMetadata
) external returns (PluginRepo pluginRepo);
It also registers the plugin in the Aragon OSx PluginRepoRegistry
contract with an ENS subdomain under the plugin.dao.eth
domain managed by Aragon.
Additional to the information required by the createVersion
function discussed earlier, it receives:
-
A valid ENS
_subdomain
unique name composed of letters from a-z, all in lower caps, separated by a-
. For ex:token-voting-plugin
. -
The address of the plugin repo maintainer who ends up having the
ROOT_PERMISSION_ID
,MAINTAINER_PERMISSION_ID
, andUPGRADE_REPO_PERMISSION_ID
permissions. These permissions enable the maintainer to call the internalPermissionManager
, thecreateVersion
andupdateReleaseMetadata
functions as well as upgrading the plugin contract.
Find detailed contract documentation at PluginRepoFactory API.
|
Plugin Repo Registry
The PluginRepoRegistry
contract is the central contract listing all the plugins managed through the Aragon OSx protocol. The PluginRepoFactory
calls on the PluginRepoRegistry
to register the plugin in the Aragon OSx protocol.
/// @notice Registers a plugin repository with a subdomain and address.
/// @param subdomain The subdomain of the PluginRepo.
/// @param pluginRepo The address of the PluginRepo contract.
function registerPluginRepo(
string calldata subdomain,
address pluginRepo
) external auth(REGISTER_PLUGIN_REPO_PERMISSION_ID) {
...
}
Find detailed contract documentation at PluginRepoRegistry API.
|