10 : Write the native token (XLM) using soroban-cli.
Token Playground Chapter 10 : Write the native token (XLM) contract using soroban-cli
1. Introduction
2. Setting up our environment
NETWORK="standalone"
SOROBAN_RPC_HOST="http://stellar:8000"
SOROBAN_RPC_URL="$SOROBAN_RPC_HOST/soroban/rpc"
FRIENDBOT_URL="$SOROBAN_RPC_HOST/friendbot"
SOROBAN_NETWORK_PASSPHRASE="Standalone Network ; February 2017"
echo Adding network
soroban config network add "$NETWORK" \
--rpc-url "$SOROBAN_RPC_URL" \
--network-passphrase "$SOROBAN_NETWORK_PASSPHRASE"
echo ---
soroban config identity generate my-account
MY_ACCOUNT_ADDRESS="$(soroban config identity address my-account)"
curl --silent -X POST "$FRIENDBOT_URL?addr=$MY_ACCOUNT_ADDRESS" > null
ARGS="--network standalone --source-account my-account"
echo Wrapping token
TOKEN_ADDRESS=$(soroban lab token wrap $ARGS --asset native)
echo Wrapped with address result: $TOKEN_ADDRESS
echo ---
echo Wrapping might fail if it was done before, so we are also getting the address:
TOKEN_ADDRESS="$(soroban lab token id --asset native --network standalone)"
echo Native token address: $TOKEN_ADDRESS
echo ---
3. Setting up your identities
4. Transfer XLM
5. Using transfer_from
6. Use our code
What is next?
Previous9 : Read the native token (XLM) using soroban-cli.Next11 : Use the native token (XLM) inside a smart contract.
Last updated