0

Specifying a PDA can easily be done by the following:

#[account(
    seeds = [MY_FST_SEED, MY_SND_SEED],
    bump
)]
pub my_account: Account<'info, MyCoolAccount>,

This makes the PDA be derived using the current program as the program seed though. How can I specify a PDA owned by a different program?

1 Answer 1

0

After checking the docs, we find this can easily be done with the seeds::program constraint:

#[account(
    seeds = [THEIR_FST_SEED, THEIR_SND_SEED],
    seeds::program = other_program_pubkey,
    bump
)]
pub their_account: Account<'info, TheirCoolAccount>,

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.