Deploy an example Teleporter Token Bridge on the local network.
Teleporter Token Bridge enables users to transfer tokens between Avalanche L1s. The bridge is a set of
smart contracts that are deployed across multiple Avalanche L1s, and leverages Teleporter for cross-chain
communication.
For more information on Teleporter Token Bridge, check:
This how-to guide focuses on deploying Teleporter Token Bridge on a local Avalanche network.
After this tutorial, you would have learned how to transfer an ERC-20 token between two
Teleporter-enabled Avalanche L1s and between C-Chain and a Teleporter-enabled Avalanche L1.
For our example, you will first need to create and deploy a Teleporter-enabled Avalanche L1 in Local
Network. We will name our Avalanche L1 testblockchain.
To create a Teleporter-enabled Avalanche L1 configuration, visit here
To deploy a Teleporter-enabled Avalanche L1, visit here
Next, we will now deploy Teleporter Token Bridge to our Local Network, where we will deploy
the Home Contract to C-Chain and the Remote Contract to our Avalanche L1.
avalanche teleporter bridge deploy✔ Local Network✔ C-Chain✔ Deploy a new Home for the token✔ An ERC-20 tokenEnter the address of the ERC-20 Token: 0x5DB9A7629912EBF95876228C24A848de0bfB43A9✔ Subnet testblockchainDownloading Bridge ContractsCompiling BridgeHome Deployed to http://127.0.0.1:9650/ext/bc/C/rpcHome Address: 0x4Ac1d98D9cEF99EC6546dEd4Bd550b0b287aaD6DRemote Deployed to http://127.0.0.1:9650/ext/bc/2TnSWd7odhkDWKYFDZHqU7CvtY8G6m46gWxUnhJRNYu4bznrrc/rpcRemote Address: 0x7DD1190e6F6CE8eE13C08F007FdAEE2f881B45D0
Before we transfer our ERC-20 token from C-Chain to our Avalanche L1, we will first call avalanche key list command to check our initial balances in C-Chain and Avalanche L1.
We will inquire the balances of our ERC-20 Token TOK both in C-Chain and our Avalanche L1, which has the
address of 0x5DB9A7629912EBF95876228C24A848de0bfB43A9 in the C-Chain and address of
0x7DD1190e6F6CE8eE13C08F007FdAEE2f881B45D0 in our Avalanche L1 testblockchain.
`avalanche key list --local --keys ewoq,blockchain_airdrop --subnets c,testblockchain --tokens 0x5DB9A7629912EBF95876228C24A848de0bfB43A9,0x7DD1190e6F6CE8eE13C08F007FdAEE2f881B45D0`+--------+--------------------+------------+--------------------------------------------+---------------+-----------------+---------------+| KIND | NAME | SUBNET | ADDRESS | TOKEN | BALANCE | NETWORK |+--------+--------------------+---------+--------------------------------------------+---------------+-----------------+---------------+| stored | ewoq | testblockchain | 0x8db97C7cEcE249c2b98bDC0226Cc4C2A57BF52FC | TOK (0x7DD1.) | 0 | Local Network |+ + +---------+--------------------------------------------+---------------+-----------------+---------------+| | | C-Chain | 0x8db97C7cEcE249c2b98bDC0226Cc4C2A57BF52FC | TOK (0x5DB9.) | 100000.000000000| Local Network |+ +--------------------+---------+--------------------------------------------+---------------+-----------------+---------------+| | blockchain | testblockchain | 0x5a4601D594Aa3848cA5EE0770b7883d3DBC666f6 | TOK (0x7DD1.) | 0 | Local Network |+ + _airdrop +---------+--------------------------------------------+---------------+-----------------+---------------+| | | C-Chain | 0x5a4601D594Aa3848cA5EE0770b7883d3DBC666f6 | TOK (0x5DB9.) | 0 | Local Network |+--------+--------------------+------------+--------------------------------------------+---------------+-----------------+---------------+
Now we will transfer 100 TOK tokens from our ewoq address in C-Chain to blockchain_airdrop
address in our Avalanche L1 testblockchain. Note that we will be using the Home contract address 0x4Ac1d98D9cEF99EC6546dEd4Bd550b0b287aaD6D
and Remote contract address 0x7DD1190e6F6CE8eE13C08F007FdAEE2f881B45D0.
avalanche key transfer✔ Local Network✔ C-Chain✔ Subnet testblockchainEnter the address of the Bridge on c-chain: 0x4Ac1d98D9cEF99EC6546dEd4Bd550b0b287aaD6DEnter the address of the Bridge on testblockchain: 0x7DD1190e6F6CE8eE13C08F007FdAEE2f881B45D0✔ ewoq✔ Key✔ blockchain_airdropAmount to send (TOKEN units): 100