1

I want to create a public wallet (public_account) when I create SPL tokens, and then this wallet holds the original mint tokens, and then others can transfer tokens from through the contract interface. There was a error when I executed the code: An account required by the instruction is missing.

#[account(
    init,
    seeds = [payer.key().as_ref(), params.name.as_bytes()],
    bump,
    payer = payer,
    mint::decimals = params.decimals,
    mint::authority = mint,
)]
pub mint: Account<'info, Mint>,

#[account(
    init_if_needed,
    payer = payer,
    associated_token::mint = mint,
    associated_token::authority = pda,
)]
pub public_account: Account<'info, TokenAccount>,

#[account(seeds = [b"token_account_pda", mint.key().as_ref()], bump)]
pub pda: AccountInfo<'info>,

Please help solve this problem.

BR

2
  • 1
    can you check if you are passing all the required accounts when calling the transaction on the client side? That's what the error means.
    – Jimii
    Commented Aug 8 at 7:24
  • Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer.
    – Community Bot
    Commented Aug 13 at 16:48

0

Your Answer

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

Browse other questions tagged or ask your own question.