Admin API

The contracts of build 2(use build 1) are currently being audited, DO NOT USE IN PRODUCTION.

Core

Admin

v1.2 (Release 1, Build 2)

initialize(contract IDAO _dao, struct IPlugin.TargetConfig _targetConfig) external

Initializes the contract.

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

supportsInterface(bytes4 _interfaceId) → bool public

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

isMember(address _account) → bool external

Checks if an account is a member of the DAO.

This function must be implemented in the plugin contract that introduces the members to the DAO.

customProposalParamsABI() → string external

The human-readable abi format for extra params included in data of createProposal.

Used for UI to easily detect what extra params the contract expects.

createProposal(bytes _metadata, struct Action[] _actions, uint64, uint64, bytes _data) → uint256 proposalId public

Creates a new proposal.

hasSucceeded(uint256) → bool public

Whether proposal succeeded or not.

Note that this must not include time window checks and only make a decision based on the thresholds.

canExecute(uint256) → bool public

Checks if a proposal can be executed.

execute(uint256) public

Executes a proposal.

Note that this function will always revert since this contract doesn’t store proposals and only executes the actions at run-time. This function is still necessary to allow compiling the contract as Admin inherits from IProposal.

executeProposal(bytes _metadata, struct Action[] _actions, uint256 _allowFailureMap) → uint256 proposalId public

Creates and executes a new proposal.

EXECUTE_PROPOSAL_PERMISSION_ID() → bytes32 public

The ID of the permission required to call the executeProposal function.

FunctionNotSupported() error

Thrown if the execute function is called.

bytes4 ADMIN_INTERFACE_ID internal constant

The [ERC-165](https://eips.ethereum.org/EIPS/eip-165) interface ID of the contract.

AdminSetup

v1.2 (Release 1, Build 2)

constructor() public

The constructor setting the Admin implementation contract to clone from.

prepareInstallation(address _dao, bytes _data) → address plugin, struct IPluginSetup.PreparedSetupData preparedSetupData external

Prepares the installation of a plugin.

prepareUninstallation(address _dao, struct IPluginSetup.SetupPayload _payload) → struct PermissionLib.MultiTargetPermission[] permissions external

Prepares the uninstallation of a plugin.

Currently, there is no reliable way to revoke the ADMIN_EXECUTE_PERMISSION_ID from all addresses it has been granted to. Accordingly, only the EXECUTE_PERMISSION_ID is revoked for this uninstallation.

EXECUTE_PROPOSAL_PERMISSION_ID() → bytes32 public

The ID of the permission required to call the executeProposal function.

AdminAddressInvalid(address admin) error

Thrown if the admin address is zero.

bytes32 EXECUTE_PERMISSION_ID internal constant

The ID of the permission required to call the execute function.