EOSIO <> EOSIO Atomic Assets Non-Fungible Tokens

This guide will essentially map the atomictokenpegeosio.spec.js unit test.

Resources:

Steps:

  • Install Zeus if not installed, zeus is used to unbox or install all the necessary dependencies to compile and deploy the necessary contracts.

  • Add LiquidX mapping file

/zeus_boxes/liquidx/models/eosio-chains/liquidxxtwax.json

The following file is for the destination chain's information.

/zeus_boxes/liquidx/models/liquidx-mappings/sidechain_name.dappservices.json

This file allows for the compiler to insert relevant chain information into the contract header.

  • Compile contracts

Update the atomic assets contract account name for each contract

If you do not perform the above step before compiling, your bridge will not function because it will not be able to detect incoming transfers.

  • Create 2 Kylin and 2 Wax Testnet Accounts

    • Kylin bridge contract Account (atomictokenpegeosio.cpp)

    • Kylin test Account no contract

    • Wax Testnet contract Account (atomictokenpegxeosio.cpp)

    • Wax Testnet Account no contract

We'll be using the existing atomicassets contracts on Kylin / Wax Testnet, so no need to create them.

  • Setup atomictokenpegeosio on the Kylin token contract Account and atomictokenpegxeosio on the Wax Testnet token contract Account using zeus migrate.

  • Import private keys

  • Create contract deployment files located in ./zeus_boxes/contract-migrations-extensions/models/contract-deployments/

  • Migrate contracts to Kylin/Wax Testnet

Initialize token contracts

  • Create NFTs on Kylin

For Kylin we'll setup the collection and schema then mint an asset to the test contract. If you have a pre existing NFT, you can send it to the Kylin test account.

On WAX Test we'll also setup the collection/schema, but we'll make the bridge contract a authorized account on the collection so it can mint new NFTs.

If you get errors such as Transaction exceeded the current network usage limit imposed on the transaction, see the Kylin / Wax Testnet account setup guides to get more tokens and to stake for more resources.

  • Mint test tokens

We will mint some test NFT tokens to our test account.

  • Register mapping

The collection author for an NFT must register that NFT with the bridge before users can transfer.

Now that we've prepared that part let's move onto staking DAPP for services. First stop is the faucet for some DAPP tokens here. Use the account that has the atomictokenpegeosio contract set to it ($KYLIN_BRIDGE_ACCOUNT).

  • Stake to required services vRAM, LiquidHarmony Oracles, and LiquidScheduler

Below we'll select each package then stake for it.

  • LiquidX stake

In order to stake for services on WAX Testnet, a LiquidX mapping must be created, for more detail see here.

  • Initialize

Here we will initialize both bridges with their settings. On Kylin we will not allow issuance because the token already exists. On WAX Testnet we allow the bridge contract to mint/burn. We set the minimum transfer to 1 TKN.

  • Transfer

Now we will test with a transfer from the Kylin example user to the Kylin bridge contract, let's see how it goes!!

  • Confirm

If all goes well you will see the tokens arrive at your WAX Testnet destination account, you can send them back to the bridge contract now to send them back!

Note that the memo destination chain is now kylin and no longer liquidxxtwax because we are sending the tokens to kylin.

Last updated

Was this helpful?