Asset Burn Guard

The Asset Burn guard restricts the mint to holders of a predefined Collection and burns the holder's Asset. Thus, the address of the Asset to burn must be provided by the payer when minting.

To have the minter burn more than one Asset the Asset Burn Multi Guard can be used.

Burn 1 Asset

from this collection

Candy Machine

Owner: Candy Machine Core Program

Candy Guard

Owner: Candy Guard Program

GuardsnftBurn- Required Collection...

Collection

Owner: Core Program

Mint from

Candy Guard Program

Access Control

Mint from

Candy Machine Program

Mint Logic

Asset

React Flow

Guard Settings

The Asset Burn guard contains the following settings:

  • Required Collection: The address of the required Collection. The Asset we use to mint with must be part of this collection.

Set up a Candy Machine using the Asset Burn guard

JavaScript

create(umi, {
  // ...
  guards: {
    assetBurn: some({ requiredCollection: requiredCollection.publicKey }),
  },
});

API References: create, AssetBurn

Mint Settings

The Asset Burn guard contains the following Mint Settings:

  • Required Collection: The mint address of the required Collection.

  • Address: The address of the Asset to burn. This must be part of the required collection and must belong to the minter.

Note that, if you’re planning on constructing instructions without the help of our SDKs, you will need to provide these Mint Settings and more as a combination of instruction arguments and remaining accounts. See the Candy Guard’s program documentation for more details.

Mint with the Asset Burn Guard

JavaScript

You may pass the Mint Settings of the Asset Burn guard using the mintArgs argument like so.


mintV1(umi, {
  // ...
  mintArgs: {
    assetBurn: some({
      requiredCollection: requiredCollection.publicKey,
      asset: assetToBurn.publicKey,
    }),
  },
});

API References: mintV1, AssetBurnMintArgs

Route Instruction

The Asset Burn guard does not support the route instruction.

Last updated