Core Candy Machine
Theme

Available Guards

Core Candy Machine - Asset Gate Guard

Overview

The Asset Gate guard allows minting if the payer is Holder of an Asset of the specified Asset collection. The Asset will not be transferred.

If the payer does not own an Asset from the required collection, minting will fail.

Guard Settings

The Asset Gate guard contains the following settings:

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

Set up a Candy Machine using the Asset Gate Guard

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

API References: create, AssetGate

Mint Settings

The Asset Gate guard contains the following Mint Settings:

  • Asset Address: The address of the Asset to prove ownership with. This must be part of the required collection and must belong to the minter.
  • Collection Address: The Address of the Collection that is used to prove ownership.

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 Core Candy Guard’s program documentation for more details.

Set up a Candy Machine using the Asset Gate Guard

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


mintV1(umi, {
  // ...
  mintArgs: {
    assetGate: some({
      requiredCollection: publicKey(requiredCollection),
      destination,
    }),
  },
});

API References: mintV1, AssetGateMintArgs

Route Instruction

The Asset Gate guard does not support the route instruction.

Previous
Asset Burn Multi