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