aztec-nr - noir_aztec::context::call_interfaces

Struct PublicStaticCallInterface

pub struct PublicStaticCallInterface<let M: u32, T>
{ /* private fields */ }

Implementations

impl<let M: u32, T> PublicStaticCallInterface<M, T>

pub fn new( target_contract: AztecAddress, selector: FunctionSelector, name: str<M>, args: [Field], ) -> Self
where T: Deserialize
pub fn with_gas(&mut self, gas_opts: GasOpts) -> &mut Self
where T: Deserialize
pub unconstrained fn view(self, context: &mut PublicContext) -> T
where T: Deserialize

Makes the read-only call to this public function.

This is similar to Solidity's staticcall. The called function cannot modify state or emit events. Any nested calls are constrained to also be staticcalls.

Will revert if the called function reverts or runs out of gas.

Arguments

  • context - The PublicContext -- made magically available to the body of every #[public] function as context, through the #[public] annotation's macro.

Returns

  • T - Whatever data the called function has returned.
pub fn enqueue_view(self, context: &mut PrivateContext)
where T: Deserialize

Enqueues a read-only call to this public function.

This is similar to Solidity's staticcall. The called function cannot modify state, emit L2->L1 messages, nor emit events. Any nested calls are constrained to also be staticcalls.

Arguments

  • context - The PrivateContext -- made magically available to the body of every #[private] function as context, through the #[private] annotation's macro.

Trait implementations

impl<let M: u32, T> CallInterface<M> for PublicStaticCallInterface<M, T>

pub fn get_args(self) -> [Field] pub fn get_selector(self) -> FunctionSelector pub fn get_name(self) -> str<M> pub fn get_contract_address(self) -> AztecAddress pub fn get_is_static(self) -> bool