logoAcademy

Transfer Native Tokens

Interact with native tokens

In this exercise, you will learn how to transfer native tokens on your own L1 in the Avalanche network using Foundry, a powerful toolkit for EVM application development. We will use the blockchain you have create in the last chapter.

Create account

avalanche key create myAddress

Save the Key to an Environment Variable

Retrieve the new address with and store it in an environment variable to match the following commands.

avalanche key list -l --blockchains myblockchain --keys myAddress
export MYADDRESS=0x...

Check the Balance

Now we are checking the balance of that key on

cast balance $MYADDRESS --rpc-url myblockchain

Transfer funds

cast send $MYADDRESS --value 200000  --private-key $PK --rpc-url myblockchain

Check balances to confirm transfer

cast balance $MYADDRESS --rpc-url myblockchain

As you saw, funds were transfered from one count to another within the same chain (myblockchain)

On this page