Skip to content

Commit

Permalink
multisig
Browse files Browse the repository at this point in the history
  • Loading branch information
hujw77 committed Aug 7, 2024
1 parent c395b49 commit 12834b6
Show file tree
Hide file tree
Showing 6 changed files with 640 additions and 1 deletion.
47 changes: 47 additions & 0 deletions src/plugins/multisig/IMultisig.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
// SPDX-License-Identifier: AGPL-3.0-or-later

pragma solidity ^0.8.17;

import {IDAO} from "@aragon/osx/core/dao/IDAO.sol";

/// @title IMultisig
/// @author Aragon Association - 2023
/// @notice An interface for an on-chain multisig governance plugin in which a proposal passes if X out of Y approvals are met.
interface IMultisig {
/// @notice 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.
/// @param _members The addresses of the members to be added.
function addAddresses(address[] calldata _members) external;

/// @notice 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.
/// @param _members The addresses of the members to be removed.
function removeAddresses(address[] calldata _members) external;

/// @notice Approves and, optionally, executes the proposal.
/// @param _proposalId The ID of the proposal.
/// @param _tryExecution If `true`, execution is tried after the approval cast. The call does not revert if execution is not possible.
function approve(uint256 _proposalId, bool _tryExecution) external;

/// @notice Checks if an account can participate on a proposal vote. This can be because the vote
/// - was executed, or
/// - the voter is not listed.
/// @param _proposalId The proposal Id.
/// @param _account The address of the user to check.
/// @return Returns true if the account is allowed to vote.
/// @dev The function assumes the queried proposal exists.
function canApprove(uint256 _proposalId, address _account) external view returns (bool);

/// @notice Checks if a proposal can be executed.
/// @param _proposalId The ID of the proposal to be checked.
/// @return True if the proposal can be executed, false otherwise.
function canExecute(uint256 _proposalId) external view returns (bool);

/// @notice Returns whether the account has approved the proposal. Note, that this does not check if the account is listed.
/// @param _proposalId The ID of the proposal.
/// @param _account The account address to be checked.
/// @return The vote option cast by a voter for a certain proposal.
function hasApproved(uint256 _proposalId, address _account) external view returns (bool);

/// @notice Executes a proposal.
/// @param _proposalId The ID of the proposal to be executed.
function execute(uint256 _proposalId) external;
}
Loading

0 comments on commit 12834b6

Please sign in to comment.