aztec-nr - noir_aztec::protocol::abis::protocol_contracts

Struct ProtocolContracts

pub struct ProtocolContracts
{ /* private fields */ }

Implementations

impl ProtocolContracts

pub fn new(derived_addresses: [AztecAddress; 11]) -> Self pub fn is_magic_protocol_contract_address(contract_address: AztecAddress) -> bool

Checks if the given address is a protocol contract address.

pub fn assert_not_derived_protocol_contract_address(self, contract_address: AztecAddress) pub fn get_derived_address( self, magic_protocol_contract_address: AztecAddress, ) -> AztecAddress

Obtains the derived address for the given magic protocol contract address.

Important! This assumes that the caller has already validated that the address is indeed a magic protocol contract address by calling is_magic_protocol_contract_address first, because this function fails if the input address is not a valid magic protocol contract address.

pub fn hash(self) -> Field

Trait implementations

impl Deserialize for ProtocolContracts

pub fn deserialize(fields: [Field; 11 * 1]) -> Self pub fn stream_deserialize<let K: u32>(reader: &mut Reader<K>) -> Self

impl Empty for ProtocolContracts

pub fn empty() -> Self pub fn is_empty(self) -> bool pub fn assert_empty<let S: u32>(self, msg: str<S>)

impl Eq for ProtocolContracts

pub fn eq(_self: Self, _other: Self) -> bool

impl Serialize for ProtocolContracts

pub fn serialize(self) -> [Field; 11 * 1] pub fn stream_serialize<let K: u32>(self, writer: &mut Writer<K>)