metaplex-foundation / metaplex

A directory of what the Metaplex Foundation works on!
https://metaplex.com
Apache License 2.0
3.31k stars 6.27k forks source link

[Bug]: REST error for x - Custom program error: 0x1778 #2000

Closed FredTheNoob closed 2 years ago

FredTheNoob commented 2 years ago

Which package is this bug report for?

candy machine cli

Issue description

I am unable to mint my tokens. I have uploaded and verified with no sign of issues.

config.json looks like this:

{
    "price": 1000.0,
    "number": 1,
    "gatekeeper": null,
    "solTreasuryAccount": "<ACCOUNT>",
    "splTokenAccount": null,
    "splToken": null,
    "goLiveDate": null,
    "endSettings": null,
    "whitelistMintSettings": {
        "mode" : { "neverBurn": true },
        "mint" : "7SNynmqBGZsrxtUCz8wCF3LoH7KJbA4KPv6N5dnbU9yM",
        "presale" : true,
        "discountPrice" : 0.01
    },
    "hiddenSettings": null,
    "storage": "arweave",
    "ipfsInfuraProjectId": null,
    "ipfsInfuraSecret": null,
    "awsS3Bucket": null,
    "noRetainAuthority": false,
    "noMutable": false
}

Command

ts-node ~/metaplex/js/packages/cli/src/candy-machine-v2-cli.ts mint_multiple_tokens \
    -e mainnet-beta\
    -k ~/Phantom.json \
    --number 41

Relevant log output

wallet public key: <KEY>
REST error for x {
  confirmationStatus: 'confirmed',
  confirmations: 1,
  err: { InstructionError: [ 4, [Object] ] },
  slot: 126335021,
  status: { Err: { InstructionError: [Array] } }
}
Timeout Error caught { InstructionError: [ 4, { Custom: 6008 } ] }
/home/judok/metaplex/js/packages/cli/src/helpers/transactions.ts:136
            throw new Error(
                  ^
Error: Transaction failed: Custom program error: 0x1778
    at sendSignedTransaction (/home/judok/metaplex/js/packages/cli/src/helpers/transactions.ts:136:19)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at async sendTransactionWithRetryWithKeypair (/home/judok/metaplex/js/packages/cli/src/helpers/transactions.ts:59:26)
    at async mintV2 (/home/judok/metaplex/js/packages/cli/src/commands/mint.ts:344:5)
    at async mintToken (/home/judok/metaplex/js/packages/cli/src/candy-machine-v2-cli.ts:735:18)
    at async Command.<anonymous> (/home/judok/metaplex/js/packages/cli/src/candy-machine-v2-cli.ts:744:5)

Operating system

Ubuntu 20 LTS (WSL 2)

Priority this issue should have

High (immediate attention needed)

Check the Docs First

stegaBOB commented 2 years ago

Couple of issues with that... looks like your number in the config is wrong. Not sure if thats impacting this or not. It should be equal to the number of nfts in your candy machine. Also, if you don't have the WL token in the wallet you used to mint, its going to try and charge you 1000 SOL. It looks like this may be the error, as the 1778 error is not enough sol.

FredTheNoob commented 2 years ago

I managed to make it mint! Just like @stegaBOB said, the WL token needs to be in the wallet, and I was unable to get that to work so I changed the price to 0.1 instead which in return fixed the issue. Closing.