glossary·2026-03-09·1 min read

Import

Import

Leo programs can import and call transitions from other deployed programs using the import statement:

leo
import credits.aleo;

final fn finalize_pay(transfer: Final<Fn(address,address,u64)>) {
    transfer.run();
}

fn pay(public receiver: address, public amount: u64) -> Final {
    let transfer: Final<Fn(address,address,u64)> = credits.aleo/transfer_public(receiver, amount);
    return final {
        finalize_pay(transfer);
    };
}

Imports are resolved statically at compile time - the imported program must already be deployed on-chain. This is how composability works on Aleo: programs call each other's public transitions while maintaining independent proof generation.