Skip to main content

Melting / Destroying Tokens and Collections

"Melting" (often called "Burning") refers to the process of decreasing a token's supply and removing it from circulation, or in some cases, even removing the token from the blockchain entirely. Melting a token with ENJ Infusion

releases the Infused ENJ to the holder.

What you'll need:
  • Some Enjin Coin on Enjin Matrixchain to pay for Transaction Fees. You can obtain cENJ (Canary ENJ) for testing from the built-in Canary faucet in the Platform UI.
  • An Enjin Platform Account.
  • A Collection or a Token to melt/destroy.

There are two ways to Melt a token:

  1. Using the Platform User Interface
  2. Using the GraphQL API

Option A. Using the Enjin Dashboard

Melting token's supply

Locate the token in the dashboard, click the 3 vertical dots (), then click "Burn Token".

The Burn Token form

Insert the amount of tokens to melt, and click on the "Burn Token" button.

The Transaction Request will then appear in the "Transactions" menu. A Transaction Submitted modal appears with the new transaction's UUID and a View Transaction button that opens its row on the Transactions page.

Since this request requires a Transaction

, it must be signed before it broadcasts.

  • By default, transactions are signed automatically by the Wallet Daemon.
  • To sign with a different account, expand Transaction Options → Signing Account on the form and provide a Managed Wallet address.

Destroying a token and removing it from the Blockchain

To destroy a token, these requirements must be met:
  • The caller is the collection owner
  • The token has no attributes
    • If the token has attributes, you can remove the attributes by clicking the 3 vertical dots () next to the token, followed by "Remove Attribute", selecting the attribute to remove and submitting the transaction. This needs to be done for all attributes.
  • The token has 0 supply
    • If the token has supply, you can follow the above guide Burning token's supply to remove all token supply (as long as you own all of the token's supply) Note - you can remove the supply and destroy the token in the same melt transaction.

Melting a token and destroying it are two different actions. The action demonstrated above is the action of melting a token, which decreases it's circulating supply. While destroying a token removes the token from the blockchain, and retrieves the Storage Deposit

to the collection owner.

To destroy a token, follow the above instructions for Melting a token, but make sure to tick the Remove Token Storage checkbox.

Destroying a collection

To destroy a collection, these requirements must be met:
  • The caller is the collection owner
  • The collection has no attributes
    • If the collection has attributes, you can remove the attributes by clicking the 3 vertical dots () next to the collection, followed by "Remove Attribute", selecting the attribute to remove and submitting the transaction. This needs to be done for all attributes.
  • The collection has 0 tokens in storage

In the Platform menu, navigate to "Collections", locate the collection you wish to destroy, click the 3 vertical dots () on its row, then click "Destroy Collection".

Confirm by clicking the "Destroy Collection" button.

A Transaction Submitted modal appears with the new transaction's UUID and a View Transaction button that opens its row on the Transactions page.

Since this request requires a Transaction

, it must be signed before it broadcasts.

  • By default, transactions are signed automatically by the Wallet Daemon.
  • To sign with a different account, expand Transaction Options → Signing Account on the form and provide a Managed Wallet address.

Option B. Using the Enjin API & SDKs

Burning is the burnToken discriminator action on CreateTransaction. The same action handles both "melt some supply" and "destroy the token entirely" — set removeTokenStorage: true to destroy.

SDKs are not yet available

The C# and C++ SDK examples below are out of date and will not work against the current Enjin Platform API. This section will be updated once new SDKs are published. Until then, use the GraphQL, cURL, Javascript, Node.js, or Python examples.

Melting token's supply

mutation BurnToken {
CreateTransaction(
network: ENJIN # or CANARY for testnet
chain: MATRIX
transaction: {
burnToken: {
collectionId: 68844
tokenId: 0
amount: 1
removeTokenStorage: false # set true to also destroy the token (see below)
}
}
) {
uuid
action
state
}
}

Once the transaction is executed, the token supply will be burned.

Destroying a token and removing it from the Blockchain

To destroy a token, these requirements must be met:
  • The caller is the collection owner
  • The token has no attributes
    • If the token has attributes, they can be removed using the removeAllTokenAttributes action (see Adding Metadata).
  • The token has 0 supply
    • You can remove the supply and destroy the token in the same burnToken transaction.

Use the same burnToken action and set removeTokenStorage: true:

mutation DestroyToken {
CreateTransaction(
network: ENJIN # or CANARY for testnet
chain: MATRIX
transaction: {
burnToken: {
collectionId: 68844
tokenId: 0
amount: 1
removeTokenStorage: true
}
}
) {
uuid
action
state
}
}

Once the transaction is executed, the token will be destroyed and the Storage Deposit

will be retrieved.

Destroying a collection

To destroy a collection, these requirements must be met:
  • The caller is the collection owner
  • The collection has no attributes
    • If the collection has attributes, they can be removed using the removeAllCollectionAttributes action (see Adding Metadata).
  • The collection has 0 tokens in storage
    • If the collection has some tokens, follow the above instructions for Destroying a token for each of the tokens in the collection, to destroy them all.

Destroying a collection is the destroyCollection discriminator action on CreateTransaction. Pass the collection ID as id:

mutation DestroyCollection {
CreateTransaction(
network: ENJIN # or CANARY for testnet
chain: MATRIX
transaction: {
destroyCollection: {
id: 68844
}
}
) {
uuid
action
state
}
}

Once the transaction is executed, the collection will be destroyed and the Storage Deposit

will be retrieved.

For each of the burn / destroy actions on this page, an event is emitted once the transaction reaches FINALIZED — useful as a confirmation signal. See Working with Events for how to read it.