LiquidApps Documentation
  • Introduction
  • 🧙‍♂️The DAPP Network
    • The DAPP Token
      • DAPP Token Overview
      • DAPP Tokens Tracks
      • Claiming DAPP Tokens
      • DAPP Tokens Distribution
      • Air-HODL
    • Cross Chain Bridges
    • Examples
      • Token bridge
      • Price Feed
      • Elemental Battles
      • LiquidChess
      • LiquidPortfolio
    • DAPP Network Resources
      • @liquidapps/dapp-client
        • vRAM
        • LiquidAccounts
        • DAPP Services
        • Air-Hodl
      • eosio-push-guarantee
      • Link Library
        • EOSIO Link
          • Tables
          • Crons
          • Macros
          • Variables
        • EVM Link - Solidity (Coming Soon)
  • ⚡Working with Zeus
    • Introduction
      • Requirements
      • Install Zeus and Unboxing
        • More on zeus-box.json
      • Get Started fast! (Zeus-IDE)
      • Docker CI/CD
      • Example Github Using Zeus
      • Getting started with AntelopeIO Contracts (formerly EOSIO)
    • Zeus Basics
      • Compiling Contracts
        • Clean CMake Files
      • Unit Testing
        • Printing Console
        • Fetching Table
        • Helper Functions
        • Example
      • Create ...
        • Contract/Unit Test
          • All DAPP Network Services
        • DSP Service
        • Contract Deployment
      • Import/Export Keys
      • Migrate Contract
      • Start local environment
        • Kill Services
      • Upgrade
      • Zeus RC File
      • Zeus Config File
    • Zeus Box Basics
      • Zeus Boxes Directory
        • Services
          • Oracles
        • Sample Boxes
        • Other Boxes
          • DAPP Network
          • SDKs
            • ETH-SDK
            • EOS SDK
          • Frontends
          • Extensions
          • Tests
          • Seeds
          • Microservices
          • Meta Boxes
          • Libraries
          • Game
          • EOS Framework
          • Economics
          • Templates
      • Add/Remove
      • Deploy
      • List Boxes
  • ⚙️DAPP Network Services
    • DAPP Network Services
      • vRAM
        • Getting Started Guide
          • Compile and Deploy
          • Staking for services
          • Test
          • Basic implementation
        • Smart Contract Macros
          • dapp::multi_index
        • Tools
          • DAPP Client Integration
            • get_vram_row
          • Zeus Commands
          • Scripts
            • Get table
            • Get ordered keys
        • Additional Features
          • Save load and reset dapp::multi_index data
          • Advanced Features
      • LiquidAccounts
        • Getting Started Guide
          • Compile and Deploy
          • Staking for services
          • Test
            • DAPP Client
          • Basic Implementation
          • DAPP Account
        • Smart Contract Macros
          • payload
          • VACCOUNTS_APPLY
          • require_vaccount
          • VACCOUNTS_DELAYED_CLEANUP
        • Tools
          • DAPP Client Integration
            • push_liquid_account_transaction
          • Zeus Commands
            • Zeus vaccounts push-action
          • Scripts
            • Deserialize Payload
        • Use between contracts
        • Use Between Chains
      • LiquidHarmony
        • Getting Started Guide
          • Compile and Deploy
          • Staking for services
          • Test
          • Basic Implementation
          • API DSP Key Storage
        • Smart Contract Macros
          • geturi
          • ORACLE_HOOK_FILTER
        • Creating an Oracle Request
          • HTTP/HTTPS GET/POST JSON
            • HTTP/HTTPS GET
            • HTTP/HTTPS GET JSON
            • HTTP/HTTPS POST
            • HTTP/HTTPS POST JSON
          • ECHO GET/POST JSON
            • ECHO GET
            • ECHO GET JSON
            • ECHO POST
            • ECHO POST JSON
          • Nodeos History Get
          • Sister Chain Fetch
            • sister_chain_block
            • sister_chain_history
            • sister_chain_info
            • sister_chain_last_irreversible
            • sister_chain_table_row
          • Foreign Chain Fetch
            • ethereum
              • endpoints
              • block_number
              • history
              • balance
              • storage
            • tron
              • endpoints
              • balance
              • block_number
              • block
              • transactions
              • transaction
            • cardano
              • endpoints
              • blocks
              • history
              • state
            • ripple
              • endpoints
              • balance
              • ledger
              • transactions
            • bitcoin
              • endpoints
              • balance
              • block
              • history
              • transaction
            • litecoin
              • endpoints
              • balance
              • block
              • history
              • transaction
            • bitcoin cash
              • endpoints
              • balance
              • block
              • history
              • transaction
          • Wolfram Alpha
          • Random Number
          • Stockfish
          • SQL
        • Additional Features
          • Pre geturi hook
          • Don't spend CPU condition
      • LiquidScheduler
        • Getting Started Guide
          • Compile and Deploy
          • Staking for Services
          • Basic Implementation
        • Smart Contract Macros
          • schedule_timer
          • remove_timer
          • timer_callback
          • start_interval
          • remove_interval
        • Additional Features
          • Don't spend CPU condition
      • LiquidStorage
        • Getting Started Guide
          • Compile and Deploy
          • Staking for Services
          • Test
          • Basic Implementation
        • Tools
          • Zeus Commands
            • zeus storage upload
            • zeus storage unpin
          • DAPP Client Integration
            • get_uri
            • unpin_public_file
            • upload_archive_to_liquidstorage
            • upload_file_to_liquidstorage
            • upload_public_file_from_vaccount
        • Example GET Static Web Page
      • LiquidLink
        • Getting Started Guide
          • Compile and Deploy
          • Staking for services
          • Test
          • Basic Implementation
        • Smart Contract Macros
          • svc_sign_signtrx
      • LiquidAuth
        • Getting Started Guide
          • Compile and Deploy
          • Staking for services
          • Test
          • Basic Implementation
        • Tools
          • DAPP Client Integration
            • invokeAuthedCall
      • DAPP Service Macros
        • CONTRACT_START
        • CONTRACT_END
        • DAPPSERVICES_ACTIONS
        • DAPPSERVICE_ACTIONS_COMMANDS
      • Additional Services
      • Smart Contract Console Log Syntax
      • Using on_notify with services
    • Packages and Staking
  • 👨‍🚀DAPP Service Providers
    • Introduction to DAPP Service Providers
    • DSPs
      • Architecture Overview
      • Setup DSP
        • Blockchain Account
        • EOSIO Node
          • Firehose Setup
        • IPFS
          • Adding peers
            • Reconnecting Peers Periodically
          • Bootsrapping from an existing IPFS Cluster
          • Running a private network
        • PostgreSQL Database Backend
          • How to wipe local database
        • Ethereum Virtual Machine Node Setup
        • DSP Node
          • Logs
            • Monitor all logs script
        • Register Package
          • Modify Package metadata
          • Enable/Disable Package
          • Update cost per action in QUOTA
          • More on Packages
          • Whitelist Stakers
        • Test Setup
        • Known attack vectors
      • DSP Maintenance
        • Upgrade DSP Node
        • Claim Rewards
        • Replay Contract
        • Cleanup IPFS and Oracle Entries
        • Consumer Pays CPU Permissions
      • DSP API Endpoints
        • Event
        • Version
        • vRAM
        • LiquidLink
        • LiquidStorage
        • LiquidAccounts
  • 👨‍💻DAPP NETWORK LABS
    • Introduction
    • DAPP Workers
    • EdgeDSPs
    • EdgeOS
  • 🌉CROSS CHAIN BRIDGES
    • Getting Started with LiquidBridge
      • EOSIO.token <> EOSIO.token Fungible Tokens
      • EOSIO.token <> ERC20 Fungible Tokens
        • EOSIO Side Setup
        • EVM Side Setup
          • Setup EVM Contracts
            • Setup EVM Token Contract
              • Initialize Token and Transfer Ownership
            • Setup EVM Tokenpeg Contract
            • Verify and Publish Source Code
              • token contract and overview
              • tokenpeg contract
        • Initialize EOSIO Side
        • Test bridge
      • EOSIO <> EOSIO Atomic Assets Non-Fungible Tokens
      • EOSIO Atomic Assets <> ERC721 Non-Fungible Tokens
        • EOSIO Side Setup
        • EVM Side Setup
          • Setup EVM ERC721 Contract
          • Setup EVM Atomictokenpeg Contract
          • Transfer Ownership
          • Verify Source Code
        • Initialize EOSIO Side
        • Test bridge
      • EOSIO Atomic Assets <> ERC1155 Non-Fungible Tokens
        • EOSIO Side Setup
        • EVM Side Setup
          • Setup Proxy Contract
          • Setup EVM ERC1155 Contract
          • Setup EVM ERC1155 Tradeable Contract
          • Transfer Ownership of ERC1155 contract to atomictokenpeg1155 contract
        • Initialize EOSIO Side
        • Test bridge
  • ⛓️LiquidX Stake Across Chains
    • Getting Started with LiquidX
      • Use DAPP Network Services
        • Smart Contract Steps
        • Add DSP on New Chain
        • Map Mainnet to New Chain
        • Map New Chain to Mainnet
      • Become a DSP on another chain
        • Editing config.toml file
        • Push DSP account mapping action
      • Example Chains to Add
        • CoVax
        • WAX
        • WAX Test
        • Telos
        • Telos Test
        • BOS
      • Add a Chain to LiquidX
        • Create accounts and set dappservicex contract
        • Register chain
  • 😷COVAX
    • Getting Started with CoVax Chain
      • Become a DAPP Service Provider
      • Become a Block Producer
  • 🗂️Blockchain Guides
    • Testnet Creation Guides
      • Create Binance Smart Chain Testnet Account
        • Add Binance Smart Chain Testnet Network to Metamask
        • Create EVM keypair
        • Get faucet funds
      • Create WAX Testnet Account
      • Creating Jungle 3 account
      • Create Mumbai Testnet Account (Matic-Polygon)
        • Get faucet funds
      • Creating CryptoKylin Account
      • Create Rinkeby Testnet Account
        • Change Metamask network to Rinkeby
        • Get faucet funds
    • Governance Guides
      • How to submit a proposal
      • How the Proposal System Works
      • Governance Rewards
      • How to Propose an MSIG
      • Update dappservices contract by msig
      • Setup MSIG Telegram Bot
      • Governance Contracts
      • Governance Frontend
      • Propose Payment by Msig
  • 🗒️Release Notes
    • Latest
    • History
      • 2.0.8191
      • 2.0.7966
      • 2.0.7931
      • 2.1.7848
      • 2.0.7735
      • 2.0.7661
      • 2.0.7644
      • 2.0.7622
      • 2.1.7420
      • 2.1.7301
      • 2.1.7111
      • 2.0.6808
      • 2.0.5328
      • 2.0.4719
      • 2.0.4002
      • 2.0.3107
      • 2.0.2812
      • 2.0.2527
  • 🙋‍♀️FAQs
    • Frequently Asked Questions The DAPP Token
    • Frequently Asked Questions DAPP Service Providers (DSPs)
    • Frequently Asked Questions vRAM
Powered by GitBook
On this page

Was this helpful?

  1. CROSS CHAIN BRIDGES
  2. Getting Started with LiquidBridge

EOSIO <> EOSIO Atomic Assets Non-Fungible Tokens

PreviousTest bridgeNextEOSIO Atomic Assets <> ERC721 Non-Fungible Tokens

Last updated 2 years ago

Was this helpful?

This guide will essentially map the unit test.

Resources:

  • Block Explorers:

  • DSP Portals

  • Documentation

    • - get accounts / tokens

  • NFT Standard Atomic Assets

Steps:

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

Ensure you're using node version 12, IPFS can be picky with other versions

mkdir atomictokenpeg; cd atomictokenpeg
zeus box create
zeus unbox atomictokenpeg
  • Add LiquidX mapping file

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

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

# remove existing JSON file to not confuse the compiler
rm -rf ./zeus_boxes/liquidx/models/eosio-chains/
mkdir ./zeus_boxes/liquidx/models/eosio-chains/
touch ./zeus_boxes/liquidx/models/eosio-chains/liquidxxtwax.json
vim ./zeus_boxes/liquidx/models/eosio-chains/liquidxxtwax.json
{
  "dsp_port": 3117,
  "webhook_dapp_port": 8813,
  "nodeos_host": "testnet.waxsweden.org",
  "nodeos_port": 443,
  "secured": true,
  "nodeos_state_history_port": 8887,
  "nodeos_p2p_port": 12451,
  "nodeos_endpoint": "https://testnet.waxsweden.org",
  "demux_port": 1232,
  "name": "liquidxxtwax",
  "local": false
}

/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.

# remove existing JSON
rm -rf ./zeus_boxes/liquidx/models/liquidx-mappings/
mkdir ./zeus_boxes/liquidx/models/liquidx-mappings/
touch ./zeus_boxes/liquidx/models/liquidx-mappings/liquidxxtwax.dappservices.json
vim ./zeus_boxes/liquidx/models/liquidx-mappings/liquidxxtwax.dappservices.json
{
  "sidechain_name": "liquidxxtwax",
  "mainnet_account": "dappservices",
  "chain_account": "dappservicex"
}
  • Compile contracts

Update the atomic assets contract account name for each contract

// atomictokenpegeosio.cpp
const name NFT_ACCOUNT = "bridgeassets"_n;
// atomictokenpegxeosio.cpp
const name NFT_ACCOUNT = "atomicassets"_n;

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.

zeus compile atomictokenpegeosio; zeus compile atomictokenpegxeosio

Examine ./contracts/eos/dappservices/dappservices.config.hpp and you will see the mapping field populate into c++ definitions, if you see TEST1, you need to delete the existing mapping files

    • 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.

export KYLIN_BRIDGE_ACCOUNT=atomicbridg1
export KYLIN_TOKEN_ACCOUNT=bridgeassets
export KYLIN_TEST_ACCOUNT=natdeveloper
export KYLIN_ENDPOINT=https://kylin.eosn.io
export WAX_TEST_BRIDGE_ACCOUNT=atomicbridg1
export WAX_TEST_TOKEN_ACCOUNT=atomicassets
export WAX_TEST_TEST_ACCOUNT=natdeveloper
export WAX_TEST_ENDPOINT=https://testnet.waxsweden.org
  • Setup atomictokenpegeosio on the Kylin token contract Account and atomictokenpegxeosio on the Wax Testnet token contract Account using zeus migrate.

  • Import private keys

zeus key import $KYLIN_BRIDGE_ACCOUNT --owner-private-key 5JPPPML... --active-private-key 5KdLRibwg1v... --network=kylin
zeus key import $WAX_TEST_BRIDGE_ACCOUNT --owner-private-key 5KkDxt... --active-private-key 5KkDxtfyKQQ... --network=waxtest
  • Create contract deployment files located in ./zeus_boxes/contract-migrations-extensions/models/contract-deployments/

zeus create contract-deployment atomictokenpegeosio $KYLIN_BRIDGE_ACCOUNT kylin
zeus create contract-deployment atomictokenpegxeosio $WAX_TEST_BRIDGE_ACCOUNT waxtest
  • Migrate contracts to Kylin/Wax Testnet

zeus migrate atomictokenpegeosio --network=kylin --creator $KYLIN_BRIDGE_ACCOUNT --no-reset --no-compile-all --creator-key=""
zeus migrate atomictokenpegxeosio --network=waxtest --creator $WAX_TEST_BRIDGE_ACCOUNT --no-reset --no-compile-all --creator-key=""
# if migration fails
cd contracts/eos
cleos -u $KYLIN_ENDPOINT set contract $KYLIN_BRIDGE_ACCOUNT atomictokenpegeosio
cleos -u $WAX_TEST_ENDPOINT set contract $WAX_TEST_BRIDGE_ACCOUNT atomictokenpegxeosio

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.

export AUTHOR=$KYLIN_TEST_ACCOUNT
export COLLECTION_NAME=nftauthcolll # create a different one because this one's taken
export ALLOW_NOTIFY=1
export AUTHORIZED_ACCOUNTS=[$KYLIN_TEST_ACCOUNT] # add additional accounts if necessary
export NOTIFY_ACCOUNTS=[""]
export MARKET_FEE=0.01 # cause we're fair people
export DATA=[]
export SCHEMA_NAME=nftauthschem
export SCHEMA_FORMAT=[ {name: "name", type: "string"}, {name: "series", type: "string"}, {name: "moment", type: "string"}, {name: "description", type: "string"}, {name: "img", type: "image"}, {name: "backimg", type: "string"}, {name: "rarity", type: "string"} ]
# not working, if you know how to make it (passing array as variable) work, please edit!!
# cleos -u $KYLIN_ENDPOINT push action $KYLIN_TOKEN_ACCOUNT createcol "[\"$AUTHOR\",\"$COLLECTION_NAME\",\"$ALLOW_NOTIFY\",\"$AUTHORIZED_ACCOUNTS\",\"$NOTIFY_ACCOUNTS\",\"$MARKET_FEE\",\"$DATA\"]" -p $KYLIN_TEST_ACCOUNT@active

# create collection
cleos -u $KYLIN_ENDPOINT push transaction '{
  "delay_sec": 0,
  "max_cpu_usage_ms": 0,
  "actions": [
    {
      "account": "bridgeassets",
      "name": "createcol",
      "data": {
        "author": "natdeveloper",
        "collection_name": "nftauthcolll",
        "allow_notify": true,
        "authorized_accounts": [
          "natdeveloper"
        ],
        "notify_accounts": [],
        "market_fee": 0.01,
        "data": []
      },
      "authorization": [
        {
          "actor": "natdeveloper",
          "permission": "active"
        }
      ]
    }
  ]
}'

# create schema
cleos -u $KYLIN_ENDPOINT push transaction '{
  "delay_sec": 0,
  "max_cpu_usage_ms": 0,
  "actions": [
    {
      "account": "bridgeassets",
      "name": "createschema",
      "data": {
        "authorized_creator": "natdeveloper",
        "collection_name": "nftauthcolll",
        "schema_name": "nftauthschem",
        "schema_format": [
          {
            "name": "name",
            "type": "string"
          },
          {
            "name": "series",
            "type": "string"
          },
          {
            "name": "moment",
            "type": "string"
          },
          {
            "name": "description",
            "type": "string"
          },
          {
            "name": "img",
            "type": "image"
          },
          {
            "name": "backimg",
            "type": "string"
          },
          {
            "name": "rarity",
            "type": "string"
          }
        ]
      },
      "authorization": [
        {
          "actor": "natdeveloper",
          "permission": "active"
        }
      ]
    }
  ]
}'
export AUTHOR=$WAX_TEST_TEST_ACCOUNT
export COLLECTION_NAME=nftauthcolll # create a different one because this one's taken
export ALLOW_NOTIFY=1
export AUTHORIZED_ACCOUNTS=[$WAX_TEST_BRIDGE_ACCOUNT] # add additional accounts if necessary
export NOTIFY_ACCOUNTS=[]
export MARKET_FEE=0.01 # cause we're fair people
export DATA=[]
cleos -u $WAX_TEST_ENDPOINT push action $WAX_TEST_TOKEN_ACCOUNT createcol "[\"$AUTHOR\",\"$COLLECTION_NAME\",\"$ALLOW_NOTIFY\",\"$AUTHORIZED_ACCOUNTS\",\"$NOTIFY_ACCOUNTS\",\"$MARKET_FEE\",\"$DATA\"]" -p $WAX_TEST_TEST_ACCOUNT@active

cleos -u $WAX_TEST_ENDPOINT push transaction '{
  "delay_sec": 0,
  "max_cpu_usage_ms": 0,
  "actions": [
    {
      "account": "atomicassets",
      "name": "createcol",
      "data": {
        "author": "natdeveloper",
        "collection_name": "nftauthcolll",
        "allow_notify": true,
        "authorized_accounts": [
          "natdeveloper",
          "atomicbridg1"
        ],
        "notify_accounts": [],
        "market_fee": 0.01,
        "data": []
      },
      "authorization": [
        {
          "actor": "natdeveloper",
          "permission": "active"
        }
      ]
    }
  ]
}'

# create schema
cleos -u $WAX_TEST_ENDPOINT push transaction '{
  "delay_sec": 0,
  "max_cpu_usage_ms": 0,
  "actions": [
    {
      "account": "atomicassets",
      "name": "createschema",
      "data": {
        "authorized_creator": "natdeveloper",
        "collection_name": "nftauthcolll",
        "schema_name": "nftauthschem",
        "schema_format": [
          {
            "name": "name",
            "type": "string"
          },
          {
            "name": "series",
            "type": "string"
          },
          {
            "name": "moment",
            "type": "string"
          },
          {
            "name": "description",
            "type": "string"
          },
          {
            "name": "img",
            "type": "image"
          },
          {
            "name": "backimg",
            "type": "string"
          },
          {
            "name": "rarity",
            "type": "string"
          }
        ]
      },
      "authorization": [
        {
          "actor": "natdeveloper",
          "permission": "active"
        }
      ]
    }
  ]
}'
  • Mint test tokens

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

Be sure to update the account name, the new asset owner, the collection name and the actor signing the transaction.

export AUTHORIZED_MINTER=$KYLIN_TEST_ACCOUNT
export COLLECTION_NAME=$COLLECTION_NAME
export SCHEMA_NAME=$SCHEMA_NAME
export TEMPLATE_ID=-1
export NEW_ASSET_OWNER=$KYLIN_TEST_ACCOUNT
export IMMUTABLE_DATA=[ { "key": "name", "value": [ "string", "The New Silk Road" ] }, { "key": "img", "value": [ "string", "QmSXDsFeNaPa3CJKmn8WKBnA421Zv5r3Ra8n71LZhvEi9s/main/genesis/1.png" ] }, { "key": "backimg", "value": [ "string", "QmSXDsFeNaPa3CJKmn8WKBnA421Zv5r3Ra8n71LZhvEi9s/main/genesis/1_back.jpg" ] }, { "key": "series", "value": [ "string", "Through the Looking Glass" ] }, { "key": "moment", "value": [ "string", "6 - The Silk Road" ] }, { "key": "rarity", "value": [ "string", "genesis" ] }, { "key": "description", "value": [ "string", "Named after an ancient Chinese trade route, the digital silk road is a virtual pathway for the delivery of merchandise." ] } ]
export MUTABLE_DATA=[]
export TOKENS_TO_BACK=[]

cleos -u $KYLIN_ENDPOINT push transaction '{
  "delay_sec": 0,
  "max_cpu_usage_ms": 0,
  "actions": [
    {
      "account": "bridgeassets",
      "name": "mintasset",
      "data": {
        "authorized_minter": "natdeveloper",
        "collection_name": "nftauthcolll",
        "schema_name": "nftauthschem",
        "template_id": -1,
        "new_asset_owner": "natdeveloper",
        "immutable_data": [ { "key": "name", "value": [ "string", "The New Silk Road" ] }, { "key": "img", "value": [ "string", "QmSXDsFeNaPa3CJKmn8WKBnA421Zv5r3Ra8n71LZhvEi9s/main/genesis/1.png" ] }, { "key": "backimg", "value": [ "string", "QmSXDsFeNaPa3CJKmn8WKBnA421Zv5r3Ra8n71LZhvEi9s/main/genesis/1_back.jpg" ] }, { "key": "series", "value": [ "string", "Through the Looking Glass" ] }, { "key": "moment", "value": [ "string", "6 - The Silk Road" ] }, { "key": "rarity", "value": [ "string", "genesis" ] }, { "key": "description", "value": [ "string", "Named after an ancient Chinese trade route, the digital silk road is a virtual pathway for the delivery of merchandise." ] } ],
        "mutable_data": [],
        "tokens_to_back": []
      },
      "authorization": [
        {
          "actor": "natdeveloper",
          "permission": "active"
        }
      ]
    }
  ]
}'
  • Register mapping

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

cleos -u $KYLIN_ENDPOINT push transaction '{
  "delay_sec": 0,
  "max_cpu_usage_ms": 0,
  "actions": [
    {
      "account": "atomicbridg1",
      "name": "regmapping",
      "data": {
        "template_id": -1,
        "schema_name": "nftauthschem",
        "collection_name": "nftauthcolll",
        "immutable_data": [ { "key": "name", "value": [ "string", "The New Silk Road" ] }, { "key": "img", "value": [ "string", "QmSXDsFeNaPa3CJKmn8WKBnA421Zv5r3Ra8n71LZhvEi9s/main/genesis/1.png" ] }, { "key": "backimg", "value": [ "string", "QmSXDsFeNaPa3CJKmn8WKBnA421Zv5r3Ra8n71LZhvEi9s/main/genesis/1_back.jpg" ] }, { "key": "series", "value": [ "string", "Through the Looking Glass" ] }, { "key": "moment", "value": [ "string", "6 - The Silk Road" ] }, { "key": "rarity", "value": [ "string", "genesis" ] }, { "key": "description", "value": [ "string", "Named after an ancient Chinese trade route, the digital silk road is a virtual pathway for the delivery of merchandise." ] } ],
      },
      "authorization": [
        {
          "actor": "natdeveloper",
          "permission": "active"
        }
      ]
    }
  ]
}'
  • Stake to required services vRAM, LiquidHarmony Oracles, and LiquidScheduler

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

export PROVIDER=uuddlrlrbass
export PACKAGE=ipfs2
export SERVICE=ipfsservice1
export QUANTITY="10.0000 DAPP"
cleos -u $KYLIN_ENDPOINT push action dappservices selectpkg "[\"$KYLIN_BRIDGE_ACCOUNT\",\"$PROVIDER\",\"$SERVICE\",\"$PACKAGE\"]" -p $KYLIN_BRIDGE_ACCOUNT@active
cleos -u $KYLIN_ENDPOINT push action dappservices stake "[\"$KYLIN_BRIDGE_ACCOUNT\",\"$PROVIDER\",\"$SERVICE\",\"$QUANTITY\"]" -p $KYLIN_BRIDGE_ACCOUNT@active
export PROVIDER=uuddlrlrbass
export PACKAGE=oracleservi2
export SERVICE=oracleservic
export QUANTITY="10.0000 DAPP"
cleos -u $KYLIN_ENDPOINT push action dappservices selectpkg "[\"$KYLIN_BRIDGE_ACCOUNT\",\"$PROVIDER\",\"$SERVICE\",\"$PACKAGE\"]" -p $KYLIN_BRIDGE_ACCOUNT@active
cleos -u $KYLIN_ENDPOINT push action dappservices stake "[\"$KYLIN_BRIDGE_ACCOUNT\",\"$PROVIDER\",\"$SERVICE\",\"$QUANTITY\"]" -p $KYLIN_BRIDGE_ACCOUNT@active
export PROVIDER=uuddlrlrbass
export PACKAGE=cronservice2
export SERVICE=cronservices
export QUANTITY="10.0000 DAPP"
cleos -u $KYLIN_ENDPOINT push action dappservices selectpkg "[\"$KYLIN_BRIDGE_ACCOUNT\",\"$PROVIDER\",\"$SERVICE\",\"$PACKAGE\"]" -p $KYLIN_BRIDGE_ACCOUNT@active
cleos -u $KYLIN_ENDPOINT push action dappservices stake "[\"$KYLIN_BRIDGE_ACCOUNT\",\"$PROVIDER\",\"$SERVICE\",\"$QUANTITY\"]" -p $KYLIN_BRIDGE_ACCOUNT@active
  • LiquidX stake

export OWNER=$KYLIN_BRIDGE_ACCOUNT
export CHAIN_ACCOUNT=$WAX_TEST_BRIDGE_ACCOUNT
export CHAIN_NAME=liquidxxtwax
cleos -u $KYLIN_ENDPOINT push action liquidxxxxxx addaccount "[\"$OWNER\",\"$CHAIN_ACCOUNT\",\"$CHAIN_NAME\"]" -p $KYLIN_BRIDGE_ACCOUNT@active
export OWNER=$WAX_TEST_BRIDGE_ACCOUNT
export MAINNET_OWNER=$KYLIN_BRIDGE_ACCOUNT
cleos -u $WAX_TEST_ENDPOINT push action dappservicex setlink "[\"$OWNER\",\"$MAINNET_OWNER\"]" -p $WAX_TEST_BRIDGE_ACCOUNT@active
export OWNER=$WAX_TEST_BRIDGE_ACCOUNT
export DSP=$PROVIDER
cleos -u $WAX_TEST_ENDPOINT push action dappservicex adddsp "[\"$OWNER\",\"$DSP\"]" -p $WAX_TEST_BRIDGE_ACCOUNT@active
  • 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.

export SISTER_CODE=$WAX_TEST_BRIDGE_ACCOUNT
export SISTER_CHAIN_NAME="waxtest"
export THIS_CHAIN_NAME="kylin"
export PROCESSING_ENABLED=1
export TOKEN_CONRACT=$KYLIN_TOKEN_ACCOUNT
export TRANSFERS_ENABLED=1
export CAN_ISSUE=0
export KYLIN_DSP_ENDPOINT=http://kylin-dsp-2.liquidapps.io
cleos -u $KYLIN_ENDPOINT push action $KYLIN_BRIDGE_ACCOUNT init "[\"$SISTER_CODE\",\"$SISTER_CHAIN_NAME\",\"$THIS_CHAIN_NAME\",\"$PROCESSING_ENABLED\",\"$TOKEN_CONRACT\",\"$TRANSFERS_ENABLED\",\"$CAN_ISSUE\"]" -p $KYLIN_BRIDGE_ACCOUNT@active
export SISTER_CODE=$KYLIN_BRIDGE_ACCOUNT
export SISTER_CHAIN_NAME="kylin"
export THIS_CHAIN_NAME="waxtest"
export PROCESSING_ENABLED=1
export TOKEN_CONRACT=$WAX_TEST_TOKEN_ACCOUNT
export TRANSFERS_ENABLED=1
export CAN_ISSUE=1
cleos -u $WAX_TEST_ENDPOINT push action $WAX_TEST_BRIDGE_ACCOUNT init "[\"$SISTER_CODE\",\"$SISTER_CHAIN_NAME\",\"$THIS_CHAIN_NAME\",\"$PROCESSING_ENABLED\",\"$TOKEN_CONRACT\",\"$TRANSFERS_ENABLED\",\"$CAN_ISSUE\"]" -p $WAX_TEST_BRIDGE_ACCOUNT@active
  • Transfer

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

export FROM=$KYLIN_TEST_ACCOUNT
export TO=$KYLIN_BRIDGE_ACCOUNT
export ASSET_ID=1099511627776
# destionation_account,destination_chain
# this is required as the memo type, it tells the bridge which chain the funds go to and who gets them
export MEMO="$WAX_TEST_TEST_ACCOUNT,$CHAIN_NAME"
cleos -u $KYLIN_ENDPOINT push action $KYLIN_TOKEN_ACCOUNT transfer "[\"$FROM\",\"$TO\",[\"$ASSET_ID\"],\"$MEMO\"]" -p $KYLIN_TEST_ACCOUNT@active
  • 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!

export FROM=$WAX_TEST_TEST_ACCOUNT
export TO=$WAX_TEST_BRIDGE_ACCOUNT
export ASSET_ID=1099511627776
# destionation_account,destination_chain
# this is required as the memo type, it tells the bridge which chain the funds go to and who gets them
export MEMO="$KYLIN_TEST_ACCOUNT,kylin"
cleos -u $WAX_TEST_ENDPOINT push action $WAX_TEST_TOKEN_ACCOUNT transfer "[\"$FROM\",\"$TO\",[\"$ASSET_ID\"],\"$MEMO\"]" -p $WAX_TEST_TEST_ACCOUNT@active

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

If the transfers are not going through, ensure that the DSP you are using has enough CPU/NET staked for it

atomictokenpeg box

Create 2 and 2 Accounts

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

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

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

🌉
atomictokenpegeosio.spec.js
https://kylin.bloks.io/
https://wax-test.bloks.io/
https://kylin.eosq.eosnation.io/
https://dsphq.liquidapps.io/
https://github.com/cryptokylin/CryptoKylin-Testnet
https://developer.wax.io/dapps/wax-testnet-quickstart/
https://waxsweden.org/testnet/
https://github.com/pinknetworkx/atomicassets-contract
Install Zeus
Unbox
Kylin
Wax Testnet
Kylin
Wax Testnet
here
here