Published on

Whitelist with Candy v2 - a walkthrough

Authors
  • Name
    Twitter

Whitelist with Candy v2 - a walkthrough

This is how to create a whitelist with candymachine v2. The metaplex guides are already quite extensive, but here is a step by step guide.

With candy machine v2 you do not add wallets to a whitelist. Instead a token is used to verify that a minting wallet is whitelisted. You will need to create one and send it to your users (or have them mint it with gumdrop).

Let's go!

Prerequesits

  1. Install the Solana CLI like this

1. Create a whitelist SPL Token

  1. Set the keypair and environment solana config set --keypair <path to your keypair> --url devnet
  2. Create your token spl-token create-token --decimals 0 and note the mint. MAKE SURE TO USE DECIMALS 0!
  3. Create a token account spl-token create-account <mint>
  4. Mint as many tokens as you want to have whitelisted users spl-token mint <mint> <amount>

2. Distribute the token

You have different possibilities to give the SPL token to your users and you need to decide how.

Depending on the size of your whitelist airdropping can come with heavy costs. An alternative to airdropping could be to use Gumdrop - Notes from the office hours

Amount of walletsAirdropGumdrop
10.00204428 SOL0.014 SOL
1000.204428 SOL0.015 SOL
10002.04428 SOL0.016 SOL

Now that this is clear. How to do it?

Airdrop

Either write a quick bash script or use one of the existing tools like

Gumdrop

Short tutorial:

  1. Go into the candy machine CLI folder (the one where you create a candy machine)
  2. run
ts-node gumdrop-cli.ts create -e mainnet-beta --keypair <keypair location> --distribution-list <path to your distribution list JSON> --claim-integration transfer --transfer-mint <mint> --distribution-method wallets --host "https://lwus.github.io/metaplex"
  1. You will have a new file with -urls- in it's name in a subfolder called .log. This is where you have all links for your users inside to "claim" their gumdrop. You need to distribute those e.g. with a discord bot. (DM me.)

More information on Gumdrop can be found in the official docs

3. Set up the Candy Machine whitelist

Set up your candy machine v2 as normal and add your token mint into the whitelist. The Docs are already quite extensive with different examples. Nevertheless here is one example config.json

{
    "price": 0.1,
    "number": 6,
    "gatekeeper": null,
    "solTreasuryAccount": "9n1VEM8Tat2hD5pmJiRb7Lx4z41xcG9hnj2Daop6L6qL",
    "splTokenAccount": null,
    "splToken": null,
    "goLiveDate": "5 Jan 2022 13:00:00 GMT",
    "endSettings": null,
    "whitelistMintSettings": {
        "mode": { "burnEveryTime": true },
        "mint": "G46XSZBr84ZDRFGdjLaZXZV5q5ayfU6nscNDDvGmLLV9",
        "presale": true,
        "discountPrice": null
        },
    "hiddenSettings": null,
    "storage": "arweave",
    "ipfsInfuraProjectId": null,
    "ipfsInfuraSecret": null,
    "awsS3Bucket": null,
    "noRetainAuthority": false,
    "noMutable": false
  }

When using whitelist you can not use the gatekeeper at the same time. Disabling it for the private mint is not an issue since validation is done through the SPL token. Nevertheless you should enable it again before the public mint to avoid botters.

Everyone holding the token will now be able to mint from your candy machine before the go live date.