aztec-nr - noir_aztec::macros::dispatch

Function generate_public_dispatch

pub comptime fn generate_public_dispatch(
    m: Module,
    generate_emit_public_init_nullifier: bool,
) -> Quoted

Generates a public_dispatch function for an Aztec contract module m.

The generated function dispatches public calls based on selector to the appropriate contract function. If generate_emit_public_init_nullifier is true, it also handles dispatch to the macro-generated __emit_public_init_nullifier function.

Alongside public_dispatch, this also emits one __aztec_nr_internals__unpack_arguments_<N> helper per parameter-type signature shared by enough public functions; see [compute_unpack_prelude] for the extraction criterion.