crispheaney / willy-wonka

Apache License 2.0
69 stars 32 forks source link

Minting Fails: custom program error: 0x0 #3

Open Marbeled opened 3 years ago

Marbeled commented 3 years ago

Minting fails 100% of the time, while checking if all items are redeemed already, I get the following output:

Items available: 10000
Items redeemed: 3782
All items have been redeemed

-> Even though clearly not all items have been redeemed.

If I just pass the statement checking if all items are minted, I get this:

Transaction simulation failed: Error processing Instruction 0: custom program error: 0x0
    Program 11111111111111111111111111111111 invoke [1]
    Create Account: account Address { address: 7MDVuMFAWm4SuvA2aPV9iqjXFbUpDRBoSubbEBMidBfT, base: None } already in use    Program 11111111111111111111111111111111 failed: custom program error: 0x0
Translating error SendTransactionError: failed to send transaction: Transaction simulation failed: Error processing Instruction 0: custom program error: 0x0
    at Connection.sendEncodedTransaction (E:\Code\Solana\willy-wonka-master\ts\node_modules\@solana\web3.js\lib\index.cjs.js:4964:13)
    at processTicksAndRejections (internal/process/task_queues.js:95:5)
    at async Connection.sendRawTransaction (E:\Code\Solana\willy-wonka-master\ts\node_modules\@solana\web3.js\lib\index.cjs.js:4923:20)
    at async Object.sendAndConfirmRawTransaction (E:\Code\Solana\willy-wonka-master\ts\node_modules\@solana\web3.js\lib\index.cjs.js:6907:21)
    at async Provider.send (E:\Code\Solana\willy-wonka-master\ts\node_modules\@project-serum\anchor\dist\cjs\provider.js:84:22)
    at async Object.rpc [as mintNft] (E:\Code\Solana\willy-wonka-master\ts\node_modules\@project-serum\anchor\dist\cjs\program\namespace\rpc.js:11:31) {
  logs: [
    'Program 11111111111111111111111111111111 invoke [1]',
    'Create Account: account Address { address: 7MDVuMFAWm4SuvA2aPV9iqjXFbUpDRBoSubbEBMidBfT, base: None } already in use',
    'Program 11111111111111111111111111111111 failed: custom program error: 0x0'
  ]
}
SendTransactionError: failed to send transaction: Transaction simulation failed: Error processing Instruction 0: custom program error: 0x0
    at Connection.sendEncodedTransaction (E:\Code\Solana\willy-wonka-master\ts\node_modules\@solana\web3.js\lib\index.cjs.js:4964:13)
    at processTicksAndRejections (internal/process/task_queues.js:95:5)
    at async Connection.sendRawTransaction (E:\Code\Solana\willy-wonka-master\ts\node_modules\@solana\web3.js\lib\index.cjs.js:4923:20)
    at async Object.sendAndConfirmRawTransaction (E:\Code\Solana\willy-wonka-master\ts\node_modules\@solana\web3.js\lib\index.cjs.js:6907:21)
    at async Provider.send (E:\Code\Solana\willy-wonka-master\ts\node_modules\@project-serum\anchor\dist\cjs\provider.js:84:22)
    at async Object.rpc [as mintNft] (E:\Code\Solana\willy-wonka-master\ts\node_modules\@project-serum\anchor\dist\cjs\program\namespace\rpc.js:11:31) {
  logs: [
    'Program 11111111111111111111111111111111 invoke [1]',
    'Create Account: account Address { address: 7MDVuMFAWm4SuvA2aPV9iqjXFbUpDRBoSubbEBMidBfT, base: None } already in use',
    'Program 11111111111111111111111111111111 failed: custom program error: 0x0'
  ]
}

What I tried was upgrading the dependencies as well as doing a fresh pull of the repo. This started occurring out of nowhere and worked fine before. I assume something on-chain changed.

Any info/hints/solutions on this matter would be greatly appreciated.

Halon2 commented 2 years ago

Have you found a solution to solve the 0x0 error? I'm currently having the same problem.

crypt0miester commented 2 years ago

move the

            const mint = anchor.web3.Keypair.generate();
            const metadata = await getMetadata(mint.publicKey);
            const masterEdition = await getMasterEdition(mint.publicKey);
            const config : anchor.web3.PublicKey = candyMachine.config;
            const token = await getTokenWallet(walletKey.publicKey, mint.publicKey);

inside mintNFT

Sedave commented 2 years ago

move the

            const mint = anchor.web3.Keypair.generate();
            const metadata = await getMetadata(mint.publicKey);
            const masterEdition = await getMasterEdition(mint.publicKey);
            const config : anchor.web3.PublicKey = candyMachine.config;
            const token = await getTokenWallet(walletKey.publicKey, mint.publicKey);

inside mintNFT

Where into const? Can you please show? Thanks in advance

crypt0miester commented 2 years ago

into the const yes.