My instruction for creating permanent-delegate is
invoke(
&initialize_permanent_delegate(
&ctx.accounts.token_program.key(),
&ctx.accounts.mint_account.key(),
&ctx.accounts.authority.key(),
)?,
&[
ctx.accounts.token_program.to_account_info(),
ctx.accounts.mint_account.to_account_info(),
ctx.accounts.authority.to_account_info(),
],
)?;
and my account struct is
#[derive(Accounts)]
#[instruction(params: TokenParams)]
pub struct MintToken<'info> {
/// CHECK: This is the token that we want to mint
#[account(
mut,
seeds = [b"mint"],
bump,
mint::authority = authority,
mint::freeze_authority = authority,
)]
pub mint_account: InterfaceAccount<'info, Mint>,
/// CHECK: the authority of the mint account
#[account(mut)]
pub authority: Signer<'info>,
#[account(address = Token2022::id())]
pub token_program: Program<'info, Token2022>,
}
but getting Error: failed to send transaction: Transaction simulation failed: Error processing Instruction 0: custom program error: 0x6