Skip to main content

Freezing & Thawing

"Freezing" refers to the process of temporarily suspending the transferability of a collection or a specific token. This action provides you greater control over the movement of assets, enhancing security and enabling unique use-cases.

One such use-case is the implementation of "Soulbound" tokens. A Soulbound token is bound to a specific address and cannot be transferred out of the wallet it's minted on. This feature can be used to create unique gameplay mechanics, loyalty rewards, and more.

note

Freezing only applies to transfers, which also results in marketplace listings being unpurchasable. Freezing does not suspend token minting.

Freeze States

A freeze state determines whether a token can be transferred and the conditions under which it remains locked or becomes transferrable. This feature enables token creators to define unique behaviors and restrictions for their assets, supporting scenarios like enhanced security, gameplay mechanics, or compliance needs.

Explanation of Freeze States

  • Permanent: The token is permanently frozen and cannot be transferred to another account under any circumstances. Use this state for tokens that are intended to stay bound to their original holder, such as "Soulbound" tokens for identity or loyalty purposes.

  • Temporary: The token is temporarily frozen, restricting transfers until it is explicitly thawed by the collection owner. This state is ideal for implementing time-limited restrictions or conditional asset movement.

  • Never: The token is always transferrable and cannot be frozen. Choose this state if you want the token to remain unrestricted in its movement across wallets and platforms.

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 and a Token to freeze.

There are two ways to Freeze / Thaw:

  1. Using the Enjin Dashboard
  2. Using the GraphQL API & SDKs

Option A. Using the Enjin Dashboard

Applying Freeze/Thaw Actions to Collections and Tokens

This tutorial illustrates the process of freezing a collection. The same flow applies to freezing or thawing a single token — Locate the token in the dashboard and pick Freeze Token or Thaw Token from its actions menu instead.

Freezing an entire collection

In the Platform menu, navigate to "Collections". Locate the collection you wish to freeze, click the 3 vertical dots () on its row, then click the "Freeze Collection" button. In the form that opens up, click on the "Freeze Collection" button.

The Freeze Collection form

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.

Option B. Using the Enjin API & SDKs

Freeze and thaw are split into four discriminator actions on CreateTransaction:

  • freezeCollection: { collectionId }
  • freezeToken: { collectionId, tokenId, state } — where state is PERMANENT, TEMPORARY, or NEVER.
  • thawCollection: { collectionId }
  • thawToken: { collectionId, tokenId, state }
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.

Freezing an entire collection

Use the freezeCollection action — freezing a collection freezes every token in it.

mutation FreezeCollection {
CreateTransaction(
network: ENJIN # or CANARY for testnet
chain: MATRIX
transaction: {
freezeCollection: { collectionId: 36105 }
}
) {
uuid
action
state
}
}

Once the transaction is executed, all tokens within the specified collection will be frozen.

Freezing a single token

Use the freezeToken action. The state field selects the freeze state to apply (TEMPORARY for a freeze that can be thawed later, PERMANENT for a soulbound-style freeze).

mutation FreezeToken {
CreateTransaction(
network: ENJIN # or CANARY for testnet
chain: MATRIX
transaction: {
freezeToken: {
collectionId: 36105
tokenId: 0
state: TEMPORARY # or PERMANENT for a soulbound freeze
}
}
) {
uuid
action
state
}
}

Once the transaction is executed, the specified token will be frozen.

Thawing a Collection or Token

Thawing a collection means allowing all tokens within that collection to be active again, so they can be transferred or burned as desired, removing the restrictions that kept them locked in a particular wallet.

Thawing an entire collection

By thawing a collection, all tokens within that collection will be thawed, meaning they can be burned and transferred out of the wallet they're currently in.

Use the thawCollection action.

mutation ThawCollection {
CreateTransaction(
network: ENJIN # or CANARY for testnet
chain: MATRIX
transaction: {
thawCollection: { collectionId: 36105 }
}
) {
uuid
action
state
}
}

Once the transaction is executed, all tokens within the specified collection will be thawed.

Thawing a single token

Use the thawToken action. The state field is the post-thaw freeze state for the token (usually TEMPORARY when lifting a temporary freeze).

mutation ThawToken {
CreateTransaction(
network: ENJIN # or CANARY for testnet
chain: MATRIX
transaction: {
thawToken: {
collectionId: 36105
tokenId: 0
state: TEMPORARY
}
}
) {
uuid
action
state
}
}

Once the transaction is executed, the specified token will be thawed.

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

Explore More Arguments

For a comprehensive view of all available arguments for queries and mutations, please refer to our API Reference. This resource will guide you on how to use the GraphiQL Playground to explore the full structure and functionality of our API.

To sign with a managed wallet instead of the Wallet Daemon, set signerAccount on CreateTransaction.

Need to send a transaction request to user's wallet?

This can be done using Enjin Platform API & WalletConnect! To learn more, check out the Using WalletConnect page.