Skip to content

Instantly share code, notes, and snippets.

@alecchendev
Created April 9, 2022 03:10
Show Gist options
  • Save alecchendev/1f2d9142c15002c84b853069f166adeb to your computer and use it in GitHub Desktop.
Save alecchendev/1f2d9142c15002c84b853069f166adeb to your computer and use it in GitHub Desktop.
// don't forget to import!
use solana_program::{
account_info::{AccountInfo, next_account_info}
};
// code inside of `process_instruction`
let accounts_iter = &mut accounts.iter(); // accounts here refers to the argument denoting the array of `AccountInfo`s
let account_one = next_account_info(accounts_iter)?;
let account_two = next_account_info(accounts_iter)?;
let account_three = next_account_info(accounts_iter)?;
...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment