subbridge.childOperatormust have enough KLAY to send a transaction. Note that
subbridge.parentOperatoris an account on the Baobab network, and
subbridge.childOperatoris an account on the ServiceChain network. Create a test account on a Baobab Wallet and get test KLAY from the faucet. Then send some KLAY to the
childOperatorhas to get KLAY from the test account generated by
homi(Refer to EN Setup and SCN Connection Guide).
childsection (SCN node on ServiceChain network) with your SCN node IP and the proper port number from
testkey1that was generated by
subbridge.childOperatoraddress that we examined in the previous step.
parentsection (EN node on Baobab network) with your EN node IP and the proper port number from
subbridge.parentOperatorof the previous step.
node erc20-deploy.js. This script deploys both the bridge contract and the token contract, and it outputs API usage to initialize bridge pair.
node erc20-transfer-1step.js. This one-step token transfer requires modification of an ERC-20 token implementation. If you don't want to modify the token contract or you have a token contract that is already deployed, please refer to ERC-20 Token Transfer (two-step).
alice balance: 100, then it has been executed successfully.
requestERC20Transfer(). We do not deploy contracts in this section since we already deployed both bridge and token contracts. You must deploy first if you didn't deploy them. You can deploy the contract using
requestERC20Transfer()function to a KIP-7 token contract to transfer KIP-7 tokens between a parent chain and a child chain. In the case of sending KIP-7 tokens via the ERC-20 interface, we call the
approve()function to allow the bridge to send the tokens on behalf of the transaction sender. Then call the
requestERC20Transfer()function. The below command deploys the bridge contract and a KIP-7 contract.
requestERC721Transfer()for token transfer. The corresponding request functions for KIP-7 and KIP-17 will be supported soon. Before the implementation is done, as you can see above, you can transfer KIP-7 tokens using ERC-20 interfaces.