How to deploy a Multisig Wallet

Create a Multisig wallet with TVM CLI

Prerequisites

  • latest Rust release

  • cargo

Build and install CLI tool

cd ~
git clone https://github.com/tvmlabs/tvm-sdk
cd tvm-sdk
cargo install --path tvm_cli --force

The path to the tvm-cli is now publicly accessible. You can also add it to your environment variables (ENVs).

export PATH=$PATH:~/tvm-sdk/target/release

Prepare wallet binary and ABI

Create a folder:

cd ~
mkdir wallet
cd wallet

Download the multisig.abi.json and multisig.tvc files for your wallet from the multisig wallet repository and place them in this folder.

Configure CLI tool

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

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

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:

tvm-cli genaddr multisig.tvc --save --genkey multisig.keys.json

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 multisig.keys.json. Be sure to copy your seed phrase if you need it.

Request SHELL tokens

On Mainnet Shell tokens will be purchased via special pool

Request SHELL tokens to your address. If you plan to test your contract systems, you can use this Multisig wallet to top up the balances of these contracts to cover gas fees.

Please contact us in the Telegram Channel.

Deploy your Multisig wallet

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

tvm-cli account <YourAddress>

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

tvm-cli deploy --abi multisig.abi.json --sign multisig.keys.json multisig.tvc '{"owners":[<PubKeyList>], "reqConfirms":<ConfirmsNum>, "value":<Tokens>}'

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

  • owners: An array of custodian public keys. Each key must include the 0x prefix.

  • reqConfirms: The default number of confirmations required to execute a transaction.

  • value: The amount (in nanotokens) of SHELL tokens to be exchanged for VMSHELL tokens during deployment.

In our example, we specify the amount of 10,000,000,000 nanoSHELL, which will be converted into 10,000,000,000 nanoVMSHELL. From this amount, the deployment fee for the contract will be deducted, and the remaining balance will be credited to the Multisig wallet.

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

If you need VMSHELL tokens later, simply call the exchangeToken(uint64 value) method in the Multisig and exchange the required amount. For example, let's convert 10 SHELL tokens into 10 VMSHELL tokens:

tvm-cli call 0:d2ba0db26f05a5f661599e3dfa1a88349bd8a4826dbf5c701ddeb191c178f95e exchangeToken '{"value":10000000000}' --abi multisig.abi.json --sign multisig.keys.json

How to send tokens from Multisig Wallet

To replenish accounts before deployment, use the following command:

sendTransaction( address dest, uint128 value, mapping(uint32 => varuint32) cc, bool bounce, uint8 flags, TvmCell payload)
  • dest - the transfer target address;

  • value - the amount of funds (VMSHELL) to transfer (should be 0);

  • cc - the type of ECC token and amount to transfer;

  • bounce - bounce flag: (should be false);

  • flags -sendmsg flags (should be 1);

  • payload - tree of cells used as body of the outbound internal message (should be an empty string).

In this case, the fees will be paid from the Multisig wallet's account

For example, we transfer 5 SHELL from the Multisig wallet's balance to the address of the future contract, with the fees also being paid from the Multisig wallet's balance:

tvm-cli call 0:d2ba0db26f05a5f661599e3dfa1a88349bd8a4826dbf5c701ddeb191c178f95e sendTransaction '{"dest":"0:2672bb98816f2f9088d027f99681b65e05843b19367fe690cb4b5130d04eccf1", "value":0, "bounce":false, "cc": {"2": 5000000000}, "flags": 1, "payload": ""}' --abi multisig.abi.json --sign multisig.keys.json

Last updated