Skip to main content

check_program_allowed

Function check_program_allowed 

Source
pub fn check_program_allowed(
    account: &AccountView,
    allowed: &[Address],
) -> ProgramResult
Expand description

Verify the account is owned by one of the programs in allowed.

Use this when accepting accounts from a known set of trusted programs. Rejects anything not in the list.

const ALLOWED: &[Address] = &[PROGRAM_A, PROGRAM_B];
check_program_allowed(account, ALLOWED)?;