Skip to main content

IMultisig

Description

An interface for an on-chain multisig governance plugin in which a proposal passes if X out of Y approvals are met.

Implementation

external function addAddresses

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.

function addAddresses(address[] _members) external
InputTypeDescription
_membersaddress[]The addresses of the members to be added.

external function removeAddresses

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.

function removeAddresses(address[] _members) external
InputTypeDescription
_membersaddress[]The addresses of the members to be removed.

external function approve

Approves and, optionally, executes the proposal.

function approve(uint256 _proposalId, bool _tryExecution) external
InputTypeDescription
_proposalIduint256The ID of the proposal.
_tryExecutionboolIf true, execution is tried after the approval cast. The call does not revert if execution is not possible.

external function canApprove

Checks if an account can participate on a proposal vote. This can be because the vote

  • was executed, or
  • the voter is not listed.
function canApprove(uint256 _proposalId, address _account) external view returns (bool)
InputTypeDescription
_proposalIduint256The proposal Id.
_accountaddressThe address of the user to check.
Output
0boolReturns true if the account is allowed to vote.

The function assumes the queried proposal exists.

external function canExecute

Checks if a proposal can be executed.

function canExecute(uint256 _proposalId) external view returns (bool)
InputTypeDescription
_proposalIduint256The ID of the proposal to be checked.
Output
0boolTrue if the proposal can be executed, false otherwise.

external function hasApproved

Returns whether the account has approved the proposal. Note, that this does not check if the account is listed.

function hasApproved(uint256 _proposalId, address _account) external view returns (bool)
InputTypeDescription
_proposalIduint256The ID of the proposal.
_accountaddressThe account address to be checked.
Output
0boolThe vote option cast by a voter for a certain proposal.

external function execute

Executes a proposal.

function execute(uint256 _proposalId) external
InputTypeDescription
_proposalIduint256The ID of the proposal to be executed.
© 2024