Wire Sysio Wire Sysion 1.0.0
|
#include <sysio.msig.hpp>
Public Types | |
using | propose_action = sysio::action_wrapper<"propose"_n, &multisig::propose> |
using | approve_action = sysio::action_wrapper<"approve"_n, &multisig::approve> |
using | unapprove_action = sysio::action_wrapper<"unapprove"_n, &multisig::unapprove> |
using | cancel_action = sysio::action_wrapper<"cancel"_n, &multisig::cancel> |
using | exec_action = sysio::action_wrapper<"exec"_n, &multisig::exec> |
using | invalidate_action = sysio::action_wrapper<"invalidate"_n, &multisig::invalidate> |
Public Member Functions | |
void | propose (ignore< name > proposer, ignore< name > proposal_name, ignore< std::vector< permission_level > > requested, ignore< transaction > trx) |
void | approve (name proposer, name proposal_name, permission_level level, const sysio::binary_extension< sysio::checksum256 > &proposal_hash) |
void | unapprove (name proposer, name proposal_name, permission_level level) |
void | cancel (name proposer, name proposal_name, name canceler) |
void | exec (name proposer, name proposal_name, name executer) |
void | invalidate (name account) |
The sysio.msig
system contract allows for creation of proposed transactions which require authorization from a list of accounts, approval of the proposed transactions by those accounts required to approve it, and finally, it also allows the execution of the approved transactions on the blockchain.
In short, the workflow to propose, review, approve and then executed a transaction it can be described by the following:
sysio.msig
contract, and you also insert the account permissions required to approve this proposal into the command that submits the proposal to the blockchain,sysio.msig
contract, and is accessible for review and approval to those accounts required to approve it,sysio.msig
contract will execute it automatically, but not before validating that the transaction has not expired, it is not cancelled, and it has been signed by all the permissions in the initial proposal's required permission list. Definition at line 19 of file sysio.msig.hpp.
using sysio::multisig::approve_action = sysio::action_wrapper<"approve"_n, &multisig::approve> |
Definition at line 110 of file sysio.msig.hpp.
using sysio::multisig::cancel_action = sysio::action_wrapper<"cancel"_n, &multisig::cancel> |
Definition at line 112 of file sysio.msig.hpp.
using sysio::multisig::exec_action = sysio::action_wrapper<"exec"_n, &multisig::exec> |
Definition at line 113 of file sysio.msig.hpp.
using sysio::multisig::invalidate_action = sysio::action_wrapper<"invalidate"_n, &multisig::invalidate> |
Definition at line 114 of file sysio.msig.hpp.
using sysio::multisig::propose_action = sysio::action_wrapper<"propose"_n, &multisig::propose> |
Definition at line 109 of file sysio.msig.hpp.
using sysio::multisig::unapprove_action = sysio::action_wrapper<"unapprove"_n, &multisig::unapprove> |
Definition at line 111 of file sysio.msig.hpp.
void sysio::multisig::approve | ( | name | proposer, |
name | proposal_name, | ||
permission_level | level, | ||
const sysio::binary_extension< sysio::checksum256 > & | proposal_hash ) |
Approve action approves an existing proposal. Allows an account, the owner of level
permission, to approve a proposal proposal_name
proposed by proposer
. If the proposal's requested approval list contains the level
permission then the level
permission is moved from internal requested_approvals
list to internal provided_approvals
list of the proposal, thus persisting the approval for the proposal_name
proposal. Storage changes are billed to proposer
.
proposer | - The account proposing a transaction |
proposal_name | - The name of the proposal (should be unique for proposer) |
level | - Permission level approving the transaction |
proposal_hash | - Transaction's checksum |
Definition at line 59 of file sysio.msig.cpp.
Cancel action cancels an existing proposal.
proposer | - The account proposing a transaction |
proposal_name | - The name of the proposal (should be an existing proposal) |
canceler | - The account cancelling the proposal (only the proposer can cancel an unexpired transaction, and the canceler has to be different than the proposer) |
Allows the canceler
account to cancel the proposal_name
proposal, created by a proposer
, only after time has expired on the proposed transaction. It removes corresponding entries from internal proptable and from approval (or old approvals) tables as well.
Definition at line 118 of file sysio.msig.cpp.
Exec action allows an executer
account to execute a proposal.
Preconditions:
executer
has authorization,proposal_name
is found in the proposals table,If all preconditions are met the transaction is executed as a deferred transaction, and the proposal is erased from the proposals table.
proposer | - The account proposing a transaction |
proposal_name | - The name of the proposal (should be an existing proposal) |
executer | - The account executing the transaction |
Definition at line 142 of file sysio.msig.cpp.
void sysio::multisig::invalidate | ( | name | account | ) |
Invalidate action allows an account
to invalidate itself, that is, its name is added to the invalidations table and this table will be cross referenced when exec is performed.
account | - The account invalidating the transaction |
Definition at line 191 of file sysio.msig.cpp.
void sysio::multisig::propose | ( | ignore< name > | proposer, |
ignore< name > | proposal_name, | ||
ignore< std::vector< permission_level > > | requested, | ||
ignore< transaction > | trx ) |
Propose action, creates a proposal containing one transaction. Allows an account proposer
to make a proposal proposal_name
which has requested
permission levels expected to approve the proposal, and if approved by all expected permission levels then trx
transaction can we executed by this proposal. The proposer
account is authorized and the trx
transaction is verified if it was authorized by the provided keys and permissions, and if the proposal name doesn’t already exist; if all validations pass the proposal_name
and trx
trasanction are saved in the proposals table and the requested
permission levels to the approvals table (for the proposer
context). Storage changes are billed to proposer
.
proposer | - The account proposing a transaction |
proposal_name | - The name of the proposal (should be unique for proposer) |
requested | - Permission levels expected to approve the proposal |
trx | - Proposed transaction |
Definition at line 9 of file sysio.msig.cpp.
void sysio::multisig::unapprove | ( | name | proposer, |
name | proposal_name, | ||
permission_level | level ) |
Unapprove action revokes an existing proposal. This action is the reverse of the approve
action: if all validations pass the level
permission is erased from internal provided_approvals
and added to the internal requested_approvals
list, and thus un-approve or revoke the proposal.
proposer | - The account proposing a transaction |
proposal_name | - The name of the proposal (should be an existing proposal) |
level | - Permission level revoking approval for proposal |
Definition at line 94 of file sysio.msig.cpp.