Multisig API

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

Core

Multisig

v1.3 (Release 1, Build 3). For each upgrade, if the reinitialization step is required, increment the version numbers in the modifier for both the initialize and initializeFrom functions.

Functions
ProposalUpgradeable
ProtocolVersion
DaoAuthorizableUpgradeable

initialize(contract IDAO _dao, address[] _members, struct Multisig.MultisigSettings _multisigSettings, struct IPlugin.TargetConfig _targetConfig, bytes _pluginMetadata) external

Initializes Release 1, Build 3.

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

initializeFrom(uint16 _fromBuild, bytes _initData) external

Reinitializes the Multisig after an upgrade from a previous build version. For each reinitialization step, use the _fromBuild version to decide which internal functions to call for reinitialization.

The contract should only be upgradeable through PSP to ensure that _fromBuild is not incorrectly passed, and that the appropriate permissions for the upgrade are properly configured.

supportsInterface(bytes4 _interfaceId) → bool public

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

addAddresses(address[] _members) external

Adds new members to the address list. Previously, it checks if the new address list length would be greater than type(uint16).max, the maximal number of approvals.

Requires the UPDATE_MULTISIG_SETTINGS_PERMISSION_ID permission.

removeAddresses(address[] _members) external

Removes existing members from the address list. Previously, it checks if the new address list length is at least as long as the minimum approvals parameter requires. Note that minApprovals is must be at least 1 so the address list cannot become empty.

Requires the UPDATE_MULTISIG_SETTINGS_PERMISSION_ID permission.

updateMultisigSettings(struct Multisig.MultisigSettings _multisigSettings) external

Updates the plugin settings.

Requires the UPDATE_MULTISIG_SETTINGS_PERMISSION_ID permission.

createProposal(bytes _metadata, struct Action[] _actions, uint256 _allowFailureMap, bool _approveProposal, bool _tryExecution, uint64 _startDate, uint64 _endDate) → uint256 proposalId public

Creates a new multisig proposal.

Requires the CREATE_PROPOSAL_PERMISSION_ID permission.

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

Creates a new proposal.

Calls a public function that requires the CREATE_PROPOSAL_PERMISSION_ID permission.

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.

approve(uint256 _proposalId, bool _tryExecution) public

Records an approval for a proposal and, if specified, attempts execution if certain conditions are met.

If _tryExecution is true, the function attempts execution after recording the approval. Execution will only proceed if the proposal is no longer open, the minimum approval requirements are met, and the caller has been granted execution permission. If execution conditions are not met, the function does not revert.

canApprove(uint256 _proposalId, address _account) → bool external

Checks if an account is eligible to participate in a proposal vote. Confirms that the proposal is open, the account is listed as a member, and the account has not previously voted or approved this proposal.

Reverts if the proposal with the given _proposalId does not exist.

canExecute(uint256 _proposalId) → bool external

Checks if a proposal can be executed.

Reverts if the proposal with the given _proposalId does not exist.

hasSucceeded(uint256 _proposalId) → bool external

Whether proposal succeeded or not.

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

getProposal(uint256 _proposalId) → bool executed, uint16 approvals, struct Multisig.ProposalParameters parameters, struct Action[] actions, uint256 allowFailureMap, struct IPlugin.TargetConfig targetConfig public

Returns all information for a proposal by its ID.

hasApproved(uint256 _proposalId, address _account) → bool public

Returns whether the account has approved the proposal.

May return false if the _proposalId or _account do not exist, as the function does not verify their existence.

execute(uint256 _proposalId) public

Executes a proposal if all execution conditions are met.

Requires the EXECUTE_PROPOSAL_PERMISSION_ID permission. Reverts if the proposal is still open or if the minimum approval threshold has not been met.

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.

_execute(uint256 _proposalId) internal

Internal function to execute a proposal.

It assumes the queried proposal exists.

_canApprove(uint256 _proposalId, address _account) → bool internal

Internal function to check if an account can approve.

It assumes the queried proposal exists.

_canExecute(uint256 _proposalId) → bool internal

Internal function to check if a proposal can be executed.

It assumes the queried proposal exists.

_isProposalOpen(struct Multisig.Proposal proposal_) → bool internal

Internal function to check if a proposal is still open.

_updateMultisigSettings(struct Multisig.MultisigSettings _multisigSettings) internal

Internal function to update the plugin settings.

UPDATE_MULTISIG_SETTINGS_PERMISSION_ID() → bytes32 public

The ID of the permission required to call the addAddresses, removeAddresses and updateMultisigSettings functions.

CREATE_PROPOSAL_PERMISSION_ID() → bytes32 public

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

EXECUTE_PROPOSAL_PERMISSION_ID() → bytes32 public

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

multisigSettings() → struct Multisig.MultisigSettings public

The current plugin settings.

lastMultisigSettingsChange() → uint64 public

Keeps track at which block number the multisig settings have been changed the last time.

This variable prevents a proposal from being created in the same block in which the multisig settings change.

Approved(uint256 indexed proposalId, address indexed approver) event

Emitted when a proposal is approve by an approver.

MultisigSettingsUpdated(bool onlyListed, uint16 indexed minApprovals) event

Emitted when the plugin settings are set.

ProposalCreationForbidden(address sender) error

Thrown when a sender is not allowed to create a proposal.

NonexistentProposal(uint256 proposalId) error

Thrown when a proposal doesn’t exist.

ApprovalCastForbidden(uint256 proposalId, address sender) error

Thrown if an approver is not allowed to cast an approve. This can be because the proposal - is not open, - was executed, or - the approver is not on the address list

ProposalExecutionForbidden(uint256 proposalId) error

Thrown if the proposal execution is forbidden.

MinApprovalsOutOfBounds(uint16 limit, uint16 actual) error

Thrown if the minimal approvals value is out of bounds (less than 1 or greater than the number of members in the address list).

AddresslistLengthOutOfBounds(uint16 limit, uint256 actual) error

Thrown if the address list length is out of bounds.

ProposalAlreadyExists(uint256 proposalId) error

Thrown if the proposal with the same id already exists.

DateOutOfBounds(uint64 limit, uint64 actual) error

Thrown if a date is out of bounds.

bytes4 MULTISIG_INTERFACE_ID internal constant

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

mapping(uint256 => struct Multisig.Proposal) proposals internal

A mapping between proposal IDs and proposal information.

MultisigSetup

v1.3 (Release 1, Build 3)

Errors
PluginUpgradeableSetup

constructor() public

The contract constructor, that deploys the Multisig plugin logic contract.

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

Prepares the installation of a plugin.

prepareUpdate(address _dao, uint16 _fromBuild, struct IPluginSetup.SetupPayload _payload) → bytes initData, struct IPluginSetup.PreparedSetupData preparedSetupData external

Prepares the update of a plugin.

Revoke the upgrade plugin permission to the DAO for all builds prior the current one (3).

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

Prepares the uninstallation of a plugin.

ListedCheckCondition

constructor(address _multisig) public

Initializes the condition with the address of the Multisig plugin.

isGranted(address _where, address _who, bytes32 _permissionId, bytes _data) → bool public

Checks if a call is permitted.