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).
  1. Burn the native tokens by calling the Account.burn() function.

Full Example Code


Expected Output

Balance before burning: 30
Transaction sent: 0x8c93b86b003b0476266f1d4d0c486dfcbbb72d4991eb5d63d5466a6cad93e9f2
Block included:
Balance after burning: 29