How to deploy a Multisig Wallet

Create a Multisig wallet with TVM CLI

Prerequisites

Prepare wallet binary and ABI

Create a folder:

cd ~
mkdir wallet
cd wallet

Download the UpdateCustodianMultisigWallet.abi.jsonarrow-up-right and UpdateCustodianMultisigWallet.tvcarrow-up-right files for your wallet from the updatecustodianmultisigwallet repositoryarrow-up-right and place them in this folder.

circle-info

The contract code can be downloaded from herearrow-up-right

circle-exclamation

Configure CLI tool

In this guide, we will use the test network at shellnet.ackinacki.orgarrow-up-right. We need to specify the blockchain endpoint for deployment:

tvm-cli config -g --url shellnet.ackinacki.org

Generate seed phrase, keys and address

In Acki Nacki blockchain, the Multisig wallet address depends on its binary code and initial data, which includes the owner's public key.

You can generate everything with one command:

triangle-exclamation
circle-info

After this step, the .tvc file will be overwritten with the specified keys.

The Raw address is the future Multisig wallet address. Keys are saved to updateCustodianMultisigWallet.keys.

Be sure to copy your seed phrase if you need it.

Request Test tokens

VMSHELLarrow-up-right tokens are used to pay network fees and are derived from SHELLarrow-up-right tokens. On the Mainnet, SHELL tokens are purchased via a special pool and then converted into VMSHELL tokens.

On the test network, you can request test tokens to be sent to your address. Please contact us on Telegramarrow-up-right to receive them.

circle-info

If you plan to test your smart contract systems, you can use the provided Multisig wallet to top up contract balances in order to cover gas fees.

Deploy your Multisig wallet

Once you receive the test tokens, check the state of the pre-deployed contract. It should be Uninit:

circle-check

Now you are ready to deploy your Multisig wallet using the following command:

The arguments for the constructor must be enclosed in curly brackets: {<constructor arguments>}

  • owners_pubkey — an array of custodians’ public keys. Each key must include the 0x prefix

  • owners_address — an array of custodian contract addresses.

  • reqConfirms — the number of signatures required to approve a transaction.

  • reqConfirmsData — the number of confirmations required to approve a change of custodians.

  • value — the amount (in nanotokensarrow-up-right) of SHELL tokens you want to exchange for VMSHELL. If the exchange is not required, set the parameter value to 0.

In our example, the command will be as follows:

Check the contract state again. This time, it should be Active

circle-info

The contract deployment fee was deducted from the VMSHELL balance.

circle-check

Multisig Wallet API

In the examples below:

circle-info

The transaction expiration time is 1 hour.

How to Send Tokens From Multisig Wallet

If the required number of confirmations for transactions is 1, tokens can be sent using the function sendTransaction:

Parameters

circle-exclamation

Example command:

If confirmation from multiple custodians is required, use the function submitTransaction:

Parameters

Return value

  • transactionId — identifier of the created multisig transaction. This id is later used in confirmTransaction.

circle-exclamation

Example command:

circle-info

If the required number of confirmations for transactions is 1, submitTransaction behaves like sendTransaction and executes immediately.

How to Confirm a Transaction

To do this, use the function confirmTransaction

Parameters

  • transactionId — identifier of the transaction to confirm. You receive it as a result of calling submitTransaction

circle-info

If the transaction has already expired, it will be deleted.

Example command:

How to create a request to update Multisig data

To change the list of custodians and the required number of confirmations, use the function submitDataUpdate

Parameters

  • owners_pubkey — array of custodian public keys;

  • owners_address — array of custodian addresses;

  • reqConfirms — required confirmations for regular transactions;

  • reqConfirmsData — required confirmations for data update operations;

Return value

  • dataUpdateId— identifier of the created multisig transaction. This id is later used in confirmDataUpdate

Example command:

How to confirm a request to update the Multisig data

To do this, use the function confirmDataUpdate

Parameters

  • dataUpdateId — identifier of the data update request. You receive it as a result of calling submitDataUpdate

circle-info

If the request is expired, it will be removed

Example command:

circle-exclamation

Last updated