All Questions
3 questions
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: ...
0
votes
1
answer
634
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 ...
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 ...