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
Ethereum Wallet Mnemonic Phrase
Sample Command:
Copy ./zwallet bridge-import-account --mnemonic "$MNEMONIC_PHRASE" --password "$ETHEREUM_WALLET_PASSWORD"
Sample Response:
Copy 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
Copy ---
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
Navigate into zwalletCLI directory
2. Run the command below to list or check whether your ethereum account is imported successfully in key vault.
Copy ./zwallet bridge-list-accounts
Sample Response:
Copy Ethereum available account: $ETHEREUM_WALLET_ID
3. Create ZCN wallet and fill it with tokens using the ./zwallet faucet
command.
Copy ./zwallet faucet --methodName pour --input “{Pay day}”
Sample Response:
Copy Execute faucet smart contract success with txn : 04f9a181c87a77306d4a6aa6473385eecacfa04c12933d96f1fae74e0c017949
4. Now to burn some ZCN tokens use the following command:
Copy ./zwallet bridge-burn-zcn --token 1
Sample Response:
Copy Executed smart contract successfully with txn: $ZCN_BURN_HASH
Transaction completed successfully:
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:
Copy ./zwallet bridge-get-zcn-burn --hash $ZCN_BURN_HASH
Sample Response:
Copy ZCN burn ticket the completed consensus
Transaction nonce: 2
Transaction amount: 10000000000
ZCN transaction ID: $ZCN
6. Mint WZCN tokens using the command below:
Copy ./zwallet bridge-mint-wzcn --hash "zcn-burn-hash"
Sample Response:
Copy Sending mint transaction to Ethereum
Payload amount: 10000000000
Payload nonce: 2
ZCN transaction ID: 67b7e0ea1d6522b62e93b22aef140dc59d2a61c6b4469a3c8f8cb8ae09b32eaa
Starting to mint WZCN
failed to prepare bridge: failed to pack arguments: argument count mismatch: got 4 for 5
Burn WZCN and Mint ZCN
Copy ./zwallet bridge-list-accounts
Sample Response:
Copy Ethereum available account: $ETHEREUM_WALLET_ID
Burn WZCN tokens using the following command :
Copy ./zwallet bridge-burn-wzcn --amount 1
List Authorizers
./zwallet bridge-list-auth
command can be used to list all authroizers available to validate client transactions.
Sample Command:
Copy ./zwallet bridge-list-auth
Sample Response:
Copy [
{
"id": "2f945f7310689f17afd8c8cb291e1e3ba21677243aa1d404a2293064e7983d60",
"url": "https://demo.zus.network/authorizer01/"
},
{
"id": "7b07c0489e2f35d7c13160f4da2866b4aa69aa4e8d2b2cd9c4fc002693dca5d7",
"url": "https://demo.zus.network/authorizer02/"
},
{
"id": "896c171639937a647f9e91d5ba676be580f6d2b7e0d708e4fe6ea36610a13ffd",
"url": "https://demo.zus.network/authorizer03/"
}
]
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
Syntax Help for the command
Sample Command:
Copy ./zwallet bridge-auth-config --id $AUTHORIZER_ID
Sample Response:
Copy {
"id": "2f945f7310689f17afd8c8cb291e1e3ba21677243aa1d404a2293064e7983d60",
"url": "https://demo.zus.network/authorizer01/",
"fee": 0,
"latitude": 0,
"longitude": 0,
"last_health_check": 0,
"delegate_wallet": "",
"min_stake": 0,
"max_stake": 0,
"num_delegates": 0,
"service_charge": 0
}
Show ZCNBridge Configurations
Sample Command:
Copy ./zwallet bridge-config
Sample Response:
Copy burn_address 0000000000000000000000000000000000000000000000000000000000000000
cost.add-authorizer 100
cost.burn 100
cost.delete-authorizer 100
cost.mint 100
max_delegates 10
max_fee 100
min_authorizers 1
min_burn 1
min_lock 0
min_mint 1
min_stake 0
owner_id 1746b06bb09f55ee01b33b5e2e055d6cc7a900cb57c0a3a5eaabb8a0e7745802
percent_authorizers 0.7