Skip to main content

require_top_level

Function require_top_level 

Source
pub fn require_top_level(
    sysvar_data: &[u8],
    our_program: &Address,
) -> ProgramResult
Expand description

Require that the current instruction is top-level (not a CPI).

Checks: current instruction’s program_id matches our_program. If called via CPI, the current instruction would have a different program_id, so this fails.