Skip to main content

All Questions

Tagged with
Filter by
Sorted by
Tagged with
1 vote
1 answer
54 views

derive correct account inside a different anchor context

Let's say I have this CampaignCount account: #[account] pub struct CampaignCount { // I keep track of how many campaigns I have so far pub id: u32, } Imagine I need to refer to this in the ...
Yilmaz's user avatar
  • 1,264
0 votes
1 answer
636 views

How to use init_if_needed?

I want to create an instruction where it is only possible to initialize a new PDA account if some parameter on another PDA account (same type) is fulfilled. So I was thinking that init_if_needed would ...
Burger Bob's user avatar
  • 1,506
0 votes
1 answer
29 views

will it fail if the program tried to create an account with the same seeds multiple times , although the bump exists ? using anchor

#[account( init, seeds = [ AMM_CONFIG_SEED.as_bytes() ], bump, payer = admin, space = 8 + AmmConfig::INIT_SPACE, )] pub amm_config: ...
FCT's user avatar
  • 3