Test bridge

Let's test by sending some tokens.

export FROM=$KYLIN_TEST_ACCOUNT
export TO=$KYLIN_BRIDGE_ACCOUNT
export QUANTITY="1.0000 TKN"
# user address, not token/tokenpeg account/contract, third account you created
export MEMO="0xE60dEdC13Ee13D563034dF75Acce5C58CB60ab12"
cleos -u $KYLIN_ENDPOINT push action $KYLIN_TOKEN_ACCOUNT transfer "[\"$FROM\",\"$TO\",\"$QUANTITY\",\"$MEMO\"]" -p $KYLIN_TEST_ACCOUNT@active  

Now let's see if the tokens make it! Navigate to your user account's address

Now let's send it back!

Navigate to your tokenpeg contract on the EVM side, click on the contract tab, go to Write Contract, and connect using your user's account.

Scroll to #4. We're going to send 1 token back 10000. And to determine the destination address we're going to use a helper function on our bridge contract.

cleos -u $EOS_ENDPOINT push action $KYLIN_BRIDGE_ACCOUNT getdest '["YOUR EOSIO USER ACCOUNT HERE"]' -p $KYLIN_BRIDGE_ACCOUNT@active

The assertion error will relay the uint64_t for the account specified, and you said EOSIO assertion messages weren't good for anything, pish posh, we move on!

Destination EOSIO Account Name Value: 11075078730411234672

Fire. Example trx

And shazam you've got tokens! https://kylin.eosq.app/tx/cbc1bd2591efc7311358ce1ee17c95e8da2dfbf895c00051f401afc794013be0

Last updated