Struct PrivateCallInterface
pub struct PrivateCallInterface<let M: u32, T>
{ /* private fields */ }
Implementations
impl<let M: u32, T> PrivateCallInterface<M, T>
pub fn new(
target_contract: AztecAddress,
selector: FunctionSelector,
name: str<M>,
args: [Field],
is_static: bool,
) -> Self
where
T: Deserialize
pub fn call(self, context: &mut PrivateContext) -> T
where
T: Deserialize
pub fn view(self, context: &mut PrivateContext) -> T
where
T: Deserialize
Makes a read-only call to this private 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.
See call for more general info on private function calls.
Arguments
context- The PrivateContext -- made magically available to the body of every #[private] function ascontext, through the #[private] annotation's macro.
Returns
T- Whatever data the called function has returned.
Trait implementations
impl<let M: u32, T> CallInterface<M> for PrivateCallInterface<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
Makes the call to this private function.
Arguments
context- The PrivateContext -- made magically available to the body of every #[private] function ascontext, through the #[private] annotation's macro.Returns
T- Whatever data the called function has returned.This enables contracts to interact with each other while maintaining privacy. This "composability" of private contract functions is a key feature of the Aztec network.
If a user's transaction includes multiple private function calls, then by the design of Aztec, the following information will remain private[1]:
[1] Caveats: Some of these privacy guarantees depend on how app developers design their smart contracts. Some actions can leak information, such as:
Advanced
Arguments
context- The PrivateContext -- made magically available to the body of every #[private] function ascontext, through the #[private] annotation's macro.Returns
T- Whatever data the called function has returned.