Closed Maxisy closed 1 year ago
Hi there 👋
Oh I remember this happening to me a little while ago.
The AddressNotFoundInAllowedList
error is unfortunately wrong because the error code from the program logs comes from a nested instruction which comes from another program. So the framework tries to resolve the error code with the candy machine program and in this case it matches another error.
Could you please provide the entire program log because I don't remember the exact solution but I know that seeing the program logs will make me remember haha.
Hey, thanks for the response. This is the complete output of the TS script:
AddressNotFoundInAllowedList: Address not found on the allowed list
Source: Program > mplCandyGuard [Guard1JwRhJkVH6XZhzoYxeBVQe872VH6QggF4BWmS9g]
Caused By: Error: failed to send transaction: Transaction simulation failed: Error processing Instruction 1: custom program error: 0x178a
Program 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 metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s invoke [3]
| Program log: IX: Create
| Program log: Init mint
| Program 11111111111111111111111111111111 invoke [4]
| Program 11111111111111111111111111111111 success
| Program TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA invoke [4]
| Program log: Instruction: InitializeMint2
| Program TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA consumed 2828 of 696050 compute units
| Program TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA success
| Program log: Transfer 5616720 lamports to the new account
| Program 11111111111111111111111111111111 invoke [4]
| Program 11111111111111111111111111111111 success
| Program log: Allocate space for the account
| Program 11111111111111111111111111111111 invoke [4]
| Program 11111111111111111111111111111111 success
| Program log: Assign the account to the owning program
| Program 11111111111111111111111111111111 invoke [4]
| Program 11111111111111111111111111111111 success
| Program log: Transfer 2853600 lamports to the new account
| Program 11111111111111111111111111111111 invoke [4]
| Program 11111111111111111111111111111111 success
| Program log: Allocate space for the account
| Program 11111111111111111111111111111111 invoke [4]
| Program 11111111111111111111111111111111 success
| Program log: Assign the account to the owning program
| Program 11111111111111111111111111111111 invoke [4]
| Program 11111111111111111111111111111111 success
| Program TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA invoke [4]
| Program log: Instruction: SetAuthority
| Program TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA consumed 3090 of 627730 compute units
| Program TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA success
| Program TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA invoke [4]
| Program log: Instruction: SetAuthority
| Program TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA consumed 3250 of 621570 compute units
| Program TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA success
| Program metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s consumed 104310 of 713745 compute units
| Program metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s success
| Program log: AnchorError occurred. Error Code: MissingTokenRecord. Error Number: 6026. Error Message: Missing token record.
| Program CndyV3LdqHUfDLmE5naZjVN8rBZz4tqhdefbAnjHG3JR consumed 144444 of 750502 compute units
| Program CndyV3LdqHUfDLmE5naZjVN8rBZz4tqhdefbAnjHG3JR failed: custom program error: 0x178a
| Program Guard1JwRhJkVH6XZhzoYxeBVQe872VH6QggF4BWmS9g consumed 193942 of 800000 compute units
| Program Guard1JwRhJkVH6XZhzoYxeBVQe872VH6QggF4BWmS9g failed: custom program error: 0x178a
at getMplCandyGuardErrorFromCode (/root/pnft-airdrop/node_modules/@metaplex-foundation/mpl-candy-machine/src/generated/errors/mplCandyGuard.ts:744:24)
at Object.getErrorFromCode (/root/pnft-airdrop/node_modules/@metaplex-foundation/mpl-candy-machine/src/generated/programs/mplCandyGuard.ts:30:43)
at Object.resolveError (/root/pnft-airdrop/node_modules/@metaplex-foundation/umi-program-repository/src/createDefaultProgramRepository.ts:122:35)
at Object.sendTransaction (/root/pnft-airdrop/node_modules/@metaplex-foundation/umi-rpc-web3js/src/createWeb3JsRpc.ts:289:42)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at async TransactionBuilder.sendAndConfirm (/root/pnft-airdrop/node_modules/@metaplex-foundation/umi/src/TransactionBuilder.ts:303:23)
at async /root/pnft-airdrop/testMint.ts:45:16 {
source: 'program',
sourceDetails: 'mplCandyGuard [Guard1JwRhJkVH6XZhzoYxeBVQe872VH6QggF4BWmS9g]',
cause: SendTransactionError: failed to send transaction: Transaction simulation failed: Error processing Instruction 1: custom program error: 0x178a
at Connection.sendEncodedTransaction (/root/pnft-airdrop/node_modules/@solana/web3.js/src/connection.ts:5860:13)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at async Connection.sendRawTransaction (/root/pnft-airdrop/node_modules/@solana/web3.js/src/connection.ts:5819:20)
at async Object.sendTransaction (/root/pnft-airdrop/node_modules/@metaplex-foundation/umi-rpc-web3js/src/createWeb3JsRpc.ts:281:25)
at async TransactionBuilder.sendAndConfirm (/root/pnft-airdrop/node_modules/@metaplex-foundation/umi/src/TransactionBuilder.ts:303:23)
at async /root/pnft-airdrop/testMint.ts:45:16 {
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 metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s invoke [3]',
'Program log: IX: Create',
'Program log: Init mint',
'Program 11111111111111111111111111111111 invoke [4]',
'Program 11111111111111111111111111111111 success',
'Program TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA invoke [4]',
'Program log: Instruction: InitializeMint2',
'Program TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA consumed 2828 of 696050 compute units',
'Program TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA success',
'Program log: Transfer 5616720 lamports to the new account',
'Program 11111111111111111111111111111111 invoke [4]',
'Program 11111111111111111111111111111111 success',
'Program log: Allocate space for the account',
'Program 11111111111111111111111111111111 invoke [4]',
'Program 11111111111111111111111111111111 success',
'Program log: Assign the account to the owning program',
'Program 11111111111111111111111111111111 invoke [4]',
'Program 11111111111111111111111111111111 success',
'Program log: Transfer 2853600 lamports to the new account',
'Program 11111111111111111111111111111111 invoke [4]',
'Program 11111111111111111111111111111111 success',
'Program log: Allocate space for the account',
'Program 11111111111111111111111111111111 invoke [4]',
'Program 11111111111111111111111111111111 success',
'Program log: Assign the account to the owning program',
'Program 11111111111111111111111111111111 invoke [4]',
'Program 11111111111111111111111111111111 success',
'Program TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA invoke [4]',
'Program log: Instruction: SetAuthority',
'Program TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA consumed 3090 of 627730 compute units',
'Program TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA success',
'Program TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA invoke [4]',
'Program log: Instruction: SetAuthority',
'Program TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA consumed 3250 of 621570 compute units',
'Program TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA success',
'Program metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s consumed 104310 of 713745 compute units',
'Program metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s success',
'Program log: AnchorError occurred. Error Code: MissingTokenRecord. Error Number: 6026. Error Message: Missing token record.',
'Program CndyV3LdqHUfDLmE5naZjVN8rBZz4tqhdefbAnjHG3JR consumed 144444 of 750502 compute units',
'Program CndyV3LdqHUfDLmE5naZjVN8rBZz4tqhdefbAnjHG3JR failed: custom program error: 0x178a',
'Program Guard1JwRhJkVH6XZhzoYxeBVQe872VH6QggF4BWmS9g consumed 193942 of 800000 compute units',
'Program Guard1JwRhJkVH6XZhzoYxeBVQe872VH6QggF4BWmS9g failed: custom program error: 0x178a'
]
},
program: {
name: 'mplCandyGuard',
publicKey: { bytes: [Uint8Array] },
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'
]
},
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 metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s invoke [3]',
'Program log: IX: Create',
'Program log: Init mint',
'Program 11111111111111111111111111111111 invoke [4]',
'Program 11111111111111111111111111111111 success',
'Program TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA invoke [4]',
'Program log: Instruction: InitializeMint2',
'Program TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA consumed 2828 of 696050 compute units',
'Program TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA success',
'Program log: Transfer 5616720 lamports to the new account',
'Program 11111111111111111111111111111111 invoke [4]',
'Program 11111111111111111111111111111111 success',
'Program log: Allocate space for the account',
'Program 11111111111111111111111111111111 invoke [4]',
'Program 11111111111111111111111111111111 success',
'Program log: Assign the account to the owning program',
'Program 11111111111111111111111111111111 invoke [4]',
'Program 11111111111111111111111111111111 success',
'Program log: Transfer 2853600 lamports to the new account',
'Program 11111111111111111111111111111111 invoke [4]',
'Program 11111111111111111111111111111111 success',
'Program log: Allocate space for the account',
'Program 11111111111111111111111111111111 invoke [4]',
'Program 11111111111111111111111111111111 success',
'Program log: Assign the account to the owning program',
'Program 11111111111111111111111111111111 invoke [4]',
'Program 11111111111111111111111111111111 success',
'Program TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA invoke [4]',
'Program log: Instruction: SetAuthority',
'Program TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA consumed 3090 of 627730 compute units',
'Program TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA success',
'Program TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA invoke [4]',
'Program log: Instruction: SetAuthority',
'Program TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA consumed 3250 of 621570 compute units',
'Program TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA success',
'Program metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s consumed 104310 of 713745 compute units',
'Program metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s success',
'Program log: AnchorError occurred. Error Code: MissingTokenRecord. Error Number: 6026. Error Message: Missing token record.',
'Program CndyV3LdqHUfDLmE5naZjVN8rBZz4tqhdefbAnjHG3JR consumed 144444 of 750502 compute units',
'Program CndyV3LdqHUfDLmE5naZjVN8rBZz4tqhdefbAnjHG3JR failed: custom program error: 0x178a',
'Program Guard1JwRhJkVH6XZhzoYxeBVQe872VH6QggF4BWmS9g consumed 193942 of 800000 compute units',
'Program Guard1JwRhJkVH6XZhzoYxeBVQe872VH6QggF4BWmS9g failed: custom program error: 0x178a'
],
code: 6026
}
This seems to be causing the problem: Program log: AnchorError occurred. Error Code: MissingTokenRecord. Error Number: 6026. Error Message: Missing token record
Ah yes! The TokenRecord will only be passed if the JS Client knows you're trying to mint a PNFT. You must pass the tokenStandard
argument for that purpose.
const mint = await transactionBuilder()
.add(setComputeUnitLimit(umi, { units: 800_000 }))
.add(
mintV2(umi, {
candyGuard: candyGuard.publicKey,
candyMachine: cmPubkey,
nftMint,
collectionMint: collectionNftPubkey,
collectionUpdateAuthority: updateAuthPubkey,
tokenStandard: TokenStandard.ProgrammableNonFungible, // <-- Add this line.
})
)
.sendAndConfirm(umi);
Thanks, it's working perfectly that way
Umi version
"@metaplex-foundation/umi": "^0.7.2",
Code
Error