Skip to main content

Burn Native Tokens

Burning native tokens refers to the permanent removal or destruction of those tokens from circulation. It renders the tokens unusable and reduces their total supply, often done to maintain scarcity, increase the value of remaining tokens, or enforce specific rules within an ecosystem.

Destroying Foundry

A foundry can only be destroyed (and its storage deposit be claimed) if the circulating supply is zero. Therefore if you control the foundry and want to destroy it in the future, you should consider melting your native tokens instead of burning them.

Example Code

The following example will:

  1. Instantiate a Wallet, get Alice's Account which was created in the first guide and sync it.
  2. Search the account's balance for a native token with a balance of at least MIN_AVAILABLE_AMOUNT (to be able to burn BURN_AMOUNT).
sdk/examples/how_tos/native_tokens/burn.rs
loading...
  1. Burn the native tokens by calling the Account.burn() function.
sdk/examples/how_tos/native_tokens/burn.rs
loading...

Full Example Code

sdk/examples/how_tos/native_tokens/burn.rs
loading...

Expected Output

Balance before burning: 30
Transaction sent: 0x8c93b86b003b0476266f1d4d0c486dfcbbb72d4991eb5d63d5466a6cad93e9f2
Block included: https://explorer.shimmer.network/testnet/block/0x49e2ec7ac5a88b1b0ffcde20bff437b53ef74f38368c28af402435f45dd5b138
Balance after burning: 29