I get this error when trying to mint master edition nft using CPI of the metaplex program
Program log: Setting mint authority
Program TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA invoke [3]
Program log: Instruction: SetAuthority
Program TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA consumed 1929 of 116474 compute units
Program TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA success
Program log: Setting freeze authority
Program TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA invoke [3]
Program log: Instruction: SetAuthority
Program log: Error: owner does not match
Program TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA consumed 1816 of 111354 compute units
Program TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA failed: custom program error: 0x4
Program metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s consumed 34531 of 144069 compute units
this is the code where the error pops up specifically at the create master edition invoking part
let master_edition_infos = vec![
ctx.accounts.master_edition.to_account_info(),
ctx.accounts.mint.to_account_info(),
ctx.accounts.mint_authority.to_account_info(),
ctx.accounts.payer.to_account_info(),
ctx.accounts.metadata.to_account_info(),
ctx.accounts.token_metadata_program.to_account_info(),
ctx.accounts.token_program.to_account_info(),
ctx.accounts.system_program.to_account_info(),
ctx.accounts.rent.to_account_info(),
];
invoke(
&create_master_edition_v3(
ctx.accounts.token_metadata_program.key(),
ctx.accounts.master_edition.key(),
ctx.accounts.mint.key(),
ctx.accounts.payer.key(),
ctx.accounts.mint_authority.key(),
ctx.accounts.metadata.key(),
ctx.accounts.payer.key(),
Some(0),
),
master_edition_infos.as_slice(),
)?;
this is the data im passing thru the client side
(await program.rpc.mintTicket({
accounts: {
mintAuthority: program.provider.wallet.publicKey,
eventAccount: eventPDA,
mint: mintKey.publicKey,
tokenAccount: NftTokenAccount,
tokenProgram: TOKEN_PROGRAM_ID,
metadata: metadataAddress,
tokenMetadataProgram: TOKEN_METADATA_PROGRAM_ID,
payer: program.provider.wallet.publicKey,
systemProgram: SystemProgram.programId,
rent: anchor.web3.SYSVAR_RENT_PUBKEY,
masterEdition: masterEdition,
},
}));
these are the accounts/pubkeys
Program Id: Crvo7H5Qupi7pD63wyyXfoPbzAkU9Hbqwno7xTrXLbKo
Event PDA: 4U1p28aYRULrkfWgUrspqPEpyauXEQRY2pAyBYhXSdhy
NFT Account: BBqs3FzBk74FGJtQ2XQbz8ZiDq9iaTBL78obSL6xhuvq
Parsed account:3XAzUULWFYkKjRGAF9LXdY21XPsvRBNSadNWXd6qCsXTSagKJVQc9U8wziuj483yy3y1JAKkzQuyhZj4G2cjdM2a
Mint key: 7hormNKw6RcX2jEBjLLdLdzb6JvHK7oN3PymDjxdbFdh
User: 7CtWnYdTNBb3P9eViqSZKUekjcKnMcaasSMC7NbTVKuE
Metadata address: Envsbupi5iaCaoZ2eFAsr1ZiM1qUZCB1tiZVygY3GrpS
MasterEdition: AX4VN8LN5B8xoHkf6kbLMTmF5RBiKcfi2QJt6fnCiJCL
And I think the issue is to do with the fact that the mint address(explorer_link) has mint authority set to the user but update authority is not the user although im not sure and would appreciate any help