Astar
Introduction
This guide will show how to integrate SLPx in your contact logic. It is based on the SLPx vTokenminting code example. To run this example, check out the guide below.
To get started with local development on Astar, check out local development guide.
In this example we will integrate vDOT minting & redemption in our contract logic. The tokens, amount of input token, destination chain id, and channel id can be configured as inputs.
The guide will cover:
Clarifying the contract info
Constructing vDOT minting in your contract
Constructing vDOT redemption in your contract
Network
SLPx contract address under Astar network:
Astar
0xc6bf0C5C78686f1D0E2E54b97D6de6e2cEFAe9fD
Contract info
Before starting, let's talk about the values we fetched here and what they represent:
create_order
calls the SLPx contract to mint or redeem vAsset on the Bifrost chain.assetAddress
is the address of the asset you want to mint or redeem.amount
is the amount of the asset you want to mint or redeem.dest_chain_id
represents the chain that your contract is deploying on, once thatorder
increate_order
is executed on Bifrost, Asset/vAsset will be transferred to this chain.receiver
is the asset receiver address on the destination chain, 20 bytes for EVM, 32 bytes for Substrate.remark
is the remark of theorder
, less than 32 bytes. For example, "OmniLS"channel_id
is a unique identifier for theorder
. It's used to join Bifrost Protocol Revenue Sharing Program (RSP). You can set it if you have one. Check here to learn more.
Examples
We assume you're trying to integrate vDOT minting and redemption into your contract. To do this, follow the examples below and adjust your inputs accordingly.
Mint 1 DOT into VDOT and send it to Astar.
Redeem 1 VDOT into DOT and send it to Astar.
Currency id & Destination Chain id
Configure your currency id and chain id inputs by checking the params below:
Astar
Astar
592
Ethereum Address(Byets20)
BNC
0xfFffFffF00000000000000010000000000000007
0x0001
1_000_000_000_000
DOT
0xFFfFfFffFFfffFFfFFfFFFFFffFFFffffFfFFFfF
0x0800
1_000_000_000_000
ASTR
0x0000000000000000000000000000000000000000
0x0803
1_000_000_000_000_000_000
GLMR
0xFFFFFFFF00000000000000010000000000000003
0x0801
1_000_000_000_000_000_000
Bifrost_Voucher_DOT
0xFfFfFfff00000000000000010000000000000008
0x0900
6_000_000_000
Bifrost_Voucher_GLMR
0xFFFFFFFF00000000000000010000000000000015
0x0901
800_000_000_000_000_000
Bifrost_Voucher_ASTR
0xfffFffff00000000000000010000000000000010
0x0903
800_000_000_000_000_000
Last updated