Burn and Mint Tokens using Zwallet

ZCN smart contract allows conversion of native ZCN token network to Ethereum wrapped WZCN token and from wrapped Ethereum WZCN token to native ZCN token through minting and burning of tokens using zwalletcli.\

Get Started

Import your Ethereum Account

./zwallet bridge-import-account command can be used to import your ethereum account Here are the parameters for the command.

Parameter
Required
Description

--mnemonic

Yes

Ethereum Wallet Mnemonic Phrase

--password

Yes

Ethereum Wallet Password

Sample Command:

./zwallet bridge-import-account --mnemonic "$MNEMONIC_PHRASE" --password "$ETHEREUM_WALLET_PASSWORD"

Sample Response:

Imported account $ETHEREUM_WALLET_ADDRESS 
to path: $WALLET_CONFIG_DIRECTORY

Prerequisites

In order to perform DEX operations using zwalletcli basic config.yaml 0chain configuration file should be extended with the following params

---
block_worker: https://demo.zus.network/dns
signature_scheme: bls0chain
min_submit: 50 # in percentage
min_confirmation: 50 # in percentage
confirmation_chain_length: 3
ethereum_node_url: https://goerli.infura.io/v3/6141be73a15d47748af0dc14f53d57d7
store_unlock_duration_sec: 2

bridge:
  bridge_address: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
  token_address: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
  authorizers_address: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
  ethereum_address: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
  password: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

Burn ZCN and Mint WZCN token

  1. Navigate into zwalletCLI directory

2. Run the command below to list or check whether your ethereum account is imported successfully in key vault.

Sample Response:

3. Create ZCN wallet and fill it with tokens using the ./zwallet faucet command.

Sample Response:

4. Now to burn some ZCN tokens use the following command:

Sample Response:

The response will output an zcn-burn-hash like above which can be used to fetch details about the burn transaction and mint WZCN tokens.

5. Here is a command for checking details about the ZCN burn transaction:

Sample Response:

6. Mint WZCN tokens using the command below:

Sample Response:

Burn WZCN and Mint ZCN

  1. Run the command below to list or check whether your ethereum account is imported successfully in key vault. If not import your Ethereum Account.

    Sample Response:

  2. Fill your ethereum wallet with WZCN tokens can be done using metamask.

  3. Burn WZCN tokens using the following command :

List Authorizers

./zwallet bridge-list-auth command can be used to list all authroizers available to validate client transactions.

Sample Command:

Sample Response:

Show Authorizer Configuration

./zwallet bridge-auth-config command can be used to view authorizer configuration. Here are the parameters for the command.\

Parameter
Required
Description

--id

Yes

Provide Authorizer ID to view its configuration . Can be fetched using list authorizers command.

--help

Syntax Help for the command

Sample Command:

Sample Response:

Show ZCNBridge Configurations

./zwallet bridge-config command can be used to view ZCNBridge configuration. To understand how to initialize a bridge client configurations check Intialize a Bridge Client.

Sample Command:

Sample Response:

Last updated