> For the complete documentation index, see [llms.txt](https://8bit-1.gitbook.io/solibrary/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://8bit-1.gitbook.io/solibrary/token-gate-guard.md).

# Token Gate Guard

Check that the

payer's token account

contains x amount tokens

Core Candy Machine

Owner: Core Candy Machine Core Program

Core Candy Guard

Owner: Core Candy Guard Program

GuardsToken Gate- Amount- Token Mint...

Mint Account

Owner: Token Program

Mint from

*Core Candy Guard Program*

Access Control

Mint from

*Core Candy Machine Program*

Mint Logic

Asset

[React Flow](https://reactflow.dev/)

### Guard Settings <a href="#guard-settings" id="guard-settings"></a>

The Token Gate guard contains the following settings:

* **Amount**: The number of tokens required.
* **Mint**: The address of the mint account defining the SPL Token we want to gate with.

Set up a Candy Machine using the Token Gate guard

JavaScript

```
create(umi, {
  // ...
  guards: {
    tokenGate: some({
      amount: 300,
      mint: tokenMint.publicKey,
    }),
  },
});
```

API References: [create](https://mpl-core-candy-machine.typedoc.metaplex.com/functions/create.html), [TokenGate](https://mpl-core-candy-machine.typedoc.metaplex.com/types/TokenGateArgs.html)

### Mint Settings <a href="#mint-settings" id="mint-settings"></a>

The Token Gate guard contains the following Mint Settings:

* **Mint**: The address of the mint account defining the SPL Token we want to gate with.

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](https://github.com/metaplex-foundation/mpl-core-candy-machine/tree/main/programs/candy-guard#tokengate) for more details.

Mint with the Token Gate Guard

JavaScript

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

```
mintV1(umi, {
  // ...
  mintArgs: {
    tokenGate: some({ mint: tokenMint.publicKey }),
  },
});
```

API References: [mintV1](https://mpl-core-candy-machine.typedoc.metaplex.com/functions/mintV1.html), [TokenGateMintArgs](https://mpl-core-candy-machine.typedoc.metaplex.com/types/TokenGateMintArgs.html)

### Route Instruction <a href="#route-instruction" id="route-instruction"></a>

*The Token Gate guard does not support the route instruction.*
