Burn Native Tokens
You may want to burn some native tokens. To do so, you will need to call the
Account.burn(burn, options)
function.
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.
Code Example
The following example will:
- Create a wallet.
- Get Alice's account which was created in the first guide.
- Get the account's balance.
- Burn 1 native token of the first ID with enough funds.
- Rust
- Nodejs
- Python
sdk/examples/how_tos/native_tokens/burn.rs
loading...
bindings/nodejs/examples/how_tos/native_tokens/burn.ts
loading...
bindings/python/examples/how_tos/native_tokens/burn.py
loading...
Expected Output
Balance before burning: 30
Transaction sent: 0x8c93b86b003b0476266f1d4d0c486dfcbbb72d4991eb5d63d5466a6cad93e9f2
Block included: https://explorer.shimmer.network/testnet/block/0x49e2ec7ac5a88b1b0ffcde20bff437b53ef74f38368c28af402435f45dd5b138
Balance after burning: 29