0
pub struct Example<'info>{
    pub mint: Account<'info, Mint>,
    pub system_program: Program<'info, System>,
    pub token_program: Program<'info, Token>,
    pub rent: Sysvar<'info, Rent>,
    pub associated_token: Program<'info, AssociatedToken>,
}

If I want my Anchor Context to accept more accounts, do I need to always explicitly add them?

Or is there another way to pass in a List of the same account types? I.e. pub mint: Vec<Account<'info, Mint>>

Also, I heard that there is a limit of 30 accounts. Is this correct?

3
  • How would you manage your constraints if you were to pass it in as a vector? Is it really a good idea to do something like this?
    – Meow
    Commented Jul 25, 2022 at 20:50
  • 2
    Also, I heard that there is a limit of 30 accounts. Is this correct? this is a separate question, feel free to ask this in a new question
    – Henry E
    Commented Jul 25, 2022 at 21:30
  • @Meow good question, is it possible to add acc constraints if Accounts are in a vector?
    – Burger Bob
    Commented Jul 26, 2022 at 16:25

0

Browse other questions tagged or ask your own question.