Framework Contracts API

The natspec generated API for the framework contracts. You can also find the contracts on the following repository.

Factories

DAOFactory

This contract is used to create a DAO.

daoBase() → address public

daoRegistry() → contract DAORegistry public

pluginSetupProcessor() → contract PluginSetupProcessor public

ROOT_PERMISSION_ID() → bytes32 internal

UPGRADE_DAO_PERMISSION_ID() → bytes32 internal

SET_TRUSTED_FORWARDER_PERMISSION_ID() → bytes32 internal

SET_METADATA_PERMISSION_ID() → bytes32 internal

REGISTER_STANDARD_CALLBACK_PERMISSION_ID() → bytes32 internal

EXECUTE_PERMISSION_ID() → bytes32 internal

APPLY_INSTALLATION_PERMISSION_ID() → bytes32 internal

NoPluginProvided() error

Thrown if PluginSettings array is empty, and no plugin is provided.

constructor(contract DAORegistry _registry, contract PluginSetupProcessor _pluginSetupProcessor) public

supportsInterface(bytes4 _interfaceId) → bool public

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

createDao(struct DAOFactory.DAOSettings _daoSettings, struct DAOFactory.PluginSettings[] _pluginSettings) → contract DAO createdDao, struct DAOFactory.InstalledPlugin[] installedPlugins external

_createDAO(struct DAOFactory.DAOSettings _daoSettings) → contract DAO dao internal

_setDAOPermissions(address _daoAddress) internal

PluginRepoFactory

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

pluginRepoRegistry() → contract PluginRepoRegistry public

pluginRepoBase() → address public

constructor(contract PluginRepoRegistry _pluginRepoRegistry) public

supportsInterface(bytes4 _interfaceId) → bool public

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

createPluginRepo(string _subdomain, address _initialOwner) → contract PluginRepo external

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

createPluginRepoWithFirstVersion(string _subdomain, address _pluginSetup, address _maintainer, bytes _releaseMetadata, bytes _buildMetadata) → contract PluginRepo pluginRepo external

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

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

_setPluginRepoPermissions(contract PluginRepo pluginRepo, address maintainer) internal

_createPluginRepo(string _subdomain, address _initialOwner) → contract PluginRepo pluginRepo internal

Registries

DAORegistry

This contract provides the possibility to register a DAO.

Modifiers

REGISTER_DAO_PERMISSION_ID() → bytes32 public

subdomainRegistrar() → contract ENSSubdomainRegistrar public

InvalidDaoSubdomain(string subdomain) error

Thrown if the DAO subdomain doesn’t match the regex [0-9a-z\-]

ENSNotSupported() error

Thrown if the subdomain is present, but registrar is address(0).

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

Emitted when a new DAO is registered.

constructor() public

initialize(contract IDAO _managingDao, contract ENSSubdomainRegistrar _subdomainRegistrar) external

register(contract IDAO dao, address creator, string subdomain) external

PluginRepoRegistry

This contract maintains an address-based registry of plugin repositories in the Aragon App DAO framework.

Modifiers

REGISTER_PLUGIN_REPO_PERMISSION_ID() → bytes32 public

subdomainRegistrar() → contract ENSSubdomainRegistrar public

PluginRepoRegistered(string subdomain, address pluginRepo) event

Emitted if a new plugin repository is registered.

InvalidPluginSubdomain(string subdomain) error

Thrown if the plugin subdomain doesn’t match the regex [0-9a-z\-]

ENSNotSupported() error

Thrown if the subdomain is present, but registrar is address(0).

constructor() public

initialize(contract IDAO _dao, contract ENSSubdomainRegistrar _subdomainRegistrar) external

registerPluginRepo(string subdomain, address pluginRepo) external

Registers a plugin repository with a subdomain and address.

If subdomain is empty, registration on ENS is skipped.

MemberRegistry

The ENS registry and resolver are trusted, known mainnet contracts. No reentrancy guard is needed — the contract is the sole caller of its own ENS operations.

Modifiers

UPGRADE_REGISTRY_PERMISSION_ID() → bytes32 public

EVICT_SUBDOMAIN_PERMISSION_ID() → bytes32 public

ens() → contract ENS public

parentNode() → bytes32 public

parentDomain() → string public

resolver() → address public

memberLabel() → mapping(address => bytes32) public

memberSubdomain() → mapping(address => string) public

labelOwner() → mapping(bytes32 => address) public

constructor() public

initialize(contract IDAO _managementDao, contract ENS _ens, string _domain, address _resolver) external

register(string subdomain) external

Register as a member by claiming a subdomain. Permissionless. One subdomain per address. Reverts if already registered (release first).

register(string subdomain, struct IMemberRegistry.Records records) external

release() external

Voluntarily release your subdomain. Permissionless. Only releases the caller’s own subdomain. Reverts if not registered.

evict(string subdomain, address newController) external

Forcibly evict a subdomain, optionally re-assigning it to a new controller. Governed. Requires EVICT_SUBDOMAIN_PERMISSION_ID on this contract (OSx permission system). If newController is the zero address, the subdomain is fully released (records cleared, subnode released). If newController is non-zero, the same subdomain is re-assigned to it as if it had called register itself: ENS subnode re-created, addr record set to newController, per-node resolver approval granted to it. Reverts if the subdomain is unknown, if newController already controls it, or if newController is already registered with a different subdomain.

move(string newSubdomain) external

Move your subdomain. Releases the old label and claims the new one atomically. Only moves the caller’s own subdomain. Reverts if not registered or new label taken.

move(string newSubdomain, struct IMemberRegistry.Records records) external

isRegistered(address member) → bool external

Returns true if the member has a registered subdomain.

MIN_SUBDOMAIN_LENGTH() → uint256 internal

MAX_SUBDOMAIN_LENGTH() → uint256 internal

_register(string subdomain, address member) → bytes32 label internal

_move(string newSubdomain) → bytes32 newLabel, string oldSubdomain internal

_release(address member) → string subdomain internal

_requireValidSubdomain(string subdomain) internal

_assignSubnode(address member, bytes32 label) internal

_releaseSubnode(address member, bytes32 label) internal

_setResolverAddr(bytes32 label, address addr) internal

_applyRecords(bytes32 label, struct IMemberRegistry.Records records) internal

_authorizeUpgrade(address) internal

Framework

PluginRepo

The plugin repository contract required for managing and publishing different plugin versions within the Aragon DAO framework.

Modifiers

MAINTAINER_PERMISSION_ID() → bytes32 public

UPGRADE_REPO_PERMISSION_ID() → bytes32 public

buildsPerRelease() → mapping(uint8 => uint16) internal

versions() → mapping(bytes32 => struct PluginRepo.Version) internal

latestTagHashForPluginSetup() → mapping(address => bytes32) internal

latestRelease() → uint8 public

VersionHashDoesNotExist(bytes32 versionHash) error

Thrown if a version does not exist.

InvalidPluginSetupInterface() error

Thrown if a plugin setup contract does not inherit from PluginSetup.

ReleaseZeroNotAllowed() error

Thrown if a release number is zero.

InvalidReleaseIncrement(uint8 latestRelease, uint8 newRelease) error

Thrown if a release number is incremented by more than one.

PluginSetupAlreadyInPreviousRelease(uint8 release, uint16 build, address pluginSetup) error

Thrown if the same plugin setup contract exists already in a previous releases.

EmptyReleaseMetadata() error

Thrown if the metadata URI is empty.

ReleaseDoesNotExist() error

Thrown if release does not exist.

constructor() public

initialize(address initialOwner) external

Initializes the contract by - initializing the permission manager - granting the MAINTAINER_PERMISSION_ID permission to the initial owner.

This method is required to support [ERC-1822](https://eips.ethereum.org/EIPS/eip-1822).

initializeFrom(uint8[3] _previousProtocolVersion, bytes _initData) external

Initializes the pluginRepo after an upgrade from a previous protocol version.

This function is a placeholder until we require reinitialization.

createVersion(uint8 _release, address _pluginSetup, bytes _buildMetadata, bytes _releaseMetadata) external

Creates a new plugin version as the latest build for an existing release number or the first build for a new release number for the provided PluginSetup contract address and metadata.

updateReleaseMetadata(uint8 _release, bytes _releaseMetadata) external

Updates the metadata for release with content @fromHex(_releaseMetadata).

getLatestVersion(uint8 _release) → struct PluginRepo.Version public

Returns the latest version for a given release number.

getLatestVersion(address _pluginSetup) → struct PluginRepo.Version public

Returns the latest version for a given plugin setup.

getVersion(struct PluginRepo.Tag _tag) → struct PluginRepo.Version public

getVersion(bytes32 _tagHash) → struct PluginRepo.Version public

Returns the version for a tag hash.

buildCount(uint8 _release) → uint256 public

Gets the total number of builds for a given release number.

tagHash(struct PluginRepo.Tag _tag) → bytes32 internal

_authorizeUpgrade(address) internal

supportsInterface(bytes4 _interfaceId) → bool public

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

PluginSetupProcessor

This contract is temporarily granted the ROOT_PERMISSION_ID permission on the applying DAO and therefore is highly security critical.

APPLY_INSTALLATION_PERMISSION_ID() → bytes32 public

APPLY_UPDATE_PERMISSION_ID() → bytes32 public

APPLY_UNINSTALLATION_PERMISSION_ID() → bytes32 public

states() → mapping(bytes32 => struct PluginSetupProcessor.PluginState) public

repoRegistry() → contract PluginRepoRegistry public

SetupApplicationUnauthorized(address dao, address caller, bytes32 permissionId) error

Thrown if a setup is unauthorized and cannot be applied because of a missing permission of the associated DAO.

This is thrown if the APPLY_INSTALLATION_PERMISSION_ID, APPLY_UPDATE_PERMISSION_ID, or APPLY_UNINSTALLATION_PERMISSION_ID is missing.

PluginNonupgradeable(address plugin) error

Thrown if a plugin is not upgradeable.

PluginProxyUpgradeFailed(address proxy, address implementation, bytes initData) error

Thrown if the upgrade of an UUPSUpgradeable proxy contract (see [ERC-1822](https://eips.ethereum.org/EIPS/eip-1822)) failed.

IPluginNotSupported(address plugin) error

Thrown if a contract does not support the IPlugin interface.

PluginRepoNonexistent() error

Thrown if a plugin repository does not exist on the plugin repo registry.

SetupAlreadyPrepared(bytes32 preparedSetupId) error

Thrown if a plugin setup was already prepared indicated by the prepared setup ID.

SetupNotApplicable(bytes32 preparedSetupId) error

Thrown if a prepared setup ID is not eligible to be applied. This can happen if another setup has been already applied or if the setup wasn’t prepared in the first place.

InvalidUpdateVersion(struct PluginRepo.Tag currentVersionTag, struct PluginRepo.Tag newVersionTag) error

PluginAlreadyInstalled() error

Thrown if plugin is already installed and one tries to prepare or apply install on it.

InvalidAppliedSetupId(bytes32 currentAppliedSetupId, bytes32 appliedSetupId) error

Thrown if the applied setup ID resulting from the supplied setup payload does not match with the current applied setup ID.

InstallationPrepared(address sender, address dao, bytes32 preparedSetupId, contract PluginRepo pluginSetupRepo, struct PluginRepo.Tag versionTag, bytes data, address plugin, struct IPluginSetup.PreparedSetupData preparedSetupData) event

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

Emitted after a plugin installation was applied.

UpdatePrepared(address sender, address dao, bytes32 preparedSetupId, contract PluginRepo pluginSetupRepo, struct PluginRepo.Tag versionTag, struct IPluginSetup.SetupPayload setupPayload, struct IPluginSetup.PreparedSetupData preparedSetupData, bytes initData) event

UpdateApplied(address dao, address plugin, bytes32 preparedSetupId, bytes32 appliedSetupId) event

Emitted after a plugin update was applied.

UninstallationPrepared(address sender, address dao, bytes32 preparedSetupId, contract PluginRepo pluginSetupRepo, struct PluginRepo.Tag versionTag, struct IPluginSetup.SetupPayload setupPayload, struct PermissionLib.MultiTargetPermission[] permissions) event

UninstallationApplied(address dao, address plugin, bytes32 preparedSetupId) event

Emitted after a plugin installation was applied.

canApply(address _dao, bytes32 _permissionId) modifier

constructor(contract PluginRepoRegistry _repoRegistry) public

prepareInstallation(address _dao, struct PluginSetupProcessor.PrepareInstallationParams _params) → address plugin, struct IPluginSetup.PreparedSetupData preparedSetupData external

applyInstallation(address _dao, struct PluginSetupProcessor.ApplyInstallationParams _params) external

prepareUpdate(address _dao, struct PluginSetupProcessor.PrepareUpdateParams _params) → bytes initData, struct IPluginSetup.PreparedSetupData preparedSetupData external

applyUpdate(address _dao, struct PluginSetupProcessor.ApplyUpdateParams _params) external

prepareUninstallation(address _dao, struct PluginSetupProcessor.PrepareUninstallationParams _params) → struct PermissionLib.MultiTargetPermission[] permissions external

applyUninstallation(address _dao, struct PluginSetupProcessor.ApplyUninstallationParams _params) external

validatePreparedSetupId(bytes32 pluginInstallationId, bytes32 preparedSetupId) public

Validates that a setup ID can be applied for applyInstallation, applyUpdate, or applyUninstallation.

If the block number stored in states[pluginInstallationId].blockNumber exceeds the one stored in pluginState.preparedSetupIdToBlockNumber[preparedSetupId], the prepared setup with preparedSetupId is outdated and not applicable anymore.