How to initiate PDA accounts on program #3373
Unanswered
lantianlaoli
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
I need to handle an uncertain amount of PDA accounts on an instruction. so I passed them as remaining accounts. but, I need to initiate anyone if it hasn't been initiated. so I found two functions
create_accountandcreate_account_with_seedsonanchor-lang-0.30.1/src/system_program.rs, which may suit my requirements.Question 1: what do the parameters mean on CreateAccount?
Question 2:
seed: &strandpub base: AccountInfo<'info>onCreateAccountWithSeed, both of them still not made clear to me what I should correctly pass in, seed is str, but my PDA account was build by two string. the base is especially unknown what does means.and
Some code use cases on github cannot solve my doubts.
All reactions