Skip to main content

12 docs tagged with "functions"

View All Tags

Calling Other Functions

A contract is a collection of persistent state variables and functions which may manipulate these variables.

Defining Functions

Functions serve as the building blocks of smart contracts. Functions can be either public, ie they are publicly available for anyone to see and can directly interact with public state, or private, meaning they are executed completely client-side in the PXE. Read more about how private functions work here.

Inner Workings of Functions

Below, we go more into depth of what is happening under the hood when you create a function in an Aztec contract. The next page will give you more information about what the attributes are really doing.

Oracle Functions

This page goes over what oracles are in Aztec and how they work.

Private <> Public Communication

Aztec operates on a model of private and public functions that are able to work together. Private functions work by providing evidence of correct execution generated locally through kernel proofs. Public functions, on the other hand, are able to utilize the latest state to manage updates and perform alterations.

Using the popCapsule Oracle

popCapsule is used for passing artbitrary data. We have not yet included this in Aztec.nr, so it is a bit more complex than the other oracles. You can follow this how-to:

Visibility

In Aztec there are multiple different types of visibility that can be applied to functions. Namely we have data visibility and function visibility. This page explains these types of visibility.