# Candy Machine V2 FAQ ###### tags: `faq, solana, metaplex, candy machine` :::info Consider getting one of my NFTs https://vol2.shapes.ltd/ :) ::: ### Table of Contents [toc] ::: info If you have any trouble with Candy Machine deployment, Frontend, Whitelist, reveals, reach out on Twitter [@halaprix](https://twitter.com/halaprix) ::: :::success You can use the [Candy Shop](https://candyshop.halaprix.com) debugging tool to check your CM settings, pull the metadata, check the mint button etc ![d](https://i.imgur.com/Ltls6s1.png=200xHeight) ::: # Questions ### 0. Debug with the tool. ![](https://i.imgur.com/pzepnxV.png) ### 1. I need a frontend for my candy machine **React:** * Material-UI v4 - **works with collections** - https://github.com/halaprix/shapes-mint-page-cm-v2 ![](https://i.imgur.com/IhCN4yv.png) * Tailwind CSS - **doesn't work with collections** - https://github.com/halaprix/shapes-mint-page-v2-tailwind ![](https://i.imgur.com/O28OWYT.png) * Bootstrap - **doesn't work with collections** - https://github.com/halaprix/mint-web-bootstrap-shapes ![](https://i.imgur.com/auvx2Yy.png) * Vanilla CSS - **doesn't work with collections - will be updated soon** -https://github.com/tonyboylehub/candymachine-v2-boiler-mint-site-noFLP ![](https://i.imgur.com/UHd8rZB.png) * Material-UI v4 - **doesn't work with collections** - https://github.com/Soul-Dogs-City/candy-machine-v2-mint * Material-UI v4 - **doesn't work with collections** - https://github.com/rez-cpu/next-candy-machinev2 * Material-UI v4 - https://github.com/Fulgurus/candy-machine-v2-responsive-ui ![](https://i.imgur.com/1pWuaHp.png) **Svelte:** * Tailwind CSS - https://github.com/alvinsga/candy-machine-v2 ![](https://i.imgur.com/AuGeCqZ.png) ### 2. What should I do if my upload fails? Usually you just have to rerun the upload. ### 3. What upload method should I use ? `arwaeve` is the most stable one so far and it works on both `mainnet-beta` and `devnet`. ### 4. I get `429` errors, what to do? You should use a private RPC or one of the available ones `https://psytrbhymqlkfrhudd.dev.genesysgo.net:8899/` for devnet, or `https://ssc-dao.genesysgo.net/` for Mainnet ### 5. My NFTs are mintend in random order?! It's a feature not a bug. You can' change it - they will always be minted in random order. ### 6. I get the `signatureUnsubscribe error: Invalid subscription id.` error, what to do? Nothing - let's call it a light error and treat it as a warning. ### 7. I can't use `mint_one_token` or `mint_multiple_tokens` from CLI! Check if: * captcha is on (you get `Error: Transaction failed: Custom program error: 0x1783`) ### 8. Are there any restrictions in the JSON files ? Yes, a few: * `name` max 31 chars [more info here](https://hackmd.io/@halaprix/S1W4vc9CY#Metadata-data) * `symbol` max 10 chars no spaces * max 4 `creators` * `creators` shares must add up to 100 ### 9. I need to update my **existing** NFTs, what can I do? :::warning Your CM can't be withdrawn for the Metaplex CLI method to work! ::: * you can use [metaboss](https://metaboss.rs/), there are plenty of options: * update metadata of single NFT `metaboss update data --keypair <PATH_TO_KEYPAIR> --account <MINT_ACCOUNT> --new-data-file <PATH_TO_NEW_DATA_FILE> ` * update metadata of multiple NFTs `metaboss update data-all --keypair <PATH_TO_KEYPAIR> --data-dir <PATH_TO_DATA_DIR> ` * update only URI of single NFT `metaboss update uri --keypair <PATH_TO_KEYPAIR> --account <MINT_ACCOUNT> --new-uri <NEW_URI> ` * update only URI of multiple NFTs `metaboss update uri-all --keypair <PATH_TO_KEYPAIR> --json-file <PATH_TO_JSON_FILE> ` * you can use the same **Metaplex CLI** you used to `upload` the Candy machine: `ts-node candy-machine-v2-cli.ts update_existing_nfts_from_latest_cache_file -e devnet -k <path to keyfile> -cp <path to config.json> -c <cache file name> -nc <new cache file name>` where the new cache file includes updated links. *This method updates URIs only!* ### 10. How much will it cost me ? Your fee is a sum of two ingredients: Solana rent and Arweave upload fee: * RENT - On average you will pay `0.0016SOL per NFT`, so `1.6SOL per 1000` and `16 SOL per 10k`. This can be withdrawn after the CM is fully minted ( or before, but the CM will stop working) * Arweave upload fee can be calculated [here](https://arweavefees.com/). At the moment of writing it's 7$ per GB. * If you are using IPFS - the upload is free, you need to provide the keys to the pinning service. ### 11. How should I number my assets? :::danger **REMEMBER #1** First asset pair is `0.json` and `0.png` - not `1.json` and `1.png`. **REMEMBER #2** in your `0.json` the name of the NFT should be `Name #1` not `Name #0` ::: ### 12. My upload failed but I have been charged **XX SOL**, what to do? If your upload command failed, but charged you a fee (CM has been created, but not written to cache - no files in `./cache` or there is no `program` segment in the file) - use `withdraw`: `ts-node ~/metaplex/js/packages/cli/src/candy-machine-v2-cli.ts withdraw -e devnet -k <path to keyfile>` You can add`--dry` at the end of the command to check the amount and don't withdraw it. If you are getting timeouts try using [metaboss](https://metaboss.rs/): `metaboss withdraw cm-v2 <CANDY_MACHINE_ID> -k <PATH_TO_KEYPAIR> ` ### 13. I need to create the `hash list`! You can create the list of NFT mint addresses only after the mint has finished - you can create it during the mint, but it will be only partial. * use [metaboss](https://metaboss.rs/): `metaboss snapshot mints --candy-machine-id <CANDY_MACHINE_ID> --v2 --output <OUTPUT_DIR> ` * use Metaplex CLI: `ts-node ~/metaplex/js/packages/cli/src/candy-machine-v2-cli.ts get_all_mint_addresses -e devnet -k <path to keyfile> -c <cache file suffix>` ### 14. What is the contract address for the collection? No it's not like Solidity. Each NFT has a different address. ### 15. How do I modify the frontend? Most of the frontend work is done in React -> https://www.codecademy.com/learn/react-101 -> still won't work ? Then you can ask 🙂 ::: success Feel free to contact me if you need to have it done. [@halaprix](https://twitter.com/halaprix) my DMs are open! ::: ### 16. Are there any limits to the image size? For `arweave` storage method, the image size must be at least 25kB and less than 10Mb. For `arweave-sol` the upper limit is 100Mb. ### 17. I need to airdrop my WL token, how? You can use one of the community created scripts, that can be found on the Metaplex Discord server. ::: success Feel free to contact me if you need to airdrop WL token, project tokens, SOL etc. [my DMs are open!](https://twitter.com/halaprix) ::: ### 18. The Candy machine is not burning my WL tokens! Your WL token has to have 0 decimals, if not only a decimal part will be burnt during the mint and not "entire" token. This is how it should be created: ``` spl-token create-token --decimals 0 spl-token create-account [token address] spl-token mint [token address] 10 ``` ### 19. My mint interface is not working, the button is disabled. Don't use https://api.mainnet-beta.solana.com/ => https://docs.metaplex.com/community#rpc. ::: success :bulb: Cheat sheet You can use : `https://psytrbhymqlkfrhudd.dev.genesysgo.net:8899/` for Devnet, or `https://ssc-dao.genesysgo.net/` for Mainnet ::: ### 20. I need to know all available commands, right now! Use `ts-node \metaplex\js\packages\cli\src\candy-machine-v2-cli.ts help` ### 21. I can't withdraw my Candy machine . If you are getting timeouts try using [metaboss](https://metaboss.rs/): `metaboss withdraw cm-v2 <CANDY_MACHINE_ID> -k <PATH_TO_KEYPAIR>` ### 22. I want to make a reveal. You can use `update_existing_nfts_from_latest_cache_file` for the reveal or all Metaboss methods mentioned earlier. ### 23. What the hell is wrong with the `-c` parameter? The -c parameter is used to set the cache name. If you use `-c final` and `-e mainnet-beta` - the name of your cache file will be `./cache/mainnet-beta-final.json` ### 24. Phantom is grouping my NFTs in a peculiar way?! https://docs.phantom.app/integrating/tokens/non-fungible-tokens#grouping-non-fungible-tokens ### 25. Is there any additional fee/ can I mint for free as authority? For each mint there is an additional fee (on top of the price) ~0.02SOL - it is the fee for the account that will hold your NFT. Even if you are the autority, you will pay this fee as it is Solana blockchain related (not conencted with CM). ### 26. Read the freaking docs! :) https://docs.metaplex.com/ ### 27. Where are the generative art commands? They were depreciated in the main Metplex repository, you can find them here https://github.com/halaprix/simple-NFT-generator ### 28. Most common whitelist set up. 1. Create the WL token in terminal: ```cmd spl-token create-token --decimals 0 # you will receive the token address - use it in the next commands spl-token create-account [token address] # 10 is an examplary amount of tokens to mint - use whatever you need spl-token mint [token address] 10 ``` 2. In your `config.json` replace `"whitelistMintSettings": null,` with: ```json "whitelistMintSettings": { "mode" : { "burnEveryTime": true }, "mint" : "7nE1GmnMmDKiycFkpHF7mKtxt356FQzVonZqBWsTWZNf", "presale" : true, "discountPrice" : 0.5 } ``` where: * `mint` is the token address from step 1. * `discountPrice` is the price for whitelist token holders * `presale` defines if WL token holders can mint before the public sale (`goLiveDate`) * `"burnEveryTime": true` - is the default setting where with eachminted NFT one WL token will be burnt in the user wallet. Alternatively you can replace it with `“neverBurn” : true` to allow multiple mints with one WL token ### 29. Upload tools - upload without CM initialization Get Rivvem's Metaplex fork: `git clone -b upload-cli https://github.com/cryptorrivem/metaplex` use `ts-node \metaplex\js\packages\cli\src\upload-cli.ts help` to see all available commands! ### 30. Simplified Metaboss metadata / creators update / reveal process 1. `metaboss snapshot mints --candy-machine-id <CANDY_MACHINE_ID> --v2 --output <OUTPUT_DIR>` 2. `metaboss decode mint --list-file <LIST_FILE> -o <OUPUT_DIRECTORY>` 3. Modify the json files 4. `metaboss update data-all --keypair <PATH_TO_KEYPAIR> --data-dir <PATH_TO_DATA_DIR>` Take special care about the difference between data you will get from step 2 and data required for step 4. ![](https://i.imgur.com/nIhxohV.png) For the reveal you can update only the URIs, using : `metaboss update uri-all --keypair <PATH_TO_KEYPAIR> --json-file <PATH_TO_JSON_FILE>` where the josn file is formated like : ```json= [ { "mint_account": "xZ43...", "new_uri": "https://arweave.net/N36gZYJ6PEH8OE11i0MppIbPG4VXKV4iuQw1zaq3rls" }, { "mint_account": "71bk...", "new_uri": "https://arweave.net/FPGAv1XnyZidnqquOdEbSY6_ES735ckcDTdaAtI7GFw" } ] ``` # Error list `1770` => `IncorrectOwner: Account does not have correct owner!` `1771` => `Uninitialized: Account is not initialized!` `1772` => `MintMismatch: Mint Mismatch!` `1773` => `IndexGreaterThanLength: Index greater than length!` `1774` => `NumericalOverflowError: Numerical overflow error!` `1775` => `TooManyCreators: Can only provide up to 4 creators to candy machine (because candy machine is one)!` `1776` => `UuidMustBeExactly6Length: Uuid must be exactly of 6 length` `1777` => `NotEnoughTokens: Not enough tokens to pay for this minting` `1778` => `NotEnoughSOL: Not enough SOL to pay for this minting` `1779` => `TokenTransferFailed: Token transfer failed` `177A` => `CandyMachineEmpty: Candy machine is empty!` `177B` => `CandyMachineNotLive: Candy machine is not live!` `177C` => `HiddenSettingsConfigsDoNotHaveConfigLines: Configs that are using hidden uris do not have config lines they have a single hash representing hashed order` `177D` => `CannotChangeNumberOfLines: Cannot change number of lines unless is a hidden config` `177E` => `DerivedKeyInvalid: Derived key invalid` `177F` => `PublicKeyMismatch: Public key mismatch` `1780` => `NoWhitelistToken: No whitelist token present` `1781` => `TokenBurnFailed: Token burn failed` `1782` => `GatewayAppMissing: Missing gateway app when required` `1783` => `GatewayTokenMissing: Missing gateway token when required` `1784` => `GatewayTokenExpireTimeInvalid: Invalid gateway token expire time` `1785` => `NetworkExpireFeatureMissing: Missing gateway network expire feature when required` `1786` => `CannotFindUsableConfigLine: Unable to find an unused config line near your random number index` `1787` => `InvalidString: Invalid string` `1788` => `SuspiciousTransaction: Suspicious transaction detected` `1789` => `CannotSwitchToHiddenSettings: Cannot Switch to Hidden Settings after items available is greater than 0` # Metadata data Metadata consists of: | Size (bytes) | Content | | -------- | -------- | | 1 | `key` | | 32 | `update authority public key` | | 4 | `name string length` | |32 | `NFT name` | | 4 | `uri string length` | | 200 | `URI` | | 4 | `symbol string length` | | 1 | `whether or not there is a creators array` | | 4 | `creators array length` | | 34 x creators count | `creators array` | Creators Array entry consists of: | Size (bytes) | Content | | -------- | -------- | | 32 | `creator pubkey` | | 1 | `creator verified` | | 1 | `creator share` |