Struct ContractSelfUtility
pub struct ContractSelfUtility<Storage> {
pub address: AztecAddress,
pub storage: Storage,
pub context: UtilityContext,
}
Fields
address: AztecAddressThe address of this contract
storage: StorageThe contract's storage instance, representing the struct to which the
storage macro was applied in your contract. If the contract has no
storage, the type of this will be ().
This storage instance is specialized for the current execution context (utility) and provides access to the contract's state variables.
Developer Note
If you've arrived here while trying to access your contract's storage while the Storage generic type is set
to unit type (), it means you haven't yet defined a Storage struct using the
storage macro in your contract. For guidance on setting this up, please
refer to our docs: https://docs.aztec.network/developers/docs/guides/smart_contracts/storage
context: UtilityContextThe utility execution context.
Implementations
impl<Storage> ContractSelfUtility<Storage>
pub fn new(context: UtilityContext, storage: Storage) -> Self
Creates a new ContractSelfUtility instance for a utility function.
This constructor is called automatically by the macro system and should not be called directly.
Core interface for interacting with aztec-nr contract features in utility execution contexts.
This struct is automatically injected into every
externalcontract function marked with"utility"by the Aztec macro system and is accessible through theselfvariable.Type Parameters
Storage: The contract's storage struct (defined withstorage, or()if the contract has no storage