Skip to main content

PluginRepoFactory

Description

This contract creates PluginRepo proxies and registers them on a PluginRepoRegistry contract.

Implementation

public variable pluginRepoRegistry

The Aragon plugin registry contract.

contract PluginRepoRegistry pluginRepoRegistry

public variable pluginRepoBase

The address of the PluginRepo base contract to proxy to..

address pluginRepoBase

public function constructor

Initializes the addresses of the Aragon plugin registry and PluginRepo base contract to proxy to.

constructor(contract PluginRepoRegistry _pluginRepoRegistry) public
InputTypeDescription
_pluginRepoRegistrycontract PluginRepoRegistryThe aragon plugin registry address.

public function supportsInterface

Checks if this or the parent contract supports an interface by its ID.

function supportsInterface(bytes4 _interfaceId) public view virtual returns (bool)
InputTypeDescription
_interfaceIdbytes4The ID of the interface.
Output
0boolReturns true if the interface is supported.

external function createPluginRepo

Creates a plugin repository proxy pointing to the pluginRepoBase implementation and registers it in the Aragon plugin registry.

function createPluginRepo(string _subdomain, address _initialOwner) external returns (contract PluginRepo)
InputTypeDescription
_subdomainstringThe plugin repository subdomain.
_initialOwneraddressThe plugin maintainer address.

external function createPluginRepoWithFirstVersion

Creates and registers a PluginRepo with an ENS subdomain and publishes an initial version 1.1.

function createPluginRepoWithFirstVersion(string _subdomain, address _pluginSetup, address _maintainer, bytes _releaseMetadata, bytes _buildMetadata) external returns (contract PluginRepo pluginRepo)
InputTypeDescription
_subdomainstringThe plugin repository subdomain.
_pluginSetupaddressThe plugin factory contract associated with the plugin version.
_maintaineraddressThe maintainer of the plugin repo. This address has permission to update metadata, upgrade the repo logic, and manage the repo permissions.
_releaseMetadatabytesThe release metadata URI.
_buildMetadatabytesThe build metadata URI.

After the creation of the PluginRepo and release of the first version by the factory, ownership is transferred to the _maintainer address.

internal function _setPluginRepoPermissions

Set the final permissions for the published plugin repository maintainer. All permissions are revoked from the plugin factory and granted to the specified plugin maintainer.

function _setPluginRepoPermissions(contract PluginRepo pluginRepo, address maintainer) internal
InputTypeDescription
pluginRepocontract PluginRepoThe plugin repository instance just created.
maintaineraddressThe plugin maintainer address.

The plugin maintainer is granted the MAINTAINER_PERMISSION_ID, UPGRADE_REPO_PERMISSION_ID, and ROOT_PERMISSION_ID.

internal function _createPluginRepo

Internal method creating a PluginRepo via the ERC-1967 proxy pattern from the provided base contract and registering it in the Aragon plugin registry.

function _createPluginRepo(string _subdomain, address _initialOwner) internal returns (contract PluginRepo pluginRepo)
InputTypeDescription
_subdomainstringThe plugin repository subdomain.
_initialOwneraddressThe initial owner address.

Passing an empty _subdomain will cause the transaction to revert.

© 2024