Msig Contract
msig is short for multiple signature, which allows multiple accounts to sign a transaction together. It enables asynchronous proposal, approval, and publication of transactions that have been agreed upon by multiple parties. The ability to sign is determined based on the weight of the account or public key, and the signature is successful when the weight threshold is reached.
Operation Example
The dmc_client
object is an instance of dmc.js
, which provides a series of methods for interacting with the blockchain. The dmc_client
in the code examples below is created using the following code, and it is not reiterated further.
1 | var DMC = require('dmc.js'); |
propose
Submit Proposal.
Parameters
name | type | description |
---|---|---|
proposer | string | proposer |
proposal_name | string | proposal name |
requested | string | required Permissions for Proposal Approval |
trx | string | transaction Details of the Proposal Execution |
Instance
In the following example, we will use the extransfer
action from the dmc.token
contract as the transaction content for the proposal.
1 | let actions = [{ |
approve
Approve the proposal.
Parameters
name | type | description |
---|---|---|
proposer | string | proposer |
proposal_name | string | proposal name |
level | string | approve the proposal using which permission. |
Instance
1 | let r = dmc.transact_sync({ |
unapprove
disapprove the proposal.
Parameters
name | type | description |
---|---|---|
proposer | string | proposer |
proposal_name | string | proposal name |
level | string | disapprove the proposal using which permission. |
Instance
1 | let r = dmc.transact_sync({ |
cancel
To cancel a proposal.
Parameters
name | type | description |
---|---|---|
proposer | string | proposer |
proposal_name | string | proposal name |
canceler | string | the account that cancel a proposal |
Instance
1 | let r = dmc.transact_sync({ |
exec
To execute a proposal.
parameter
name | type | description |
---|---|---|
proposer | string | proposer |
proposal_name | string | proposal name |
executer | string | the account that execute a proposal |
Instance
1 | let r = dmc.transact_sync({ |