0

I encountered an error while executing a program call. Specifically, the error arises during the invocation of a function where I'm attempting to create a metadata account using the create_metadata_account_v3 method of spl_token::metadata. I think that the error is from this method call.

Here's the method call

let seeds = &["mint".as_bytes(), &[ctx.bumps.mint]];

        // CPI Context

        create_metadata_accounts_v3(
            CpiContext::new_with_signer(
                ctx.accounts.token_metadata_program.to_account_info(),
                CreateMetadataAccountsV3 {
                    metadata: ctx.accounts.metadata_account.to_account_info(), // the metadata account being created
                    mint: ctx.accounts.mint.to_account_info(), // the mint account of the metadata account
                    mint_authority: ctx.accounts.payer.to_account_info(), // the mint authority of the mint account
                    update_authority: ctx.accounts.mint.to_account_info(), // the update authority of the metadata account
                    payer: ctx.accounts.payer.to_account_info(), // the payer for creating the metadata account
                    system_program: ctx.accounts.system_program.to_account_info(), // the system program account
                    rent: ctx.accounts.rent.to_account_info(), // the rent sysvar account
                },
                &[&seeds[..]],
            ), // cpi context
            data_v2, // token metadata
            true,    // is_mutable
            true,    // update_authority_is_signer
            None,    // collection details
        )?;

I would really appreciate any suggestions or insights on resolving this issue

1 Answer 1

2

If this is an error comming from the token_metadata_program then my way is to search for the program and checking the error set.

For that the metadata program can be found at https://github.com/metaplex-foundation/mpl-token-metadata

and the errors are at https://github.com/metaplex-foundation/mpl-token-metadata/blob/token-metadata%40v1.13.3/programs/token-metadata/program/src/error.rs#L34

From the description it seems to be a wrong seed used for metadata creation. What is the seed you used for mint account creation and does it align with the "mint".as_bytes() as it's in the code at let seeds?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.