# Candy Machine with custom SPL Token
> This document contains all the steps and process we need to create our custom token and use that in Candy Machine
- Table of Contents
[ToC]
## :memo: Create SPL token
### Step 1: Create a new wallet which can act as authority for the SPL tokens generated
### Step 2: Create SPL token commands
> 1. **spl-token create-token** - To create a new SPL token which can be used for candy machine
> 2. **spl-token create-account <TOKEN ADDRESS>** - To create associated token account for this token
> 3. **spl-token mint tokenAddress mintAmount recipientAddress** - To mint the amount of tokens for a particular token.
> 4. **spl-token authorize tokenAddress mint --disable** - To disable further minting of that token.
> 5. **spl-token accounts** - To get list of accounts associated with that authority.
> 6. **spl-token transfer --fund-recipient tokenAddress transferAmount recipientAddress** - To transfer tokens to different wallet so in our case we need to run this command for airdrop of tokens.
## :memo: Commands for Candy Machine
### Step 1: Candy Machine commands to run for candy machine creation with SPL token
>1. node build/candy-machine-cli.js upload <upload folder path> -n <number of images to upload> -k <wallet path> -c <cache file name> -e <env - mainnet-beta,devnet>
>2. node build/candy-machine-cli.js verify -k <wallet path> -c <cache file name> -e <env - mainnet-beta,devnet>
>3. node build/candy-machine-cli.js create_candy_machine -p <price> -t <spl token address> -a <spl-token-account address which receives the mint> -k <wallet path> -c <cache file name> -e <env - mainnet-beta,devnet>
>4. node build/candy-machine-cli.js update_candy_machine -d <date 04 Dec 1995 00:12:00 GMT> -p <price>
>5. node build/candy-machine-cli.js verify_price -p <price> -cache-path <cache file name>
>6. node build/candy-machine-cli.js show --cache-path <Cache file name>
>7. node build/candy-machine-cli.js verify_token_metadata <Path to assets> -n <number of assets in collection>
---
**WIP** Adding few more items here :
1. Airdrop custom token to user script
2. Update metadata script
---
| Reference | Link |
| ----------------- |:----------------------- |
| Figment Pathway - Create SPL token | [:link:][Figment-Sync] |
| Candy Machine | [:link:][CM-it] |
[Figment-Sync]: https://learn.figment.io/tutorials/sol-mint-token
[CM-it]: https://hackmd.io/@levicook/HJcDneEWF