I am trying to call the MintV2
candy machine instruction, but I am getting the error below originating from the Guard program.
Here is the code first
async function createCandyMachine() {
const candyMachine = generateSigner(umi);//! ONLY USE WHEN CREATING NEW CANDY MACHINE
let tx = await create(umi, {
candyMachine,
collectionMint: collectionMint,
collectionUpdateAuthority: umi.identity,
tokenStandard: TokenStandard.NonFungible,
sellerFeeBasisPoints: percentAmount(9.99, 2), // 9.99%
itemsAvailable: 50,
creators: [
{
address: umi.identity.publicKey,
verified: true,
percentageShare: 100,
},
],
configLineSettings: some({
prefixName: '',
nameLength: 32,
prefixUri: '',
uriLength: 200,
isSequential: false,
}),
});
tx.sendAndConfirm(umi);
}
async function mintFromCandyMachine() {
const candyMachine = await fetchCandyMachine(umi, publicKey("ErsrkFwzmCJSBfWts4PXdcCKmVUXwKy5sjrwFfRZChPR"));
// add items to our candy machine
await addConfigLines(umi, {
candyMachine: candyMachine.publicKey,
index: 0,
configLines: [
{
name: 'Kobeni 1',
uri: 'https://raw.githubusercontent.com/687c/solana-nft-native-client/main/metadata.json',
},
{
name: 'Kobeni 2',
uri: 'https://raw.githubusercontent.com/687c/solana-nft-native-client/main/metadata.json',
},
{
name: 'Kobeni 3',
uri: 'https://raw.githubusercontent.com/687c/solana-nft-native-client/main/metadata.json',
}
]
}).sendAndConfirm(umi);
await transactionBuilder()
.add(setComputeUnitLimit(umi, { units: 800_000 }))
.add(mintV2(umi, {
candyMachine: candyMachine.publicKey,
nftMint: nftMint.publicKey,
collectionMint: collectionMint,
collectionUpdateAuthority: umi.identity.publicKey,
}))
.sendAndConfirm(umi)
}
and the error logs
logs: [
'Program ComputeBudget111111111111111111111111111111 invoke [1]',
'Program ComputeBudget111111111111111111111111111111 success',
'Program Guard1JwRhJkVH6XZhzoYxeBVQe872VH6QggF4BWmS9g invoke [1]',
'Program log: Instruction: MintV2',
'Program CndyV3LdqHUfDLmE5naZjVN8rBZz4tqhdefbAnjHG3JR invoke [2]',
'Program log: Instruction: MintV2',
'Program log: AnchorError thrown in program/src/instructions/mint_v2.rs:219. Error Code: NotFullyLoaded. Error Number: 6020. Error Message: Not all config lines were added to the candy machine.',
'Program CndyV3LdqHUfDLmE5naZjVN8rBZz4tqhdefbAnjHG3JR consumed 29254 of 752695 compute units',
'Program CndyV3LdqHUfDLmE5naZjVN8rBZz4tqhdefbAnjHG3JR failed: custom program error: 0x1784',
'Program Guard1JwRhJkVH6XZhzoYxeBVQe872VH6QggF4BWmS9g consumed 76559 of 800000 compute units',
'Program Guard1JwRhJkVH6XZhzoYxeBVQe872VH6QggF4BWmS9g failed: custom program error: 0x1784'
]
},
program: {
name: 'mplCandyGuard',
publicKey: 'Guard1JwRhJkVH6XZhzoYxeBVQe872VH6QggF4BWmS9g',
getErrorFromCode: [Function: getErrorFromCode],
getErrorFromName: [Function: getErrorFromName],
isOnCluster: [Function: isOnCluster],
availableGuards: [
'botTax', 'solPayment',
'tokenPayment', 'startDate',
'thirdPartySigner', 'tokenGate',
'gatekeeper', 'endDate',
'allowList', 'mintLimit',
'nftPayment', 'redeemedAmount',
'addressGate', 'nftGate',
'nftBurn', 'tokenBurn',
'freezeSolPayment', 'freezeTokenPayment',
'programGate', 'allocation',
'token2022Payment'
]
},
logs: [
'Program ComputeBudget111111111111111111111111111111 invoke [1]',
'Program ComputeBudget111111111111111111111111111111 success',
'Program Guard1JwRhJkVH6XZhzoYxeBVQe872VH6QggF4BWmS9g invoke [1]',
'Program log: Instruction: MintV2',
'Program CndyV3LdqHUfDLmE5naZjVN8rBZz4tqhdefbAnjHG3JR invoke [2]',
'Program log: Instruction: MintV2',
'Program log: AnchorError thrown in program/src/instructions/mint_v2.rs:219. Error Code: NotFullyLoaded. Error Number: 6020. Error Message: Not all config lines were added to the candy machine.',
'Program CndyV3LdqHUfDLmE5naZjVN8rBZz4tqhdefbAnjHG3JR consumed 29254 of 752695 compute units',
'Program CndyV3LdqHUfDLmE5naZjVN8rBZz4tqhdefbAnjHG3JR failed: custom program error: 0x1784',
'Program Guard1JwRhJkVH6XZhzoYxeBVQe872VH6QggF4BWmS9g consumed 76559 of 800000 compute units',
'Program Guard1JwRhJkVH6XZhzoYxeBVQe872VH6QggF4BWmS9g failed: custom program error: 0x1784'
],
code: 6020
}