Assessment reports>Initia>Threat Model>Module multisig.move

Module multisig.move

This module allows to create and manage multi-sig accounts with a set of N members. Any of the members can create a proposal for executing a transaction from the account, and a minimum number of members K (0<=K<=N) must authorize the proposal to execute it.

Function: create_multisig_account

This function can be used to create a new multi-sig account.

Inputs

  • account: &signer

    • Validation: Must be a member of the multi-sig.

    • Impact: Creator of the multi-sig account.

  • name: String

    • Validation: None required.

    • Impact: Used to derive the address of the multi-sig.

  • members: vector<address>

    • Validation: Must contain account.

    • Impact: Members of the multi-sig.

  • threshold: u64

    • Validation: Must be at most the number of members.

    • Impact: Number of signers required to perform an action.

  • max_voting_period_height: Option<u64>

    • Validation: None.

    • Impact: Optional maximum number of blocks limiting the voting period of a proposal.

  • max_voting_period_timestamp: Option<u64>

    • Validation: None.

    • Impact: Optional maximum time window limiting the voting period of a proposal.

Function: create_proposal

This function can be used by a member of the multi-sig to create a new proposal.

Inputs

  • account: &signer

    • Validation: Must be a member of the multi-sig.

    • Impact: Authorizes proposal creation.

  • multisig_addr: address

    • Validation: Must be the address of a multi-sig.

    • Impact: Address of the multi-sig for which the proposal will be created.

  • module_address: address

    • Validation: None.

    • Impact: Address of the module to call.

  • module_name: String

    • Validation: None.

    • Impact: Name of the module to call.

  • function_name: String

    • Validation: None.

    • Impact: Name of the function to call.

  • type_args: vector<String>

    • Validation: None.

    • Impact: Type arguments provided to the function to call.

  • args: vector<vector<u8>>

    • Validation: None.

    • Impact: BCS-serialized arguments provided to the function to call.

Function: vote_proposal

This function can be used by a member of a multi-sig to endorse or reject a proposal.

Inputs

  • account: &signer

    • Validation: Must be a member of the multi-sig.

    • Impact: Authorizes the vote.

  • multisig_addr: address

    • Validation: Must be the address of a multi-sig.

    • Impact: Address of the multi-sig.

  • proposal_id: u64

    • Validation: Must be the ID of a nonexpired pending proposal for multisig_address.

    • Impact: Identifies the proposal to be voted on.

  • vote_yes: bool

    • Validation: None.

    • Impact: Determines whether the vote endorses or rejects a proposal.

Function: execute_proposal

This function can be used to execute a proposal that has accrued enough votes from its members.

Inputs

  • account: &signer

    • Validation: Must be a member of the multi-sig.

    • Impact: Authorizes execution of the proposal.

  • multisig_addr: address

    • Validation: Must be a multi-sig.

    • Impact: Address of the multi-sig.

  • proposal_id: u64

    • Validation: Must be the ID of a pending, nonexpired proposal that has accrued enough positive votes.

    • Impact: Identifies the proposal to be executed.

Function: update_config

This function can be used to update the configuration of a multi-sig: its members, the required threshold, and the maximum voting period windows. The function can only be invoked by the multi-sig address on itself, by executing a proposal voted by enough members.

Inputs

  • account: &signer

    • Validation: Address of the multi-sig to update.

    • Impact: Multi-sig to update.

  • new_members: vector<address>

    • Validation: Must contain at least new_threshold members and contain unique members.

    • Impact: Set of new members of the multi-sig.

  • new_threshold: u64

    • Validation: Must be at most the number of new_members.

    • Impact: New required threshold.

  • new_max_voting_period_height: Option<u64>

    • Validation: None.

    • Impact: Optional new maximum number of blocks for which the proposal voting period can last.

  • new_max_voting_period_timestamp: Option<u64>

    • Validation: None.

    • Impact: Optional new maximum time window for which the proposal voting period can last.

Zellic © 2024Back to top ↑