Moonriver
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 Moonriver, check out local development guide.
In this example we will integrate vKSM 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 vKSM minting in your contract
Constructing vKSM redemption in your contract
Network
SLPx contract address under Moonriver network:
Moonriver
0x6b0A44c64190279f7034b77c13a566E914FE5Ec4
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 vKSM minting and redemption into your contract. To do this, follow the examples below and adjust your inputs accordingly.
Mint 1 KSM into vKSM and send it to Moonriver.
Redeem 1 vKSM into KSM and send it to Moonriver.
Currency id & Destination Chain id
Configure your currency id and chain id inputs by checking the params below:
Moonriver
Chains
Dest_Chain_Id
Receiver Type
Moonriver
1284
Ethereum Address(Byets20)
xcBNC
0xFFfFFfFFF075423be54811EcB478e911F22dDe7D
0x0001
1_000_000_000_000
xcKSM
0xFfFFfFff1FcaCBd218EDc0EbA20Fc2308C778080
0x0204
500_000_000_000
MOVR
0x0000000000000000000000000000000000000802
0x020a
500_000_000_000_000_000
Bifrost_Voucher_BNC
0xFFffffff3646A00f78caDf8883c5A2791BfCDdc4
0x0101
800_000_000_000
Bifrost_Voucher_KSM
0xFFffffFFC6DEec7Fc8B11A2C8ddE9a59F8c62EFe
0x0104
400_000_000_000
Bifrost_Voucher_MOVR
0xfFfffFfF98e37bF6a393504b5aDC5B53B4D0ba11
0x010a
400_000_000_000_000_000
XcmOracle
XCM Oracle is a an oracle tool to query Vasset storage from Bifrost chain, you can learn more via here.
Moonriver
0x682D05cD8D96b9904eC2b1B97BD1eb640B10fC2d
KSM / MOVR / BNC
Contract info
Last updated