From aa81a88abb1b67dd651491bed811fd12c8f4ca5e Mon Sep 17 00:00:00 2001 From: signorecello Date: Fri, 3 May 2024 11:58:22 +0000 Subject: [PATCH 1/8] feat: replacing mentions to aztec-starter with codespace methods --- .../contracts/testing_contracts/main.md | 2 +- .../developers/getting_started/quickstart.md | 63 ++++++++++++------- .../sandbox/references/sandbox-reference.md | 52 +-------------- .../public-vm/gen/_instruction-set.mdx | 1 - docs/docs/welcome.md | 2 - docs/docusaurus.config.js | 2 +- docs/package.json | 4 +- .../img/codespaces_badges/react_cta_badge.svg | 19 ++++++ .../img/codespaces_badges/token_cta_badge.svg | 19 ++++++ .../codespaces_badges/vanilla_cta_badge.svg | 19 ++++++ 10 files changed, 103 insertions(+), 80 deletions(-) create mode 100644 docs/static/img/codespaces_badges/react_cta_badge.svg create mode 100644 docs/static/img/codespaces_badges/token_cta_badge.svg create mode 100644 docs/static/img/codespaces_badges/vanilla_cta_badge.svg diff --git a/docs/docs/developers/contracts/testing_contracts/main.md b/docs/docs/developers/contracts/testing_contracts/main.md index e0d217adbef9..f00e567bc0a5 100644 --- a/docs/docs/developers/contracts/testing_contracts/main.md +++ b/docs/docs/developers/contracts/testing_contracts/main.md @@ -10,4 +10,4 @@ To make testing easier, the sandbox is shipped with cheat codes to easily test i ## Examples -You can find example tests in the [aztec-starter](https://github.com/AztecProtocol/aztec-starter/tree/main) repo as well as the [Aztec Boxes](https://github.com/AztecProtocol/aztec-packages/tree/master/boxes). +You can find example tests in the [Aztec Boxes](https://github.com/AztecProtocol/aztec-packages/tree/master/boxes). You can also have a look at the [end-to-end tests](https://github.com/AztecProtocol/aztec-packages/tree/master/yarn-project/end-to-end). diff --git a/docs/docs/developers/getting_started/quickstart.md b/docs/docs/developers/getting_started/quickstart.md index a05f8abc6752..ce894a34c38f 100644 --- a/docs/docs/developers/getting_started/quickstart.md +++ b/docs/docs/developers/getting_started/quickstart.md @@ -2,39 +2,57 @@ title: Quickstart --- -In this guide, you will +Getting started on Aztec is easy. Here are the three recommended ways of starting developing on Aztec: -1. Set up the Aztec sandbox (local development environment) locally -2. Install the Aztec development kit -3. Use Aztec.js to deploy an example contract that comes with the sandbox -4. Use Aztec.js to interact with the contract you just deployed +- Codespaces - For a zero-requirement, <5min starter that runs on your grandma's IBM PC, you can use Github Codespaces, which is free up to 60h per month. +- `npx create-aztec-app` - Will guide you through the "Aztec Boxes": full boilerplate projects with a built-in sandbox. Requires node, docker and some 4gb RAM at least. +- Manual install - Install the sandbox and only the sandbox. -... in less than 10 minutes. +## 1. Codespaces -## Prerequisites +Please click one of these buttons and hit "create codespace": -- Node.js >= v18 (recommend installing with [nvm](https://github.com/nvm-sh/nvm)) +[![One-Click React Starter](/img/codespaces_badges/react_cta_badge.svg)](https://codespaces.new/AztecProtocol/aztec-packages?devcontainer_path=.devcontainer%2Freact%2Fdevcontainer.json) [![One-Click HTML/TS Starter](/img/codespaces_badges/vanilla_cta_badge.svg)](https://codespaces.new/AztecProtocol/aztec-packages?devcontainer_path=.devcontainer%2Fvanilla%2Fdevcontainer.json) [![One-Click Token Starter](/img/codespaces_badges/token_cta_badge.svg)](https://codespaces.new/AztecProtocol/aztec-packages?devcontainer_path=.devcontainer%2Ftoken%2Fdevcontainer.json) + +That's it, have a good night 🖐️🎤 + +### What the... + +Ok ok, what this does is create a codespace with a prebuilt image containing one of the "Aztec Boxes" and a development network (sandbox). +- You can develop directly on the codespace, push it to a repo, make yourself at home. +- You can also just use the sandbox that comes with it. The URL will be logged, you just need to use it as your PXE_URL. -## Install Docker +## 2. Aztec Boxes -Aztec tooling requires the Docker daemon to be running, and this is easily achieved via Docker Desktop. See [this page of the Docker docs](https://docs.docker.com/get-docker/) for instructions on how to install Docker Desktop for your operating system. -Note: if installing via Docker Desktop, you do NOT need to keep the application open at all times (just Docker daemon). +The above method uses aztec boxes to install the sandbox and clone the repo. You can use it too to get started on your own machine and use your own IDE -Installing and running the Docker daemon can also be achieved by installing Docker Engine, see [these instructions](https://docs.docker.com/engine/install/). +### Prerequisites -However installed, ensure Docker daemon is running. See [start Docker daemon](https://docs.docker.com/config/daemon/start/). +- Node.js >= v18 (recommend installing with [nvm](https://github.com/nvm-sh/nvm)) +- Docker (visit [this page of the Docker docs](https://docs.docker.com/get-docker/) on how to install it) -### Note on Linux +### Run the `npx` script -If you are running Linux, you will need to set the context (because Docker Desktop runs in a VM by default). See [this page](https://docs.docker.com/desktop/faqs/linuxfaqs/#what-is-the-difference-between-docker-desktop-for-linux-and-docker-engine) for more information. You can do this by running: +With the node installation, you now should have `npm` and be able to run `npx` scripts. You can do that running: ```bash -docker context use default +npx create-aztec-app ``` -## Install the Sandbox +And follow the instructions. If all goes well, you should now have a development environment running locally on your machine. + +You can run `npx create-aztec-app sandbox -h` to start, stop, update and output logs from the sandbox. + +## 3. Manual Install + +If you don't want a boilerplate project, you can also install the sandbox via the underlying script used by the `npx` command. -You can run the Sandbox using Docker. +### Prerequisites + +- Node.js >= v18 (recommend installing with [nvm](https://github.com/nvm-sh/nvm)) +- Docker (visit [this page of the Docker docs](https://docs.docker.com/get-docker/) on how to install it) + +### Install the sandbox To install the latest Sandbox version, run: @@ -42,10 +60,7 @@ To install the latest Sandbox version, run: bash -i <(curl -s install.aztec.network) ``` -> If Docker has been installed on your linux server but you encounter the error "Docker is not running. Please start Docker and try again". If you're encountering this issue, it's likely because Docker is running with root user privileges. In such cases, consider [managing Docker as a non-root user](https://docs.docker.com/engine/install/linux-postinstall/#manage-docker-as-a-non-root-user) to resolve the problem. - - -This will install the following: +This will install the following tools: - **aztec** - launches various infrastructure subsystems (sequencer, prover, pxe, etc). - **aztec-nargo** - aztec's build of nargo, the noir compiler toolchain. @@ -53,14 +68,13 @@ This will install the following: - **aztec-up** - a tool to upgrade the aztec toolchain to the latest, or specific versions. - **aztec-builder** - A useful tool for projects to generate ABIs and update their dependencies. - Once these have been installed, to start the sandbox, run: ```bash aztec-sandbox ``` -This will attempt to run the Sandbox on ` localhost:8080`, so you will have to make sure nothing else is running on that port or change the port defined in `./.aztec/docker-compose.yml`. Running the installation again will overwrite any changes made to the `docker-compose.yml`. +### Have fun! **Congratulations, you have just installed and run the Aztec Sandbox!** @@ -85,3 +99,4 @@ To deploy a smart contract to your sandbox and interact with it using Aztec.js, To skip this and write your first smart contract, go to the [Aztec.nr getting started page](aztecnr-getting-started.md). + diff --git a/docs/docs/developers/sandbox/references/sandbox-reference.md b/docs/docs/developers/sandbox/references/sandbox-reference.md index 99e7850fb04e..80ac3d86976c 100644 --- a/docs/docs/developers/sandbox/references/sandbox-reference.md +++ b/docs/docs/developers/sandbox/references/sandbox-reference.md @@ -2,57 +2,11 @@ title: Sandbox Reference --- -Here you will find a reference to everything available within the Sandbox. +:::tip -## Installation +Follow the [quick start guide](../../getting_started/quickstart.md) to install the sandbox. -You can run the Sandbox using Docker. See the [Quickstart](../../getting_started/quickstart.md#install-docker) for instructions on installing Docker. - -### With Docker - -```bash -bash -i <(curl -s install.aztec.network) -``` - -This will install the following: - -- **aztec** - launches various infrastructure subsystems (sequencer, prover, pxe, etc). -- **aztec-nargo** - aztec's build of nargo, the noir compiler toolchain. -- **aztec-sandbox** - a wrapper around docker-compose that launches services needed for sandbox testing. -- **aztec-up** - a tool to upgrade the aztec toolchain to the latest, or specific versions. -- **aztec-builder** - A useful tool for projects to generate ABIs and update their dependencies. - -Once these have been installed, to start the sandbox, run: - -```bash -aztec-sandbox -``` - -This will attempt to run the Sandbox with the PXE listening on ` localhost:8080`. You can change the port defined in `./.aztec/docker-compose.yml` or by setting the `PXE_PORT` environment variable. Running the install command again will overwrite any changes made to the `docker-compose.yml`. - -See the full list of configurable environment variables [here](#environment-variables). - -If you have previously installed the CLI via a node package manager, you will need to uninstall it and remove it from your project dependencies and install it via Docker. - -To install a specific version of the sandbox, you can set the environment variable `SANDBOX_VERSION` - -```bash -VERSION= bash -i <(curl -s install.aztec.network) -``` - -## Running - -Once the installed, you can run the sandbox with: - -```bash -aztec-sandbox -``` - -Alternatively, you can run like so: - -```bash -cd ~/.aztec && docker-compose up -``` +::: ## Running Aztec PXE / Node / P2P-Bootstrap node diff --git a/docs/docs/protocol-specs/public-vm/gen/_instruction-set.mdx b/docs/docs/protocol-specs/public-vm/gen/_instruction-set.mdx index a13fb19a0f55..a2a35da1fb8a 100644 --- a/docs/docs/protocol-specs/public-vm/gen/_instruction-set.mdx +++ b/docs/docs/protocol-specs/public-vm/gen/_instruction-set.mdx @@ -1103,7 +1103,6 @@ context.machineState.pc = loc`} - **Details**: Target location is an immediate value (a constant in the bytecode). - **Bit-size**: 48 -[![](/img/protocol-specs/public-vm/bit-formats/INTERNALCALL.png)](/img/protocol-specs/public-vm/bit-formats/INTERNALCALL.png) ### `INTERNALRETURN` Return from an internal call. Pop from the internal call stack and jump to the popped location. diff --git a/docs/docs/welcome.md b/docs/docs/welcome.md index 6be66998211a..c579ef9d130b 100644 --- a/docs/docs/welcome.md +++ b/docs/docs/welcome.md @@ -23,6 +23,4 @@ Go to the [Getting Started section](./developers/getting_started/main.md) of the Check out the [Awesome Aztec repo](https://github.com/AztecProtocol/awesome-aztec) for a curated list of learning resources and tools to help you learn more about Aztec. -Clone the [Aztec Starter repo](https://github.com/AztecProtocol/aztec-starter) to get a minimal project set up with Sandbox (local developer network), a simple contract and a test suite. - Jump into one of the [tutorials](./developers/tutorials/main.md) to learn how to build more complex applications on Aztec. diff --git a/docs/docusaurus.config.js b/docs/docusaurus.config.js index b0a158adaf43..ddfc137fc7c2 100644 --- a/docs/docusaurus.config.js +++ b/docs/docusaurus.config.js @@ -43,7 +43,7 @@ const config = { /** @type {import('@docusaurus/preset-classic').Options} */ ({ docs: { - path: "processed-docs", + path: process.env.ENV === "dev" ? "docs" : "processed-docs", sidebarPath: require.resolve("./sidebars.js"), editUrl: (params) => { return ( diff --git a/docs/package.json b/docs/package.json index a6cd883a4e2c..c4aaac29040b 100644 --- a/docs/package.json +++ b/docs/package.json @@ -4,8 +4,8 @@ "private": true, "scripts": { "docusaurus": "docusaurus", - "start": "yarn preprocess && yarn typedoc && docusaurus start --host 0.0.0.0", - "start:dev": "yarn start", + "start": "yarn preprocess && yarn typedoc && docusaurus start --host 0.0.0.0 ", + "start:dev": "ENV=dev yarn start", "start:dev:local": "yarn preprocess && yarn typedoc && docusaurus start", "build": "./scripts/build.sh", "swizzle": "docusaurus swizzle", diff --git a/docs/static/img/codespaces_badges/react_cta_badge.svg b/docs/static/img/codespaces_badges/react_cta_badge.svg new file mode 100644 index 000000000000..c8c3d1738d43 --- /dev/null +++ b/docs/static/img/codespaces_badges/react_cta_badge.svg @@ -0,0 +1,19 @@ + + + + + + + + + + + + + + + + + + + diff --git a/docs/static/img/codespaces_badges/token_cta_badge.svg b/docs/static/img/codespaces_badges/token_cta_badge.svg new file mode 100644 index 000000000000..9d536be120b2 --- /dev/null +++ b/docs/static/img/codespaces_badges/token_cta_badge.svg @@ -0,0 +1,19 @@ + + + + + + + + + + + + + + + + + + + diff --git a/docs/static/img/codespaces_badges/vanilla_cta_badge.svg b/docs/static/img/codespaces_badges/vanilla_cta_badge.svg new file mode 100644 index 000000000000..a717e72561a2 --- /dev/null +++ b/docs/static/img/codespaces_badges/vanilla_cta_badge.svg @@ -0,0 +1,19 @@ + + + + + + + + + + + + + + + + + + + From c15e7225385958f8cafc47fc6a0b61a14677df75 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Pedro=20Sousa?= Date: Mon, 6 May 2024 17:17:26 +0100 Subject: [PATCH 2/8] Apply suggestions from code review Co-authored-by: Cat McGee --- docs/docs/developers/getting_started/quickstart.md | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/docs/docs/developers/getting_started/quickstart.md b/docs/docs/developers/getting_started/quickstart.md index ce894a34c38f..1ec2e8f193eb 100644 --- a/docs/docs/developers/getting_started/quickstart.md +++ b/docs/docs/developers/getting_started/quickstart.md @@ -14,17 +14,15 @@ Please click one of these buttons and hit "create codespace": [![One-Click React Starter](/img/codespaces_badges/react_cta_badge.svg)](https://codespaces.new/AztecProtocol/aztec-packages?devcontainer_path=.devcontainer%2Freact%2Fdevcontainer.json) [![One-Click HTML/TS Starter](/img/codespaces_badges/vanilla_cta_badge.svg)](https://codespaces.new/AztecProtocol/aztec-packages?devcontainer_path=.devcontainer%2Fvanilla%2Fdevcontainer.json) [![One-Click Token Starter](/img/codespaces_badges/token_cta_badge.svg)](https://codespaces.new/AztecProtocol/aztec-packages?devcontainer_path=.devcontainer%2Ftoken%2Fdevcontainer.json) -That's it, have a good night 🖐️🎤 +That's it! -### What the... - -Ok ok, what this does is create a codespace with a prebuilt image containing one of the "Aztec Boxes" and a development network (sandbox). +This creates a codespace with a prebuilt image containing one of the "Aztec Boxes" and a development network (sandbox). - You can develop directly on the codespace, push it to a repo, make yourself at home. -- You can also just use the sandbox that comes with it. The URL will be logged, you just need to use it as your PXE_URL. +- You can also just use the sandbox that comes with it. The URL will be logged, you just need to use it as your `PXE_URL`. ## 2. Aztec Boxes -The above method uses aztec boxes to install the sandbox and clone the repo. You can use it too to get started on your own machine and use your own IDE +The above method uses Aztec boxes to install the sandbox and clone the repo. You can use it too to get started on your own machine and use your own IDE ### Prerequisites From 0cf9eae45a22f646d08eefc58caee8355d65f9a7 Mon Sep 17 00:00:00 2001 From: signorecello Date: Mon, 6 May 2024 16:18:16 +0000 Subject: [PATCH 3/8] fixing npx script with docker compose instead of docker-compose --- boxes/package.json | 3 +-- boxes/scripts/steps/sandbox/run.js | 6 +++--- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/boxes/package.json b/boxes/package.json index c0c3cda556f4..ad941bc6c07d 100644 --- a/boxes/package.json +++ b/boxes/package.json @@ -1,9 +1,8 @@ { "name": "create-aztec-app", "packageManager": "yarn@4.0.2", - "version": "0.4.2", + "version": "0.4.4", "type": "module", - "private": true, "scripts": { "compile": "yarn workspaces foreach -A -v run compile", "build": "yarn workspaces foreach -A -v run build", diff --git a/boxes/scripts/steps/sandbox/run.js b/boxes/scripts/steps/sandbox/run.js index 77238e289b72..65206dd785a9 100644 --- a/boxes/scripts/steps/sandbox/run.js +++ b/boxes/scripts/steps/sandbox/run.js @@ -4,8 +4,8 @@ import axios from "axios"; const sandbox = (command) => execSync( - `docker-compose -f $HOME/.aztec/docker-compose.yml -p sandbox ${command}`, - { stdio: "inherit" }, + `docker compose -f $HOME/.aztec/docker-compose.yml -p sandbox ${command}`, + { stdio: "inherit" } ); export const start = () => sandbox("up -d"); @@ -29,7 +29,7 @@ export async function sandboxRunStep() { Accept: "*/*", "Content-Type": "application/json", }, - }, + } ); spinner.succeed(); success("The Sandbox is already running!"); From c249a78516861c16794bdf21cbf5d7dc84ecfcd8 Mon Sep 17 00:00:00 2001 From: signorecello Date: Mon, 6 May 2024 16:28:36 +0000 Subject: [PATCH 4/8] applying suggestions --- .../developers/getting_started/quickstart.md | 66 ++----------------- .../sandbox/references/sandbox-reference.md | 53 ++++++++++++++- 2 files changed, 57 insertions(+), 62 deletions(-) diff --git a/docs/docs/developers/getting_started/quickstart.md b/docs/docs/developers/getting_started/quickstart.md index 1ec2e8f193eb..6cc067c01517 100644 --- a/docs/docs/developers/getting_started/quickstart.md +++ b/docs/docs/developers/getting_started/quickstart.md @@ -2,15 +2,7 @@ title: Quickstart --- -Getting started on Aztec is easy. Here are the three recommended ways of starting developing on Aztec: - -- Codespaces - For a zero-requirement, <5min starter that runs on your grandma's IBM PC, you can use Github Codespaces, which is free up to 60h per month. -- `npx create-aztec-app` - Will guide you through the "Aztec Boxes": full boilerplate projects with a built-in sandbox. Requires node, docker and some 4gb RAM at least. -- Manual install - Install the sandbox and only the sandbox. - -## 1. Codespaces - -Please click one of these buttons and hit "create codespace": +The easiest way to start developing on Aztec is simply to click on one of these buttons: [![One-Click React Starter](/img/codespaces_badges/react_cta_badge.svg)](https://codespaces.new/AztecProtocol/aztec-packages?devcontainer_path=.devcontainer%2Freact%2Fdevcontainer.json) [![One-Click HTML/TS Starter](/img/codespaces_badges/vanilla_cta_badge.svg)](https://codespaces.new/AztecProtocol/aztec-packages?devcontainer_path=.devcontainer%2Fvanilla%2Fdevcontainer.json) [![One-Click Token Starter](/img/codespaces_badges/token_cta_badge.svg)](https://codespaces.new/AztecProtocol/aztec-packages?devcontainer_path=.devcontainer%2Ftoken%2Fdevcontainer.json) @@ -20,9 +12,11 @@ This creates a codespace with a prebuilt image containing one of the "Aztec Boxe - You can develop directly on the codespace, push it to a repo, make yourself at home. - You can also just use the sandbox that comes with it. The URL will be logged, you just need to use it as your `PXE_URL`. -## 2. Aztec Boxes +## Develop Locally + +The above method uses Aztec boxes to install the sandbox and clone the repo. You can use it too to get started on your own machine and use your own IDE. -The above method uses Aztec boxes to install the sandbox and clone the repo. You can use it too to get started on your own machine and use your own IDE +You can also [install the sandbox manually](../sandbox/references/sandbox-reference.md). ### Prerequisites @@ -41,56 +35,6 @@ And follow the instructions. If all goes well, you should now have a development You can run `npx create-aztec-app sandbox -h` to start, stop, update and output logs from the sandbox. -## 3. Manual Install - -If you don't want a boilerplate project, you can also install the sandbox via the underlying script used by the `npx` command. - -### Prerequisites - -- Node.js >= v18 (recommend installing with [nvm](https://github.com/nvm-sh/nvm)) -- Docker (visit [this page of the Docker docs](https://docs.docker.com/get-docker/) on how to install it) - -### Install the sandbox - -To install the latest Sandbox version, run: - -```bash -bash -i <(curl -s install.aztec.network) -``` - -This will install the following tools: - -- **aztec** - launches various infrastructure subsystems (sequencer, prover, pxe, etc). -- **aztec-nargo** - aztec's build of nargo, the noir compiler toolchain. -- **aztec-sandbox** - a wrapper around docker-compose that launches services needed for sandbox testing. -- **aztec-up** - a tool to upgrade the aztec toolchain to the latest, or specific versions. -- **aztec-builder** - A useful tool for projects to generate ABIs and update their dependencies. - -Once these have been installed, to start the sandbox, run: - -```bash -aztec-sandbox -``` - -### Have fun! - -**Congratulations, you have just installed and run the Aztec Sandbox!** - -```bash - /\ | | - / \ ___| |_ ___ ___ - / /\ \ |_ / __/ _ \/ __| - / ____ \ / /| || __/ (__ - /_/___ \_\/___|\__\___|\___| - -``` - -In the terminal, you will see some logs: -1. Sandbox version -2. Contract addresses of rollup contracts -3. PXE (private execution environment) setup logs -4. Initial accounts that are shipped with the sandbox and can be used in tests - ## What's next? To deploy a smart contract to your sandbox and interact with it using Aztec.js, go to the [next page](aztecjs-getting-started.md). diff --git a/docs/docs/developers/sandbox/references/sandbox-reference.md b/docs/docs/developers/sandbox/references/sandbox-reference.md index 80ac3d86976c..fc401a573367 100644 --- a/docs/docs/developers/sandbox/references/sandbox-reference.md +++ b/docs/docs/developers/sandbox/references/sandbox-reference.md @@ -4,10 +4,61 @@ title: Sandbox Reference :::tip -Follow the [quick start guide](../../getting_started/quickstart.md) to install the sandbox. +For a quick start, follow the [guide](../../getting_started/quickstart.md) to install the sandbox. ::: +## Manual Install + +You can manually install the sandbox via the underlying script used in the [Aztec Boxes](../../getting_started/quickstart.md#run-the-npx-script). + +### Prerequisites + +- Node.js >= v18 (recommend installing with [nvm](https://github.com/nvm-sh/nvm)) +- Docker (visit [this page of the Docker docs](https://docs.docker.com/get-docker/) on how to install it) + +### Install the sandbox + +To install the latest Sandbox version, run: + +```bash +bash -i <(curl -s install.aztec.network) +``` + +This will install the following tools: + +- **aztec** - launches various infrastructure subsystems (sequencer, prover, pxe, etc). +- **aztec-nargo** - aztec's build of nargo, the noir compiler toolchain. +- **aztec-sandbox** - a wrapper around docker-compose that launches services needed for sandbox testing. +- **aztec-up** - a tool to upgrade the aztec toolchain to the latest, or specific versions. +- **aztec-builder** - A useful tool for projects to generate ABIs and update their dependencies. + +Once these have been installed, to start the sandbox, run: + +```bash +aztec-sandbox +``` + +### Have fun! + +**Congratulations, you have just installed and run the Aztec Sandbox!** + +```bash + /\ | | + / \ ___| |_ ___ ___ + / /\ \ |_ / __/ _ \/ __| + / ____ \ / /| || __/ (__ + /_/___ \_\/___|\__\___|\___| + +``` + +In the terminal, you will see some logs: +1. Sandbox version +2. Contract addresses of rollup contracts +3. PXE (private execution environment) setup logs +4. Initial accounts that are shipped with the sandbox and can be used in tests + + ## Running Aztec PXE / Node / P2P-Bootstrap node If you wish to run components of the Aztec network stack separately, you can use the `aztec start` command with various options for enabling components. From 094f40e8235f4317b99534da2186396cdac17cb0 Mon Sep 17 00:00:00 2001 From: signorecello Date: Wed, 8 May 2024 09:49:32 +0000 Subject: [PATCH 5/8] adding stuff to readme --- boxes/README.md | 31 +- boxes/boxes/react/README.md | 29 + boxes/boxes/vanilla/README.md | 30 + boxes/contract-only/README.md | 31 +- .../aztec-nr/address-note/address_note.md | 61 ++ .../aztec-nr/authwit/account.md | 102 +++ .../aztec-nr/authwit/auth.md | 67 ++ .../aztec-nr/authwit/auth_witness.md | 24 + .../aztec-nr/authwit/entrypoint/app.md | 61 ++ .../aztec-nr/authwit/entrypoint/fee.md | 57 ++ .../authwit/entrypoint/function_call.md | 36 + .../aztec-nr/aztec/context.md | 52 ++ .../aztec-nr/aztec/context/avm_context.md | 498 +++++++++++ .../aztec-nr/aztec/context/gas.md | 30 + .../context/inputs/avm_context_inputs.md | 8 + .../context/inputs/private_context_inputs.md | 22 + .../context/inputs/public_context_inputs.md | 24 + .../aztec-nr/aztec/context/interface.md | 446 ++++++++++ .../aztec-nr/aztec/context/private_context.md | 685 +++++++++++++++ .../aztec-nr/aztec/context/public_context.md | 477 +++++++++++ .../aztec-nr/aztec/deploy.md | 16 + .../aztec-nr/aztec/hash.md | 211 +++++ .../aztec/history/contract_inclusion.md | 54 ++ .../aztec-nr/aztec/history/note_inclusion.md | 41 + .../aztec-nr/aztec/history/note_validity.md | 29 + .../aztec/history/nullifier_inclusion.md | 66 ++ .../aztec/history/nullifier_non_inclusion.md | 66 ++ .../aztec-nr/aztec/history/public_storage.md | 48 ++ .../aztec-nr/aztec/initializer.md | 157 ++++ .../aztec-nr/aztec/keys/getters.md | 91 ++ .../aztec/keys/point_to_symmetric_key.md | 24 + .../aztec-nr/aztec/messaging.md | 19 + .../aztec-nr/aztec/note/lifecycle.md | 41 + .../aztec-nr/aztec/note/note_getter.md | 149 ++++ .../aztec/note/note_getter_options.md | 172 ++++ .../aztec-nr/aztec/note/note_header.md | 46 + .../aztec-nr/aztec/note/note_interface.md | 102 +++ .../aztec/note/note_viewer_options.md | 73 ++ .../aztec-nr/aztec/note/utils.md | 104 +++ .../aztec-nr/aztec/oracle/arguments.md | 46 + .../aztec/oracle/call_private_function.md | 34 + .../aztec-nr/aztec/oracle/encryption.md | 28 + .../oracle/enqueue_public_function_call.md | 77 ++ .../aztec/oracle/get_contract_instance.md | 68 ++ .../oracle/get_l1_to_l2_membership_witness.md | 28 + .../aztec/oracle/get_membership_witness.md | 52 ++ .../get_nullifier_membership_witness.md | 72 ++ .../aztec/oracle/get_public_data_witness.md | 35 + .../aztec-nr/aztec/oracle/get_public_key.md | 35 + .../aztec-nr/aztec/oracle/get_sibling_path.md | 28 + .../aztec-nr/aztec/oracle/header.md | 36 + .../aztec-nr/aztec/oracle/keys.md | 35 + .../aztec-nr/aztec/oracle/logs.md | 35 + .../aztec-nr/aztec/oracle/logs_traits.md | 800 ++++++++++++++++++ .../aztec-nr/aztec/oracle/notes.md | 160 ++++ .../aztec-nr/aztec/oracle/nullifier_key.md | 57 ++ .../aztec-nr/aztec/oracle/public_call.md | 34 + .../aztec-nr/aztec/oracle/returns.md | 46 + .../aztec-nr/aztec/oracle/storage.md | 60 ++ .../aztec-nr/aztec/oracle/unsafe_rand.md | 18 + .../aztec-nr/aztec/public_storage.md | 84 ++ .../aztec-nr/aztec/state_vars/map.md | 40 + .../aztec/state_vars/private_immutable.md | 71 ++ .../aztec/state_vars/private_mutable.md | 85 ++ .../aztec-nr/aztec/state_vars/private_set.md | 103 +++ .../aztec/state_vars/public_immutable.md | 36 + .../aztec/state_vars/public_mutable.md | 36 + .../aztec/state_vars/shared_immutable.md | 49 ++ .../shared_mutable/scheduled_value_change.md | 193 +++++ .../shared_mutable/shared_mutable.md | 185 ++++ .../shared_mutable_private_getter.md | 49 ++ .../aztec-nr/aztec/state_vars/storage.md | 13 + .../compressed-string/compressed_string.md | 78 ++ .../field_compressed_string.md | 80 ++ .../easy-private-state/easy_private_uint.md | 53 ++ .../aztec-nr/tests/mock/test_note.md | 123 +++ .../aztec-nr/tests/note_getter_test.md | 58 ++ .../aztec-nr/value-note/balance_utils.md | 25 + .../aztec-nr/value-note/filter.md | 14 + .../aztec-nr/value-note/utils.md | 75 ++ .../aztec-nr/value-note/value_note.md | 72 ++ 81 files changed, 7565 insertions(+), 21 deletions(-) create mode 100644 docs/docs/reference/reference/smart_contract_reference/aztec-nr/address-note/address_note.md create mode 100644 docs/docs/reference/reference/smart_contract_reference/aztec-nr/authwit/account.md create mode 100644 docs/docs/reference/reference/smart_contract_reference/aztec-nr/authwit/auth.md create mode 100644 docs/docs/reference/reference/smart_contract_reference/aztec-nr/authwit/auth_witness.md create mode 100644 docs/docs/reference/reference/smart_contract_reference/aztec-nr/authwit/entrypoint/app.md create mode 100644 docs/docs/reference/reference/smart_contract_reference/aztec-nr/authwit/entrypoint/fee.md create mode 100644 docs/docs/reference/reference/smart_contract_reference/aztec-nr/authwit/entrypoint/function_call.md create mode 100644 docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/context.md create mode 100644 docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/context/avm_context.md create mode 100644 docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/context/gas.md create mode 100644 docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/context/inputs/avm_context_inputs.md create mode 100644 docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/context/inputs/private_context_inputs.md create mode 100644 docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/context/inputs/public_context_inputs.md create mode 100644 docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/context/interface.md create mode 100644 docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/context/private_context.md create mode 100644 docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/context/public_context.md create mode 100644 docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/deploy.md create mode 100644 docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/hash.md create mode 100644 docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/history/contract_inclusion.md create mode 100644 docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/history/note_inclusion.md create mode 100644 docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/history/note_validity.md create mode 100644 docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/history/nullifier_inclusion.md create mode 100644 docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/history/nullifier_non_inclusion.md create mode 100644 docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/history/public_storage.md create mode 100644 docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/initializer.md create mode 100644 docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/keys/getters.md create mode 100644 docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/keys/point_to_symmetric_key.md create mode 100644 docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/messaging.md create mode 100644 docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/note/lifecycle.md create mode 100644 docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/note/note_getter.md create mode 100644 docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/note/note_getter_options.md create mode 100644 docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/note/note_header.md create mode 100644 docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/note/note_interface.md create mode 100644 docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/note/note_viewer_options.md create mode 100644 docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/note/utils.md create mode 100644 docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/oracle/arguments.md create mode 100644 docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/oracle/call_private_function.md create mode 100644 docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/oracle/encryption.md create mode 100644 docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/oracle/enqueue_public_function_call.md create mode 100644 docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/oracle/get_contract_instance.md create mode 100644 docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/oracle/get_l1_to_l2_membership_witness.md create mode 100644 docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/oracle/get_membership_witness.md create mode 100644 docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/oracle/get_nullifier_membership_witness.md create mode 100644 docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/oracle/get_public_data_witness.md create mode 100644 docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/oracle/get_public_key.md create mode 100644 docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/oracle/get_sibling_path.md create mode 100644 docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/oracle/header.md create mode 100644 docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/oracle/keys.md create mode 100644 docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/oracle/logs.md create mode 100644 docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/oracle/logs_traits.md create mode 100644 docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/oracle/notes.md create mode 100644 docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/oracle/nullifier_key.md create mode 100644 docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/oracle/public_call.md create mode 100644 docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/oracle/returns.md create mode 100644 docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/oracle/storage.md create mode 100644 docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/oracle/unsafe_rand.md create mode 100644 docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/public_storage.md create mode 100644 docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/state_vars/map.md create mode 100644 docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/state_vars/private_immutable.md create mode 100644 docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/state_vars/private_mutable.md create mode 100644 docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/state_vars/private_set.md create mode 100644 docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/state_vars/public_immutable.md create mode 100644 docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/state_vars/public_mutable.md create mode 100644 docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/state_vars/shared_immutable.md create mode 100644 docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/state_vars/shared_mutable/scheduled_value_change.md create mode 100644 docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/state_vars/shared_mutable/shared_mutable.md create mode 100644 docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/state_vars/shared_mutable/shared_mutable_private_getter.md create mode 100644 docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/state_vars/storage.md create mode 100644 docs/docs/reference/reference/smart_contract_reference/aztec-nr/compressed-string/compressed_string.md create mode 100644 docs/docs/reference/reference/smart_contract_reference/aztec-nr/compressed-string/field_compressed_string.md create mode 100644 docs/docs/reference/reference/smart_contract_reference/aztec-nr/easy-private-state/easy_private_uint.md create mode 100644 docs/docs/reference/reference/smart_contract_reference/aztec-nr/tests/mock/test_note.md create mode 100644 docs/docs/reference/reference/smart_contract_reference/aztec-nr/tests/note_getter_test.md create mode 100644 docs/docs/reference/reference/smart_contract_reference/aztec-nr/value-note/balance_utils.md create mode 100644 docs/docs/reference/reference/smart_contract_reference/aztec-nr/value-note/filter.md create mode 100644 docs/docs/reference/reference/smart_contract_reference/aztec-nr/value-note/utils.md create mode 100644 docs/docs/reference/reference/smart_contract_reference/aztec-nr/value-note/value_note.md diff --git a/boxes/README.md b/boxes/README.md index 67cf195e9eda..e1c4607d1d62 100644 --- a/boxes/README.md +++ b/boxes/README.md @@ -8,36 +8,27 @@ Aztec Boxes are the one-stop-shop for developing on Aztec. They often include a Boxes include the sandbox installation script and its start command. By choosing the appropriate box, you can get started working on Aztec in a minimal amount of time. -## Getting started +## Contributing -If you have [node](https://nodejs.org/en/download) installed, you can open a terminal in any folder and run: +Because of the CI/CD nature of the monorepo, every box is tested against every merge on master. This drastically reduces their maintenance cost. Thus, some scripting is needed to make sure the user gets a working repository after "unboxing". -`npx create-aztec-app` +Most of the logic is in the `bin.js` file, where `commander` commands stuff. Here's a brief description on what the script exactly does: -or +- Prompts the user for options and commands +- Inits some global variables such as a logger, a getter for the github repositories, the latest stable versions and tags, etc +- Prompts the user to choose the project and clone it. It then rewrites the `Nargo.toml` and `package.json` files to point to the repos instead of the local dependencies. +- Queries the local docker daemon for any existing sandbox images, prompting the user to install or update it if needed +- Asks the user if they want to run the sandbox right away -`npx create-aztec-app` - -The script will install the sandbox, run it, and clone the boilerplate you chose. You can pass some options: - -| Option | Description | -| --- | --- | -| -d, --debug | Displays some more information for debug reasons. | -| -gh, --github_token | You can pass a github_token in case you hit API rate limit | -| -v, --version | You can specify a semver version, or "MASTER" | -| -h, --help | Shows up this help menu | - - If at any time you encounter problems, refer to the guides at [docs.aztec.network](https://docs.aztec.network) for more information. ## Templates -Currently there are two boxes: +As noted above, every box is tested at every merge to master. Any breaking changes need to happen in every box, so we try to keep the number of templates strategically low. For that reason, we ask contributors to reach directly to the [devrel team](https://github.com/orgs/AztecProtocol/teams/devrel) before adding another template. + +Currently there are two "app" boxes and one "contract-only" box: - React - A React boilerplate with a minimal UI. - Vanilla JS and HTML - Some say if you get something working in vanilla JS and HTML, you can make it work on any framework. If you can't find the box you need, this could be a good starting point. - -And one contract-only box: - - Token - An example token contract on Aztec ## Support diff --git a/boxes/boxes/react/README.md b/boxes/boxes/react/README.md index 40fdeed5b6fe..03f03cde8c0d 100644 --- a/boxes/boxes/react/README.md +++ b/boxes/boxes/react/README.md @@ -2,6 +2,35 @@ This box is a one-stop-shop for Aztec that will deploy a minimal React page. You can use it as a boilerplate to start developing your own Aztec app in seconds! +## Getting Started + +The easiest way to start is with a Github Codespaces, which has a generous free tier. Just click on this button: + +[![One-Click React Starter](.devcontainer/assets/react_cta_badge.svg)](https://codespaces.new/AztecProtocol/aztec-packages?devcontainer_path=.devcontainer%2Freact%2Fdevcontainer.json) + +## Using the `npx` command + +The above method just uses the `npx` command, AKA "unboxing the box". This is a CLI command to quickly start developing on your own machine. + +### Prerequisites + +- Node >v18 +- Docker + +### Usage + +Just open a terminal and write: + +```bash +npx create-aztec-app +``` + +It should ask you some questions about your project, install and run the Sandbox (local developer network). You can also start, stop, update, and do other things on the sandbox through this script. Just run: + +```bash +npx create-aztec-app sandbox --help +``` + ## More information Visit the [Aztec Docs](https://docs.aztec.network) for more information on how Aztec works, and the [Awesome Aztec Repository](https://github.com/AztecProtocol/awesome-aztec) for more cool projects, boilerplates and tooling. diff --git a/boxes/boxes/vanilla/README.md b/boxes/boxes/vanilla/README.md index 92b9db74c589..8190eb5d4cdf 100644 --- a/boxes/boxes/vanilla/README.md +++ b/boxes/boxes/vanilla/README.md @@ -2,6 +2,36 @@ This box is a one-stop-shop for Aztec that will deploy a minimal barebones HTML+JS page. You can use it as a boilerplate to start developing your own Aztec app in seconds! + +## Getting Started + +The easiest way to start is with a Github Codespaces, which has a generous free tier. Just click on this button: + +[![One-Click HTML/TS Starter](.devcontainer/assets/vanilla_cta_badge.svg)](https://codespaces.new/AztecProtocol/aztec-packages?devcontainer_path=.devcontainer%2Fvanilla%2Fdevcontainer.json) + +## Using the `npx` command + +The above method just uses the `npx` command, AKA "unboxing the box". This is a CLI command to quickly start developing on your own machine. + +### Prerequisites + +- Node >v18 +- Docker + +### Usage + +Just open a terminal and write: + +```bash +npx create-aztec-app +``` + +It should ask you some questions about your project, install and run the Sandbox (local developer network). You can also start, stop, update, and do other things on the sandbox through this script. Just run: + +```bash +npx create-aztec-app sandbox --help +``` + ## More information Visit the [Aztec Docs](https://docs.aztec.network) for more information on how Aztec works, and the [Awesome Aztec Repository](https://github.com/AztecProtocol/awesome-aztec) for more cool projects, boilerplates and tooling. diff --git a/boxes/contract-only/README.md b/boxes/contract-only/README.md index 9ab9f68660dd..452b7a4b2137 100644 --- a/boxes/contract-only/README.md +++ b/boxes/contract-only/README.md @@ -2,7 +2,36 @@ This box is a one-stop-shop for Aztec with the %%contract_name%% example contract. You can use it as a boilerplate to start developing your own Aztec app in seconds! -## How to start +## Getting Started + +The easiest way to start is with a Github Codespaces, which has a generous free tier. Just click on this button: + +[![One-Click Token Starter](.devcontainer/assets/token_cta_badge.svg)](https://codespaces.new/AztecProtocol/aztec-packages?devcontainer_path=.devcontainer%2Ftoken%2Fdevcontainer.json) + +## Using the `npx` command + +The above method just uses the `npx` command, AKA "unboxing the box". This is a CLI command to quickly start developing on your own machine. + +### Prerequisites + +- Node >v18 +- Docker + +### Usage + +Just open a terminal and write: + +```bash +npx create-aztec-app +``` + +It should ask you some questions about your project, install and run the Sandbox (local developer network). You can also start, stop, update, and do other things on the sandbox through this script. Just run: + +```bash +npx create-aztec-app sandbox --help +``` + +## What's in the box The script copied one of the example contracts and put it into a one-size-fits-all "box". With it, you can run commands such as: diff --git a/docs/docs/reference/reference/smart_contract_reference/aztec-nr/address-note/address_note.md b/docs/docs/reference/reference/smart_contract_reference/aztec-nr/address-note/address_note.md new file mode 100644 index 000000000000..5c803821d8b4 --- /dev/null +++ b/docs/docs/reference/reference/smart_contract_reference/aztec-nr/address-note/address_note.md @@ -0,0 +1,61 @@ +# AddressNote + +## Fields +| Field | Type | +| --- | --- | +| address | AztecAddress | +| owner | AztecAddress | +| randomness | Field | + +## Methods + +### new + +```rust +AddressNote::new(address, owner); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| address | AztecAddress | +| owner | AztecAddress | + +## Standalone Functions + +### compute_nullifier + +```rust +compute_nullifier(self, context); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| self | | +| context | &mut PrivateContext | + +### compute_nullifier_without_context + +```rust +compute_nullifier_without_context(self); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| self | | + +### broadcast + +```rust +broadcast(self, context, slot); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| self | | +| context | &mut PrivateContext | +| slot | Field | + diff --git a/docs/docs/reference/reference/smart_contract_reference/aztec-nr/authwit/account.md b/docs/docs/reference/reference/smart_contract_reference/aztec-nr/authwit/account.md new file mode 100644 index 000000000000..59d47f52f4a2 --- /dev/null +++ b/docs/docs/reference/reference/smart_contract_reference/aztec-nr/authwit/account.md @@ -0,0 +1,102 @@ +# AccountActions + +## Fields +| Field | Type | +| --- | --- | +| context | Context | +| is_valid_impl | fn(&mut PrivateContext, Field) -> bool | +| approved_action | Map<Field, PublicMutable<bool>> | + +## Methods + +### init + +```rust +AccountActions::init(context, approved_action_storage_slot, is_valid_impl, Field); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| context | Context | +| approved_action_storage_slot | Field | +| is_valid_impl | fn(&mut PrivateContext | +| Field | | + +### private + +```rust +AccountActions::private(context, approved_action_storage_slot, is_valid_impl, Field); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| context | &mut PrivateContext | +| approved_action_storage_slot | Field | +| is_valid_impl | fn(&mut PrivateContext | +| Field | | + +### public + +```rust +AccountActions::public(context, approved_action_storage_slot, is_valid_impl, Field); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| context | &mut PublicContext | +| approved_action_storage_slot | Field | +| is_valid_impl | fn(&mut PrivateContext | +| Field | | + +### entrypoint + +```rust +AccountActions::entrypoint(self, app_payload, fee_payload); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| self | | +| app_payload | AppPayload | +| fee_payload | FeePayload | + +### spend_private_authwit + +```rust +AccountActions::spend_private_authwit(self, inner_hash); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| self | | +| inner_hash | Field | + +### spend_public_authwit + +```rust +AccountActions::spend_public_authwit(self, inner_hash); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| self | | +| inner_hash | Field | + +### approve_public_authwit + +```rust +AccountActions::approve_public_authwit(self, message_hash); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| self | | +| message_hash | Field | + diff --git a/docs/docs/reference/reference/smart_contract_reference/aztec-nr/authwit/auth.md b/docs/docs/reference/reference/smart_contract_reference/aztec-nr/authwit/auth.md new file mode 100644 index 000000000000..68174d8ad499 --- /dev/null +++ b/docs/docs/reference/reference/smart_contract_reference/aztec-nr/authwit/auth.md @@ -0,0 +1,67 @@ +## Standalone Functions + +### assert_current_call_valid_authwit + +```rust +assert_current_call_valid_authwit(context, on_behalf_of); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| context | &mut PrivateContext | +| on_behalf_of | AztecAddress | + +### assert_current_call_valid_authwit_public + +```rust +assert_current_call_valid_authwit_public(context, on_behalf_of); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| context | &mut TPublicContext | +| on_behalf_of | AztecAddress | + +### compute_call_authwit_hash + +```rust +compute_call_authwit_hash(caller, consumer, chain_id, version, selector, args); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| caller | AztecAddress | +| consumer | AztecAddress | +| chain_id | Field | +| version | Field | +| selector | FunctionSelector | +| args | [Field; N] | + +### compute_inner_authwit_hash + +```rust +compute_inner_authwit_hash(args); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| args | [Field; N] | + +### compute_outer_authwit_hash + +```rust +compute_outer_authwit_hash(consumer, chain_id, version, inner_hash); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| consumer | AztecAddress | +| chain_id | Field | +| version | Field | +| inner_hash | Field | + diff --git a/docs/docs/reference/reference/smart_contract_reference/aztec-nr/authwit/auth_witness.md b/docs/docs/reference/reference/smart_contract_reference/aztec-nr/authwit/auth_witness.md new file mode 100644 index 000000000000..11338206f5cd --- /dev/null +++ b/docs/docs/reference/reference/smart_contract_reference/aztec-nr/authwit/auth_witness.md @@ -0,0 +1,24 @@ +## Standalone Functions + +### get_auth_witness_oracle + +```rust +get_auth_witness_oracle(_message_hash); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| _message_hash | Field | + +### get_auth_witness + +```rust +get_auth_witness(message_hash); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| message_hash | Field | + diff --git a/docs/docs/reference/reference/smart_contract_reference/aztec-nr/authwit/entrypoint/app.md b/docs/docs/reference/reference/smart_contract_reference/aztec-nr/authwit/entrypoint/app.md new file mode 100644 index 000000000000..9870a7f64691 --- /dev/null +++ b/docs/docs/reference/reference/smart_contract_reference/aztec-nr/authwit/entrypoint/app.md @@ -0,0 +1,61 @@ +# AppPayload + +Note: If you change the following struct you have to update default_entrypoint.ts + +## Fields +| Field | Type | +| --- | --- | +| function_calls | FunctionCall; ACCOUNT_MAX_CALLS] | +| nonce | Field | + +## Methods + +### to_be_bytes + +Serializes the payload as an array of bytes. Useful for hashing with sha256. + +```rust +AppPayload::to_be_bytes(self); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| self | | + +### execute_calls + +```rust +AppPayload::execute_calls(self, context); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| self | | +| context | &mut PrivateContext | + +## Standalone Functions + +### serialize + +```rust +serialize(self); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| self | | + +### hash + +```rust +hash(self); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| self | | + diff --git a/docs/docs/reference/reference/smart_contract_reference/aztec-nr/authwit/entrypoint/fee.md b/docs/docs/reference/reference/smart_contract_reference/aztec-nr/authwit/entrypoint/fee.md new file mode 100644 index 000000000000..d897895cae70 --- /dev/null +++ b/docs/docs/reference/reference/smart_contract_reference/aztec-nr/authwit/entrypoint/fee.md @@ -0,0 +1,57 @@ +# FeePayload + +## Fields +| Field | Type | +| --- | --- | +| function_calls | FunctionCall; MAX_FEE_FUNCTION_CALLS] | +| nonce | Field | + +## Methods + +### to_be_bytes + +```rust +FeePayload::to_be_bytes(self); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| self | | + +### execute_calls + +```rust +FeePayload::execute_calls(self, context); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| self | | +| context | &mut PrivateContext | + +## Standalone Functions + +### serialize + +```rust +serialize(self); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| self | | + +### hash + +```rust +hash(self); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| self | | + diff --git a/docs/docs/reference/reference/smart_contract_reference/aztec-nr/authwit/entrypoint/function_call.md b/docs/docs/reference/reference/smart_contract_reference/aztec-nr/authwit/entrypoint/function_call.md new file mode 100644 index 000000000000..806625d9619e --- /dev/null +++ b/docs/docs/reference/reference/smart_contract_reference/aztec-nr/authwit/entrypoint/function_call.md @@ -0,0 +1,36 @@ +# FunctionCall + +## Fields +| Field | Type | +| --- | --- | +| args_hash | Field | +| function_selector | FunctionSelector | +| target_address | AztecAddress | +| is_public | bool | + +## Methods + +### to_be_bytes + +```rust +FunctionCall::to_be_bytes(self); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| self | | + +## Standalone Functions + +### serialize + +```rust +serialize(self); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| self | | + diff --git a/docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/context.md b/docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/context.md new file mode 100644 index 000000000000..1e582bd0d42d --- /dev/null +++ b/docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/context.md @@ -0,0 +1,52 @@ +# Context + +## Fields +| Field | Type | +| --- | --- | +| private | Option<&mut PrivateContext> | +| public | Option<&mut PublicContext> | +| avm | Option<&mut AvmContext> | + +## Methods + +### private + +```rust +Context::private(context); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| context | &mut PrivateContext | + +### public + +```rust +Context::public(context); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| context | &mut PublicContext | + +### avm + +```rust +Context::avm(context); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| context | &mut AvmContext | + +### none + +```rust +Context::none(); +``` + +Takes no parameters. + diff --git a/docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/context/avm_context.md b/docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/context/avm_context.md new file mode 100644 index 000000000000..97a4e5d47d15 --- /dev/null +++ b/docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/context/avm_context.md @@ -0,0 +1,498 @@ +# AvmContext + +## Fields +| Field | Type | +| --- | --- | +| inputs | AvmContextInputs | + +## Methods + +### new + +```rust +AvmContext::new(inputs); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| inputs | AvmContextInputs | + +### storage_address + +```rust +AvmContext::storage_address(self); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| self | | + +### fee_per_l2_gas + +```rust +AvmContext::fee_per_l2_gas(self); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| self | | + +### fee_per_da_gas + +```rust +AvmContext::fee_per_da_gas(self); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| self | | + +### emit_unencrypted_log + +```rust +AvmContext::emit_unencrypted_log(&mut self, event_selector, log); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| &mut self | | +| event_selector | Field | +| log | T | + +### note_hash_exists + +```rust +AvmContext::note_hash_exists(self, note_hash, leaf_index); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| self | | +| note_hash | Field | +| leaf_index | Field | + +### l1_to_l2_msg_exists + +```rust +AvmContext::l1_to_l2_msg_exists(self, msg_hash, msg_leaf_index); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| self | | +| msg_hash | Field | +| msg_leaf_index | Field | + +## Standalone Functions + +### block_number + +```rust +block_number(self); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| self | | + +### timestamp + +```rust +timestamp(self); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| self | | + +### coinbase + +```rust +coinbase(self); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| self | | + +### fee_recipient + +```rust +fee_recipient(self); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| self | | + +### transaction_fee + +```rust +transaction_fee(self); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| self | | + +### nullifier_exists + +```rust +nullifier_exists(self, unsiloed_nullifier, address); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| self | | +| unsiloed_nullifier | Field | +| address | AztecAddress | + +### consume_l1_to_l2_message + +```rust +consume_l1_to_l2_message(&mut self, content, secret, sender, leaf_index); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| &mut self | | +| content | Field | +| secret | Field | +| sender | EthAddress | +| leaf_index | Field | + +### message_portal + +```rust +message_portal(&mut self, recipient, content); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| &mut self | | +| recipient | EthAddress | +| content | Field | + +### call_public_function + +```rust +call_public_function(self, contract_address, temporary_function_selector, args, gas_opts); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| self | &mut Self | +| contract_address | AztecAddress | +| temporary_function_selector | FunctionSelector | +| args | [Field] | +| gas_opts | GasOpts | + +### static_call_public_function + +```rust +static_call_public_function(self, contract_address, temporary_function_selector, args, gas_opts); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| self | &mut Self | +| contract_address | AztecAddress | +| temporary_function_selector | FunctionSelector | +| args | [Field] | +| gas_opts | GasOpts | + +### delegate_call_public_function + +```rust +delegate_call_public_function(self, contract_address, function_selector, args); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| self | &mut Self | +| contract_address | AztecAddress | +| function_selector | FunctionSelector | +| args | [Field] | + +### push_new_note_hash + +```rust +push_new_note_hash(&mut self, note_hash); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| &mut self | | +| note_hash | Field | + +### push_new_nullifier + +```rust +push_new_nullifier(&mut self, nullifier, _nullified_commitment); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| &mut self | | +| nullifier | Field | +| _nullified_commitment | Field | + +### msg_sender + +```rust +msg_sender(self); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| self | | + +### this_address + +```rust +this_address(self); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| self | | + +### chain_id + +```rust +chain_id(self); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| self | | + +### version + +```rust +version(self); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| self | | + +### selector + +```rust +selector(self); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| self | | + +### get_args_hash + +```rust +get_args_hash(self); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| self | | + +### gas_for_call + +```rust +gas_for_call(user_gas); +``` + +Helper functions + +#### Parameters +| Name | Type | +| --- | --- | +| user_gas | GasOpts | + +### address + +```rust +address(); +``` + +Takes no parameters. + +### sender + +```rust +sender(); +``` + +Takes no parameters. + +### portal + +```rust +portal(); +``` + +Takes no parameters. + +### transaction_fee + +```rust +transaction_fee(); +``` + +Takes no parameters. + +### chain_id + +```rust +chain_id(); +``` + +Takes no parameters. + +### version + +```rust +version(); +``` + +Takes no parameters. + +### block_number + +```rust +block_number(); +``` + +Takes no parameters. + +### timestamp + +```rust +timestamp(); +``` + +Takes no parameters. + +### l2_gas_left + +```rust +l2_gas_left(); +``` + +Takes no parameters. + +### da_gas_left + +```rust +da_gas_left(); +``` + +Takes no parameters. + +### emit_note_hash + +```rust +emit_note_hash(note_hash); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| note_hash | Field | + +### nullifier_exists + +```rust +nullifier_exists(nullifier, address); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| nullifier | Field | +| address | Field | + +### emit_nullifier + +```rust +emit_nullifier(nullifier); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| nullifier | Field | + +### send_l2_to_l1_msg + +```rust +send_l2_to_l1_msg(recipient, content); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| recipient | EthAddress | +| content | Field | + +### call + +```rust +call(gas, // gas allocation, da_gas] + address, args, // TODO(5110); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| gas | [Field; 2] | +| // gas allocation | [l2_gas | +| da_gas] + address | AztecAddress | +| args | [Field] | +| // TODO(5110 | | + +### call_static + +```rust +call_static(gas, // gas allocation, da_gas] + address, args, // TODO(5110); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| gas | [Field; 2] | +| // gas allocation | [l2_gas | +| da_gas] + address | AztecAddress | +| args | [Field] | +| // TODO(5110 | | + diff --git a/docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/context/gas.md b/docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/context/gas.md new file mode 100644 index 000000000000..6db6b1306abc --- /dev/null +++ b/docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/context/gas.md @@ -0,0 +1,30 @@ +# GasOpts + +## Fields +| Field | Type | +| --- | --- | +| l2_gas | Option<Field> | +| da_gas | Option<Field> | + +## Methods + +### default + +```rust +GasOpts::default(); +``` + +Takes no parameters. + +### new + +```rust +GasOpts::new(l2_gas, da_gas); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| l2_gas | Field | +| da_gas | Field | + diff --git a/docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/context/inputs/avm_context_inputs.md b/docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/context/inputs/avm_context_inputs.md new file mode 100644 index 000000000000..25383fdd079b --- /dev/null +++ b/docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/context/inputs/avm_context_inputs.md @@ -0,0 +1,8 @@ +# AvmContextInputs + +## Fields +| Field | Type | +| --- | --- | +| selector | Field | +| args_hash | Field | + diff --git a/docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/context/inputs/private_context_inputs.md b/docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/context/inputs/private_context_inputs.md new file mode 100644 index 000000000000..a34b1d5e78b6 --- /dev/null +++ b/docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/context/inputs/private_context_inputs.md @@ -0,0 +1,22 @@ +# PrivateContextInputs + +PrivateContextInputs are expected to be provided to each private function + +## Fields +| Field | Type | +| --- | --- | +| call_context | CallContext | +| historical_header | Header | +| tx_context | TxContext | +| start_side_effect_counter | u32 | + +## Standalone Functions + +### empty + +```rust +empty(); +``` + +Takes no parameters. + diff --git a/docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/context/inputs/public_context_inputs.md b/docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/context/inputs/public_context_inputs.md new file mode 100644 index 000000000000..62fda63ddb99 --- /dev/null +++ b/docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/context/inputs/public_context_inputs.md @@ -0,0 +1,24 @@ +# PublicContextInputs + +PublicContextInputs are expected to be provided to each public function + +## Fields +| Field | Type | +| --- | --- | +| call_context | CallContext | +| historical_header | Header | +| public_global_variables | PublicGlobalVariables | +| start_side_effect_counter | u32 | +| gas_left | Gas | +| transaction_fee | Field | + +## Standalone Functions + +### empty + +```rust +empty(); +``` + +Takes no parameters. + diff --git a/docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/context/interface.md b/docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/context/interface.md new file mode 100644 index 000000000000..4fd45c078474 --- /dev/null +++ b/docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/context/interface.md @@ -0,0 +1,446 @@ +# PrivateVoidCallInterface + +## Fields +| Field | Type | +| --- | --- | +| target_contract | AztecAddress | +| selector | FunctionSelector | +| args_hash | Field | + +## Methods + +### call + +```rust +PrivateVoidCallInterface::call(self, context); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| self | | +| context | &mut PrivateContext | + +### static_call + +```rust +PrivateVoidCallInterface::static_call(self, context); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| self | | +| context | &mut PrivateContext | + +### delegate_call + +```rust +PrivateVoidCallInterface::delegate_call(self, context); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| self | | +| context | &mut PrivateContext | + +# PublicVoidCallInterface + +## Fields +| Field | Type | +| --- | --- | +| target_contract | AztecAddress | +| selector | FunctionSelector | +| args_hash | Field | + +## Methods + +### call + +```rust +PublicVoidCallInterface::call(self, context); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| self | | +| context | &mut PublicContext | + +### static_call + +```rust +PublicVoidCallInterface::static_call(self, context); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| self | | +| context | &mut PublicContext | + +### delegate_call + +```rust +PublicVoidCallInterface::delegate_call(self, context); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| self | | +| context | &mut PublicContext | + +### enqueue + +```rust +PublicVoidCallInterface::enqueue(self, context); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| self | | +| context | &mut PrivateContext | + +### static_enqueue + +```rust +PublicVoidCallInterface::static_enqueue(self, context); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| self | | +| context | &mut PrivateContext | + +### delegate_enqueue + +```rust +PublicVoidCallInterface::delegate_enqueue(self, context); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| self | | +| context | &mut PrivateContext | + +# AvmVoidCallInterface + +## Fields +| Field | Type | +| --- | --- | +| target_contract | AztecAddress | +| selector | FunctionSelector | +| args | Field] | + +## Methods + +### call + +```rust +AvmVoidCallInterface::call(self, context, gas_opts); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| self | | +| context | &mut AvmContext | +| gas_opts | GasOpts | + +### static_call + +```rust +AvmVoidCallInterface::static_call(self, context, gas_opts); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| self | | +| context | &mut AvmContext | +| gas_opts | GasOpts | + +### delegate_call + +```rust +AvmVoidCallInterface::delegate_call(self, context); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| self | | +| context | &mut AvmContext | + +## Standalone Functions + +### push_new_note_hash + +```rust +push_new_note_hash(&mut self, note_hash); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| &mut self | | +| note_hash | Field | + +### push_new_nullifier + +```rust +push_new_nullifier(&mut self, nullifier, nullified_commitment); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| &mut self | | +| nullifier | Field | +| nullified_commitment | Field | + +### msg_sender + +```rust +msg_sender(self); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| self | | + +### this_address + +```rust +this_address(self); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| self | | + +### chain_id + +```rust +chain_id(self); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| self | | + +### version + +```rust +version(self); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| self | | + +### selector + +```rust +selector(self); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| self | | + +### get_args_hash + +```rust +get_args_hash(self); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| self | | + +### block_number + +```rust +block_number(self); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| self | | + +### timestamp + +```rust +timestamp(self); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| self | | + +### coinbase + +```rust +coinbase(self); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| self | | + +### fee_recipient + +```rust +fee_recipient(self); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| self | | + +### fee_per_da_gas + +```rust +fee_per_da_gas(self); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| self | | + +### fee_per_l2_gas + +```rust +fee_per_l2_gas(self); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| self | | + +### transaction_fee + +```rust +transaction_fee(self); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| self | | + +### message_portal + +```rust +message_portal(&mut self, recipient, content); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| &mut self | | +| recipient | EthAddress | +| content | Field | + +### consume_l1_to_l2_message + +```rust +consume_l1_to_l2_message(&mut self, content, secret, sender, leaf_index); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| &mut self | | +| content | Field | +| secret | Field | +| sender | EthAddress | +| leaf_index | Field | + +### emit_unencrypted_log + +```rust +emit_unencrypted_log(&mut self, log); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| &mut self | | +| log | T | + +### call_public_function + +```rust +call_public_function(self, contract_address, function_selector, args, gas_opts); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| self | &mut Self | +| contract_address | AztecAddress | +| function_selector | FunctionSelector | +| args | [Field] | +| gas_opts | GasOpts | + +### static_call_public_function + +```rust +static_call_public_function(self, contract_address, function_selector, args, gas_opts); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| self | &mut Self | +| contract_address | AztecAddress | +| function_selector | FunctionSelector | +| args | [Field] | +| gas_opts | GasOpts | + +### delegate_call_public_function + +```rust +delegate_call_public_function(self, contract_address, function_selector, args); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| self | &mut Self | +| contract_address | AztecAddress | +| function_selector | FunctionSelector | +| args | [Field] | + +### nullifier_exists + +```rust +nullifier_exists(self, unsiloed_nullifier, address); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| self | | +| unsiloed_nullifier | Field | +| address | AztecAddress | + diff --git a/docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/context/private_context.md b/docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/context/private_context.md new file mode 100644 index 000000000000..c8c6c2e13469 --- /dev/null +++ b/docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/context/private_context.md @@ -0,0 +1,685 @@ +# PrivateContext + +When finished, one can call .finish() to convert back to the abi + +## Fields +| Field | Type | +| --- | --- | +| inputs | PrivateContextInputs | +| side_effect_counter | u32 | +| min_revertible_side_effect_counter | u32 | +| args_hash | Field | +| return_hash | Field | +| max_block_number | MaxBlockNumber | +| note_hash_read_requests | BoundedVec<ReadRequest, MAX_NOTE_HASH_READ_REQUESTS_PER_CALL> | +| nullifier_read_requests | BoundedVec<ReadRequest, MAX_NULLIFIER_READ_REQUESTS_PER_CALL> | +| nullifier_key_validation_requests | BoundedVec<NullifierKeyValidationRequest, MAX_NULLIFIER_KEY_VALIDATION_REQUESTS_PER_CALL> | +| new_note_hashes | BoundedVec<NoteHash, MAX_NEW_NOTE_HASHES_PER_CALL> | +| new_nullifiers | BoundedVec<Nullifier, MAX_NEW_NULLIFIERS_PER_CALL> | +| private_call_stack_hashes | BoundedVec<Field, MAX_PRIVATE_CALL_STACK_LENGTH_PER_CALL> | +| public_call_stack_hashes | BoundedVec<Field, MAX_PUBLIC_CALL_STACK_LENGTH_PER_CALL> | +| public_teardown_function_hash | Field | +| new_l2_to_l1_msgs | BoundedVec<L2ToL1Message, MAX_NEW_L2_TO_L1_MSGS_PER_CALL> | +| historical_header | Header | +| encrypted_logs_hashes | BoundedVec<SideEffect, MAX_ENCRYPTED_LOGS_PER_CALL> | +| unencrypted_logs_hashes | BoundedVec<SideEffect, MAX_UNENCRYPTED_LOGS_PER_CALL> | +| encrypted_log_preimages_length | Field | +| unencrypted_log_preimages_length | Field | +| nullifier_key | Option<NullifierKeys> | + +## Methods + +### new + +```rust +PrivateContext::new(inputs, args_hash); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| inputs | PrivateContextInputs | +| args_hash | Field | + +### get_header + +Returns the header of a block whose state is used during private execution (not the block the transaction is included in). + +```rust +PrivateContext::get_header(self); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| self | | + +### get_header_at + +Returns the header of an arbitrary block whose block number is less than or equal to the block number of historical header. + +```rust +PrivateContext::get_header_at(self, block_number); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| self | | +| block_number | u32 | + +### set_return_hash + +```rust +PrivateContext::set_return_hash(&mut self, returns_hasher); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| &mut self | | +| returns_hasher | ArgsHasher | + +### finish + +```rust +PrivateContext::finish(self); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| self | | + +### end_setup + +```rust +PrivateContext::end_setup(&mut self); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| &mut self | | + +### set_tx_max_block_number + +```rust +PrivateContext::set_tx_max_block_number(&mut self, max_block_number); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| &mut self | | +| max_block_number | u32 | + +### push_note_hash_read_request + +```rust +PrivateContext::push_note_hash_read_request(&mut self, note_hash); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| &mut self | | +| note_hash | Field | + +### push_nullifier_read_request + +```rust +PrivateContext::push_nullifier_read_request(&mut self, nullifier); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| &mut self | | +| nullifier | Field | + +### request_app_nullifier_secret_key + +```rust +PrivateContext::request_app_nullifier_secret_key(&mut self, account); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| &mut self | | +| account | AztecAddress | + +### message_portal + +```rust +PrivateContext::message_portal(&mut self, recipient, content); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| &mut self | | +| recipient | EthAddress | +| content | Field | + +### consume_l1_to_l2_message + +```rust +PrivateContext::consume_l1_to_l2_message(&mut self, content, secret, sender); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| &mut self | | +| content | Field | +| secret | Field | +| sender | EthAddress | + +### emit_unencrypted_log + +TODO: We might want to remove this since emitting unencrypted logs from private functions is violating privacy. --> might be a better approach to force devs to make a public function call that emits the log if needed then it would be less easy to accidentally leak information. If we decide to keep this function around would make sense to wait for traits and then merge it with emit_unencrypted_log. + +```rust +PrivateContext::emit_unencrypted_log(&mut self, log); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| &mut self | | +| log | T | + +### emit_contract_class_unencrypted_log + +This fn exists separately from emit_unencrypted_log because sha hashing the preimage is too large to compile (16,200 fields, 518,400 bytes) => the oracle hashes it It is ONLY used with contract_class_registerer_contract since we already assert correctness: - Contract class -> we will commit to the packed bytecode (currently a TODO) - Private function -> we provide a membership proof - Unconstrained function -> we provide a membership proof Ordinary logs are not protected by the above so this fn shouldn't be called by anything else + +```rust +PrivateContext::emit_contract_class_unencrypted_log(&mut self, log); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| &mut self | | +| log | [Field; N] | + +### emit_encrypted_log + +```rust +PrivateContext::emit_encrypted_log(&mut self, contract_address, storage_slot, note_type_id, encryption_pub_key, preimage); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| &mut self | | +| contract_address | AztecAddress | +| storage_slot | Field | +| note_type_id | Field | +| encryption_pub_key | GrumpkinPoint | +| preimage | [Field; N] | + +### call_private_function + +```rust +PrivateContext::call_private_function(&mut self, contract_address, function_selector, args); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| &mut self | | +| contract_address | AztecAddress | +| function_selector | FunctionSelector | +| args | [Field; ARGS_COUNT] | + +### static_call_private_function + +```rust +PrivateContext::static_call_private_function(&mut self, contract_address, function_selector, args); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| &mut self | | +| contract_address | AztecAddress | +| function_selector | FunctionSelector | +| args | [Field; ARGS_COUNT] | + +### delegate_call_private_function + +```rust +PrivateContext::delegate_call_private_function(&mut self, contract_address, function_selector, args); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| &mut self | | +| contract_address | AztecAddress | +| function_selector | FunctionSelector | +| args | [Field; ARGS_COUNT] | + +### call_private_function_no_args + +```rust +PrivateContext::call_private_function_no_args(&mut self, contract_address, function_selector); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| &mut self | | +| contract_address | AztecAddress | +| function_selector | FunctionSelector | + +### static_call_private_function_no_args + +```rust +PrivateContext::static_call_private_function_no_args(&mut self, contract_address, function_selector); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| &mut self | | +| contract_address | AztecAddress | +| function_selector | FunctionSelector | + +### delegate_call_private_function_no_args + +```rust +PrivateContext::delegate_call_private_function_no_args(&mut self, contract_address, function_selector); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| &mut self | | +| contract_address | AztecAddress | +| function_selector | FunctionSelector | + +### call_private_function_with_packed_args + +```rust +PrivateContext::call_private_function_with_packed_args(&mut self, contract_address, function_selector, args_hash, is_static_call, is_delegate_call); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| &mut self | | +| contract_address | AztecAddress | +| function_selector | FunctionSelector | +| args_hash | Field | +| is_static_call | bool | +| is_delegate_call | bool | + +### call_public_function + +```rust +PrivateContext::call_public_function(&mut self, contract_address, function_selector, args); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| &mut self | | +| contract_address | AztecAddress | +| function_selector | FunctionSelector | +| args | [Field; ARGS_COUNT] | + +### static_call_public_function + +```rust +PrivateContext::static_call_public_function(&mut self, contract_address, function_selector, args); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| &mut self | | +| contract_address | AztecAddress | +| function_selector | FunctionSelector | +| args | [Field; ARGS_COUNT] | + +### delegate_call_public_function + +```rust +PrivateContext::delegate_call_public_function(&mut self, contract_address, function_selector, args); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| &mut self | | +| contract_address | AztecAddress | +| function_selector | FunctionSelector | +| args | [Field; ARGS_COUNT] | + +### call_public_function_no_args + +```rust +PrivateContext::call_public_function_no_args(&mut self, contract_address, function_selector); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| &mut self | | +| contract_address | AztecAddress | +| function_selector | FunctionSelector | + +### static_call_public_function_no_args + +```rust +PrivateContext::static_call_public_function_no_args(&mut self, contract_address, function_selector); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| &mut self | | +| contract_address | AztecAddress | +| function_selector | FunctionSelector | + +### delegate_call_public_function_no_args + +```rust +PrivateContext::delegate_call_public_function_no_args(&mut self, contract_address, function_selector); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| &mut self | | +| contract_address | AztecAddress | +| function_selector | FunctionSelector | + +### call_public_function_with_packed_args + +```rust +PrivateContext::call_public_function_with_packed_args(&mut self, contract_address, function_selector, args_hash, is_static_call, is_delegate_call); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| &mut self | | +| contract_address | AztecAddress | +| function_selector | FunctionSelector | +| args_hash | Field | +| is_static_call | bool | +| is_delegate_call | bool | + +### set_public_teardown_function + +```rust +PrivateContext::set_public_teardown_function(&mut self, contract_address, function_selector, args); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| &mut self | | +| contract_address | AztecAddress | +| function_selector | FunctionSelector | +| args | [Field; ARGS_COUNT] | + +### set_public_teardown_function_with_packed_args + +```rust +PrivateContext::set_public_teardown_function_with_packed_args(&mut self, contract_address, function_selector, args_hash, is_static_call, is_delegate_call); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| &mut self | | +| contract_address | AztecAddress | +| function_selector | FunctionSelector | +| args_hash | Field | +| is_static_call | bool | +| is_delegate_call | bool | + +### validate_call_stack_item_from_oracle + +```rust +PrivateContext::validate_call_stack_item_from_oracle(self, item, contract_address, function_selector, args_hash, is_static_call, is_delegate_call); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| self | | +| item | PublicCallStackItem | +| contract_address | AztecAddress | +| function_selector | FunctionSelector | +| args_hash | Field | +| is_static_call | bool | +| is_delegate_call | bool | + +# PackedReturns + +## Fields +| Field | Type | +| --- | --- | +| packed_returns | Field | + +## Methods + +### new + +```rust +PackedReturns::new(packed_returns); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| packed_returns | Field | + +### assert_empty + +```rust +PackedReturns::assert_empty(self); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| self | | + +### raw + +```rust +PackedReturns::raw(self); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| self | | + +### unpack + +```rust +PackedReturns::unpack(self); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| self | | + +### unpack_into + +```rust +PackedReturns::unpack_into(self); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| self | | + +## Standalone Functions + +### msg_sender + +```rust +msg_sender(self); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| self | | + +### this_address + +```rust +this_address(self); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| self | | + +### chain_id + +```rust +chain_id(self); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| self | | + +### version + +```rust +version(self); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| self | | + +### selector + +```rust +selector(self); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| self | | + +### get_args_hash + +```rust +get_args_hash(self); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| self | | + +### push_new_note_hash + +```rust +push_new_note_hash(&mut self, note_hash); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| &mut self | | +| note_hash | Field | + +### push_new_nullifier + +```rust +push_new_nullifier(&mut self, nullifier, nullified_note_hash); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| &mut self | | +| nullifier | Field | +| nullified_note_hash | Field | + +### empty + +```rust +empty(); +``` + +Takes no parameters. + +### emit_unencrypted_log_oracle_private + +```rust +emit_unencrypted_log_oracle_private(_contract_address, _event_selector, _message, _counter); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| _contract_address | AztecAddress | +| _event_selector | Field | +| _message | T | +| _counter | u32 | + +### emit_unencrypted_log_private_internal + +```rust +emit_unencrypted_log_private_internal(contract_address, event_selector, message, counter); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| contract_address | AztecAddress | +| event_selector | Field | +| message | T | +| counter | u32 | + +### emit_contract_class_unencrypted_log_private + +```rust +emit_contract_class_unencrypted_log_private(contract_address, event_selector, message, counter); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| contract_address | AztecAddress | +| event_selector | Field | +| message | [Field; N] | +| counter | u32 | + +### emit_contract_class_unencrypted_log_private_internal + +```rust +emit_contract_class_unencrypted_log_private_internal(contract_address, event_selector, message, counter); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| contract_address | AztecAddress | +| event_selector | Field | +| message | [Field; N] | +| counter | u32 | + diff --git a/docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/context/public_context.md b/docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/context/public_context.md new file mode 100644 index 000000000000..29a0a32981f2 --- /dev/null +++ b/docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/context/public_context.md @@ -0,0 +1,477 @@ +# PublicContext + +## Fields +| Field | Type | +| --- | --- | +| inputs | PublicContextInputs | +| side_effect_counter | u32 | +| args_hash | Field | +| return_hash | Field | +| nullifier_read_requests | BoundedVec<ReadRequest, MAX_NULLIFIER_READ_REQUESTS_PER_CALL> | +| nullifier_non_existent_read_requests | BoundedVec<ReadRequest, MAX_NULLIFIER_NON_EXISTENT_READ_REQUESTS_PER_CALL> | +| contract_storage_update_requests | BoundedVec<StorageUpdateRequest, MAX_PUBLIC_DATA_UPDATE_REQUESTS_PER_CALL> | +| contract_storage_reads | BoundedVec<StorageRead, MAX_PUBLIC_DATA_READS_PER_CALL> | +| public_call_stack_hashes | BoundedVec<Field, MAX_PUBLIC_CALL_STACK_LENGTH_PER_CALL> | +| new_note_hashes | BoundedVec<NoteHash, MAX_NEW_NOTE_HASHES_PER_CALL> | +| new_nullifiers | BoundedVec<Nullifier, MAX_NEW_NULLIFIERS_PER_CALL> | +| new_l2_to_l1_msgs | BoundedVec<L2ToL1Message, MAX_NEW_L2_TO_L1_MSGS_PER_CALL> | +| unencrypted_logs_hashes | BoundedVec<SideEffect, MAX_UNENCRYPTED_LOGS_PER_CALL> | +| unencrypted_log_preimages_length | Field | +| historical_header | Header | +| prover_address | AztecAddress | + +## Methods + +### new + +```rust +PublicContext::new(inputs, args_hash); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| inputs | PublicContextInputs | +| args_hash | Field | + +### call_public_function_no_args + +```rust +PublicContext::call_public_function_no_args(self, contract_address, function_selector); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| self | &mut Self | +| contract_address | AztecAddress | +| function_selector | FunctionSelector | + +### static_call_public_function_no_args + +```rust +PublicContext::static_call_public_function_no_args(self, contract_address, function_selector); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| self | &mut Self | +| contract_address | AztecAddress | +| function_selector | FunctionSelector | + +### delegate_call_public_function_no_args + +```rust +PublicContext::delegate_call_public_function_no_args(self, contract_address, function_selector); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| self | &mut Self | +| contract_address | AztecAddress | +| function_selector | FunctionSelector | + +### call_public_function_with_packed_args + +```rust +PublicContext::call_public_function_with_packed_args(self, contract_address, function_selector, args_hash, is_static_call, is_delegate_call); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| self | &mut Self | +| contract_address | AztecAddress | +| function_selector | FunctionSelector | +| args_hash | Field | +| is_static_call | bool | +| is_delegate_call | bool | + +### set_return_hash + +```rust +PublicContext::set_return_hash(&mut self, returns_hasher); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| &mut self | | +| returns_hasher | ArgsHasher | + +### push_nullifier_read_request + +Keep private or ask the AVM team if you want to change it. + +```rust +PublicContext::push_nullifier_read_request(&mut self, nullifier); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| &mut self | | +| nullifier | Field | + +### push_nullifier_non_existent_read_request + +Keep private or ask the AVM team if you want to change it. + +```rust +PublicContext::push_nullifier_non_existent_read_request(&mut self, nullifier); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| &mut self | | +| nullifier | Field | + +### finish + +```rust +PublicContext::finish(self); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| self | | + +## Standalone Functions + +### msg_sender + +```rust +msg_sender(self); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| self | | + +### this_address + +```rust +this_address(self); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| self | | + +### chain_id + +```rust +chain_id(self); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| self | | + +### version + +```rust +version(self); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| self | | + +### selector + +```rust +selector(self); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| self | | + +### get_args_hash + +```rust +get_args_hash(self); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| self | | + +### push_new_note_hash + +```rust +push_new_note_hash(&mut self, note_hash); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| &mut self | | +| note_hash | Field | + +### push_new_nullifier + +```rust +push_new_nullifier(&mut self, nullifier, _nullified_note_hash); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| &mut self | | +| nullifier | Field | +| _nullified_note_hash | Field | + +### block_number + +```rust +block_number(self); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| self | | + +### timestamp + +```rust +timestamp(self); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| self | | + +### coinbase + +```rust +coinbase(self); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| self | | + +### fee_recipient + +```rust +fee_recipient(self); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| self | | + +### fee_per_da_gas + +```rust +fee_per_da_gas(self); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| self | | + +### fee_per_l2_gas + +```rust +fee_per_l2_gas(self); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| self | | + +### transaction_fee + +```rust +transaction_fee(self); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| self | | + +### nullifier_exists + +```rust +nullifier_exists(self, unsiloed_nullifier, address); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| self | | +| unsiloed_nullifier | Field | +| address | AztecAddress | + +### message_portal + +```rust +message_portal(&mut self, recipient, content); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| &mut self | | +| recipient | EthAddress | +| content | Field | + +### consume_l1_to_l2_message + +```rust +consume_l1_to_l2_message(&mut self, content, secret, sender, _leaf_index); +``` + +Leaf index is not used in public context, but it is used in the AVMContext which will replace it. + +#### Parameters +| Name | Type | +| --- | --- | +| &mut self | | +| content | Field | +| secret | Field | +| sender | EthAddress | +| _leaf_index | Field | + +### emit_unencrypted_log + +```rust +emit_unencrypted_log(&mut self, log); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| &mut self | | +| log | T | + +### call_public_function + +```rust +call_public_function(self, contract_address, function_selector, args, _gas); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| self | &mut Self | +| contract_address | AztecAddress | +| function_selector | FunctionSelector | +| args | [Field] | +| _gas | GasOpts | + +### static_call_public_function + +```rust +static_call_public_function(self, contract_address, function_selector, args, _gas); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| self | &mut Self | +| contract_address | AztecAddress | +| function_selector | FunctionSelector | +| args | [Field] | +| _gas | GasOpts | + +### delegate_call_public_function + +```rust +delegate_call_public_function(self, contract_address, function_selector, args); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| self | &mut Self | +| contract_address | AztecAddress | +| function_selector | FunctionSelector | +| args | [Field] | + +### empty + +```rust +empty(); +``` + +Takes no parameters. + +### nullifier_exists_oracle + +```rust +nullifier_exists_oracle(nullifier); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| nullifier | Field | + +### emit_unencrypted_log_oracle + +```rust +emit_unencrypted_log_oracle(_contract_address, _event_selector, _message, _counter); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| _contract_address | AztecAddress | +| _event_selector | Field | +| _message | T | +| _counter | u32 | + +### assert_empty + +```rust +assert_empty(returns); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| returns | FunctionReturns<0> | + +### raw + +```rust +raw(self); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| self | | + +### deserialize_into + +```rust +deserialize_into(self); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| self | | + diff --git a/docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/deploy.md b/docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/deploy.md new file mode 100644 index 000000000000..b250ece82dd1 --- /dev/null +++ b/docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/deploy.md @@ -0,0 +1,16 @@ +## Standalone Functions + +### deploy_contract + +```rust +deploy_contract(context, target); +``` + +Calls `deploy` on the deployer contract to deploy a new instance. + +#### Parameters +| Name | Type | +| --- | --- | +| context | &mut PrivateContext | +| target | AztecAddress | + diff --git a/docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/hash.md b/docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/hash.md new file mode 100644 index 000000000000..4ff3f98e3757 --- /dev/null +++ b/docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/hash.md @@ -0,0 +1,211 @@ +# ArgsHasher + +## Fields +| Field | Type | +| --- | --- | +| fields | Field] | + +## Methods + +### new + +```rust +ArgsHasher::new(); +``` + +Takes no parameters. + +### add + +```rust +ArgsHasher::add(&mut self, field); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| &mut self | | +| field | Field | + +### add_multiple + +```rust +ArgsHasher::add_multiple(&mut self, fields); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| &mut self | | +| fields | [Field; N] | + +## Standalone Functions + +### compute_secret_hash + +```rust +compute_secret_hash(secret); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| secret | Field | + +### compute_encrypted_log_hash + +```rust +compute_encrypted_log_hash(encrypted_log); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| encrypted_log | [Field; M] | + +### compute_unencrypted_log_hash + +```rust +compute_unencrypted_log_hash(contract_address, event_selector, log, ); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| contract_address | AztecAddress | +| event_selector | Field | +| log | T | +| | | + +### compute_message_hash + +```rust +compute_message_hash(sender, chain_id, recipient, version, content, secret_hash); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| sender | EthAddress | +| chain_id | Field | +| recipient | AztecAddress | +| version | Field | +| content | Field | +| secret_hash | Field | + +### compute_message_nullifier + +```rust +compute_message_nullifier(message_hash, secret, leaf_index); +``` + +in the L1 to L2 message tree + +#### Parameters +| Name | Type | +| --- | --- | +| message_hash | Field | +| secret | Field | +| leaf_index | Field | + +### compute_siloed_nullifier + +```rust +compute_siloed_nullifier(address, nullifier); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| address | AztecAddress | +| nullifier | Field | + +### hash + +```rust +hash(self); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| self | | + +### hash_args_array + +```rust +hash_args_array(args); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| args | [Field; N] | + +### hash_args + +```rust +hash_args(args); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| args | [Field] | + +### compute_var_args_hash + +```rust +compute_var_args_hash(); +``` + +Takes no parameters. + +### compute_enc_log_hash_304 + +```rust +compute_enc_log_hash_304(); +``` + +Takes no parameters. + +### compute_enc_log_hash_368 + +```rust +compute_enc_log_hash_368(); +``` + +Takes no parameters. + +### compute_unenc_log_hash_array + +```rust +compute_unenc_log_hash_array(); +``` + +Takes no parameters. + +### compute_unenc_log_hash_addr + +```rust +compute_unenc_log_hash_addr(); +``` + +Takes no parameters. + +### compute_unenc_log_hash_str + +```rust +compute_unenc_log_hash_str(); +``` + +Takes no parameters. + +### compute_unenc_log_hash_longer_str + +```rust +compute_unenc_log_hash_longer_str(); +``` + +Takes no parameters. + diff --git a/docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/history/contract_inclusion.md b/docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/history/contract_inclusion.md new file mode 100644 index 000000000000..369b858123a8 --- /dev/null +++ b/docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/history/contract_inclusion.md @@ -0,0 +1,54 @@ +## Standalone Functions + +### prove_contract_deployment_at + +```rust +prove_contract_deployment_at(contract_address, block_number, context); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| contract_address | AztecAddress | +| block_number | u32 | +| context | PrivateContext | + +### prove_contract_non_deployment_at + +```rust +prove_contract_non_deployment_at(contract_address, block_number, context); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| contract_address | AztecAddress | +| block_number | u32 | +| context | PrivateContext | + +### prove_contract_initialization_at + +```rust +prove_contract_initialization_at(contract_address, block_number, context); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| contract_address | AztecAddress | +| block_number | u32 | +| context | PrivateContext | + +### prove_contract_non_initialization_at + +```rust +prove_contract_non_initialization_at(contract_address, block_number, context); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| contract_address | AztecAddress | +| block_number | u32 | +| context | PrivateContext | + diff --git a/docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/history/note_inclusion.md b/docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/history/note_inclusion.md new file mode 100644 index 000000000000..985d46cfcb19 --- /dev/null +++ b/docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/history/note_inclusion.md @@ -0,0 +1,41 @@ +## Standalone Functions + +### _note_inclusion + +```rust +_note_inclusion(note, header); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| note | Note | +| header | Header | + +### prove_note_inclusion + +```rust +prove_note_inclusion(note, context); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| note | Note | +| context | PrivateContext | + +### prove_note_inclusion_at + +```rust +prove_note_inclusion_at(note, block_number, // The block at which we'll prove that the note exists + context); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| note | Note | +| block_number | u32 | +| // The block at which we'll prove that the note exists + context | PrivateContext | + diff --git a/docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/history/note_validity.md b/docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/history/note_validity.md new file mode 100644 index 000000000000..b9936984de23 --- /dev/null +++ b/docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/history/note_validity.md @@ -0,0 +1,29 @@ +## Standalone Functions + +### prove_note_validity + +```rust +prove_note_validity(note, context); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| note | Note | +| context | &mut PrivateContext | + +### prove_note_validity_at + +```rust +prove_note_validity_at(note, block_number, context); +``` + +A helper function that proves that a note is valid at the given block number + +#### Parameters +| Name | Type | +| --- | --- | +| note | Note | +| block_number | u32 | +| context | &mut PrivateContext | + diff --git a/docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/history/nullifier_inclusion.md b/docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/history/nullifier_inclusion.md new file mode 100644 index 000000000000..57eba778b576 --- /dev/null +++ b/docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/history/nullifier_inclusion.md @@ -0,0 +1,66 @@ +## Standalone Functions + +### _nullifier_inclusion + +```rust +_nullifier_inclusion(nullifier, header); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| nullifier | Field | +| header | Header | + +### prove_nullifier_inclusion + +```rust +prove_nullifier_inclusion(nullifier, context); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| nullifier | Field | +| context | PrivateContext | + +### prove_nullifier_inclusion_at + +```rust +prove_nullifier_inclusion_at(nullifier, block_number, // The block at which we'll prove that the nullifier exists in the nullifier tree + context); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| nullifier | Field | +| block_number | u32 | +| // The block at which we'll prove that the nullifier exists in the nullifier tree + context | PrivateContext | + +### prove_note_is_nullified + +```rust +prove_note_is_nullified(note, context); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| note | Note | +| context | &mut PrivateContext | + +### prove_note_is_nullified_at + +```rust +prove_note_is_nullified_at(note, block_number, context); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| note | Note | +| block_number | u32 | +| context | &mut PrivateContext | + diff --git a/docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/history/nullifier_non_inclusion.md b/docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/history/nullifier_non_inclusion.md new file mode 100644 index 000000000000..c72d3a9ba8ea --- /dev/null +++ b/docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/history/nullifier_non_inclusion.md @@ -0,0 +1,66 @@ +## Standalone Functions + +### _nullifier_non_inclusion + +```rust +_nullifier_non_inclusion(nullifier, header); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| nullifier | Field | +| header | Header | + +### prove_nullifier_not_included + +```rust +prove_nullifier_not_included(nullifier, context); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| nullifier | Field | +| context | PrivateContext | + +### prove_nullifier_not_included_at + +```rust +prove_nullifier_not_included_at(nullifier, block_number, context); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| nullifier | Field | +| block_number | u32 | +| context | PrivateContext | + +### prove_note_not_nullified + +```rust +prove_note_not_nullified(note, context); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| note | Note | +| context | &mut PrivateContext | + +### prove_note_not_nullified_at + +```rust +prove_note_not_nullified_at(note, block_number, // The block at which we'll prove that the note was not nullified + context); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| note | Note | +| block_number | u32 | +| // The block at which we'll prove that the note was not nullified + context | &mut PrivateContext | + diff --git a/docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/history/public_storage.md b/docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/history/public_storage.md new file mode 100644 index 000000000000..778e47f77a50 --- /dev/null +++ b/docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/history/public_storage.md @@ -0,0 +1,48 @@ +## Standalone Functions + +### _public_storage_historical_read + +```rust +_public_storage_historical_read(storage_slot, contract_address, header); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| storage_slot | Field | +| contract_address | AztecAddress | +| header | Header | + +### public_storage_historical_read + +```rust +public_storage_historical_read(context, storage_slot, // The storage slot to read + contract_address); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| context | PrivateContext | +| storage_slot | Field | +| // The storage slot to read + contract_address | AztecAddress // The contract we want to look into | + +### public_storage_historical_read_at + +```rust +public_storage_historical_read_at(context, storage_slot, // The storage slot to read + contract_address, // The contract we want to look into + block_number); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| context | PrivateContext | +| storage_slot | Field | +| // The storage slot to read + contract_address | AztecAddress | +| // The contract we want to look into + block_number | u32 // The block number at the end of which we'll read the value | + diff --git a/docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/initializer.md b/docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/initializer.md new file mode 100644 index 000000000000..6c447dfa211f --- /dev/null +++ b/docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/initializer.md @@ -0,0 +1,157 @@ +## Standalone Functions + +### mark_as_initialized_public + +```rust +mark_as_initialized_public(context); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| context | &mut PublicContext | + +### mark_as_initialized_avm + +```rust +mark_as_initialized_avm(context); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| context | &mut AvmContext | + +### mark_as_initialized_private + +```rust +mark_as_initialized_private(context); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| context | &mut PrivateContext | + +### mark_as_initialized + +```rust +mark_as_initialized(context); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| context | &mut TContext | + +### assert_is_initialized_public + +```rust +assert_is_initialized_public(context); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| context | &mut PublicContext | + +### assert_is_initialized_avm + +```rust +assert_is_initialized_avm(context); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| context | &mut AvmContext | + +### assert_is_initialized_private + +```rust +assert_is_initialized_private(context); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| context | &mut PrivateContext | + +### compute_contract_initialization_nullifier + +```rust +compute_contract_initialization_nullifier(address); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| address | AztecAddress | + +### compute_unsiloed_contract_initialization_nullifier + +```rust +compute_unsiloed_contract_initialization_nullifier(address); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| address | AztecAddress | + +### assert_initialization_matches_address_preimage_public + +```rust +assert_initialization_matches_address_preimage_public(context); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| context | PublicContext | + +### assert_initialization_matches_address_preimage_avm + +```rust +assert_initialization_matches_address_preimage_avm(context); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| context | AvmContext | + +### assert_initialization_matches_address_preimage_private + +```rust +assert_initialization_matches_address_preimage_private(context); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| context | PrivateContext | + +### assert_initialization_matches_address_preimage + +```rust +assert_initialization_matches_address_preimage(context); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| context | TContext | + +### compute_initialization_hash + +```rust +compute_initialization_hash(init_selector, init_args_hash); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| init_selector | FunctionSelector | +| init_args_hash | Field | + diff --git a/docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/keys/getters.md b/docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/keys/getters.md new file mode 100644 index 000000000000..a0a3da5ac46b --- /dev/null +++ b/docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/keys/getters.md @@ -0,0 +1,91 @@ +## Standalone Functions + +### get_npk_m + +```rust +get_npk_m(context, address); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| context | &mut PrivateContext | +| address | AztecAddress | + +### get_ivpk_m + +```rust +get_ivpk_m(context, address); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| context | &mut PrivateContext | +| address | AztecAddress | + +### get_ovpk_m + +```rust +get_ovpk_m(context, address); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| context | &mut PrivateContext | +| address | AztecAddress | + +### get_tpk_m + +```rust +get_tpk_m(context, address); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| context | &mut PrivateContext | +| address | AztecAddress | + +### get_master_key + +```rust +get_master_key(context, address, key_index); +``` + +} + +#### Parameters +| Name | Type | +| --- | --- | +| context | &mut PrivateContext | +| address | AztecAddress | +| key_index | Field | + +### fetch_key_from_registry + +```rust +fetch_key_from_registry(context, key_index, address); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| context | &mut PrivateContext | +| key_index | Field | +| address | AztecAddress | + +### fetch_and_constrain_keys + +```rust +fetch_and_constrain_keys(address); +``` + +Passes only when keys were not rotated - is expected to be called only when keys were not registered yet + +#### Parameters +| Name | Type | +| --- | --- | +| address | AztecAddress | + diff --git a/docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/keys/point_to_symmetric_key.md b/docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/keys/point_to_symmetric_key.md new file mode 100644 index 000000000000..902c8f7c6634 --- /dev/null +++ b/docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/keys/point_to_symmetric_key.md @@ -0,0 +1,24 @@ +## Standalone Functions + +### point_to_symmetric_key + +```rust +point_to_symmetric_key(secret, point); +``` + +point is not the only input of the function. Unify naming with TS once we have a better name. + +#### Parameters +| Name | Type | +| --- | --- | +| secret | GrumpkinScalar | +| point | GrumpkinPoint | + +### check_point_to_symmetric_key + +```rust +check_point_to_symmetric_key(); +``` + +Takes no parameters. + diff --git a/docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/messaging.md b/docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/messaging.md new file mode 100644 index 000000000000..2b54d3b8564c --- /dev/null +++ b/docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/messaging.md @@ -0,0 +1,19 @@ +## Standalone Functions + +### process_l1_to_l2_message + +```rust +process_l1_to_l2_message(l1_to_l2_root, storage_contract_address, portal_contract_address, chain_id, version, content, secret); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| l1_to_l2_root | Field | +| storage_contract_address | AztecAddress | +| portal_contract_address | EthAddress | +| chain_id | Field | +| version | Field | +| content | Field | +| secret | Field | + diff --git a/docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/note/lifecycle.md b/docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/note/lifecycle.md new file mode 100644 index 000000000000..77bc7b0a64f5 --- /dev/null +++ b/docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/note/lifecycle.md @@ -0,0 +1,41 @@ +## Standalone Functions + +### create_note + +```rust +create_note(context, storage_slot, note, broadcast); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| context | &mut PrivateContext | +| storage_slot | Field | +| note | &mut Note | +| broadcast | bool | + +### create_note_hash_from_public + +```rust +create_note_hash_from_public(context, storage_slot, note); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| context | &mut PublicContext | +| storage_slot | Field | +| note | &mut Note | + +### destroy_note + +```rust +destroy_note(context, note); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| context | &mut PrivateContext | +| note | Note | + diff --git a/docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/note/note_getter.md b/docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/note/note_getter.md new file mode 100644 index 000000000000..acbf790df4b6 --- /dev/null +++ b/docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/note/note_getter.md @@ -0,0 +1,149 @@ +## Standalone Functions + +### extract_property_value_from_selector + +```rust +extract_property_value_from_selector(serialized_note, selector); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| serialized_note | [Field; N] | +| selector | PropertySelector | + +### check_note_header + +```rust +check_note_header(context, storage_slot, note); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| context | PrivateContext | +| storage_slot | Field | +| note | Note | + +### check_note_fields + +```rust +check_note_fields(serialized_note, selects, N>); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| serialized_note | [Field; N] | +| selects | BoundedVec<Option<Select> | +| N> | | + +### check_notes_order + +```rust +check_notes_order(fields_0, fields_1, sorts, N>); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| fields_0 | [Field; N] | +| fields_1 | [Field; N] | +| sorts | BoundedVec<Option<Sort> | +| N> | | + +### get_note + +```rust +get_note(context, storage_slot); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| context | &mut PrivateContext | +| storage_slot | Field | + +### get_notes + +```rust +get_notes(context, storage_slot, options, N, FILTER_ARGS>); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| context | &mut PrivateContext | +| storage_slot | Field | +| options | NoteGetterOptions<Note | +| N | | +| FILTER_ARGS> | | + +### _get_notes_constrain_get_notes_internal + +```rust +_get_notes_constrain_get_notes_internal(context, storage_slot, opt_notes, options, N, FILTER_ARGS>); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| context | &mut PrivateContext | +| storage_slot | Field | +| opt_notes | [Option<Note>; MAX_NOTE_HASH_READ_REQUESTS_PER_CALL] | +| options | NoteGetterOptions<Note | +| N | | +| FILTER_ARGS> | | + +### get_note_internal + +```rust +get_note_internal(storage_slot); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| storage_slot | Field | + +### get_notes_internal + +```rust +get_notes_internal(storage_slot, options, N, FILTER_ARGS>); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| storage_slot | Field | +| options | NoteGetterOptions<Note | +| N | | +| FILTER_ARGS> | | + +### view_notes + +```rust +view_notes(storage_slot, options, N>); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| storage_slot | Field | +| options | NoteViewerOptions<Note | +| N> | | + +### flatten_options + +```rust +flatten_options(selects, N>, sorts, N>); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| selects | BoundedVec<Option<Select> | +| N> | | +| sorts | BoundedVec<Option<Sort> | +| N> | | + diff --git a/docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/note/note_getter_options.md b/docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/note/note_getter_options.md new file mode 100644 index 000000000000..4a013eaa1557 --- /dev/null +++ b/docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/note/note_getter_options.md @@ -0,0 +1,172 @@ +# PropertySelector + +## Fields +| Field | Type | +| --- | --- | +| index | u8 | +| offset | u8 | +| length | u8 | + +# ComparatorEnum + +## Fields +| Field | Type | +| --- | --- | +| EQ | u8 | +| NEQ | u8 | +| LT | u8 | +| LTE | u8 | +| GT | u8 | +| GTE | u8 | + +# Select + +## Fields +| Field | Type | +| --- | --- | +| property_selector | PropertySelector | +| value | Field | +| comparator | u8 | + +## Methods + +### new + +```rust +Select::new(property_selector, value, comparator); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| property_selector | PropertySelector | +| value | Field | +| comparator | u8 | + +# SortOrderEnum + +## Fields +| Field | Type | +| --- | --- | +| DESC | u8 | +| ASC | u8 | + +# Sort + +## Fields +| Field | Type | +| --- | --- | +| property_selector | PropertySelector | +| order | u8 | + +## Methods + +### new + +```rust +Sort::new(property_selector, order); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| property_selector | PropertySelector | +| order | u8 | + +# NoteStatusEnum + +## Fields +| Field | Type | +| --- | --- | +| ACTIVE | u8 | +| ACTIVE_OR_NULLIFIED | u8 | + +## Standalone Functions + +### return_all_notes + +```rust +return_all_notes(notes, _p); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| notes | [Option<Note>; MAX_NOTE_HASH_READ_REQUESTS_PER_CALL] | +| _p | Field | + +### with_filter + +```rust +with_filter(filter, FILTER_ARGS); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| filter | fn([Option<Note>; MAX_NOTE_HASH_READ_REQUESTS_PER_CALL] | +| FILTER_ARGS | | + +### select + +```rust +select(&mut self, property_selector, value, comparator); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| &mut self | | +| property_selector | PropertySelector | +| value | T | +| comparator | Option<u8> | + +### sort + +```rust +sort(&mut self, property_selector, order); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| &mut self | | +| property_selector | PropertySelector | +| order | u8 | + +### set_limit + +```rust +set_limit(&mut self, limit); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| &mut self | | +| limit | u32 | + +### set_offset + +```rust +set_offset(&mut self, offset); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| &mut self | | +| offset | u32 | + +### set_status + +```rust +set_status(&mut self, status); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| &mut self | | +| status | u8 | + diff --git a/docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/note/note_header.md b/docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/note/note_header.md new file mode 100644 index 000000000000..481db9855cc8 --- /dev/null +++ b/docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/note/note_header.md @@ -0,0 +1,46 @@ +# NoteHeader + +## Fields +| Field | Type | +| --- | --- | +| contract_address | AztecAddress | +| nonce | Field | +| storage_slot | Field | +| is_transient | bool | + +## Methods + +### new + +```rust +NoteHeader::new(contract_address, nonce, storage_slot); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| contract_address | AztecAddress | +| nonce | Field | +| storage_slot | Field | + +## Standalone Functions + +### empty + +```rust +empty(); +``` + +Takes no parameters. + +### serialize + +```rust +serialize(self); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| self | | + diff --git a/docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/note/note_interface.md b/docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/note/note_interface.md new file mode 100644 index 000000000000..c22a4952d72f --- /dev/null +++ b/docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/note/note_interface.md @@ -0,0 +1,102 @@ +## Standalone Functions + +### compute_nullifier + +```rust +compute_nullifier(self, context); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| self | | +| context | &mut PrivateContext | + +### compute_nullifier_without_context + +```rust +compute_nullifier_without_context(self); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| self | | + +### broadcast + +```rust +broadcast(self, context, slot); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| self | | +| context | &mut PrivateContext | +| slot | Field | + +### serialize_content + +```rust +serialize_content(self); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| self | | + +### deserialize_content + +```rust +deserialize_content(fields); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| fields | [Field; N] | + +### compute_note_content_hash + +```rust +compute_note_content_hash(self); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| self | | + +### get_header + +```rust +get_header(self); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| self | | + +### set_header + +```rust +set_header(&mut self, header); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| &mut self | | +| header | NoteHeader | + +### get_note_type_id + +```rust +get_note_type_id(); +``` + +Takes no parameters. + diff --git a/docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/note/note_viewer_options.md b/docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/note/note_viewer_options.md new file mode 100644 index 000000000000..b00a5781eb8f --- /dev/null +++ b/docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/note/note_viewer_options.md @@ -0,0 +1,73 @@ +## Standalone Functions + +### new + +```rust +new(); +``` + +Takes no parameters. + +### select + +```rust +select(&mut self, property_selector, value, comparator); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| &mut self | | +| property_selector | PropertySelector | +| value | T | +| comparator | Option<u8> | + +### sort + +```rust +sort(&mut self, property_selector, order); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| &mut self | | +| property_selector | PropertySelector | +| order | u8 | + +### set_limit + +```rust +set_limit(&mut self, limit); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| &mut self | | +| limit | u32 | + +### set_offset + +```rust +set_offset(&mut self, offset); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| &mut self | | +| offset | u32 | + +### set_status + +```rust +set_status(&mut self, status); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| &mut self | | +| status | u8 | + diff --git a/docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/note/utils.md b/docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/note/utils.md new file mode 100644 index 000000000000..f5275ec5783d --- /dev/null +++ b/docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/note/utils.md @@ -0,0 +1,104 @@ +## Standalone Functions + +### compute_siloed_hash + +```rust +compute_siloed_hash(contract_address, inner_note_hash); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| contract_address | AztecAddress | +| inner_note_hash | Field | + +### compute_unique_hash + +```rust +compute_unique_hash(nonce, siloed_note_hash); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| nonce | Field | +| siloed_note_hash | Field | + +### compute_inner_note_hash + +```rust +compute_inner_note_hash(note); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| note | Note | + +### compute_siloed_note_hash + +```rust +compute_siloed_note_hash(note_with_header); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| note_with_header | Note | + +### compute_unique_siloed_note_hash + +```rust +compute_unique_siloed_note_hash(note_with_header); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| note_with_header | Note | + +### compute_siloed_nullifier + +```rust +compute_siloed_nullifier(note_with_header, context); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| note_with_header | Note | +| context | &mut PrivateContext | + +### compute_note_hash_for_insertion + +```rust +compute_note_hash_for_insertion(note); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| note | Note | + +### compute_note_hash_for_consumption + +```rust +compute_note_hash_for_consumption(note); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| note | Note | + +### compute_note_hash_and_nullifier + +```rust +compute_note_hash_and_nullifier(// docs); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| // docs | start | + diff --git a/docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/oracle/arguments.md b/docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/oracle/arguments.md new file mode 100644 index 000000000000..9e95f15f1645 --- /dev/null +++ b/docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/oracle/arguments.md @@ -0,0 +1,46 @@ +## Standalone Functions + +### pack_arguments_array_oracle + +```rust +pack_arguments_array_oracle(_args); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| _args | [Field; N] | + +### pack_arguments_oracle + +```rust +pack_arguments_oracle(_args); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| _args | [Field] | + +### pack_arguments_array + +```rust +pack_arguments_array(args); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| args | [Field; N] | + +### pack_arguments + +```rust +pack_arguments(args); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| args | [Field] | + diff --git a/docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/oracle/call_private_function.md b/docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/oracle/call_private_function.md new file mode 100644 index 000000000000..b3937e0f93d3 --- /dev/null +++ b/docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/oracle/call_private_function.md @@ -0,0 +1,34 @@ +## Standalone Functions + +### call_private_function_oracle + +```rust +call_private_function_oracle(_contract_address, _function_selector, _args_hash, _start_side_effect_counter, _is_static_call, _is_delegate_call); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| _contract_address | AztecAddress | +| _function_selector | FunctionSelector | +| _args_hash | Field | +| _start_side_effect_counter | u32 | +| _is_static_call | bool | +| _is_delegate_call | bool | + +### call_private_function_internal + +```rust +call_private_function_internal(contract_address, function_selector, args_hash, start_side_effect_counter, is_static_call, is_delegate_call); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| contract_address | AztecAddress | +| function_selector | FunctionSelector | +| args_hash | Field | +| start_side_effect_counter | u32 | +| is_static_call | bool | +| is_delegate_call | bool | + diff --git a/docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/oracle/encryption.md b/docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/oracle/encryption.md new file mode 100644 index 000000000000..46fa14e86cfc --- /dev/null +++ b/docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/oracle/encryption.md @@ -0,0 +1,28 @@ +## Standalone Functions + +### aes128_encrypt_oracle + +```rust +aes128_encrypt_oracle(input, iv, key); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| input | [u8; N] | +| iv | [u8; 16] | +| key | [u8; 16] | + +### aes128_encrypt + +```rust +aes128_encrypt(input, iv, key); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| input | [u8; N] | +| iv | [u8; 16] | +| key | [u8; 16] | + diff --git a/docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/oracle/enqueue_public_function_call.md b/docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/oracle/enqueue_public_function_call.md new file mode 100644 index 000000000000..8e5a0b662cd7 --- /dev/null +++ b/docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/oracle/enqueue_public_function_call.md @@ -0,0 +1,77 @@ +## Standalone Functions + +### enqueue_public_function_call_oracle + +```rust +enqueue_public_function_call_oracle(_contract_address, _function_selector, _args_hash, _side_effect_counter, _is_static_call, _is_delegate_call); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| _contract_address | AztecAddress | +| _function_selector | FunctionSelector | +| _args_hash | Field | +| _side_effect_counter | u32 | +| _is_static_call | bool | +| _is_delegate_call | bool | + +### enqueue_public_function_call_internal + +```rust +enqueue_public_function_call_internal(contract_address, function_selector, args_hash, side_effect_counter, is_static_call, is_delegate_call); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| contract_address | AztecAddress | +| function_selector | FunctionSelector | +| args_hash | Field | +| side_effect_counter | u32 | +| is_static_call | bool | +| is_delegate_call | bool | + +### set_public_teardown_function_call_oracle + +```rust +set_public_teardown_function_call_oracle(_contract_address, _function_selector, _args_hash, _side_effect_counter, _is_static_call, _is_delegate_call); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| _contract_address | AztecAddress | +| _function_selector | FunctionSelector | +| _args_hash | Field | +| _side_effect_counter | u32 | +| _is_static_call | bool | +| _is_delegate_call | bool | + +### set_public_teardown_function_call_internal + +```rust +set_public_teardown_function_call_internal(contract_address, function_selector, args_hash, side_effect_counter, is_static_call, is_delegate_call); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| contract_address | AztecAddress | +| function_selector | FunctionSelector | +| args_hash | Field | +| side_effect_counter | u32 | +| is_static_call | bool | +| is_delegate_call | bool | + +### parse_public_call_stack_item_from_oracle + +```rust +parse_public_call_stack_item_from_oracle(fields); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| fields | [Field; ENQUEUE_PUBLIC_FUNCTION_CALL_RETURN_LENGTH] | + diff --git a/docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/oracle/get_contract_instance.md b/docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/oracle/get_contract_instance.md new file mode 100644 index 000000000000..162cc992738b --- /dev/null +++ b/docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/oracle/get_contract_instance.md @@ -0,0 +1,68 @@ +## Standalone Functions + +### get_contract_instance_oracle + +```rust +get_contract_instance_oracle(_address); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| _address | AztecAddress | + +### get_contract_instance_oracle_avm + +```rust +get_contract_instance_oracle_avm(_address); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| _address | AztecAddress | + +### get_contract_instance_internal + +```rust +get_contract_instance_internal(address); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| address | AztecAddress | + +### get_contract_instance_internal_avm + +```rust +get_contract_instance_internal_avm(address); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| address | AztecAddress | + +### get_contract_instance + +```rust +get_contract_instance(address); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| address | AztecAddress | + +### get_contract_instance_avm + +```rust +get_contract_instance_avm(address); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| address | AztecAddress | + diff --git a/docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/oracle/get_l1_to_l2_membership_witness.md b/docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/oracle/get_l1_to_l2_membership_witness.md new file mode 100644 index 000000000000..f2a2d9c2c5ab --- /dev/null +++ b/docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/oracle/get_l1_to_l2_membership_witness.md @@ -0,0 +1,28 @@ +## Standalone Functions + +### get_l1_to_l2_membership_witness_oracle + +```rust +get_l1_to_l2_membership_witness_oracle(_contract_address, _message_hash, _secret); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| _contract_address | AztecAddress | +| _message_hash | Field | +| _secret | Field | + +### get_l1_to_l2_membership_witness + +```rust +get_l1_to_l2_membership_witness(contract_address, message_hash, secret); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| contract_address | AztecAddress | +| message_hash | Field | +| secret | Field | + diff --git a/docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/oracle/get_membership_witness.md b/docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/oracle/get_membership_witness.md new file mode 100644 index 000000000000..c23aa029bc2b --- /dev/null +++ b/docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/oracle/get_membership_witness.md @@ -0,0 +1,52 @@ +## Standalone Functions + +### get_membership_witness_oracle + +```rust +get_membership_witness_oracle(_block_number, _tree_id, _leaf_value); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| _block_number | u32 | +| _tree_id | Field | +| _leaf_value | Field | + +### get_membership_witness + +```rust +get_membership_witness(block_number, tree_id, leaf_value); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| block_number | u32 | +| tree_id | Field | +| leaf_value | Field | + +### get_note_hash_membership_witness + +```rust +get_note_hash_membership_witness(block_number, leaf_value); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| block_number | u32 | +| leaf_value | Field | + +### get_archive_membership_witness + +```rust +get_archive_membership_witness(block_number, leaf_value); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| block_number | u32 | +| leaf_value | Field | + diff --git a/docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/oracle/get_nullifier_membership_witness.md b/docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/oracle/get_nullifier_membership_witness.md new file mode 100644 index 000000000000..20dd83778360 --- /dev/null +++ b/docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/oracle/get_nullifier_membership_witness.md @@ -0,0 +1,72 @@ +# NullifierMembershipWitness + +## Fields +| Field | Type | +| --- | --- | +| index | Field | +| leaf_preimage | NullifierLeafPreimage | +| path | Field; NULLIFIER_TREE_HEIGHT] | + +## Methods + +### deserialize + +```rust +NullifierMembershipWitness::deserialize(fields); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| fields | [Field; NULLIFIER_MEMBERSHIP_WITNESS] | + +## Standalone Functions + +### get_low_nullifier_membership_witness_oracle + +```rust +get_low_nullifier_membership_witness_oracle(_block_number, _nullifier); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| _block_number | u32 | +| _nullifier | Field | + +### get_low_nullifier_membership_witness + +```rust +get_low_nullifier_membership_witness(block_number, nullifier); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| block_number | u32 | +| nullifier | Field | + +### get_nullifier_membership_witness_oracle + +```rust +get_nullifier_membership_witness_oracle(_block_number, _nullifier); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| _block_number | u32 | +| _nullifier | Field | + +### get_nullifier_membership_witness + +```rust +get_nullifier_membership_witness(block_number, nullifier); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| block_number | u32 | +| nullifier | Field | + diff --git a/docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/oracle/get_public_data_witness.md b/docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/oracle/get_public_data_witness.md new file mode 100644 index 000000000000..70b5a24193b5 --- /dev/null +++ b/docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/oracle/get_public_data_witness.md @@ -0,0 +1,35 @@ +# PublicDataWitness + +## Fields +| Field | Type | +| --- | --- | +| index | Field | +| leaf_preimage | PublicDataTreeLeafPreimage | +| path | Field; PUBLIC_DATA_TREE_HEIGHT] | + +## Standalone Functions + +### get_public_data_witness_oracle + +```rust +get_public_data_witness_oracle(_block_number, _leaf_slot); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| _block_number | u32 | +| _leaf_slot | Field | + +### get_public_data_witness + +```rust +get_public_data_witness(block_number, leaf_slot); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| block_number | u32 | +| leaf_slot | Field | + diff --git a/docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/oracle/get_public_key.md b/docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/oracle/get_public_key.md new file mode 100644 index 000000000000..bc7ce606b17a --- /dev/null +++ b/docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/oracle/get_public_key.md @@ -0,0 +1,35 @@ +## Standalone Functions + +### get_public_key_and_partial_address_oracle + +```rust +get_public_key_and_partial_address_oracle(_address); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| _address | AztecAddress | + +### get_public_key_and_partial_address_internal + +```rust +get_public_key_and_partial_address_internal(address); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| address | AztecAddress | + +### get_public_key + +```rust +get_public_key(address); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| address | AztecAddress | + diff --git a/docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/oracle/get_sibling_path.md b/docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/oracle/get_sibling_path.md new file mode 100644 index 000000000000..acca3273b633 --- /dev/null +++ b/docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/oracle/get_sibling_path.md @@ -0,0 +1,28 @@ +## Standalone Functions + +### get_sibling_path_oracle + +```rust +get_sibling_path_oracle(_block_number, _tree_id, _leaf_index); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| _block_number | u32 | +| _tree_id | Field | +| _leaf_index | Field | + +### get_sibling_path + +```rust +get_sibling_path(block_number, tree_id, leaf_index); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| block_number | u32 | +| tree_id | Field | +| leaf_index | Field | + diff --git a/docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/oracle/header.md b/docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/oracle/header.md new file mode 100644 index 000000000000..96f6243f59e2 --- /dev/null +++ b/docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/oracle/header.md @@ -0,0 +1,36 @@ +## Standalone Functions + +### get_header_at_oracle + +```rust +get_header_at_oracle(_block_number); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| _block_number | u32 | + +### get_header_at_internal + +```rust +get_header_at_internal(block_number); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| block_number | u32 | + +### get_header_at + +```rust +get_header_at(block_number, context); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| block_number | u32 | +| context | PrivateContext | + diff --git a/docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/oracle/keys.md b/docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/oracle/keys.md new file mode 100644 index 000000000000..3eba875de13c --- /dev/null +++ b/docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/oracle/keys.md @@ -0,0 +1,35 @@ +## Standalone Functions + +### get_public_keys_and_partial_address_oracle + +```rust +get_public_keys_and_partial_address_oracle(_address); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| _address | AztecAddress | + +### get_public_keys_and_partial_address_oracle_wrapper + +```rust +get_public_keys_and_partial_address_oracle_wrapper(address); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| address | AztecAddress | + +### get_public_keys_and_partial_address + +```rust +get_public_keys_and_partial_address(address); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| address | AztecAddress | + diff --git a/docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/oracle/logs.md b/docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/oracle/logs.md new file mode 100644 index 000000000000..deea20f82bf7 --- /dev/null +++ b/docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/oracle/logs.md @@ -0,0 +1,35 @@ +## Standalone Functions + +### emit_encrypted_log_oracle + +```rust +emit_encrypted_log_oracle(_contract_address, _storage_slot, _note_type_id, _encryption_pub_key, _preimage, _counter, ); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| _contract_address | AztecAddress | +| _storage_slot | Field | +| _note_type_id | Field | +| _encryption_pub_key | GrumpkinPoint | +| _preimage | [Field; N] | +| _counter | u32 | +| | | + +### emit_encrypted_log + +```rust +emit_encrypted_log(contract_address, storage_slot, note_type_id, encryption_pub_key, preimage, counter); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| contract_address | AztecAddress | +| storage_slot | Field | +| note_type_id | Field | +| encryption_pub_key | GrumpkinPoint | +| preimage | [Field; N] | +| counter | u32 | + diff --git a/docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/oracle/logs_traits.md b/docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/oracle/logs_traits.md new file mode 100644 index 000000000000..e5b5cf4b6359 --- /dev/null +++ b/docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/oracle/logs_traits.md @@ -0,0 +1,800 @@ +## Standalone Functions + +### output_fields + +```rust +output_fields(self); +``` + +L = encryption output len in bytes (= 32*M - 16) + +#### Parameters +| Name | Type | +| --- | --- | +| self | [Field; N] | + +### output_bytes + +```rust +output_bytes(self); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| self | [Field; N] | + +### output_fields + +```rust +output_fields(self); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| self | | + +### output_bytes + +```rust +output_bytes(self); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| self | | + +### output_fields + +```rust +output_fields(self); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| self | | + +### output_bytes + +```rust +output_bytes(self); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| self | | + +### output_fields + +```rust +output_fields(self); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| self | | + +### output_bytes + +```rust +output_bytes(self); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| self | | + +### output_fields + +```rust +output_fields(self); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| self | | + +### output_bytes + +```rust +output_bytes(self); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| self | | + +### output_fields + +```rust +output_fields(self); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| self | | + +### output_bytes + +```rust +output_bytes(self); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| self | | + +### output_fields + +```rust +output_fields(self); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| self | | + +### output_bytes + +```rust +output_bytes(self); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| self | | + +### to_be_bytes_arr + +```rust +to_be_bytes_arr(self); +``` + +M = full log input in bytes ( = N + 40 = N + 32 for addr, + 4 for selector, + 4 for len) + +#### Parameters +| Name | Type | +| --- | --- | +| self | | + +### output_bytes + +```rust +output_bytes(self); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| self | | + +### to_be_bytes_arr + +```rust +to_be_bytes_arr(self); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| self | | + +### output_bytes + +```rust +output_bytes(self); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| self | | + +### to_be_bytes_arr + +```rust +to_be_bytes_arr(self); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| self | | + +### output_bytes + +```rust +output_bytes(self); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| self | | + +### arr_to_be_bytes_arr + +```rust +arr_to_be_bytes_arr(fields); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| fields | [Field; L] | + +### str_to_be_bytes_arr + +```rust +str_to_be_bytes_arr(string); +``` + +then an ACVM field via the oracle => we recreate here + +#### Parameters +| Name | Type | +| --- | --- | +| string | str<L> | + +### to_be_bytes_arr + +```rust +to_be_bytes_arr(self); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| self | | + +### output_bytes + +```rust +output_bytes(self); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| self | | + +### to_be_bytes_arr + +```rust +to_be_bytes_arr(self); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| self | | + +### output_bytes + +```rust +output_bytes(self); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| self | | + +### to_be_bytes_arr + +```rust +to_be_bytes_arr(self); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| self | | + +### output_bytes + +```rust +output_bytes(self); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| self | | + +### to_be_bytes_arr + +```rust +to_be_bytes_arr(self); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| self | | + +### output_bytes + +```rust +output_bytes(self); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| self | | + +### to_be_bytes_arr + +```rust +to_be_bytes_arr(self); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| self | | + +### output_bytes + +```rust +output_bytes(self); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| self | | + +### to_be_bytes_arr + +```rust +to_be_bytes_arr(self); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| self | | + +### output_bytes + +```rust +output_bytes(self); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| self | | + +### to_be_bytes_arr + +```rust +to_be_bytes_arr(self); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| self | | + +### output_bytes + +```rust +output_bytes(self); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| self | | + +### to_be_bytes_arr + +```rust +to_be_bytes_arr(self); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| self | | + +### output_bytes + +```rust +output_bytes(self); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| self | | + +### to_be_bytes_arr + +```rust +to_be_bytes_arr(self); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| self | | + +### output_bytes + +```rust +output_bytes(self); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| self | | + +### to_be_bytes_arr + +```rust +to_be_bytes_arr(self); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| self | | + +### output_bytes + +```rust +output_bytes(self); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| self | | + +### to_be_bytes_arr + +```rust +to_be_bytes_arr(self); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| self | | + +### output_bytes + +```rust +output_bytes(self); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| self | | + +### to_be_bytes_arr + +```rust +to_be_bytes_arr(self); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| self | | + +### output_bytes + +```rust +output_bytes(self); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| self | | + +### to_be_bytes_arr + +```rust +to_be_bytes_arr(self); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| self | | + +### output_bytes + +```rust +output_bytes(self); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| self | | + +### to_be_bytes_arr + +```rust +to_be_bytes_arr(self); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| self | | + +### output_bytes + +```rust +output_bytes(self); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| self | | + +### to_be_bytes_arr + +```rust +to_be_bytes_arr(self); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| self | | + +### output_bytes + +```rust +output_bytes(self); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| self | | + +### to_be_bytes_arr + +```rust +to_be_bytes_arr(self); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| self | | + +### output_bytes + +```rust +output_bytes(self); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| self | | + +### to_be_bytes_arr + +```rust +to_be_bytes_arr(self); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| self | | + +### output_bytes + +```rust +output_bytes(self); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| self | | + +### to_be_bytes_arr + +```rust +to_be_bytes_arr(self); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| self | | + +### output_bytes + +```rust +output_bytes(self); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| self | | + +### to_be_bytes_arr + +```rust +to_be_bytes_arr(self); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| self | | + +### output_bytes + +```rust +output_bytes(self); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| self | | + +### to_be_bytes_arr + +```rust +to_be_bytes_arr(self); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| self | | + +### output_bytes + +```rust +output_bytes(self); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| self | | + +### to_be_bytes_arr + +```rust +to_be_bytes_arr(self); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| self | | + +### output_bytes + +```rust +output_bytes(self); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| self | | + +### to_be_bytes_arr + +```rust +to_be_bytes_arr(self); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| self | | + +### output_bytes + +```rust +output_bytes(self); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| self | | + +### to_be_bytes_arr + +```rust +to_be_bytes_arr(self); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| self | | + +### output_bytes + +```rust +output_bytes(self); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| self | | + +### to_be_bytes_arr + +```rust +to_be_bytes_arr(self); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| self | | + +### output_bytes + +```rust +output_bytes(self); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| self | | + +### to_be_bytes_arr + +```rust +to_be_bytes_arr(self); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| self | | + +### output_bytes + +```rust +output_bytes(self); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| self | | + diff --git a/docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/oracle/notes.md b/docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/oracle/notes.md new file mode 100644 index 000000000000..b1c9118ec1e1 --- /dev/null +++ b/docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/oracle/notes.md @@ -0,0 +1,160 @@ +## Standalone Functions + +### notify_created_note_oracle + +```rust +notify_created_note_oracle(_storage_slot, _note_type_id, _serialized_note, _inner_note_hash, _counter); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| _storage_slot | Field | +| _note_type_id | Field | +| _serialized_note | [Field; N] | +| _inner_note_hash | Field | +| _counter | u32 | + +### notify_created_note + +```rust +notify_created_note(storage_slot, note_type_id, serialized_note, inner_note_hash, counter); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| storage_slot | Field | +| note_type_id | Field | +| serialized_note | [Field; N] | +| inner_note_hash | Field | +| counter | u32 | + +### notify_nullified_note_oracle + +```rust +notify_nullified_note_oracle(_nullifier, _inner_note_hash, _counter); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| _nullifier | Field | +| _inner_note_hash | Field | +| _counter | u32 | + +### notify_nullified_note + +```rust +notify_nullified_note(nullifier, inner_note_hash, counter); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| nullifier | Field | +| inner_note_hash | Field | +| counter | u32 | + +### get_notes_oracle + +```rust +get_notes_oracle(_storage_slot, _num_selects, _select_by_indexes, _select_by_offsets, _select_by_lengths, _select_values, _select_comparators, _sort_by_indexes, _sort_by_offsets, _sort_by_lengths, _sort_order, _limit, _offset, _status, _return_size, _placeholder_fields); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| _storage_slot | Field | +| _num_selects | u8 | +| _select_by_indexes | [u8; N] | +| _select_by_offsets | [u8; N] | +| _select_by_lengths | [u8; N] | +| _select_values | [Field; N] | +| _select_comparators | [u8; N] | +| _sort_by_indexes | [u8; N] | +| _sort_by_offsets | [u8; N] | +| _sort_by_lengths | [u8; N] | +| _sort_order | [u8; N] | +| _limit | u32 | +| _offset | u32 | +| _status | u8 | +| _return_size | u32 | +| _placeholder_fields | [Field; S] | + +### get_notes_oracle_wrapper + +```rust +get_notes_oracle_wrapper(storage_slot, num_selects, select_by_indexes, select_by_offsets, select_by_lengths, select_values, select_comparators, sort_by_indexes, sort_by_offsets, sort_by_lengths, sort_order, limit, offset, status, mut placeholder_fields); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| storage_slot | Field | +| num_selects | u8 | +| select_by_indexes | [u8; N] | +| select_by_offsets | [u8; N] | +| select_by_lengths | [u8; N] | +| select_values | [Field; N] | +| select_comparators | [u8; N] | +| sort_by_indexes | [u8; N] | +| sort_by_offsets | [u8; N] | +| sort_by_lengths | [u8; N] | +| sort_order | [u8; N] | +| limit | u32 | +| offset | u32 | +| status | u8 | +| mut placeholder_fields | [Field; S] | + +### get_notes + +```rust +get_notes(storage_slot, num_selects, select_by_indexes, select_by_offsets, select_by_lengths, select_values, select_comparators, sort_by_indexes, sort_by_offsets, sort_by_lengths, sort_order, limit, offset, status, mut placeholder_opt_notes, // TODO, // TODO); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| storage_slot | Field | +| num_selects | u8 | +| select_by_indexes | [u8; M] | +| select_by_offsets | [u8; M] | +| select_by_lengths | [u8; M] | +| select_values | [Field; M] | +| select_comparators | [u8; M] | +| sort_by_indexes | [u8; M] | +| sort_by_offsets | [u8; M] | +| sort_by_lengths | [u8; M] | +| sort_order | [u8; M] | +| limit | u32 | +| offset | u32 | +| status | u8 | +| mut placeholder_opt_notes | [Option<Note>; S] | +| // TODO | Remove it and use `limit` to initialize the note array. + placeholder_fields | +| // TODO | Remove it and use `limit` to initialize the note array. + _placeholder_note_length | + +### check_nullifier_exists_oracle + +```rust +check_nullifier_exists_oracle(_inner_nullifier); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| _inner_nullifier | Field | + +### check_nullifier_exists + +```rust +check_nullifier_exists(inner_nullifier); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| inner_nullifier | Field | + diff --git a/docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/oracle/nullifier_key.md b/docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/oracle/nullifier_key.md new file mode 100644 index 000000000000..f9294646028e --- /dev/null +++ b/docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/oracle/nullifier_key.md @@ -0,0 +1,57 @@ +# NullifierKeys + +Nullifier keys pertaining to a specific account + +## Fields +| Field | Type | +| --- | --- | +| account | AztecAddress | +| master_nullifier_public_key | GrumpkinPoint | +| app_nullifier_secret_key | Field | + +## Standalone Functions + +### get_nullifier_keys_oracle + +```rust +get_nullifier_keys_oracle(_account); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| _account | AztecAddress | + +### get_nullifier_keys_internal + +```rust +get_nullifier_keys_internal(account); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| account | AztecAddress | + +### get_nullifier_keys + +```rust +get_nullifier_keys(account); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| account | AztecAddress | + +### get_app_nullifier_secret_key + +```rust +get_app_nullifier_secret_key(account); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| account | AztecAddress | + diff --git a/docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/oracle/public_call.md b/docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/oracle/public_call.md new file mode 100644 index 000000000000..e219df2ee67c --- /dev/null +++ b/docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/oracle/public_call.md @@ -0,0 +1,34 @@ +## Standalone Functions + +### call_public_function_oracle + +```rust +call_public_function_oracle(_contract_address, _function_selector, _args_hash, _side_effect_counter, _is_static_call, _is_delegate_call); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| _contract_address | AztecAddress | +| _function_selector | FunctionSelector | +| _args_hash | Field | +| _side_effect_counter | u32 | +| _is_static_call | bool | +| _is_delegate_call | bool | + +### call_public_function_internal + +```rust +call_public_function_internal(contract_address, function_selector, args_hash, side_effect_counter, is_static_call, is_delegate_call); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| contract_address | AztecAddress | +| function_selector | FunctionSelector | +| args_hash | Field | +| side_effect_counter | u32 | +| is_static_call | bool | +| is_delegate_call | bool | + diff --git a/docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/oracle/returns.md b/docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/oracle/returns.md new file mode 100644 index 000000000000..b56816cc34aa --- /dev/null +++ b/docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/oracle/returns.md @@ -0,0 +1,46 @@ +## Standalone Functions + +### pack_returns_oracle + +```rust +pack_returns_oracle(_returns); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| _returns | [Field] | + +### pack_returns + +```rust +pack_returns(returns); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| returns | [Field] | + +### unpack_returns_oracle + +```rust +unpack_returns_oracle(_return_hash); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| _return_hash | Field | + +### unpack_returns + +```rust +unpack_returns(return_hash); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| return_hash | Field | + diff --git a/docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/oracle/storage.md b/docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/oracle/storage.md new file mode 100644 index 000000000000..364545676299 --- /dev/null +++ b/docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/oracle/storage.md @@ -0,0 +1,60 @@ +## Standalone Functions + +### storage_read_oracle + +```rust +storage_read_oracle(_storage_slot, _number_of_elements); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| _storage_slot | Field | +| _number_of_elements | Field | + +### storage_read_oracle_wrapper + +```rust +storage_read_oracle_wrapper(_storage_slot); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| _storage_slot | Field | + +### storage_read + +```rust +storage_read(storage_slot); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| storage_slot | Field | + +### storage_write_oracle + +```rust +storage_write_oracle(_storage_slot, _values); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| _storage_slot | Field | +| _values | [Field; N] | + +### storage_write + +```rust +storage_write(storage_slot, fields); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| storage_slot | Field | +| fields | [Field; N] | + diff --git a/docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/oracle/unsafe_rand.md b/docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/oracle/unsafe_rand.md new file mode 100644 index 000000000000..4ad350bb7ed3 --- /dev/null +++ b/docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/oracle/unsafe_rand.md @@ -0,0 +1,18 @@ +## Standalone Functions + +### rand_oracle + +```rust +rand_oracle(); +``` + +Takes no parameters. + +### unsafe_rand + +```rust +unsafe_rand(); +``` + +Takes no parameters. + diff --git a/docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/public_storage.md b/docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/public_storage.md new file mode 100644 index 000000000000..5b8ab756b66a --- /dev/null +++ b/docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/public_storage.md @@ -0,0 +1,84 @@ +# TestStruct + +## Fields +| Field | Type | +| --- | --- | +| a | Field | +| b | Field | + +## Standalone Functions + +### read + +```rust +read(storage_slot); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| storage_slot | Field | + +### write + +```rust +write(storage_slot, value); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| storage_slot | Field | +| value | T | + +### read_historical + +```rust +read_historical(// storage_slot, // context); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| // storage_slot | Field | +| // context | PrivateContext +// | + +### deserialize + +```rust +deserialize(fields); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| fields | [Field; 2] | + +### serialize + +```rust +serialize(self); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| self | | + +### test_read + +```rust +test_read(); +``` + +Takes no parameters. + +### test_write + +```rust +test_write(); +``` + +Takes no parameters. + diff --git a/docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/state_vars/map.md b/docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/state_vars/map.md new file mode 100644 index 000000000000..3060e29c96f3 --- /dev/null +++ b/docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/state_vars/map.md @@ -0,0 +1,40 @@ +## Standalone Functions + +### new + +```rust +new(context, storage_slot, state_var_constructor, Field); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| context | Context | +| storage_slot | Field | +| state_var_constructor | fn(Context | +| Field | | + +### at + +```rust +at(self, key); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| self | | +| key | K | + +### derive_storage_slot_in_map + +```rust +derive_storage_slot_in_map(storage_slot, key); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| storage_slot | Field | +| key | K | + diff --git a/docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/state_vars/private_immutable.md b/docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/state_vars/private_immutable.md new file mode 100644 index 000000000000..70c65259d2c2 --- /dev/null +++ b/docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/state_vars/private_immutable.md @@ -0,0 +1,71 @@ +## Standalone Functions + +### new + +```rust +new(context, storage_slot); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| context | Context | +| storage_slot | Field | + +### compute_initialization_nullifier + +```rust +compute_initialization_nullifier(self); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| self | | + +### is_initialized + +```rust +is_initialized(self); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| self | | + +### initialize + +```rust +initialize(self, note, broadcast); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| self | | +| note | &mut Note | +| broadcast | bool | + +### get_note + +```rust +get_note(self); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| self | | + +### view_note + +```rust +view_note(self); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| self | | + diff --git a/docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/state_vars/private_mutable.md b/docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/state_vars/private_mutable.md new file mode 100644 index 000000000000..abf8070530ba --- /dev/null +++ b/docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/state_vars/private_mutable.md @@ -0,0 +1,85 @@ +## Standalone Functions + +### new + +```rust +new(context, storage_slot); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| context | Context | +| storage_slot | Field | + +### compute_initialization_nullifier + +```rust +compute_initialization_nullifier(self); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| self | | + +### is_initialized + +```rust +is_initialized(self); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| self | | + +### initialize + +```rust +initialize(self, note, broadcast); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| self | | +| note | &mut Note | +| broadcast | bool | + +### replace + +```rust +replace(self, new_note, broadcast); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| self | | +| new_note | &mut Note | +| broadcast | bool | + +### get_note + +```rust +get_note(self, broadcast); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| self | | +| broadcast | bool | + +### view_note + +```rust +view_note(self); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| self | | + diff --git a/docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/state_vars/private_set.md b/docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/state_vars/private_set.md new file mode 100644 index 000000000000..3c9dcd5b1dcb --- /dev/null +++ b/docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/state_vars/private_set.md @@ -0,0 +1,103 @@ +## Standalone Functions + +### new + +```rust +new(context, storage_slot); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| context | Context | +| storage_slot | Field | + +### insert + +```rust +insert(self, note, broadcast); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| self | | +| note | &mut Note | +| broadcast | bool | + +### insert_from_public + +```rust +insert_from_public(self, note); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| self | | +| note | &mut Note | + +### assert_contains_and_remove + +```rust +assert_contains_and_remove(_self, _note, _nonce); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| _self | Self | +| _note | &mut Note | +| _nonce | Field | + +### assert_contains_and_remove_publicly_created + +```rust +assert_contains_and_remove_publicly_created(_self, _note); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| _self | Self | +| _note | &mut Note | + +### remove + +```rust +remove(self, note); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| self | | +| note | Note | + +### get_notes + +```rust +get_notes(self, options, N, FILTER_ARGS>); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| self | | +| options | NoteGetterOptions<Note | +| N | | +| FILTER_ARGS> | | + +### view_notes + +```rust +view_notes(self, options, N>); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| self | | +| options | NoteViewerOptions<Note | +| N> | | + diff --git a/docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/state_vars/public_immutable.md b/docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/state_vars/public_immutable.md new file mode 100644 index 000000000000..d5904c719532 --- /dev/null +++ b/docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/state_vars/public_immutable.md @@ -0,0 +1,36 @@ +## Standalone Functions + +### new + +```rust +new(// Note); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| // Note | Passing the contexts to new(.. | + +### initialize + +```rust +initialize(self, value); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| self | | +| value | T | + +### read + +```rust +read(self); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| self | | + diff --git a/docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/state_vars/public_mutable.md b/docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/state_vars/public_mutable.md new file mode 100644 index 000000000000..3297e68f154c --- /dev/null +++ b/docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/state_vars/public_mutable.md @@ -0,0 +1,36 @@ +## Standalone Functions + +### new + +```rust +new(// Note); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| // Note | Passing the contexts to new(.. | + +### read + +```rust +read(self); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| self | | + +### write + +```rust +write(self, value); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| self | | +| value | T | + diff --git a/docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/state_vars/shared_immutable.md b/docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/state_vars/shared_immutable.md new file mode 100644 index 000000000000..283a1246a40b --- /dev/null +++ b/docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/state_vars/shared_immutable.md @@ -0,0 +1,49 @@ +## Standalone Functions + +### new + +```rust +new(// Note); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| // Note | Passing the contexts to new(.. | + +### initialize + +```rust +initialize(self, value); +``` + +Intended to be only called once. + +#### Parameters +| Name | Type | +| --- | --- | +| self | | +| value | T | + +### read_public + +```rust +read_public(self); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| self | | + +### read_private + +```rust +read_private(self); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| self | | + diff --git a/docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/state_vars/shared_mutable/scheduled_value_change.md b/docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/state_vars/shared_mutable/scheduled_value_change.md new file mode 100644 index 000000000000..124c4982ba3c --- /dev/null +++ b/docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/state_vars/shared_mutable/scheduled_value_change.md @@ -0,0 +1,193 @@ +## Standalone Functions + +### new + +```rust +new(pre, post, block_of_change); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| pre | T | +| post | T | +| block_of_change | u32 | + +### get_current_at + +```rust +get_current_at(self, block_number); +``` + +/ equal to the block horizon (see `get_block_horizon()`). + +#### Parameters +| Name | Type | +| --- | --- | +| self | | +| block_number | u32 | + +### get_scheduled + +```rust +get_scheduled(self); +``` + +/ Additionally, further changes might be later scheduled, potentially canceling the one returned by this function. + +#### Parameters +| Name | Type | +| --- | --- | +| self | | + +### get_block_horizon + +```rust +get_block_horizon(self, historical_block_number, minimum_delay); +``` + +/ using the same historical block number. + +#### Parameters +| Name | Type | +| --- | --- | +| self | | +| historical_block_number | u32 | +| minimum_delay | u32 | + +### schedule_change + +```rust +schedule_change(&mut self, new_value, current_block_number, minimum_delay, block_of_change); +``` + +/ meaningful when called in public with the current block number. + +#### Parameters +| Name | Type | +| --- | --- | +| &mut self | | +| new_value | T | +| current_block_number | u32 | +| minimum_delay | u32 | +| block_of_change | u32 | + +### serialize + +```rust +serialize(self); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| self | | + +### deserialize + +```rust +deserialize(input); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| input | [Field; 3] | + +### min + +```rust +min(lhs, rhs); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| lhs | u32 | +| rhs | u32 | + +### test_min + +```rust +test_min(); +``` + +Takes no parameters. + +### test_get_current_at + +```rust +test_get_current_at(); +``` + +Takes no parameters. + +### test_get_scheduled + +```rust +test_get_scheduled(); +``` + +Takes no parameters. + +### assert_block_horizon_invariants + +```rust +assert_block_horizon_invariants(value, historical_block_number, block_horizon); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| value | &mut ScheduledValueChange<Field> | +| historical_block_number | u32 | +| block_horizon | u32 | + +### test_get_block_horizon_change_in_past + +```rust +test_get_block_horizon_change_in_past(); +``` + +Takes no parameters. + +### test_get_block_horizon_change_in_immediate_past + +```rust +test_get_block_horizon_change_in_immediate_past(); +``` + +Takes no parameters. + +### test_get_block_horizon_change_in_near_future + +```rust +test_get_block_horizon_change_in_near_future(); +``` + +Takes no parameters. + +### test_get_block_horizon_change_in_far_future + +```rust +test_get_block_horizon_change_in_far_future(); +``` + +Takes no parameters. + +### test_schedule_change_before_prior_change + +```rust +test_schedule_change_before_prior_change(); +``` + +Takes no parameters. + +### test_schedule_change_after_prior_change + +```rust +test_schedule_change_after_prior_change(); +``` + +Takes no parameters. + diff --git a/docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/state_vars/shared_mutable/shared_mutable.md b/docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/state_vars/shared_mutable/shared_mutable.md new file mode 100644 index 000000000000..efd4b7c4a7f9 --- /dev/null +++ b/docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/state_vars/shared_mutable/shared_mutable.md @@ -0,0 +1,185 @@ +## Standalone Functions + +### new + +```rust +new(context, storage_slot); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| context | Context | +| storage_slot | Field | + +### schedule_value_change + +```rust +schedule_value_change(self, new_value); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| self | | +| new_value | T | + +### get_current_value_in_public + +```rust +get_current_value_in_public(self); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| self | | + +### get_scheduled_value_in_public + +```rust +get_scheduled_value_in_public(self); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| self | | + +### get_current_value_in_private + +```rust +get_current_value_in_private(self); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| self | | + +### historical_read_from_public_storage + +```rust +historical_read_from_public_storage(self, context); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| self | | +| context | PrivateContext | + +### get_derived_storage_slot + +```rust +get_derived_storage_slot(self); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| self | | + +### setup + +```rust +setup(private); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| private | bool | + +### create_context + +```rust +create_context(block_number, private); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| block_number | Field | +| private | bool | + +### test_get_current_value_in_public_before_change + +```rust +test_get_current_value_in_public_before_change(); +``` + +Takes no parameters. + +### test_get_current_value_in_public_at_change + +```rust +test_get_current_value_in_public_at_change(); +``` + +Takes no parameters. + +### test_get_current_value_in_public_after_change + +```rust +test_get_current_value_in_public_after_change(); +``` + +Takes no parameters. + +### test_get_scheduled_value_in_public_before_change + +```rust +test_get_scheduled_value_in_public_before_change(); +``` + +Takes no parameters. + +### test_get_scheduled_value_in_public_at_change + +```rust +test_get_scheduled_value_in_public_at_change(); +``` + +Takes no parameters. + +### test_get_scheduled_value_in_public_after_change + +```rust +test_get_scheduled_value_in_public_after_change(); +``` + +Takes no parameters. + +### test_schedule_value_change_before_change + +```rust +test_schedule_value_change_before_change(); +``` + +Takes no parameters. + +### test_schedule_value_change_at_change + +```rust +test_schedule_value_change_at_change(); +``` + +Takes no parameters. + +### test_schedule_value_change_after_change + +```rust +test_schedule_value_change_after_change(); +``` + +Takes no parameters. + +### test_get_current_value_in_private_before_change + +```rust +test_get_current_value_in_private_before_change(); +``` + +Takes no parameters. + diff --git a/docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/state_vars/shared_mutable/shared_mutable_private_getter.md b/docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/state_vars/shared_mutable/shared_mutable_private_getter.md new file mode 100644 index 000000000000..e279c62fd69a --- /dev/null +++ b/docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/state_vars/shared_mutable/shared_mutable_private_getter.md @@ -0,0 +1,49 @@ +## Standalone Functions + +### new + +```rust +new(context, other_contract_address, storage_slot); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| context | PrivateContext | +| other_contract_address | AztecAddress | +| storage_slot | Field | + +### get_current_value_in_private + +```rust +get_current_value_in_private(self); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| self | | + +### historical_read_from_public_storage + +```rust +historical_read_from_public_storage(self, context); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| self | | +| context | PrivateContext | + +### get_derived_storage_slot + +```rust +get_derived_storage_slot(self); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| self | | + diff --git a/docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/state_vars/storage.md b/docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/state_vars/storage.md new file mode 100644 index 000000000000..58821394326a --- /dev/null +++ b/docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/state_vars/storage.md @@ -0,0 +1,13 @@ +## Standalone Functions + +### get_storage_slot + +```rust +get_storage_slot(self); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| self | | + diff --git a/docs/docs/reference/reference/smart_contract_reference/aztec-nr/compressed-string/compressed_string.md b/docs/docs/reference/reference/smart_contract_reference/aztec-nr/compressed-string/compressed_string.md new file mode 100644 index 000000000000..f0e414e40216 --- /dev/null +++ b/docs/docs/reference/reference/smart_contract_reference/aztec-nr/compressed-string/compressed_string.md @@ -0,0 +1,78 @@ +## Standalone Functions + +### from_string + +```rust +from_string(input_string); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| input_string | str<M> | + +### to_bytes + +```rust +to_bytes(self); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| self | | + +### serialize + +```rust +serialize(self); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| self | | + +### deserialize + +```rust +deserialize(input); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| input | [Field; N] | + +### test_short_string + +```rust +test_short_string(); +``` + +Takes no parameters. + +### test_long_string + +```rust +test_long_string(); +``` + +Takes no parameters. + +### test_long_string_work_with_too_many_fields + +```rust +test_long_string_work_with_too_many_fields(); +``` + +Takes no parameters. + +### test_long_string_fail_with_too_few_fields + +```rust +test_long_string_fail_with_too_few_fields(); +``` + +Takes no parameters. + diff --git a/docs/docs/reference/reference/smart_contract_reference/aztec-nr/compressed-string/field_compressed_string.md b/docs/docs/reference/reference/smart_contract_reference/aztec-nr/compressed-string/field_compressed_string.md new file mode 100644 index 000000000000..63a7a35a9557 --- /dev/null +++ b/docs/docs/reference/reference/smart_contract_reference/aztec-nr/compressed-string/field_compressed_string.md @@ -0,0 +1,80 @@ +# FieldCompressedString + +A Fixedsize Compressed String. Essentially a special version of Compressed String for practical use. + +## Fields +| Field | Type | +| --- | --- | +| value | Field | + +## Methods + +### is_eq + +```rust +FieldCompressedString::is_eq(self, other); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| self | | +| other | FieldCompressedString | + +### from_field + +```rust +FieldCompressedString::from_field(input_field); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| input_field | Field | + +### from_string + +```rust +FieldCompressedString::from_string(input_string); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| input_string | str<31> | + +### to_bytes + +```rust +FieldCompressedString::to_bytes(self); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| self | | + +## Standalone Functions + +### serialize + +```rust +serialize(self); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| self | | + +### deserialize + +```rust +deserialize(input); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| input | [Field; 1] | + diff --git a/docs/docs/reference/reference/smart_contract_reference/aztec-nr/easy-private-state/easy_private_uint.md b/docs/docs/reference/reference/smart_contract_reference/aztec-nr/easy-private-state/easy_private_uint.md new file mode 100644 index 000000000000..4ddc9e319304 --- /dev/null +++ b/docs/docs/reference/reference/smart_contract_reference/aztec-nr/easy-private-state/easy_private_uint.md @@ -0,0 +1,53 @@ +# EasyPrivateUint + +## Fields +| Field | Type | +| --- | --- | +| context | Context | +| set | PrivateSet<ValueNote> | +| storage_slot | Field | + +## Methods + +### new + +```rust +EasyPrivateUint::new(context, storage_slot); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| context | Context | +| storage_slot | Field | + +### add + +Very similar to `value_note::utils::increment`. + +```rust +EasyPrivateUint::add(self, addend, owner); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| self | | +| addend | u64 | +| owner | AztecAddress | + +### sub + +Very similar to `value_note::utils::decrement`. + +```rust +EasyPrivateUint::sub(self, subtrahend, owner); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| self | | +| subtrahend | u64 | +| owner | AztecAddress | + diff --git a/docs/docs/reference/reference/smart_contract_reference/aztec-nr/tests/mock/test_note.md b/docs/docs/reference/reference/smart_contract_reference/aztec-nr/tests/mock/test_note.md new file mode 100644 index 000000000000..b6a07d707eae --- /dev/null +++ b/docs/docs/reference/reference/smart_contract_reference/aztec-nr/tests/mock/test_note.md @@ -0,0 +1,123 @@ +# TestNote + +## Fields +| Field | Type | +| --- | --- | +| header | NoteHeader | +| value | Field | + +## Methods + +### new + +```rust +TestNote::new(value); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| value | Field | + +## Standalone Functions + +### serialize_content + +```rust +serialize_content(self); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| self | | + +### deserialize_content + +```rust +deserialize_content(fields); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| fields | [Field; TEST_NOTE_LENGTH] | + +### compute_note_content_hash + +```rust +compute_note_content_hash(self); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| self | | + +### get_header + +```rust +get_header(self); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| self | | + +### set_header + +```rust +set_header(&mut self, header); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| &mut self | | +| header | NoteHeader | + +### get_note_type_id + +```rust +get_note_type_id(); +``` + +Takes no parameters. + +### compute_nullifier + +```rust +compute_nullifier(self, _context); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| self | | +| _context | &mut PrivateContext | + +### compute_nullifier_without_context + +```rust +compute_nullifier_without_context(self); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| self | | + +### broadcast + +```rust +broadcast(self, context, slot); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| self | | +| context | &mut PrivateContext | +| slot | Field | + diff --git a/docs/docs/reference/reference/smart_contract_reference/aztec-nr/tests/note_getter_test.md b/docs/docs/reference/reference/smart_contract_reference/aztec-nr/tests/note_getter_test.md new file mode 100644 index 000000000000..41bd9e57380f --- /dev/null +++ b/docs/docs/reference/reference/smart_contract_reference/aztec-nr/tests/note_getter_test.md @@ -0,0 +1,58 @@ +## Standalone Functions + +### sets_note_manually_and_fetches_it + +```rust +sets_note_manually_and_fetches_it(); +``` + +Takes no parameters. + +### cannot_return_zero_notes + +```rust +cannot_return_zero_notes(); +``` + +Takes no parameters. + +### mismatched_address + +```rust +mismatched_address(); +``` + +Takes no parameters. + +### mismatched_storage_slot + +```rust +mismatched_storage_slot(); +``` + +Takes no parameters. + +### invalid_selector + +```rust +invalid_selector(); +``` + +Takes no parameters. + +### invalid_note_order + +```rust +invalid_note_order(); +``` + +Takes no parameters. + +### sparse_notes_array + +```rust +sparse_notes_array(); +``` + +Takes no parameters. + diff --git a/docs/docs/reference/reference/smart_contract_reference/aztec-nr/value-note/balance_utils.md b/docs/docs/reference/reference/smart_contract_reference/aztec-nr/value-note/balance_utils.md new file mode 100644 index 000000000000..95a96dbc6a16 --- /dev/null +++ b/docs/docs/reference/reference/smart_contract_reference/aztec-nr/value-note/balance_utils.md @@ -0,0 +1,25 @@ +## Standalone Functions + +### get_balance + +```rust +get_balance(set); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| set | PrivateSet<ValueNote> | + +### get_balance_with_offset + +```rust +get_balance_with_offset(set, offset); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| set | PrivateSet<ValueNote> | +| offset | u32 | + diff --git a/docs/docs/reference/reference/smart_contract_reference/aztec-nr/value-note/filter.md b/docs/docs/reference/reference/smart_contract_reference/aztec-nr/value-note/filter.md new file mode 100644 index 000000000000..15607ea4656b --- /dev/null +++ b/docs/docs/reference/reference/smart_contract_reference/aztec-nr/value-note/filter.md @@ -0,0 +1,14 @@ +## Standalone Functions + +### filter_notes_min_sum + +```rust +filter_notes_min_sum(notes, min_sum); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| notes | [Option<ValueNote>; MAX_NOTE_HASH_READ_REQUESTS_PER_CALL] | +| min_sum | Field | + diff --git a/docs/docs/reference/reference/smart_contract_reference/aztec-nr/value-note/utils.md b/docs/docs/reference/reference/smart_contract_reference/aztec-nr/value-note/utils.md new file mode 100644 index 000000000000..320355e8bc0f --- /dev/null +++ b/docs/docs/reference/reference/smart_contract_reference/aztec-nr/value-note/utils.md @@ -0,0 +1,75 @@ +## Standalone Functions + +### create_note_getter_options_for_decreasing_balance + +```rust +create_note_getter_options_for_decreasing_balance(amount); +``` + +Pick the fewest notes whose sum is equal to or greater than `amount`. + +#### Parameters +| Name | Type | +| --- | --- | +| amount | Field | + +### increment + +```rust +increment(balance, amount, recipient); +``` + +Inserts it to the recipient's set of notes. + +#### Parameters +| Name | Type | +| --- | --- | +| balance | PrivateSet<ValueNote> | +| amount | Field | +| recipient | AztecAddress | + +### decrement + +```rust +decrement(balance, amount, owner); +``` + +Fail if the sum of the selected notes is less than the amount. + +#### Parameters +| Name | Type | +| --- | --- | +| balance | PrivateSet<ValueNote> | +| amount | Field | +| owner | AztecAddress | + +### decrement_by_at_most + +```rust +decrement_by_at_most(balance, max_amount, owner); +``` + +// It returns the decremented amount, which should be less than or equal to max_amount. + +#### Parameters +| Name | Type | +| --- | --- | +| balance | PrivateSet<ValueNote> | +| max_amount | Field | +| owner | AztecAddress | + +### destroy_note + +```rust +destroy_note(balance, owner, note); +``` + +Returns the value of the destroyed note. + +#### Parameters +| Name | Type | +| --- | --- | +| balance | PrivateSet<ValueNote> | +| owner | AztecAddress | +| note | ValueNote | + diff --git a/docs/docs/reference/reference/smart_contract_reference/aztec-nr/value-note/value_note.md b/docs/docs/reference/reference/smart_contract_reference/aztec-nr/value-note/value_note.md new file mode 100644 index 000000000000..9e836ccdb291 --- /dev/null +++ b/docs/docs/reference/reference/smart_contract_reference/aztec-nr/value-note/value_note.md @@ -0,0 +1,72 @@ +# ValueNote + +## Fields +| Field | Type | +| --- | --- | +| value | Field | +| owner | AztecAddress | +| randomness | Field | + +## Methods + +### new + +```rust +ValueNote::new(value, owner); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| value | Field | +| owner | AztecAddress | + +## Standalone Functions + +### compute_nullifier + +```rust +compute_nullifier(self, context); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| self | | +| context | &mut PrivateContext | + +### compute_nullifier_without_context + +```rust +compute_nullifier_without_context(self); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| self | | + +### broadcast + +```rust +broadcast(self, context, slot); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| self | | +| context | &mut PrivateContext | +| slot | Field | + +### serialize + +```rust +serialize(self); +``` + +#### Parameters +| Name | Type | +| --- | --- | +| self | | + From 49dc1b856c3ac832c911549f82231586af4a2b88 Mon Sep 17 00:00:00 2001 From: signorecello Date: Wed, 8 May 2024 17:14:53 +0000 Subject: [PATCH 6/8] ignored files --- .../public-vm/gen/_instruction-set.mdx | 1 + .../aztec-nr/address-note/address_note.md | 61 -- .../aztec-nr/authwit/account.md | 102 --- .../aztec-nr/authwit/auth.md | 67 -- .../aztec-nr/authwit/auth_witness.md | 24 - .../aztec-nr/authwit/entrypoint/app.md | 61 -- .../aztec-nr/authwit/entrypoint/fee.md | 57 -- .../authwit/entrypoint/function_call.md | 36 - .../aztec-nr/aztec/context.md | 52 -- .../aztec-nr/aztec/context/avm_context.md | 498 ----------- .../aztec-nr/aztec/context/gas.md | 30 - .../context/inputs/avm_context_inputs.md | 8 - .../context/inputs/private_context_inputs.md | 22 - .../context/inputs/public_context_inputs.md | 24 - .../aztec-nr/aztec/context/interface.md | 446 ---------- .../aztec-nr/aztec/context/private_context.md | 685 --------------- .../aztec-nr/aztec/context/public_context.md | 477 ----------- .../aztec-nr/aztec/deploy.md | 16 - .../aztec-nr/aztec/hash.md | 211 ----- .../aztec/history/contract_inclusion.md | 54 -- .../aztec-nr/aztec/history/note_inclusion.md | 41 - .../aztec-nr/aztec/history/note_validity.md | 29 - .../aztec/history/nullifier_inclusion.md | 66 -- .../aztec/history/nullifier_non_inclusion.md | 66 -- .../aztec-nr/aztec/history/public_storage.md | 48 -- .../aztec-nr/aztec/initializer.md | 157 ---- .../aztec-nr/aztec/keys/getters.md | 91 -- .../aztec/keys/point_to_symmetric_key.md | 24 - .../aztec-nr/aztec/messaging.md | 19 - .../aztec-nr/aztec/note/lifecycle.md | 41 - .../aztec-nr/aztec/note/note_getter.md | 149 ---- .../aztec/note/note_getter_options.md | 172 ---- .../aztec-nr/aztec/note/note_header.md | 46 - .../aztec-nr/aztec/note/note_interface.md | 102 --- .../aztec/note/note_viewer_options.md | 73 -- .../aztec-nr/aztec/note/utils.md | 104 --- .../aztec-nr/aztec/oracle/arguments.md | 46 - .../aztec/oracle/call_private_function.md | 34 - .../aztec-nr/aztec/oracle/encryption.md | 28 - .../oracle/enqueue_public_function_call.md | 77 -- .../aztec/oracle/get_contract_instance.md | 68 -- .../oracle/get_l1_to_l2_membership_witness.md | 28 - .../aztec/oracle/get_membership_witness.md | 52 -- .../get_nullifier_membership_witness.md | 72 -- .../aztec/oracle/get_public_data_witness.md | 35 - .../aztec-nr/aztec/oracle/get_public_key.md | 35 - .../aztec-nr/aztec/oracle/get_sibling_path.md | 28 - .../aztec-nr/aztec/oracle/header.md | 36 - .../aztec-nr/aztec/oracle/keys.md | 35 - .../aztec-nr/aztec/oracle/logs.md | 35 - .../aztec-nr/aztec/oracle/logs_traits.md | 800 ------------------ .../aztec-nr/aztec/oracle/notes.md | 160 ---- .../aztec-nr/aztec/oracle/nullifier_key.md | 57 -- .../aztec-nr/aztec/oracle/public_call.md | 34 - .../aztec-nr/aztec/oracle/returns.md | 46 - .../aztec-nr/aztec/oracle/storage.md | 60 -- .../aztec-nr/aztec/oracle/unsafe_rand.md | 18 - .../aztec-nr/aztec/public_storage.md | 84 -- .../aztec-nr/aztec/state_vars/map.md | 40 - .../aztec/state_vars/private_immutable.md | 71 -- .../aztec/state_vars/private_mutable.md | 85 -- .../aztec-nr/aztec/state_vars/private_set.md | 103 --- .../aztec/state_vars/public_immutable.md | 36 - .../aztec/state_vars/public_mutable.md | 36 - .../aztec/state_vars/shared_immutable.md | 49 -- .../shared_mutable/scheduled_value_change.md | 193 ----- .../shared_mutable/shared_mutable.md | 185 ---- .../shared_mutable_private_getter.md | 49 -- .../aztec-nr/aztec/state_vars/storage.md | 13 - .../compressed-string/compressed_string.md | 78 -- .../field_compressed_string.md | 80 -- .../easy-private-state/easy_private_uint.md | 53 -- .../aztec-nr/tests/mock/test_note.md | 123 --- .../aztec-nr/tests/note_getter_test.md | 58 -- .../aztec-nr/value-note/balance_utils.md | 25 - .../aztec-nr/value-note/filter.md | 14 - .../aztec-nr/value-note/utils.md | 75 -- .../aztec-nr/value-note/value_note.md | 72 -- 78 files changed, 1 insertion(+), 7465 deletions(-) delete mode 100644 docs/docs/reference/reference/smart_contract_reference/aztec-nr/address-note/address_note.md delete mode 100644 docs/docs/reference/reference/smart_contract_reference/aztec-nr/authwit/account.md delete mode 100644 docs/docs/reference/reference/smart_contract_reference/aztec-nr/authwit/auth.md delete mode 100644 docs/docs/reference/reference/smart_contract_reference/aztec-nr/authwit/auth_witness.md delete mode 100644 docs/docs/reference/reference/smart_contract_reference/aztec-nr/authwit/entrypoint/app.md delete mode 100644 docs/docs/reference/reference/smart_contract_reference/aztec-nr/authwit/entrypoint/fee.md delete mode 100644 docs/docs/reference/reference/smart_contract_reference/aztec-nr/authwit/entrypoint/function_call.md delete mode 100644 docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/context.md delete mode 100644 docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/context/avm_context.md delete mode 100644 docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/context/gas.md delete mode 100644 docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/context/inputs/avm_context_inputs.md delete mode 100644 docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/context/inputs/private_context_inputs.md delete mode 100644 docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/context/inputs/public_context_inputs.md delete mode 100644 docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/context/interface.md delete mode 100644 docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/context/private_context.md delete mode 100644 docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/context/public_context.md delete mode 100644 docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/deploy.md delete mode 100644 docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/hash.md delete mode 100644 docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/history/contract_inclusion.md delete mode 100644 docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/history/note_inclusion.md delete mode 100644 docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/history/note_validity.md delete mode 100644 docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/history/nullifier_inclusion.md delete mode 100644 docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/history/nullifier_non_inclusion.md delete mode 100644 docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/history/public_storage.md delete mode 100644 docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/initializer.md delete mode 100644 docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/keys/getters.md delete mode 100644 docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/keys/point_to_symmetric_key.md delete mode 100644 docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/messaging.md delete mode 100644 docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/note/lifecycle.md delete mode 100644 docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/note/note_getter.md delete mode 100644 docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/note/note_getter_options.md delete mode 100644 docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/note/note_header.md delete mode 100644 docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/note/note_interface.md delete mode 100644 docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/note/note_viewer_options.md delete mode 100644 docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/note/utils.md delete mode 100644 docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/oracle/arguments.md delete mode 100644 docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/oracle/call_private_function.md delete mode 100644 docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/oracle/encryption.md delete mode 100644 docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/oracle/enqueue_public_function_call.md delete mode 100644 docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/oracle/get_contract_instance.md delete mode 100644 docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/oracle/get_l1_to_l2_membership_witness.md delete mode 100644 docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/oracle/get_membership_witness.md delete mode 100644 docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/oracle/get_nullifier_membership_witness.md delete mode 100644 docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/oracle/get_public_data_witness.md delete mode 100644 docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/oracle/get_public_key.md delete mode 100644 docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/oracle/get_sibling_path.md delete mode 100644 docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/oracle/header.md delete mode 100644 docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/oracle/keys.md delete mode 100644 docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/oracle/logs.md delete mode 100644 docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/oracle/logs_traits.md delete mode 100644 docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/oracle/notes.md delete mode 100644 docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/oracle/nullifier_key.md delete mode 100644 docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/oracle/public_call.md delete mode 100644 docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/oracle/returns.md delete mode 100644 docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/oracle/storage.md delete mode 100644 docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/oracle/unsafe_rand.md delete mode 100644 docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/public_storage.md delete mode 100644 docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/state_vars/map.md delete mode 100644 docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/state_vars/private_immutable.md delete mode 100644 docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/state_vars/private_mutable.md delete mode 100644 docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/state_vars/private_set.md delete mode 100644 docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/state_vars/public_immutable.md delete mode 100644 docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/state_vars/public_mutable.md delete mode 100644 docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/state_vars/shared_immutable.md delete mode 100644 docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/state_vars/shared_mutable/scheduled_value_change.md delete mode 100644 docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/state_vars/shared_mutable/shared_mutable.md delete mode 100644 docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/state_vars/shared_mutable/shared_mutable_private_getter.md delete mode 100644 docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/state_vars/storage.md delete mode 100644 docs/docs/reference/reference/smart_contract_reference/aztec-nr/compressed-string/compressed_string.md delete mode 100644 docs/docs/reference/reference/smart_contract_reference/aztec-nr/compressed-string/field_compressed_string.md delete mode 100644 docs/docs/reference/reference/smart_contract_reference/aztec-nr/easy-private-state/easy_private_uint.md delete mode 100644 docs/docs/reference/reference/smart_contract_reference/aztec-nr/tests/mock/test_note.md delete mode 100644 docs/docs/reference/reference/smart_contract_reference/aztec-nr/tests/note_getter_test.md delete mode 100644 docs/docs/reference/reference/smart_contract_reference/aztec-nr/value-note/balance_utils.md delete mode 100644 docs/docs/reference/reference/smart_contract_reference/aztec-nr/value-note/filter.md delete mode 100644 docs/docs/reference/reference/smart_contract_reference/aztec-nr/value-note/utils.md delete mode 100644 docs/docs/reference/reference/smart_contract_reference/aztec-nr/value-note/value_note.md diff --git a/docs/docs/protocol-specs/public-vm/gen/_instruction-set.mdx b/docs/docs/protocol-specs/public-vm/gen/_instruction-set.mdx index a2a35da1fb8a..a13fb19a0f55 100644 --- a/docs/docs/protocol-specs/public-vm/gen/_instruction-set.mdx +++ b/docs/docs/protocol-specs/public-vm/gen/_instruction-set.mdx @@ -1103,6 +1103,7 @@ context.machineState.pc = loc`} - **Details**: Target location is an immediate value (a constant in the bytecode). - **Bit-size**: 48 +[![](/img/protocol-specs/public-vm/bit-formats/INTERNALCALL.png)](/img/protocol-specs/public-vm/bit-formats/INTERNALCALL.png) ### `INTERNALRETURN` Return from an internal call. Pop from the internal call stack and jump to the popped location. diff --git a/docs/docs/reference/reference/smart_contract_reference/aztec-nr/address-note/address_note.md b/docs/docs/reference/reference/smart_contract_reference/aztec-nr/address-note/address_note.md deleted file mode 100644 index 5c803821d8b4..000000000000 --- a/docs/docs/reference/reference/smart_contract_reference/aztec-nr/address-note/address_note.md +++ /dev/null @@ -1,61 +0,0 @@ -# AddressNote - -## Fields -| Field | Type | -| --- | --- | -| address | AztecAddress | -| owner | AztecAddress | -| randomness | Field | - -## Methods - -### new - -```rust -AddressNote::new(address, owner); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| address | AztecAddress | -| owner | AztecAddress | - -## Standalone Functions - -### compute_nullifier - -```rust -compute_nullifier(self, context); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| self | | -| context | &mut PrivateContext | - -### compute_nullifier_without_context - -```rust -compute_nullifier_without_context(self); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| self | | - -### broadcast - -```rust -broadcast(self, context, slot); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| self | | -| context | &mut PrivateContext | -| slot | Field | - diff --git a/docs/docs/reference/reference/smart_contract_reference/aztec-nr/authwit/account.md b/docs/docs/reference/reference/smart_contract_reference/aztec-nr/authwit/account.md deleted file mode 100644 index 59d47f52f4a2..000000000000 --- a/docs/docs/reference/reference/smart_contract_reference/aztec-nr/authwit/account.md +++ /dev/null @@ -1,102 +0,0 @@ -# AccountActions - -## Fields -| Field | Type | -| --- | --- | -| context | Context | -| is_valid_impl | fn(&mut PrivateContext, Field) -> bool | -| approved_action | Map<Field, PublicMutable<bool>> | - -## Methods - -### init - -```rust -AccountActions::init(context, approved_action_storage_slot, is_valid_impl, Field); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| context | Context | -| approved_action_storage_slot | Field | -| is_valid_impl | fn(&mut PrivateContext | -| Field | | - -### private - -```rust -AccountActions::private(context, approved_action_storage_slot, is_valid_impl, Field); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| context | &mut PrivateContext | -| approved_action_storage_slot | Field | -| is_valid_impl | fn(&mut PrivateContext | -| Field | | - -### public - -```rust -AccountActions::public(context, approved_action_storage_slot, is_valid_impl, Field); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| context | &mut PublicContext | -| approved_action_storage_slot | Field | -| is_valid_impl | fn(&mut PrivateContext | -| Field | | - -### entrypoint - -```rust -AccountActions::entrypoint(self, app_payload, fee_payload); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| self | | -| app_payload | AppPayload | -| fee_payload | FeePayload | - -### spend_private_authwit - -```rust -AccountActions::spend_private_authwit(self, inner_hash); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| self | | -| inner_hash | Field | - -### spend_public_authwit - -```rust -AccountActions::spend_public_authwit(self, inner_hash); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| self | | -| inner_hash | Field | - -### approve_public_authwit - -```rust -AccountActions::approve_public_authwit(self, message_hash); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| self | | -| message_hash | Field | - diff --git a/docs/docs/reference/reference/smart_contract_reference/aztec-nr/authwit/auth.md b/docs/docs/reference/reference/smart_contract_reference/aztec-nr/authwit/auth.md deleted file mode 100644 index 68174d8ad499..000000000000 --- a/docs/docs/reference/reference/smart_contract_reference/aztec-nr/authwit/auth.md +++ /dev/null @@ -1,67 +0,0 @@ -## Standalone Functions - -### assert_current_call_valid_authwit - -```rust -assert_current_call_valid_authwit(context, on_behalf_of); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| context | &mut PrivateContext | -| on_behalf_of | AztecAddress | - -### assert_current_call_valid_authwit_public - -```rust -assert_current_call_valid_authwit_public(context, on_behalf_of); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| context | &mut TPublicContext | -| on_behalf_of | AztecAddress | - -### compute_call_authwit_hash - -```rust -compute_call_authwit_hash(caller, consumer, chain_id, version, selector, args); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| caller | AztecAddress | -| consumer | AztecAddress | -| chain_id | Field | -| version | Field | -| selector | FunctionSelector | -| args | [Field; N] | - -### compute_inner_authwit_hash - -```rust -compute_inner_authwit_hash(args); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| args | [Field; N] | - -### compute_outer_authwit_hash - -```rust -compute_outer_authwit_hash(consumer, chain_id, version, inner_hash); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| consumer | AztecAddress | -| chain_id | Field | -| version | Field | -| inner_hash | Field | - diff --git a/docs/docs/reference/reference/smart_contract_reference/aztec-nr/authwit/auth_witness.md b/docs/docs/reference/reference/smart_contract_reference/aztec-nr/authwit/auth_witness.md deleted file mode 100644 index 11338206f5cd..000000000000 --- a/docs/docs/reference/reference/smart_contract_reference/aztec-nr/authwit/auth_witness.md +++ /dev/null @@ -1,24 +0,0 @@ -## Standalone Functions - -### get_auth_witness_oracle - -```rust -get_auth_witness_oracle(_message_hash); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| _message_hash | Field | - -### get_auth_witness - -```rust -get_auth_witness(message_hash); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| message_hash | Field | - diff --git a/docs/docs/reference/reference/smart_contract_reference/aztec-nr/authwit/entrypoint/app.md b/docs/docs/reference/reference/smart_contract_reference/aztec-nr/authwit/entrypoint/app.md deleted file mode 100644 index 9870a7f64691..000000000000 --- a/docs/docs/reference/reference/smart_contract_reference/aztec-nr/authwit/entrypoint/app.md +++ /dev/null @@ -1,61 +0,0 @@ -# AppPayload - -Note: If you change the following struct you have to update default_entrypoint.ts - -## Fields -| Field | Type | -| --- | --- | -| function_calls | FunctionCall; ACCOUNT_MAX_CALLS] | -| nonce | Field | - -## Methods - -### to_be_bytes - -Serializes the payload as an array of bytes. Useful for hashing with sha256. - -```rust -AppPayload::to_be_bytes(self); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| self | | - -### execute_calls - -```rust -AppPayload::execute_calls(self, context); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| self | | -| context | &mut PrivateContext | - -## Standalone Functions - -### serialize - -```rust -serialize(self); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| self | | - -### hash - -```rust -hash(self); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| self | | - diff --git a/docs/docs/reference/reference/smart_contract_reference/aztec-nr/authwit/entrypoint/fee.md b/docs/docs/reference/reference/smart_contract_reference/aztec-nr/authwit/entrypoint/fee.md deleted file mode 100644 index d897895cae70..000000000000 --- a/docs/docs/reference/reference/smart_contract_reference/aztec-nr/authwit/entrypoint/fee.md +++ /dev/null @@ -1,57 +0,0 @@ -# FeePayload - -## Fields -| Field | Type | -| --- | --- | -| function_calls | FunctionCall; MAX_FEE_FUNCTION_CALLS] | -| nonce | Field | - -## Methods - -### to_be_bytes - -```rust -FeePayload::to_be_bytes(self); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| self | | - -### execute_calls - -```rust -FeePayload::execute_calls(self, context); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| self | | -| context | &mut PrivateContext | - -## Standalone Functions - -### serialize - -```rust -serialize(self); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| self | | - -### hash - -```rust -hash(self); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| self | | - diff --git a/docs/docs/reference/reference/smart_contract_reference/aztec-nr/authwit/entrypoint/function_call.md b/docs/docs/reference/reference/smart_contract_reference/aztec-nr/authwit/entrypoint/function_call.md deleted file mode 100644 index 806625d9619e..000000000000 --- a/docs/docs/reference/reference/smart_contract_reference/aztec-nr/authwit/entrypoint/function_call.md +++ /dev/null @@ -1,36 +0,0 @@ -# FunctionCall - -## Fields -| Field | Type | -| --- | --- | -| args_hash | Field | -| function_selector | FunctionSelector | -| target_address | AztecAddress | -| is_public | bool | - -## Methods - -### to_be_bytes - -```rust -FunctionCall::to_be_bytes(self); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| self | | - -## Standalone Functions - -### serialize - -```rust -serialize(self); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| self | | - diff --git a/docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/context.md b/docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/context.md deleted file mode 100644 index 1e582bd0d42d..000000000000 --- a/docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/context.md +++ /dev/null @@ -1,52 +0,0 @@ -# Context - -## Fields -| Field | Type | -| --- | --- | -| private | Option<&mut PrivateContext> | -| public | Option<&mut PublicContext> | -| avm | Option<&mut AvmContext> | - -## Methods - -### private - -```rust -Context::private(context); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| context | &mut PrivateContext | - -### public - -```rust -Context::public(context); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| context | &mut PublicContext | - -### avm - -```rust -Context::avm(context); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| context | &mut AvmContext | - -### none - -```rust -Context::none(); -``` - -Takes no parameters. - diff --git a/docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/context/avm_context.md b/docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/context/avm_context.md deleted file mode 100644 index 97a4e5d47d15..000000000000 --- a/docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/context/avm_context.md +++ /dev/null @@ -1,498 +0,0 @@ -# AvmContext - -## Fields -| Field | Type | -| --- | --- | -| inputs | AvmContextInputs | - -## Methods - -### new - -```rust -AvmContext::new(inputs); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| inputs | AvmContextInputs | - -### storage_address - -```rust -AvmContext::storage_address(self); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| self | | - -### fee_per_l2_gas - -```rust -AvmContext::fee_per_l2_gas(self); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| self | | - -### fee_per_da_gas - -```rust -AvmContext::fee_per_da_gas(self); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| self | | - -### emit_unencrypted_log - -```rust -AvmContext::emit_unencrypted_log(&mut self, event_selector, log); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| &mut self | | -| event_selector | Field | -| log | T | - -### note_hash_exists - -```rust -AvmContext::note_hash_exists(self, note_hash, leaf_index); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| self | | -| note_hash | Field | -| leaf_index | Field | - -### l1_to_l2_msg_exists - -```rust -AvmContext::l1_to_l2_msg_exists(self, msg_hash, msg_leaf_index); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| self | | -| msg_hash | Field | -| msg_leaf_index | Field | - -## Standalone Functions - -### block_number - -```rust -block_number(self); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| self | | - -### timestamp - -```rust -timestamp(self); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| self | | - -### coinbase - -```rust -coinbase(self); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| self | | - -### fee_recipient - -```rust -fee_recipient(self); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| self | | - -### transaction_fee - -```rust -transaction_fee(self); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| self | | - -### nullifier_exists - -```rust -nullifier_exists(self, unsiloed_nullifier, address); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| self | | -| unsiloed_nullifier | Field | -| address | AztecAddress | - -### consume_l1_to_l2_message - -```rust -consume_l1_to_l2_message(&mut self, content, secret, sender, leaf_index); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| &mut self | | -| content | Field | -| secret | Field | -| sender | EthAddress | -| leaf_index | Field | - -### message_portal - -```rust -message_portal(&mut self, recipient, content); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| &mut self | | -| recipient | EthAddress | -| content | Field | - -### call_public_function - -```rust -call_public_function(self, contract_address, temporary_function_selector, args, gas_opts); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| self | &mut Self | -| contract_address | AztecAddress | -| temporary_function_selector | FunctionSelector | -| args | [Field] | -| gas_opts | GasOpts | - -### static_call_public_function - -```rust -static_call_public_function(self, contract_address, temporary_function_selector, args, gas_opts); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| self | &mut Self | -| contract_address | AztecAddress | -| temporary_function_selector | FunctionSelector | -| args | [Field] | -| gas_opts | GasOpts | - -### delegate_call_public_function - -```rust -delegate_call_public_function(self, contract_address, function_selector, args); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| self | &mut Self | -| contract_address | AztecAddress | -| function_selector | FunctionSelector | -| args | [Field] | - -### push_new_note_hash - -```rust -push_new_note_hash(&mut self, note_hash); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| &mut self | | -| note_hash | Field | - -### push_new_nullifier - -```rust -push_new_nullifier(&mut self, nullifier, _nullified_commitment); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| &mut self | | -| nullifier | Field | -| _nullified_commitment | Field | - -### msg_sender - -```rust -msg_sender(self); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| self | | - -### this_address - -```rust -this_address(self); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| self | | - -### chain_id - -```rust -chain_id(self); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| self | | - -### version - -```rust -version(self); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| self | | - -### selector - -```rust -selector(self); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| self | | - -### get_args_hash - -```rust -get_args_hash(self); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| self | | - -### gas_for_call - -```rust -gas_for_call(user_gas); -``` - -Helper functions - -#### Parameters -| Name | Type | -| --- | --- | -| user_gas | GasOpts | - -### address - -```rust -address(); -``` - -Takes no parameters. - -### sender - -```rust -sender(); -``` - -Takes no parameters. - -### portal - -```rust -portal(); -``` - -Takes no parameters. - -### transaction_fee - -```rust -transaction_fee(); -``` - -Takes no parameters. - -### chain_id - -```rust -chain_id(); -``` - -Takes no parameters. - -### version - -```rust -version(); -``` - -Takes no parameters. - -### block_number - -```rust -block_number(); -``` - -Takes no parameters. - -### timestamp - -```rust -timestamp(); -``` - -Takes no parameters. - -### l2_gas_left - -```rust -l2_gas_left(); -``` - -Takes no parameters. - -### da_gas_left - -```rust -da_gas_left(); -``` - -Takes no parameters. - -### emit_note_hash - -```rust -emit_note_hash(note_hash); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| note_hash | Field | - -### nullifier_exists - -```rust -nullifier_exists(nullifier, address); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| nullifier | Field | -| address | Field | - -### emit_nullifier - -```rust -emit_nullifier(nullifier); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| nullifier | Field | - -### send_l2_to_l1_msg - -```rust -send_l2_to_l1_msg(recipient, content); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| recipient | EthAddress | -| content | Field | - -### call - -```rust -call(gas, // gas allocation, da_gas] - address, args, // TODO(5110); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| gas | [Field; 2] | -| // gas allocation | [l2_gas | -| da_gas] - address | AztecAddress | -| args | [Field] | -| // TODO(5110 | | - -### call_static - -```rust -call_static(gas, // gas allocation, da_gas] - address, args, // TODO(5110); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| gas | [Field; 2] | -| // gas allocation | [l2_gas | -| da_gas] - address | AztecAddress | -| args | [Field] | -| // TODO(5110 | | - diff --git a/docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/context/gas.md b/docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/context/gas.md deleted file mode 100644 index 6db6b1306abc..000000000000 --- a/docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/context/gas.md +++ /dev/null @@ -1,30 +0,0 @@ -# GasOpts - -## Fields -| Field | Type | -| --- | --- | -| l2_gas | Option<Field> | -| da_gas | Option<Field> | - -## Methods - -### default - -```rust -GasOpts::default(); -``` - -Takes no parameters. - -### new - -```rust -GasOpts::new(l2_gas, da_gas); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| l2_gas | Field | -| da_gas | Field | - diff --git a/docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/context/inputs/avm_context_inputs.md b/docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/context/inputs/avm_context_inputs.md deleted file mode 100644 index 25383fdd079b..000000000000 --- a/docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/context/inputs/avm_context_inputs.md +++ /dev/null @@ -1,8 +0,0 @@ -# AvmContextInputs - -## Fields -| Field | Type | -| --- | --- | -| selector | Field | -| args_hash | Field | - diff --git a/docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/context/inputs/private_context_inputs.md b/docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/context/inputs/private_context_inputs.md deleted file mode 100644 index a34b1d5e78b6..000000000000 --- a/docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/context/inputs/private_context_inputs.md +++ /dev/null @@ -1,22 +0,0 @@ -# PrivateContextInputs - -PrivateContextInputs are expected to be provided to each private function - -## Fields -| Field | Type | -| --- | --- | -| call_context | CallContext | -| historical_header | Header | -| tx_context | TxContext | -| start_side_effect_counter | u32 | - -## Standalone Functions - -### empty - -```rust -empty(); -``` - -Takes no parameters. - diff --git a/docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/context/inputs/public_context_inputs.md b/docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/context/inputs/public_context_inputs.md deleted file mode 100644 index 62fda63ddb99..000000000000 --- a/docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/context/inputs/public_context_inputs.md +++ /dev/null @@ -1,24 +0,0 @@ -# PublicContextInputs - -PublicContextInputs are expected to be provided to each public function - -## Fields -| Field | Type | -| --- | --- | -| call_context | CallContext | -| historical_header | Header | -| public_global_variables | PublicGlobalVariables | -| start_side_effect_counter | u32 | -| gas_left | Gas | -| transaction_fee | Field | - -## Standalone Functions - -### empty - -```rust -empty(); -``` - -Takes no parameters. - diff --git a/docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/context/interface.md b/docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/context/interface.md deleted file mode 100644 index 4fd45c078474..000000000000 --- a/docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/context/interface.md +++ /dev/null @@ -1,446 +0,0 @@ -# PrivateVoidCallInterface - -## Fields -| Field | Type | -| --- | --- | -| target_contract | AztecAddress | -| selector | FunctionSelector | -| args_hash | Field | - -## Methods - -### call - -```rust -PrivateVoidCallInterface::call(self, context); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| self | | -| context | &mut PrivateContext | - -### static_call - -```rust -PrivateVoidCallInterface::static_call(self, context); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| self | | -| context | &mut PrivateContext | - -### delegate_call - -```rust -PrivateVoidCallInterface::delegate_call(self, context); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| self | | -| context | &mut PrivateContext | - -# PublicVoidCallInterface - -## Fields -| Field | Type | -| --- | --- | -| target_contract | AztecAddress | -| selector | FunctionSelector | -| args_hash | Field | - -## Methods - -### call - -```rust -PublicVoidCallInterface::call(self, context); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| self | | -| context | &mut PublicContext | - -### static_call - -```rust -PublicVoidCallInterface::static_call(self, context); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| self | | -| context | &mut PublicContext | - -### delegate_call - -```rust -PublicVoidCallInterface::delegate_call(self, context); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| self | | -| context | &mut PublicContext | - -### enqueue - -```rust -PublicVoidCallInterface::enqueue(self, context); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| self | | -| context | &mut PrivateContext | - -### static_enqueue - -```rust -PublicVoidCallInterface::static_enqueue(self, context); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| self | | -| context | &mut PrivateContext | - -### delegate_enqueue - -```rust -PublicVoidCallInterface::delegate_enqueue(self, context); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| self | | -| context | &mut PrivateContext | - -# AvmVoidCallInterface - -## Fields -| Field | Type | -| --- | --- | -| target_contract | AztecAddress | -| selector | FunctionSelector | -| args | Field] | - -## Methods - -### call - -```rust -AvmVoidCallInterface::call(self, context, gas_opts); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| self | | -| context | &mut AvmContext | -| gas_opts | GasOpts | - -### static_call - -```rust -AvmVoidCallInterface::static_call(self, context, gas_opts); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| self | | -| context | &mut AvmContext | -| gas_opts | GasOpts | - -### delegate_call - -```rust -AvmVoidCallInterface::delegate_call(self, context); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| self | | -| context | &mut AvmContext | - -## Standalone Functions - -### push_new_note_hash - -```rust -push_new_note_hash(&mut self, note_hash); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| &mut self | | -| note_hash | Field | - -### push_new_nullifier - -```rust -push_new_nullifier(&mut self, nullifier, nullified_commitment); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| &mut self | | -| nullifier | Field | -| nullified_commitment | Field | - -### msg_sender - -```rust -msg_sender(self); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| self | | - -### this_address - -```rust -this_address(self); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| self | | - -### chain_id - -```rust -chain_id(self); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| self | | - -### version - -```rust -version(self); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| self | | - -### selector - -```rust -selector(self); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| self | | - -### get_args_hash - -```rust -get_args_hash(self); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| self | | - -### block_number - -```rust -block_number(self); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| self | | - -### timestamp - -```rust -timestamp(self); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| self | | - -### coinbase - -```rust -coinbase(self); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| self | | - -### fee_recipient - -```rust -fee_recipient(self); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| self | | - -### fee_per_da_gas - -```rust -fee_per_da_gas(self); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| self | | - -### fee_per_l2_gas - -```rust -fee_per_l2_gas(self); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| self | | - -### transaction_fee - -```rust -transaction_fee(self); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| self | | - -### message_portal - -```rust -message_portal(&mut self, recipient, content); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| &mut self | | -| recipient | EthAddress | -| content | Field | - -### consume_l1_to_l2_message - -```rust -consume_l1_to_l2_message(&mut self, content, secret, sender, leaf_index); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| &mut self | | -| content | Field | -| secret | Field | -| sender | EthAddress | -| leaf_index | Field | - -### emit_unencrypted_log - -```rust -emit_unencrypted_log(&mut self, log); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| &mut self | | -| log | T | - -### call_public_function - -```rust -call_public_function(self, contract_address, function_selector, args, gas_opts); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| self | &mut Self | -| contract_address | AztecAddress | -| function_selector | FunctionSelector | -| args | [Field] | -| gas_opts | GasOpts | - -### static_call_public_function - -```rust -static_call_public_function(self, contract_address, function_selector, args, gas_opts); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| self | &mut Self | -| contract_address | AztecAddress | -| function_selector | FunctionSelector | -| args | [Field] | -| gas_opts | GasOpts | - -### delegate_call_public_function - -```rust -delegate_call_public_function(self, contract_address, function_selector, args); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| self | &mut Self | -| contract_address | AztecAddress | -| function_selector | FunctionSelector | -| args | [Field] | - -### nullifier_exists - -```rust -nullifier_exists(self, unsiloed_nullifier, address); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| self | | -| unsiloed_nullifier | Field | -| address | AztecAddress | - diff --git a/docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/context/private_context.md b/docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/context/private_context.md deleted file mode 100644 index c8c6c2e13469..000000000000 --- a/docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/context/private_context.md +++ /dev/null @@ -1,685 +0,0 @@ -# PrivateContext - -When finished, one can call .finish() to convert back to the abi - -## Fields -| Field | Type | -| --- | --- | -| inputs | PrivateContextInputs | -| side_effect_counter | u32 | -| min_revertible_side_effect_counter | u32 | -| args_hash | Field | -| return_hash | Field | -| max_block_number | MaxBlockNumber | -| note_hash_read_requests | BoundedVec<ReadRequest, MAX_NOTE_HASH_READ_REQUESTS_PER_CALL> | -| nullifier_read_requests | BoundedVec<ReadRequest, MAX_NULLIFIER_READ_REQUESTS_PER_CALL> | -| nullifier_key_validation_requests | BoundedVec<NullifierKeyValidationRequest, MAX_NULLIFIER_KEY_VALIDATION_REQUESTS_PER_CALL> | -| new_note_hashes | BoundedVec<NoteHash, MAX_NEW_NOTE_HASHES_PER_CALL> | -| new_nullifiers | BoundedVec<Nullifier, MAX_NEW_NULLIFIERS_PER_CALL> | -| private_call_stack_hashes | BoundedVec<Field, MAX_PRIVATE_CALL_STACK_LENGTH_PER_CALL> | -| public_call_stack_hashes | BoundedVec<Field, MAX_PUBLIC_CALL_STACK_LENGTH_PER_CALL> | -| public_teardown_function_hash | Field | -| new_l2_to_l1_msgs | BoundedVec<L2ToL1Message, MAX_NEW_L2_TO_L1_MSGS_PER_CALL> | -| historical_header | Header | -| encrypted_logs_hashes | BoundedVec<SideEffect, MAX_ENCRYPTED_LOGS_PER_CALL> | -| unencrypted_logs_hashes | BoundedVec<SideEffect, MAX_UNENCRYPTED_LOGS_PER_CALL> | -| encrypted_log_preimages_length | Field | -| unencrypted_log_preimages_length | Field | -| nullifier_key | Option<NullifierKeys> | - -## Methods - -### new - -```rust -PrivateContext::new(inputs, args_hash); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| inputs | PrivateContextInputs | -| args_hash | Field | - -### get_header - -Returns the header of a block whose state is used during private execution (not the block the transaction is included in). - -```rust -PrivateContext::get_header(self); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| self | | - -### get_header_at - -Returns the header of an arbitrary block whose block number is less than or equal to the block number of historical header. - -```rust -PrivateContext::get_header_at(self, block_number); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| self | | -| block_number | u32 | - -### set_return_hash - -```rust -PrivateContext::set_return_hash(&mut self, returns_hasher); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| &mut self | | -| returns_hasher | ArgsHasher | - -### finish - -```rust -PrivateContext::finish(self); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| self | | - -### end_setup - -```rust -PrivateContext::end_setup(&mut self); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| &mut self | | - -### set_tx_max_block_number - -```rust -PrivateContext::set_tx_max_block_number(&mut self, max_block_number); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| &mut self | | -| max_block_number | u32 | - -### push_note_hash_read_request - -```rust -PrivateContext::push_note_hash_read_request(&mut self, note_hash); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| &mut self | | -| note_hash | Field | - -### push_nullifier_read_request - -```rust -PrivateContext::push_nullifier_read_request(&mut self, nullifier); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| &mut self | | -| nullifier | Field | - -### request_app_nullifier_secret_key - -```rust -PrivateContext::request_app_nullifier_secret_key(&mut self, account); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| &mut self | | -| account | AztecAddress | - -### message_portal - -```rust -PrivateContext::message_portal(&mut self, recipient, content); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| &mut self | | -| recipient | EthAddress | -| content | Field | - -### consume_l1_to_l2_message - -```rust -PrivateContext::consume_l1_to_l2_message(&mut self, content, secret, sender); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| &mut self | | -| content | Field | -| secret | Field | -| sender | EthAddress | - -### emit_unencrypted_log - -TODO: We might want to remove this since emitting unencrypted logs from private functions is violating privacy. --> might be a better approach to force devs to make a public function call that emits the log if needed then it would be less easy to accidentally leak information. If we decide to keep this function around would make sense to wait for traits and then merge it with emit_unencrypted_log. - -```rust -PrivateContext::emit_unencrypted_log(&mut self, log); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| &mut self | | -| log | T | - -### emit_contract_class_unencrypted_log - -This fn exists separately from emit_unencrypted_log because sha hashing the preimage is too large to compile (16,200 fields, 518,400 bytes) => the oracle hashes it It is ONLY used with contract_class_registerer_contract since we already assert correctness: - Contract class -> we will commit to the packed bytecode (currently a TODO) - Private function -> we provide a membership proof - Unconstrained function -> we provide a membership proof Ordinary logs are not protected by the above so this fn shouldn't be called by anything else - -```rust -PrivateContext::emit_contract_class_unencrypted_log(&mut self, log); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| &mut self | | -| log | [Field; N] | - -### emit_encrypted_log - -```rust -PrivateContext::emit_encrypted_log(&mut self, contract_address, storage_slot, note_type_id, encryption_pub_key, preimage); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| &mut self | | -| contract_address | AztecAddress | -| storage_slot | Field | -| note_type_id | Field | -| encryption_pub_key | GrumpkinPoint | -| preimage | [Field; N] | - -### call_private_function - -```rust -PrivateContext::call_private_function(&mut self, contract_address, function_selector, args); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| &mut self | | -| contract_address | AztecAddress | -| function_selector | FunctionSelector | -| args | [Field; ARGS_COUNT] | - -### static_call_private_function - -```rust -PrivateContext::static_call_private_function(&mut self, contract_address, function_selector, args); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| &mut self | | -| contract_address | AztecAddress | -| function_selector | FunctionSelector | -| args | [Field; ARGS_COUNT] | - -### delegate_call_private_function - -```rust -PrivateContext::delegate_call_private_function(&mut self, contract_address, function_selector, args); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| &mut self | | -| contract_address | AztecAddress | -| function_selector | FunctionSelector | -| args | [Field; ARGS_COUNT] | - -### call_private_function_no_args - -```rust -PrivateContext::call_private_function_no_args(&mut self, contract_address, function_selector); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| &mut self | | -| contract_address | AztecAddress | -| function_selector | FunctionSelector | - -### static_call_private_function_no_args - -```rust -PrivateContext::static_call_private_function_no_args(&mut self, contract_address, function_selector); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| &mut self | | -| contract_address | AztecAddress | -| function_selector | FunctionSelector | - -### delegate_call_private_function_no_args - -```rust -PrivateContext::delegate_call_private_function_no_args(&mut self, contract_address, function_selector); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| &mut self | | -| contract_address | AztecAddress | -| function_selector | FunctionSelector | - -### call_private_function_with_packed_args - -```rust -PrivateContext::call_private_function_with_packed_args(&mut self, contract_address, function_selector, args_hash, is_static_call, is_delegate_call); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| &mut self | | -| contract_address | AztecAddress | -| function_selector | FunctionSelector | -| args_hash | Field | -| is_static_call | bool | -| is_delegate_call | bool | - -### call_public_function - -```rust -PrivateContext::call_public_function(&mut self, contract_address, function_selector, args); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| &mut self | | -| contract_address | AztecAddress | -| function_selector | FunctionSelector | -| args | [Field; ARGS_COUNT] | - -### static_call_public_function - -```rust -PrivateContext::static_call_public_function(&mut self, contract_address, function_selector, args); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| &mut self | | -| contract_address | AztecAddress | -| function_selector | FunctionSelector | -| args | [Field; ARGS_COUNT] | - -### delegate_call_public_function - -```rust -PrivateContext::delegate_call_public_function(&mut self, contract_address, function_selector, args); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| &mut self | | -| contract_address | AztecAddress | -| function_selector | FunctionSelector | -| args | [Field; ARGS_COUNT] | - -### call_public_function_no_args - -```rust -PrivateContext::call_public_function_no_args(&mut self, contract_address, function_selector); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| &mut self | | -| contract_address | AztecAddress | -| function_selector | FunctionSelector | - -### static_call_public_function_no_args - -```rust -PrivateContext::static_call_public_function_no_args(&mut self, contract_address, function_selector); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| &mut self | | -| contract_address | AztecAddress | -| function_selector | FunctionSelector | - -### delegate_call_public_function_no_args - -```rust -PrivateContext::delegate_call_public_function_no_args(&mut self, contract_address, function_selector); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| &mut self | | -| contract_address | AztecAddress | -| function_selector | FunctionSelector | - -### call_public_function_with_packed_args - -```rust -PrivateContext::call_public_function_with_packed_args(&mut self, contract_address, function_selector, args_hash, is_static_call, is_delegate_call); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| &mut self | | -| contract_address | AztecAddress | -| function_selector | FunctionSelector | -| args_hash | Field | -| is_static_call | bool | -| is_delegate_call | bool | - -### set_public_teardown_function - -```rust -PrivateContext::set_public_teardown_function(&mut self, contract_address, function_selector, args); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| &mut self | | -| contract_address | AztecAddress | -| function_selector | FunctionSelector | -| args | [Field; ARGS_COUNT] | - -### set_public_teardown_function_with_packed_args - -```rust -PrivateContext::set_public_teardown_function_with_packed_args(&mut self, contract_address, function_selector, args_hash, is_static_call, is_delegate_call); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| &mut self | | -| contract_address | AztecAddress | -| function_selector | FunctionSelector | -| args_hash | Field | -| is_static_call | bool | -| is_delegate_call | bool | - -### validate_call_stack_item_from_oracle - -```rust -PrivateContext::validate_call_stack_item_from_oracle(self, item, contract_address, function_selector, args_hash, is_static_call, is_delegate_call); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| self | | -| item | PublicCallStackItem | -| contract_address | AztecAddress | -| function_selector | FunctionSelector | -| args_hash | Field | -| is_static_call | bool | -| is_delegate_call | bool | - -# PackedReturns - -## Fields -| Field | Type | -| --- | --- | -| packed_returns | Field | - -## Methods - -### new - -```rust -PackedReturns::new(packed_returns); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| packed_returns | Field | - -### assert_empty - -```rust -PackedReturns::assert_empty(self); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| self | | - -### raw - -```rust -PackedReturns::raw(self); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| self | | - -### unpack - -```rust -PackedReturns::unpack(self); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| self | | - -### unpack_into - -```rust -PackedReturns::unpack_into(self); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| self | | - -## Standalone Functions - -### msg_sender - -```rust -msg_sender(self); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| self | | - -### this_address - -```rust -this_address(self); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| self | | - -### chain_id - -```rust -chain_id(self); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| self | | - -### version - -```rust -version(self); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| self | | - -### selector - -```rust -selector(self); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| self | | - -### get_args_hash - -```rust -get_args_hash(self); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| self | | - -### push_new_note_hash - -```rust -push_new_note_hash(&mut self, note_hash); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| &mut self | | -| note_hash | Field | - -### push_new_nullifier - -```rust -push_new_nullifier(&mut self, nullifier, nullified_note_hash); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| &mut self | | -| nullifier | Field | -| nullified_note_hash | Field | - -### empty - -```rust -empty(); -``` - -Takes no parameters. - -### emit_unencrypted_log_oracle_private - -```rust -emit_unencrypted_log_oracle_private(_contract_address, _event_selector, _message, _counter); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| _contract_address | AztecAddress | -| _event_selector | Field | -| _message | T | -| _counter | u32 | - -### emit_unencrypted_log_private_internal - -```rust -emit_unencrypted_log_private_internal(contract_address, event_selector, message, counter); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| contract_address | AztecAddress | -| event_selector | Field | -| message | T | -| counter | u32 | - -### emit_contract_class_unencrypted_log_private - -```rust -emit_contract_class_unencrypted_log_private(contract_address, event_selector, message, counter); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| contract_address | AztecAddress | -| event_selector | Field | -| message | [Field; N] | -| counter | u32 | - -### emit_contract_class_unencrypted_log_private_internal - -```rust -emit_contract_class_unencrypted_log_private_internal(contract_address, event_selector, message, counter); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| contract_address | AztecAddress | -| event_selector | Field | -| message | [Field; N] | -| counter | u32 | - diff --git a/docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/context/public_context.md b/docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/context/public_context.md deleted file mode 100644 index 29a0a32981f2..000000000000 --- a/docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/context/public_context.md +++ /dev/null @@ -1,477 +0,0 @@ -# PublicContext - -## Fields -| Field | Type | -| --- | --- | -| inputs | PublicContextInputs | -| side_effect_counter | u32 | -| args_hash | Field | -| return_hash | Field | -| nullifier_read_requests | BoundedVec<ReadRequest, MAX_NULLIFIER_READ_REQUESTS_PER_CALL> | -| nullifier_non_existent_read_requests | BoundedVec<ReadRequest, MAX_NULLIFIER_NON_EXISTENT_READ_REQUESTS_PER_CALL> | -| contract_storage_update_requests | BoundedVec<StorageUpdateRequest, MAX_PUBLIC_DATA_UPDATE_REQUESTS_PER_CALL> | -| contract_storage_reads | BoundedVec<StorageRead, MAX_PUBLIC_DATA_READS_PER_CALL> | -| public_call_stack_hashes | BoundedVec<Field, MAX_PUBLIC_CALL_STACK_LENGTH_PER_CALL> | -| new_note_hashes | BoundedVec<NoteHash, MAX_NEW_NOTE_HASHES_PER_CALL> | -| new_nullifiers | BoundedVec<Nullifier, MAX_NEW_NULLIFIERS_PER_CALL> | -| new_l2_to_l1_msgs | BoundedVec<L2ToL1Message, MAX_NEW_L2_TO_L1_MSGS_PER_CALL> | -| unencrypted_logs_hashes | BoundedVec<SideEffect, MAX_UNENCRYPTED_LOGS_PER_CALL> | -| unencrypted_log_preimages_length | Field | -| historical_header | Header | -| prover_address | AztecAddress | - -## Methods - -### new - -```rust -PublicContext::new(inputs, args_hash); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| inputs | PublicContextInputs | -| args_hash | Field | - -### call_public_function_no_args - -```rust -PublicContext::call_public_function_no_args(self, contract_address, function_selector); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| self | &mut Self | -| contract_address | AztecAddress | -| function_selector | FunctionSelector | - -### static_call_public_function_no_args - -```rust -PublicContext::static_call_public_function_no_args(self, contract_address, function_selector); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| self | &mut Self | -| contract_address | AztecAddress | -| function_selector | FunctionSelector | - -### delegate_call_public_function_no_args - -```rust -PublicContext::delegate_call_public_function_no_args(self, contract_address, function_selector); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| self | &mut Self | -| contract_address | AztecAddress | -| function_selector | FunctionSelector | - -### call_public_function_with_packed_args - -```rust -PublicContext::call_public_function_with_packed_args(self, contract_address, function_selector, args_hash, is_static_call, is_delegate_call); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| self | &mut Self | -| contract_address | AztecAddress | -| function_selector | FunctionSelector | -| args_hash | Field | -| is_static_call | bool | -| is_delegate_call | bool | - -### set_return_hash - -```rust -PublicContext::set_return_hash(&mut self, returns_hasher); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| &mut self | | -| returns_hasher | ArgsHasher | - -### push_nullifier_read_request - -Keep private or ask the AVM team if you want to change it. - -```rust -PublicContext::push_nullifier_read_request(&mut self, nullifier); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| &mut self | | -| nullifier | Field | - -### push_nullifier_non_existent_read_request - -Keep private or ask the AVM team if you want to change it. - -```rust -PublicContext::push_nullifier_non_existent_read_request(&mut self, nullifier); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| &mut self | | -| nullifier | Field | - -### finish - -```rust -PublicContext::finish(self); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| self | | - -## Standalone Functions - -### msg_sender - -```rust -msg_sender(self); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| self | | - -### this_address - -```rust -this_address(self); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| self | | - -### chain_id - -```rust -chain_id(self); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| self | | - -### version - -```rust -version(self); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| self | | - -### selector - -```rust -selector(self); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| self | | - -### get_args_hash - -```rust -get_args_hash(self); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| self | | - -### push_new_note_hash - -```rust -push_new_note_hash(&mut self, note_hash); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| &mut self | | -| note_hash | Field | - -### push_new_nullifier - -```rust -push_new_nullifier(&mut self, nullifier, _nullified_note_hash); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| &mut self | | -| nullifier | Field | -| _nullified_note_hash | Field | - -### block_number - -```rust -block_number(self); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| self | | - -### timestamp - -```rust -timestamp(self); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| self | | - -### coinbase - -```rust -coinbase(self); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| self | | - -### fee_recipient - -```rust -fee_recipient(self); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| self | | - -### fee_per_da_gas - -```rust -fee_per_da_gas(self); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| self | | - -### fee_per_l2_gas - -```rust -fee_per_l2_gas(self); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| self | | - -### transaction_fee - -```rust -transaction_fee(self); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| self | | - -### nullifier_exists - -```rust -nullifier_exists(self, unsiloed_nullifier, address); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| self | | -| unsiloed_nullifier | Field | -| address | AztecAddress | - -### message_portal - -```rust -message_portal(&mut self, recipient, content); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| &mut self | | -| recipient | EthAddress | -| content | Field | - -### consume_l1_to_l2_message - -```rust -consume_l1_to_l2_message(&mut self, content, secret, sender, _leaf_index); -``` - -Leaf index is not used in public context, but it is used in the AVMContext which will replace it. - -#### Parameters -| Name | Type | -| --- | --- | -| &mut self | | -| content | Field | -| secret | Field | -| sender | EthAddress | -| _leaf_index | Field | - -### emit_unencrypted_log - -```rust -emit_unencrypted_log(&mut self, log); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| &mut self | | -| log | T | - -### call_public_function - -```rust -call_public_function(self, contract_address, function_selector, args, _gas); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| self | &mut Self | -| contract_address | AztecAddress | -| function_selector | FunctionSelector | -| args | [Field] | -| _gas | GasOpts | - -### static_call_public_function - -```rust -static_call_public_function(self, contract_address, function_selector, args, _gas); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| self | &mut Self | -| contract_address | AztecAddress | -| function_selector | FunctionSelector | -| args | [Field] | -| _gas | GasOpts | - -### delegate_call_public_function - -```rust -delegate_call_public_function(self, contract_address, function_selector, args); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| self | &mut Self | -| contract_address | AztecAddress | -| function_selector | FunctionSelector | -| args | [Field] | - -### empty - -```rust -empty(); -``` - -Takes no parameters. - -### nullifier_exists_oracle - -```rust -nullifier_exists_oracle(nullifier); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| nullifier | Field | - -### emit_unencrypted_log_oracle - -```rust -emit_unencrypted_log_oracle(_contract_address, _event_selector, _message, _counter); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| _contract_address | AztecAddress | -| _event_selector | Field | -| _message | T | -| _counter | u32 | - -### assert_empty - -```rust -assert_empty(returns); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| returns | FunctionReturns<0> | - -### raw - -```rust -raw(self); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| self | | - -### deserialize_into - -```rust -deserialize_into(self); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| self | | - diff --git a/docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/deploy.md b/docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/deploy.md deleted file mode 100644 index b250ece82dd1..000000000000 --- a/docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/deploy.md +++ /dev/null @@ -1,16 +0,0 @@ -## Standalone Functions - -### deploy_contract - -```rust -deploy_contract(context, target); -``` - -Calls `deploy` on the deployer contract to deploy a new instance. - -#### Parameters -| Name | Type | -| --- | --- | -| context | &mut PrivateContext | -| target | AztecAddress | - diff --git a/docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/hash.md b/docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/hash.md deleted file mode 100644 index 4ff3f98e3757..000000000000 --- a/docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/hash.md +++ /dev/null @@ -1,211 +0,0 @@ -# ArgsHasher - -## Fields -| Field | Type | -| --- | --- | -| fields | Field] | - -## Methods - -### new - -```rust -ArgsHasher::new(); -``` - -Takes no parameters. - -### add - -```rust -ArgsHasher::add(&mut self, field); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| &mut self | | -| field | Field | - -### add_multiple - -```rust -ArgsHasher::add_multiple(&mut self, fields); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| &mut self | | -| fields | [Field; N] | - -## Standalone Functions - -### compute_secret_hash - -```rust -compute_secret_hash(secret); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| secret | Field | - -### compute_encrypted_log_hash - -```rust -compute_encrypted_log_hash(encrypted_log); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| encrypted_log | [Field; M] | - -### compute_unencrypted_log_hash - -```rust -compute_unencrypted_log_hash(contract_address, event_selector, log, ); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| contract_address | AztecAddress | -| event_selector | Field | -| log | T | -| | | - -### compute_message_hash - -```rust -compute_message_hash(sender, chain_id, recipient, version, content, secret_hash); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| sender | EthAddress | -| chain_id | Field | -| recipient | AztecAddress | -| version | Field | -| content | Field | -| secret_hash | Field | - -### compute_message_nullifier - -```rust -compute_message_nullifier(message_hash, secret, leaf_index); -``` - -in the L1 to L2 message tree - -#### Parameters -| Name | Type | -| --- | --- | -| message_hash | Field | -| secret | Field | -| leaf_index | Field | - -### compute_siloed_nullifier - -```rust -compute_siloed_nullifier(address, nullifier); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| address | AztecAddress | -| nullifier | Field | - -### hash - -```rust -hash(self); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| self | | - -### hash_args_array - -```rust -hash_args_array(args); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| args | [Field; N] | - -### hash_args - -```rust -hash_args(args); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| args | [Field] | - -### compute_var_args_hash - -```rust -compute_var_args_hash(); -``` - -Takes no parameters. - -### compute_enc_log_hash_304 - -```rust -compute_enc_log_hash_304(); -``` - -Takes no parameters. - -### compute_enc_log_hash_368 - -```rust -compute_enc_log_hash_368(); -``` - -Takes no parameters. - -### compute_unenc_log_hash_array - -```rust -compute_unenc_log_hash_array(); -``` - -Takes no parameters. - -### compute_unenc_log_hash_addr - -```rust -compute_unenc_log_hash_addr(); -``` - -Takes no parameters. - -### compute_unenc_log_hash_str - -```rust -compute_unenc_log_hash_str(); -``` - -Takes no parameters. - -### compute_unenc_log_hash_longer_str - -```rust -compute_unenc_log_hash_longer_str(); -``` - -Takes no parameters. - diff --git a/docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/history/contract_inclusion.md b/docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/history/contract_inclusion.md deleted file mode 100644 index 369b858123a8..000000000000 --- a/docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/history/contract_inclusion.md +++ /dev/null @@ -1,54 +0,0 @@ -## Standalone Functions - -### prove_contract_deployment_at - -```rust -prove_contract_deployment_at(contract_address, block_number, context); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| contract_address | AztecAddress | -| block_number | u32 | -| context | PrivateContext | - -### prove_contract_non_deployment_at - -```rust -prove_contract_non_deployment_at(contract_address, block_number, context); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| contract_address | AztecAddress | -| block_number | u32 | -| context | PrivateContext | - -### prove_contract_initialization_at - -```rust -prove_contract_initialization_at(contract_address, block_number, context); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| contract_address | AztecAddress | -| block_number | u32 | -| context | PrivateContext | - -### prove_contract_non_initialization_at - -```rust -prove_contract_non_initialization_at(contract_address, block_number, context); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| contract_address | AztecAddress | -| block_number | u32 | -| context | PrivateContext | - diff --git a/docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/history/note_inclusion.md b/docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/history/note_inclusion.md deleted file mode 100644 index 985d46cfcb19..000000000000 --- a/docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/history/note_inclusion.md +++ /dev/null @@ -1,41 +0,0 @@ -## Standalone Functions - -### _note_inclusion - -```rust -_note_inclusion(note, header); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| note | Note | -| header | Header | - -### prove_note_inclusion - -```rust -prove_note_inclusion(note, context); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| note | Note | -| context | PrivateContext | - -### prove_note_inclusion_at - -```rust -prove_note_inclusion_at(note, block_number, // The block at which we'll prove that the note exists - context); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| note | Note | -| block_number | u32 | -| // The block at which we'll prove that the note exists - context | PrivateContext | - diff --git a/docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/history/note_validity.md b/docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/history/note_validity.md deleted file mode 100644 index b9936984de23..000000000000 --- a/docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/history/note_validity.md +++ /dev/null @@ -1,29 +0,0 @@ -## Standalone Functions - -### prove_note_validity - -```rust -prove_note_validity(note, context); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| note | Note | -| context | &mut PrivateContext | - -### prove_note_validity_at - -```rust -prove_note_validity_at(note, block_number, context); -``` - -A helper function that proves that a note is valid at the given block number - -#### Parameters -| Name | Type | -| --- | --- | -| note | Note | -| block_number | u32 | -| context | &mut PrivateContext | - diff --git a/docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/history/nullifier_inclusion.md b/docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/history/nullifier_inclusion.md deleted file mode 100644 index 57eba778b576..000000000000 --- a/docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/history/nullifier_inclusion.md +++ /dev/null @@ -1,66 +0,0 @@ -## Standalone Functions - -### _nullifier_inclusion - -```rust -_nullifier_inclusion(nullifier, header); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| nullifier | Field | -| header | Header | - -### prove_nullifier_inclusion - -```rust -prove_nullifier_inclusion(nullifier, context); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| nullifier | Field | -| context | PrivateContext | - -### prove_nullifier_inclusion_at - -```rust -prove_nullifier_inclusion_at(nullifier, block_number, // The block at which we'll prove that the nullifier exists in the nullifier tree - context); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| nullifier | Field | -| block_number | u32 | -| // The block at which we'll prove that the nullifier exists in the nullifier tree - context | PrivateContext | - -### prove_note_is_nullified - -```rust -prove_note_is_nullified(note, context); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| note | Note | -| context | &mut PrivateContext | - -### prove_note_is_nullified_at - -```rust -prove_note_is_nullified_at(note, block_number, context); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| note | Note | -| block_number | u32 | -| context | &mut PrivateContext | - diff --git a/docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/history/nullifier_non_inclusion.md b/docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/history/nullifier_non_inclusion.md deleted file mode 100644 index c72d3a9ba8ea..000000000000 --- a/docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/history/nullifier_non_inclusion.md +++ /dev/null @@ -1,66 +0,0 @@ -## Standalone Functions - -### _nullifier_non_inclusion - -```rust -_nullifier_non_inclusion(nullifier, header); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| nullifier | Field | -| header | Header | - -### prove_nullifier_not_included - -```rust -prove_nullifier_not_included(nullifier, context); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| nullifier | Field | -| context | PrivateContext | - -### prove_nullifier_not_included_at - -```rust -prove_nullifier_not_included_at(nullifier, block_number, context); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| nullifier | Field | -| block_number | u32 | -| context | PrivateContext | - -### prove_note_not_nullified - -```rust -prove_note_not_nullified(note, context); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| note | Note | -| context | &mut PrivateContext | - -### prove_note_not_nullified_at - -```rust -prove_note_not_nullified_at(note, block_number, // The block at which we'll prove that the note was not nullified - context); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| note | Note | -| block_number | u32 | -| // The block at which we'll prove that the note was not nullified - context | &mut PrivateContext | - diff --git a/docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/history/public_storage.md b/docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/history/public_storage.md deleted file mode 100644 index 778e47f77a50..000000000000 --- a/docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/history/public_storage.md +++ /dev/null @@ -1,48 +0,0 @@ -## Standalone Functions - -### _public_storage_historical_read - -```rust -_public_storage_historical_read(storage_slot, contract_address, header); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| storage_slot | Field | -| contract_address | AztecAddress | -| header | Header | - -### public_storage_historical_read - -```rust -public_storage_historical_read(context, storage_slot, // The storage slot to read - contract_address); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| context | PrivateContext | -| storage_slot | Field | -| // The storage slot to read - contract_address | AztecAddress // The contract we want to look into | - -### public_storage_historical_read_at - -```rust -public_storage_historical_read_at(context, storage_slot, // The storage slot to read - contract_address, // The contract we want to look into - block_number); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| context | PrivateContext | -| storage_slot | Field | -| // The storage slot to read - contract_address | AztecAddress | -| // The contract we want to look into - block_number | u32 // The block number at the end of which we'll read the value | - diff --git a/docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/initializer.md b/docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/initializer.md deleted file mode 100644 index 6c447dfa211f..000000000000 --- a/docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/initializer.md +++ /dev/null @@ -1,157 +0,0 @@ -## Standalone Functions - -### mark_as_initialized_public - -```rust -mark_as_initialized_public(context); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| context | &mut PublicContext | - -### mark_as_initialized_avm - -```rust -mark_as_initialized_avm(context); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| context | &mut AvmContext | - -### mark_as_initialized_private - -```rust -mark_as_initialized_private(context); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| context | &mut PrivateContext | - -### mark_as_initialized - -```rust -mark_as_initialized(context); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| context | &mut TContext | - -### assert_is_initialized_public - -```rust -assert_is_initialized_public(context); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| context | &mut PublicContext | - -### assert_is_initialized_avm - -```rust -assert_is_initialized_avm(context); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| context | &mut AvmContext | - -### assert_is_initialized_private - -```rust -assert_is_initialized_private(context); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| context | &mut PrivateContext | - -### compute_contract_initialization_nullifier - -```rust -compute_contract_initialization_nullifier(address); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| address | AztecAddress | - -### compute_unsiloed_contract_initialization_nullifier - -```rust -compute_unsiloed_contract_initialization_nullifier(address); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| address | AztecAddress | - -### assert_initialization_matches_address_preimage_public - -```rust -assert_initialization_matches_address_preimage_public(context); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| context | PublicContext | - -### assert_initialization_matches_address_preimage_avm - -```rust -assert_initialization_matches_address_preimage_avm(context); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| context | AvmContext | - -### assert_initialization_matches_address_preimage_private - -```rust -assert_initialization_matches_address_preimage_private(context); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| context | PrivateContext | - -### assert_initialization_matches_address_preimage - -```rust -assert_initialization_matches_address_preimage(context); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| context | TContext | - -### compute_initialization_hash - -```rust -compute_initialization_hash(init_selector, init_args_hash); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| init_selector | FunctionSelector | -| init_args_hash | Field | - diff --git a/docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/keys/getters.md b/docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/keys/getters.md deleted file mode 100644 index a0a3da5ac46b..000000000000 --- a/docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/keys/getters.md +++ /dev/null @@ -1,91 +0,0 @@ -## Standalone Functions - -### get_npk_m - -```rust -get_npk_m(context, address); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| context | &mut PrivateContext | -| address | AztecAddress | - -### get_ivpk_m - -```rust -get_ivpk_m(context, address); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| context | &mut PrivateContext | -| address | AztecAddress | - -### get_ovpk_m - -```rust -get_ovpk_m(context, address); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| context | &mut PrivateContext | -| address | AztecAddress | - -### get_tpk_m - -```rust -get_tpk_m(context, address); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| context | &mut PrivateContext | -| address | AztecAddress | - -### get_master_key - -```rust -get_master_key(context, address, key_index); -``` - -} - -#### Parameters -| Name | Type | -| --- | --- | -| context | &mut PrivateContext | -| address | AztecAddress | -| key_index | Field | - -### fetch_key_from_registry - -```rust -fetch_key_from_registry(context, key_index, address); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| context | &mut PrivateContext | -| key_index | Field | -| address | AztecAddress | - -### fetch_and_constrain_keys - -```rust -fetch_and_constrain_keys(address); -``` - -Passes only when keys were not rotated - is expected to be called only when keys were not registered yet - -#### Parameters -| Name | Type | -| --- | --- | -| address | AztecAddress | - diff --git a/docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/keys/point_to_symmetric_key.md b/docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/keys/point_to_symmetric_key.md deleted file mode 100644 index 902c8f7c6634..000000000000 --- a/docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/keys/point_to_symmetric_key.md +++ /dev/null @@ -1,24 +0,0 @@ -## Standalone Functions - -### point_to_symmetric_key - -```rust -point_to_symmetric_key(secret, point); -``` - -point is not the only input of the function. Unify naming with TS once we have a better name. - -#### Parameters -| Name | Type | -| --- | --- | -| secret | GrumpkinScalar | -| point | GrumpkinPoint | - -### check_point_to_symmetric_key - -```rust -check_point_to_symmetric_key(); -``` - -Takes no parameters. - diff --git a/docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/messaging.md b/docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/messaging.md deleted file mode 100644 index 2b54d3b8564c..000000000000 --- a/docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/messaging.md +++ /dev/null @@ -1,19 +0,0 @@ -## Standalone Functions - -### process_l1_to_l2_message - -```rust -process_l1_to_l2_message(l1_to_l2_root, storage_contract_address, portal_contract_address, chain_id, version, content, secret); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| l1_to_l2_root | Field | -| storage_contract_address | AztecAddress | -| portal_contract_address | EthAddress | -| chain_id | Field | -| version | Field | -| content | Field | -| secret | Field | - diff --git a/docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/note/lifecycle.md b/docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/note/lifecycle.md deleted file mode 100644 index 77bc7b0a64f5..000000000000 --- a/docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/note/lifecycle.md +++ /dev/null @@ -1,41 +0,0 @@ -## Standalone Functions - -### create_note - -```rust -create_note(context, storage_slot, note, broadcast); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| context | &mut PrivateContext | -| storage_slot | Field | -| note | &mut Note | -| broadcast | bool | - -### create_note_hash_from_public - -```rust -create_note_hash_from_public(context, storage_slot, note); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| context | &mut PublicContext | -| storage_slot | Field | -| note | &mut Note | - -### destroy_note - -```rust -destroy_note(context, note); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| context | &mut PrivateContext | -| note | Note | - diff --git a/docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/note/note_getter.md b/docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/note/note_getter.md deleted file mode 100644 index acbf790df4b6..000000000000 --- a/docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/note/note_getter.md +++ /dev/null @@ -1,149 +0,0 @@ -## Standalone Functions - -### extract_property_value_from_selector - -```rust -extract_property_value_from_selector(serialized_note, selector); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| serialized_note | [Field; N] | -| selector | PropertySelector | - -### check_note_header - -```rust -check_note_header(context, storage_slot, note); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| context | PrivateContext | -| storage_slot | Field | -| note | Note | - -### check_note_fields - -```rust -check_note_fields(serialized_note, selects, N>); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| serialized_note | [Field; N] | -| selects | BoundedVec<Option<Select> | -| N> | | - -### check_notes_order - -```rust -check_notes_order(fields_0, fields_1, sorts, N>); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| fields_0 | [Field; N] | -| fields_1 | [Field; N] | -| sorts | BoundedVec<Option<Sort> | -| N> | | - -### get_note - -```rust -get_note(context, storage_slot); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| context | &mut PrivateContext | -| storage_slot | Field | - -### get_notes - -```rust -get_notes(context, storage_slot, options, N, FILTER_ARGS>); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| context | &mut PrivateContext | -| storage_slot | Field | -| options | NoteGetterOptions<Note | -| N | | -| FILTER_ARGS> | | - -### _get_notes_constrain_get_notes_internal - -```rust -_get_notes_constrain_get_notes_internal(context, storage_slot, opt_notes, options, N, FILTER_ARGS>); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| context | &mut PrivateContext | -| storage_slot | Field | -| opt_notes | [Option<Note>; MAX_NOTE_HASH_READ_REQUESTS_PER_CALL] | -| options | NoteGetterOptions<Note | -| N | | -| FILTER_ARGS> | | - -### get_note_internal - -```rust -get_note_internal(storage_slot); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| storage_slot | Field | - -### get_notes_internal - -```rust -get_notes_internal(storage_slot, options, N, FILTER_ARGS>); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| storage_slot | Field | -| options | NoteGetterOptions<Note | -| N | | -| FILTER_ARGS> | | - -### view_notes - -```rust -view_notes(storage_slot, options, N>); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| storage_slot | Field | -| options | NoteViewerOptions<Note | -| N> | | - -### flatten_options - -```rust -flatten_options(selects, N>, sorts, N>); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| selects | BoundedVec<Option<Select> | -| N> | | -| sorts | BoundedVec<Option<Sort> | -| N> | | - diff --git a/docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/note/note_getter_options.md b/docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/note/note_getter_options.md deleted file mode 100644 index 4a013eaa1557..000000000000 --- a/docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/note/note_getter_options.md +++ /dev/null @@ -1,172 +0,0 @@ -# PropertySelector - -## Fields -| Field | Type | -| --- | --- | -| index | u8 | -| offset | u8 | -| length | u8 | - -# ComparatorEnum - -## Fields -| Field | Type | -| --- | --- | -| EQ | u8 | -| NEQ | u8 | -| LT | u8 | -| LTE | u8 | -| GT | u8 | -| GTE | u8 | - -# Select - -## Fields -| Field | Type | -| --- | --- | -| property_selector | PropertySelector | -| value | Field | -| comparator | u8 | - -## Methods - -### new - -```rust -Select::new(property_selector, value, comparator); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| property_selector | PropertySelector | -| value | Field | -| comparator | u8 | - -# SortOrderEnum - -## Fields -| Field | Type | -| --- | --- | -| DESC | u8 | -| ASC | u8 | - -# Sort - -## Fields -| Field | Type | -| --- | --- | -| property_selector | PropertySelector | -| order | u8 | - -## Methods - -### new - -```rust -Sort::new(property_selector, order); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| property_selector | PropertySelector | -| order | u8 | - -# NoteStatusEnum - -## Fields -| Field | Type | -| --- | --- | -| ACTIVE | u8 | -| ACTIVE_OR_NULLIFIED | u8 | - -## Standalone Functions - -### return_all_notes - -```rust -return_all_notes(notes, _p); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| notes | [Option<Note>; MAX_NOTE_HASH_READ_REQUESTS_PER_CALL] | -| _p | Field | - -### with_filter - -```rust -with_filter(filter, FILTER_ARGS); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| filter | fn([Option<Note>; MAX_NOTE_HASH_READ_REQUESTS_PER_CALL] | -| FILTER_ARGS | | - -### select - -```rust -select(&mut self, property_selector, value, comparator); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| &mut self | | -| property_selector | PropertySelector | -| value | T | -| comparator | Option<u8> | - -### sort - -```rust -sort(&mut self, property_selector, order); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| &mut self | | -| property_selector | PropertySelector | -| order | u8 | - -### set_limit - -```rust -set_limit(&mut self, limit); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| &mut self | | -| limit | u32 | - -### set_offset - -```rust -set_offset(&mut self, offset); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| &mut self | | -| offset | u32 | - -### set_status - -```rust -set_status(&mut self, status); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| &mut self | | -| status | u8 | - diff --git a/docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/note/note_header.md b/docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/note/note_header.md deleted file mode 100644 index 481db9855cc8..000000000000 --- a/docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/note/note_header.md +++ /dev/null @@ -1,46 +0,0 @@ -# NoteHeader - -## Fields -| Field | Type | -| --- | --- | -| contract_address | AztecAddress | -| nonce | Field | -| storage_slot | Field | -| is_transient | bool | - -## Methods - -### new - -```rust -NoteHeader::new(contract_address, nonce, storage_slot); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| contract_address | AztecAddress | -| nonce | Field | -| storage_slot | Field | - -## Standalone Functions - -### empty - -```rust -empty(); -``` - -Takes no parameters. - -### serialize - -```rust -serialize(self); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| self | | - diff --git a/docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/note/note_interface.md b/docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/note/note_interface.md deleted file mode 100644 index c22a4952d72f..000000000000 --- a/docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/note/note_interface.md +++ /dev/null @@ -1,102 +0,0 @@ -## Standalone Functions - -### compute_nullifier - -```rust -compute_nullifier(self, context); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| self | | -| context | &mut PrivateContext | - -### compute_nullifier_without_context - -```rust -compute_nullifier_without_context(self); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| self | | - -### broadcast - -```rust -broadcast(self, context, slot); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| self | | -| context | &mut PrivateContext | -| slot | Field | - -### serialize_content - -```rust -serialize_content(self); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| self | | - -### deserialize_content - -```rust -deserialize_content(fields); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| fields | [Field; N] | - -### compute_note_content_hash - -```rust -compute_note_content_hash(self); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| self | | - -### get_header - -```rust -get_header(self); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| self | | - -### set_header - -```rust -set_header(&mut self, header); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| &mut self | | -| header | NoteHeader | - -### get_note_type_id - -```rust -get_note_type_id(); -``` - -Takes no parameters. - diff --git a/docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/note/note_viewer_options.md b/docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/note/note_viewer_options.md deleted file mode 100644 index b00a5781eb8f..000000000000 --- a/docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/note/note_viewer_options.md +++ /dev/null @@ -1,73 +0,0 @@ -## Standalone Functions - -### new - -```rust -new(); -``` - -Takes no parameters. - -### select - -```rust -select(&mut self, property_selector, value, comparator); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| &mut self | | -| property_selector | PropertySelector | -| value | T | -| comparator | Option<u8> | - -### sort - -```rust -sort(&mut self, property_selector, order); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| &mut self | | -| property_selector | PropertySelector | -| order | u8 | - -### set_limit - -```rust -set_limit(&mut self, limit); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| &mut self | | -| limit | u32 | - -### set_offset - -```rust -set_offset(&mut self, offset); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| &mut self | | -| offset | u32 | - -### set_status - -```rust -set_status(&mut self, status); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| &mut self | | -| status | u8 | - diff --git a/docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/note/utils.md b/docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/note/utils.md deleted file mode 100644 index f5275ec5783d..000000000000 --- a/docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/note/utils.md +++ /dev/null @@ -1,104 +0,0 @@ -## Standalone Functions - -### compute_siloed_hash - -```rust -compute_siloed_hash(contract_address, inner_note_hash); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| contract_address | AztecAddress | -| inner_note_hash | Field | - -### compute_unique_hash - -```rust -compute_unique_hash(nonce, siloed_note_hash); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| nonce | Field | -| siloed_note_hash | Field | - -### compute_inner_note_hash - -```rust -compute_inner_note_hash(note); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| note | Note | - -### compute_siloed_note_hash - -```rust -compute_siloed_note_hash(note_with_header); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| note_with_header | Note | - -### compute_unique_siloed_note_hash - -```rust -compute_unique_siloed_note_hash(note_with_header); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| note_with_header | Note | - -### compute_siloed_nullifier - -```rust -compute_siloed_nullifier(note_with_header, context); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| note_with_header | Note | -| context | &mut PrivateContext | - -### compute_note_hash_for_insertion - -```rust -compute_note_hash_for_insertion(note); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| note | Note | - -### compute_note_hash_for_consumption - -```rust -compute_note_hash_for_consumption(note); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| note | Note | - -### compute_note_hash_and_nullifier - -```rust -compute_note_hash_and_nullifier(// docs); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| // docs | start | - diff --git a/docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/oracle/arguments.md b/docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/oracle/arguments.md deleted file mode 100644 index 9e95f15f1645..000000000000 --- a/docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/oracle/arguments.md +++ /dev/null @@ -1,46 +0,0 @@ -## Standalone Functions - -### pack_arguments_array_oracle - -```rust -pack_arguments_array_oracle(_args); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| _args | [Field; N] | - -### pack_arguments_oracle - -```rust -pack_arguments_oracle(_args); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| _args | [Field] | - -### pack_arguments_array - -```rust -pack_arguments_array(args); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| args | [Field; N] | - -### pack_arguments - -```rust -pack_arguments(args); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| args | [Field] | - diff --git a/docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/oracle/call_private_function.md b/docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/oracle/call_private_function.md deleted file mode 100644 index b3937e0f93d3..000000000000 --- a/docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/oracle/call_private_function.md +++ /dev/null @@ -1,34 +0,0 @@ -## Standalone Functions - -### call_private_function_oracle - -```rust -call_private_function_oracle(_contract_address, _function_selector, _args_hash, _start_side_effect_counter, _is_static_call, _is_delegate_call); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| _contract_address | AztecAddress | -| _function_selector | FunctionSelector | -| _args_hash | Field | -| _start_side_effect_counter | u32 | -| _is_static_call | bool | -| _is_delegate_call | bool | - -### call_private_function_internal - -```rust -call_private_function_internal(contract_address, function_selector, args_hash, start_side_effect_counter, is_static_call, is_delegate_call); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| contract_address | AztecAddress | -| function_selector | FunctionSelector | -| args_hash | Field | -| start_side_effect_counter | u32 | -| is_static_call | bool | -| is_delegate_call | bool | - diff --git a/docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/oracle/encryption.md b/docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/oracle/encryption.md deleted file mode 100644 index 46fa14e86cfc..000000000000 --- a/docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/oracle/encryption.md +++ /dev/null @@ -1,28 +0,0 @@ -## Standalone Functions - -### aes128_encrypt_oracle - -```rust -aes128_encrypt_oracle(input, iv, key); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| input | [u8; N] | -| iv | [u8; 16] | -| key | [u8; 16] | - -### aes128_encrypt - -```rust -aes128_encrypt(input, iv, key); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| input | [u8; N] | -| iv | [u8; 16] | -| key | [u8; 16] | - diff --git a/docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/oracle/enqueue_public_function_call.md b/docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/oracle/enqueue_public_function_call.md deleted file mode 100644 index 8e5a0b662cd7..000000000000 --- a/docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/oracle/enqueue_public_function_call.md +++ /dev/null @@ -1,77 +0,0 @@ -## Standalone Functions - -### enqueue_public_function_call_oracle - -```rust -enqueue_public_function_call_oracle(_contract_address, _function_selector, _args_hash, _side_effect_counter, _is_static_call, _is_delegate_call); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| _contract_address | AztecAddress | -| _function_selector | FunctionSelector | -| _args_hash | Field | -| _side_effect_counter | u32 | -| _is_static_call | bool | -| _is_delegate_call | bool | - -### enqueue_public_function_call_internal - -```rust -enqueue_public_function_call_internal(contract_address, function_selector, args_hash, side_effect_counter, is_static_call, is_delegate_call); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| contract_address | AztecAddress | -| function_selector | FunctionSelector | -| args_hash | Field | -| side_effect_counter | u32 | -| is_static_call | bool | -| is_delegate_call | bool | - -### set_public_teardown_function_call_oracle - -```rust -set_public_teardown_function_call_oracle(_contract_address, _function_selector, _args_hash, _side_effect_counter, _is_static_call, _is_delegate_call); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| _contract_address | AztecAddress | -| _function_selector | FunctionSelector | -| _args_hash | Field | -| _side_effect_counter | u32 | -| _is_static_call | bool | -| _is_delegate_call | bool | - -### set_public_teardown_function_call_internal - -```rust -set_public_teardown_function_call_internal(contract_address, function_selector, args_hash, side_effect_counter, is_static_call, is_delegate_call); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| contract_address | AztecAddress | -| function_selector | FunctionSelector | -| args_hash | Field | -| side_effect_counter | u32 | -| is_static_call | bool | -| is_delegate_call | bool | - -### parse_public_call_stack_item_from_oracle - -```rust -parse_public_call_stack_item_from_oracle(fields); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| fields | [Field; ENQUEUE_PUBLIC_FUNCTION_CALL_RETURN_LENGTH] | - diff --git a/docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/oracle/get_contract_instance.md b/docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/oracle/get_contract_instance.md deleted file mode 100644 index 162cc992738b..000000000000 --- a/docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/oracle/get_contract_instance.md +++ /dev/null @@ -1,68 +0,0 @@ -## Standalone Functions - -### get_contract_instance_oracle - -```rust -get_contract_instance_oracle(_address); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| _address | AztecAddress | - -### get_contract_instance_oracle_avm - -```rust -get_contract_instance_oracle_avm(_address); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| _address | AztecAddress | - -### get_contract_instance_internal - -```rust -get_contract_instance_internal(address); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| address | AztecAddress | - -### get_contract_instance_internal_avm - -```rust -get_contract_instance_internal_avm(address); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| address | AztecAddress | - -### get_contract_instance - -```rust -get_contract_instance(address); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| address | AztecAddress | - -### get_contract_instance_avm - -```rust -get_contract_instance_avm(address); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| address | AztecAddress | - diff --git a/docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/oracle/get_l1_to_l2_membership_witness.md b/docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/oracle/get_l1_to_l2_membership_witness.md deleted file mode 100644 index f2a2d9c2c5ab..000000000000 --- a/docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/oracle/get_l1_to_l2_membership_witness.md +++ /dev/null @@ -1,28 +0,0 @@ -## Standalone Functions - -### get_l1_to_l2_membership_witness_oracle - -```rust -get_l1_to_l2_membership_witness_oracle(_contract_address, _message_hash, _secret); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| _contract_address | AztecAddress | -| _message_hash | Field | -| _secret | Field | - -### get_l1_to_l2_membership_witness - -```rust -get_l1_to_l2_membership_witness(contract_address, message_hash, secret); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| contract_address | AztecAddress | -| message_hash | Field | -| secret | Field | - diff --git a/docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/oracle/get_membership_witness.md b/docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/oracle/get_membership_witness.md deleted file mode 100644 index c23aa029bc2b..000000000000 --- a/docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/oracle/get_membership_witness.md +++ /dev/null @@ -1,52 +0,0 @@ -## Standalone Functions - -### get_membership_witness_oracle - -```rust -get_membership_witness_oracle(_block_number, _tree_id, _leaf_value); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| _block_number | u32 | -| _tree_id | Field | -| _leaf_value | Field | - -### get_membership_witness - -```rust -get_membership_witness(block_number, tree_id, leaf_value); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| block_number | u32 | -| tree_id | Field | -| leaf_value | Field | - -### get_note_hash_membership_witness - -```rust -get_note_hash_membership_witness(block_number, leaf_value); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| block_number | u32 | -| leaf_value | Field | - -### get_archive_membership_witness - -```rust -get_archive_membership_witness(block_number, leaf_value); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| block_number | u32 | -| leaf_value | Field | - diff --git a/docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/oracle/get_nullifier_membership_witness.md b/docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/oracle/get_nullifier_membership_witness.md deleted file mode 100644 index 20dd83778360..000000000000 --- a/docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/oracle/get_nullifier_membership_witness.md +++ /dev/null @@ -1,72 +0,0 @@ -# NullifierMembershipWitness - -## Fields -| Field | Type | -| --- | --- | -| index | Field | -| leaf_preimage | NullifierLeafPreimage | -| path | Field; NULLIFIER_TREE_HEIGHT] | - -## Methods - -### deserialize - -```rust -NullifierMembershipWitness::deserialize(fields); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| fields | [Field; NULLIFIER_MEMBERSHIP_WITNESS] | - -## Standalone Functions - -### get_low_nullifier_membership_witness_oracle - -```rust -get_low_nullifier_membership_witness_oracle(_block_number, _nullifier); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| _block_number | u32 | -| _nullifier | Field | - -### get_low_nullifier_membership_witness - -```rust -get_low_nullifier_membership_witness(block_number, nullifier); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| block_number | u32 | -| nullifier | Field | - -### get_nullifier_membership_witness_oracle - -```rust -get_nullifier_membership_witness_oracle(_block_number, _nullifier); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| _block_number | u32 | -| _nullifier | Field | - -### get_nullifier_membership_witness - -```rust -get_nullifier_membership_witness(block_number, nullifier); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| block_number | u32 | -| nullifier | Field | - diff --git a/docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/oracle/get_public_data_witness.md b/docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/oracle/get_public_data_witness.md deleted file mode 100644 index 70b5a24193b5..000000000000 --- a/docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/oracle/get_public_data_witness.md +++ /dev/null @@ -1,35 +0,0 @@ -# PublicDataWitness - -## Fields -| Field | Type | -| --- | --- | -| index | Field | -| leaf_preimage | PublicDataTreeLeafPreimage | -| path | Field; PUBLIC_DATA_TREE_HEIGHT] | - -## Standalone Functions - -### get_public_data_witness_oracle - -```rust -get_public_data_witness_oracle(_block_number, _leaf_slot); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| _block_number | u32 | -| _leaf_slot | Field | - -### get_public_data_witness - -```rust -get_public_data_witness(block_number, leaf_slot); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| block_number | u32 | -| leaf_slot | Field | - diff --git a/docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/oracle/get_public_key.md b/docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/oracle/get_public_key.md deleted file mode 100644 index bc7ce606b17a..000000000000 --- a/docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/oracle/get_public_key.md +++ /dev/null @@ -1,35 +0,0 @@ -## Standalone Functions - -### get_public_key_and_partial_address_oracle - -```rust -get_public_key_and_partial_address_oracle(_address); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| _address | AztecAddress | - -### get_public_key_and_partial_address_internal - -```rust -get_public_key_and_partial_address_internal(address); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| address | AztecAddress | - -### get_public_key - -```rust -get_public_key(address); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| address | AztecAddress | - diff --git a/docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/oracle/get_sibling_path.md b/docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/oracle/get_sibling_path.md deleted file mode 100644 index acca3273b633..000000000000 --- a/docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/oracle/get_sibling_path.md +++ /dev/null @@ -1,28 +0,0 @@ -## Standalone Functions - -### get_sibling_path_oracle - -```rust -get_sibling_path_oracle(_block_number, _tree_id, _leaf_index); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| _block_number | u32 | -| _tree_id | Field | -| _leaf_index | Field | - -### get_sibling_path - -```rust -get_sibling_path(block_number, tree_id, leaf_index); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| block_number | u32 | -| tree_id | Field | -| leaf_index | Field | - diff --git a/docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/oracle/header.md b/docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/oracle/header.md deleted file mode 100644 index 96f6243f59e2..000000000000 --- a/docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/oracle/header.md +++ /dev/null @@ -1,36 +0,0 @@ -## Standalone Functions - -### get_header_at_oracle - -```rust -get_header_at_oracle(_block_number); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| _block_number | u32 | - -### get_header_at_internal - -```rust -get_header_at_internal(block_number); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| block_number | u32 | - -### get_header_at - -```rust -get_header_at(block_number, context); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| block_number | u32 | -| context | PrivateContext | - diff --git a/docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/oracle/keys.md b/docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/oracle/keys.md deleted file mode 100644 index 3eba875de13c..000000000000 --- a/docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/oracle/keys.md +++ /dev/null @@ -1,35 +0,0 @@ -## Standalone Functions - -### get_public_keys_and_partial_address_oracle - -```rust -get_public_keys_and_partial_address_oracle(_address); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| _address | AztecAddress | - -### get_public_keys_and_partial_address_oracle_wrapper - -```rust -get_public_keys_and_partial_address_oracle_wrapper(address); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| address | AztecAddress | - -### get_public_keys_and_partial_address - -```rust -get_public_keys_and_partial_address(address); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| address | AztecAddress | - diff --git a/docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/oracle/logs.md b/docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/oracle/logs.md deleted file mode 100644 index deea20f82bf7..000000000000 --- a/docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/oracle/logs.md +++ /dev/null @@ -1,35 +0,0 @@ -## Standalone Functions - -### emit_encrypted_log_oracle - -```rust -emit_encrypted_log_oracle(_contract_address, _storage_slot, _note_type_id, _encryption_pub_key, _preimage, _counter, ); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| _contract_address | AztecAddress | -| _storage_slot | Field | -| _note_type_id | Field | -| _encryption_pub_key | GrumpkinPoint | -| _preimage | [Field; N] | -| _counter | u32 | -| | | - -### emit_encrypted_log - -```rust -emit_encrypted_log(contract_address, storage_slot, note_type_id, encryption_pub_key, preimage, counter); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| contract_address | AztecAddress | -| storage_slot | Field | -| note_type_id | Field | -| encryption_pub_key | GrumpkinPoint | -| preimage | [Field; N] | -| counter | u32 | - diff --git a/docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/oracle/logs_traits.md b/docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/oracle/logs_traits.md deleted file mode 100644 index e5b5cf4b6359..000000000000 --- a/docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/oracle/logs_traits.md +++ /dev/null @@ -1,800 +0,0 @@ -## Standalone Functions - -### output_fields - -```rust -output_fields(self); -``` - -L = encryption output len in bytes (= 32*M - 16) - -#### Parameters -| Name | Type | -| --- | --- | -| self | [Field; N] | - -### output_bytes - -```rust -output_bytes(self); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| self | [Field; N] | - -### output_fields - -```rust -output_fields(self); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| self | | - -### output_bytes - -```rust -output_bytes(self); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| self | | - -### output_fields - -```rust -output_fields(self); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| self | | - -### output_bytes - -```rust -output_bytes(self); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| self | | - -### output_fields - -```rust -output_fields(self); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| self | | - -### output_bytes - -```rust -output_bytes(self); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| self | | - -### output_fields - -```rust -output_fields(self); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| self | | - -### output_bytes - -```rust -output_bytes(self); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| self | | - -### output_fields - -```rust -output_fields(self); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| self | | - -### output_bytes - -```rust -output_bytes(self); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| self | | - -### output_fields - -```rust -output_fields(self); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| self | | - -### output_bytes - -```rust -output_bytes(self); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| self | | - -### to_be_bytes_arr - -```rust -to_be_bytes_arr(self); -``` - -M = full log input in bytes ( = N + 40 = N + 32 for addr, + 4 for selector, + 4 for len) - -#### Parameters -| Name | Type | -| --- | --- | -| self | | - -### output_bytes - -```rust -output_bytes(self); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| self | | - -### to_be_bytes_arr - -```rust -to_be_bytes_arr(self); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| self | | - -### output_bytes - -```rust -output_bytes(self); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| self | | - -### to_be_bytes_arr - -```rust -to_be_bytes_arr(self); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| self | | - -### output_bytes - -```rust -output_bytes(self); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| self | | - -### arr_to_be_bytes_arr - -```rust -arr_to_be_bytes_arr(fields); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| fields | [Field; L] | - -### str_to_be_bytes_arr - -```rust -str_to_be_bytes_arr(string); -``` - -then an ACVM field via the oracle => we recreate here - -#### Parameters -| Name | Type | -| --- | --- | -| string | str<L> | - -### to_be_bytes_arr - -```rust -to_be_bytes_arr(self); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| self | | - -### output_bytes - -```rust -output_bytes(self); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| self | | - -### to_be_bytes_arr - -```rust -to_be_bytes_arr(self); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| self | | - -### output_bytes - -```rust -output_bytes(self); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| self | | - -### to_be_bytes_arr - -```rust -to_be_bytes_arr(self); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| self | | - -### output_bytes - -```rust -output_bytes(self); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| self | | - -### to_be_bytes_arr - -```rust -to_be_bytes_arr(self); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| self | | - -### output_bytes - -```rust -output_bytes(self); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| self | | - -### to_be_bytes_arr - -```rust -to_be_bytes_arr(self); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| self | | - -### output_bytes - -```rust -output_bytes(self); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| self | | - -### to_be_bytes_arr - -```rust -to_be_bytes_arr(self); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| self | | - -### output_bytes - -```rust -output_bytes(self); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| self | | - -### to_be_bytes_arr - -```rust -to_be_bytes_arr(self); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| self | | - -### output_bytes - -```rust -output_bytes(self); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| self | | - -### to_be_bytes_arr - -```rust -to_be_bytes_arr(self); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| self | | - -### output_bytes - -```rust -output_bytes(self); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| self | | - -### to_be_bytes_arr - -```rust -to_be_bytes_arr(self); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| self | | - -### output_bytes - -```rust -output_bytes(self); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| self | | - -### to_be_bytes_arr - -```rust -to_be_bytes_arr(self); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| self | | - -### output_bytes - -```rust -output_bytes(self); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| self | | - -### to_be_bytes_arr - -```rust -to_be_bytes_arr(self); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| self | | - -### output_bytes - -```rust -output_bytes(self); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| self | | - -### to_be_bytes_arr - -```rust -to_be_bytes_arr(self); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| self | | - -### output_bytes - -```rust -output_bytes(self); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| self | | - -### to_be_bytes_arr - -```rust -to_be_bytes_arr(self); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| self | | - -### output_bytes - -```rust -output_bytes(self); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| self | | - -### to_be_bytes_arr - -```rust -to_be_bytes_arr(self); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| self | | - -### output_bytes - -```rust -output_bytes(self); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| self | | - -### to_be_bytes_arr - -```rust -to_be_bytes_arr(self); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| self | | - -### output_bytes - -```rust -output_bytes(self); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| self | | - -### to_be_bytes_arr - -```rust -to_be_bytes_arr(self); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| self | | - -### output_bytes - -```rust -output_bytes(self); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| self | | - -### to_be_bytes_arr - -```rust -to_be_bytes_arr(self); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| self | | - -### output_bytes - -```rust -output_bytes(self); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| self | | - -### to_be_bytes_arr - -```rust -to_be_bytes_arr(self); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| self | | - -### output_bytes - -```rust -output_bytes(self); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| self | | - -### to_be_bytes_arr - -```rust -to_be_bytes_arr(self); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| self | | - -### output_bytes - -```rust -output_bytes(self); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| self | | - -### to_be_bytes_arr - -```rust -to_be_bytes_arr(self); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| self | | - -### output_bytes - -```rust -output_bytes(self); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| self | | - -### to_be_bytes_arr - -```rust -to_be_bytes_arr(self); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| self | | - -### output_bytes - -```rust -output_bytes(self); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| self | | - -### to_be_bytes_arr - -```rust -to_be_bytes_arr(self); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| self | | - -### output_bytes - -```rust -output_bytes(self); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| self | | - -### to_be_bytes_arr - -```rust -to_be_bytes_arr(self); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| self | | - -### output_bytes - -```rust -output_bytes(self); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| self | | - -### to_be_bytes_arr - -```rust -to_be_bytes_arr(self); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| self | | - -### output_bytes - -```rust -output_bytes(self); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| self | | - -### to_be_bytes_arr - -```rust -to_be_bytes_arr(self); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| self | | - -### output_bytes - -```rust -output_bytes(self); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| self | | - diff --git a/docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/oracle/notes.md b/docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/oracle/notes.md deleted file mode 100644 index b1c9118ec1e1..000000000000 --- a/docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/oracle/notes.md +++ /dev/null @@ -1,160 +0,0 @@ -## Standalone Functions - -### notify_created_note_oracle - -```rust -notify_created_note_oracle(_storage_slot, _note_type_id, _serialized_note, _inner_note_hash, _counter); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| _storage_slot | Field | -| _note_type_id | Field | -| _serialized_note | [Field; N] | -| _inner_note_hash | Field | -| _counter | u32 | - -### notify_created_note - -```rust -notify_created_note(storage_slot, note_type_id, serialized_note, inner_note_hash, counter); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| storage_slot | Field | -| note_type_id | Field | -| serialized_note | [Field; N] | -| inner_note_hash | Field | -| counter | u32 | - -### notify_nullified_note_oracle - -```rust -notify_nullified_note_oracle(_nullifier, _inner_note_hash, _counter); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| _nullifier | Field | -| _inner_note_hash | Field | -| _counter | u32 | - -### notify_nullified_note - -```rust -notify_nullified_note(nullifier, inner_note_hash, counter); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| nullifier | Field | -| inner_note_hash | Field | -| counter | u32 | - -### get_notes_oracle - -```rust -get_notes_oracle(_storage_slot, _num_selects, _select_by_indexes, _select_by_offsets, _select_by_lengths, _select_values, _select_comparators, _sort_by_indexes, _sort_by_offsets, _sort_by_lengths, _sort_order, _limit, _offset, _status, _return_size, _placeholder_fields); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| _storage_slot | Field | -| _num_selects | u8 | -| _select_by_indexes | [u8; N] | -| _select_by_offsets | [u8; N] | -| _select_by_lengths | [u8; N] | -| _select_values | [Field; N] | -| _select_comparators | [u8; N] | -| _sort_by_indexes | [u8; N] | -| _sort_by_offsets | [u8; N] | -| _sort_by_lengths | [u8; N] | -| _sort_order | [u8; N] | -| _limit | u32 | -| _offset | u32 | -| _status | u8 | -| _return_size | u32 | -| _placeholder_fields | [Field; S] | - -### get_notes_oracle_wrapper - -```rust -get_notes_oracle_wrapper(storage_slot, num_selects, select_by_indexes, select_by_offsets, select_by_lengths, select_values, select_comparators, sort_by_indexes, sort_by_offsets, sort_by_lengths, sort_order, limit, offset, status, mut placeholder_fields); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| storage_slot | Field | -| num_selects | u8 | -| select_by_indexes | [u8; N] | -| select_by_offsets | [u8; N] | -| select_by_lengths | [u8; N] | -| select_values | [Field; N] | -| select_comparators | [u8; N] | -| sort_by_indexes | [u8; N] | -| sort_by_offsets | [u8; N] | -| sort_by_lengths | [u8; N] | -| sort_order | [u8; N] | -| limit | u32 | -| offset | u32 | -| status | u8 | -| mut placeholder_fields | [Field; S] | - -### get_notes - -```rust -get_notes(storage_slot, num_selects, select_by_indexes, select_by_offsets, select_by_lengths, select_values, select_comparators, sort_by_indexes, sort_by_offsets, sort_by_lengths, sort_order, limit, offset, status, mut placeholder_opt_notes, // TODO, // TODO); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| storage_slot | Field | -| num_selects | u8 | -| select_by_indexes | [u8; M] | -| select_by_offsets | [u8; M] | -| select_by_lengths | [u8; M] | -| select_values | [Field; M] | -| select_comparators | [u8; M] | -| sort_by_indexes | [u8; M] | -| sort_by_offsets | [u8; M] | -| sort_by_lengths | [u8; M] | -| sort_order | [u8; M] | -| limit | u32 | -| offset | u32 | -| status | u8 | -| mut placeholder_opt_notes | [Option<Note>; S] | -| // TODO | Remove it and use `limit` to initialize the note array. - placeholder_fields | -| // TODO | Remove it and use `limit` to initialize the note array. - _placeholder_note_length | - -### check_nullifier_exists_oracle - -```rust -check_nullifier_exists_oracle(_inner_nullifier); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| _inner_nullifier | Field | - -### check_nullifier_exists - -```rust -check_nullifier_exists(inner_nullifier); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| inner_nullifier | Field | - diff --git a/docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/oracle/nullifier_key.md b/docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/oracle/nullifier_key.md deleted file mode 100644 index f9294646028e..000000000000 --- a/docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/oracle/nullifier_key.md +++ /dev/null @@ -1,57 +0,0 @@ -# NullifierKeys - -Nullifier keys pertaining to a specific account - -## Fields -| Field | Type | -| --- | --- | -| account | AztecAddress | -| master_nullifier_public_key | GrumpkinPoint | -| app_nullifier_secret_key | Field | - -## Standalone Functions - -### get_nullifier_keys_oracle - -```rust -get_nullifier_keys_oracle(_account); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| _account | AztecAddress | - -### get_nullifier_keys_internal - -```rust -get_nullifier_keys_internal(account); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| account | AztecAddress | - -### get_nullifier_keys - -```rust -get_nullifier_keys(account); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| account | AztecAddress | - -### get_app_nullifier_secret_key - -```rust -get_app_nullifier_secret_key(account); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| account | AztecAddress | - diff --git a/docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/oracle/public_call.md b/docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/oracle/public_call.md deleted file mode 100644 index e219df2ee67c..000000000000 --- a/docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/oracle/public_call.md +++ /dev/null @@ -1,34 +0,0 @@ -## Standalone Functions - -### call_public_function_oracle - -```rust -call_public_function_oracle(_contract_address, _function_selector, _args_hash, _side_effect_counter, _is_static_call, _is_delegate_call); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| _contract_address | AztecAddress | -| _function_selector | FunctionSelector | -| _args_hash | Field | -| _side_effect_counter | u32 | -| _is_static_call | bool | -| _is_delegate_call | bool | - -### call_public_function_internal - -```rust -call_public_function_internal(contract_address, function_selector, args_hash, side_effect_counter, is_static_call, is_delegate_call); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| contract_address | AztecAddress | -| function_selector | FunctionSelector | -| args_hash | Field | -| side_effect_counter | u32 | -| is_static_call | bool | -| is_delegate_call | bool | - diff --git a/docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/oracle/returns.md b/docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/oracle/returns.md deleted file mode 100644 index b56816cc34aa..000000000000 --- a/docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/oracle/returns.md +++ /dev/null @@ -1,46 +0,0 @@ -## Standalone Functions - -### pack_returns_oracle - -```rust -pack_returns_oracle(_returns); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| _returns | [Field] | - -### pack_returns - -```rust -pack_returns(returns); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| returns | [Field] | - -### unpack_returns_oracle - -```rust -unpack_returns_oracle(_return_hash); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| _return_hash | Field | - -### unpack_returns - -```rust -unpack_returns(return_hash); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| return_hash | Field | - diff --git a/docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/oracle/storage.md b/docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/oracle/storage.md deleted file mode 100644 index 364545676299..000000000000 --- a/docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/oracle/storage.md +++ /dev/null @@ -1,60 +0,0 @@ -## Standalone Functions - -### storage_read_oracle - -```rust -storage_read_oracle(_storage_slot, _number_of_elements); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| _storage_slot | Field | -| _number_of_elements | Field | - -### storage_read_oracle_wrapper - -```rust -storage_read_oracle_wrapper(_storage_slot); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| _storage_slot | Field | - -### storage_read - -```rust -storage_read(storage_slot); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| storage_slot | Field | - -### storage_write_oracle - -```rust -storage_write_oracle(_storage_slot, _values); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| _storage_slot | Field | -| _values | [Field; N] | - -### storage_write - -```rust -storage_write(storage_slot, fields); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| storage_slot | Field | -| fields | [Field; N] | - diff --git a/docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/oracle/unsafe_rand.md b/docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/oracle/unsafe_rand.md deleted file mode 100644 index 4ad350bb7ed3..000000000000 --- a/docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/oracle/unsafe_rand.md +++ /dev/null @@ -1,18 +0,0 @@ -## Standalone Functions - -### rand_oracle - -```rust -rand_oracle(); -``` - -Takes no parameters. - -### unsafe_rand - -```rust -unsafe_rand(); -``` - -Takes no parameters. - diff --git a/docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/public_storage.md b/docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/public_storage.md deleted file mode 100644 index 5b8ab756b66a..000000000000 --- a/docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/public_storage.md +++ /dev/null @@ -1,84 +0,0 @@ -# TestStruct - -## Fields -| Field | Type | -| --- | --- | -| a | Field | -| b | Field | - -## Standalone Functions - -### read - -```rust -read(storage_slot); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| storage_slot | Field | - -### write - -```rust -write(storage_slot, value); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| storage_slot | Field | -| value | T | - -### read_historical - -```rust -read_historical(// storage_slot, // context); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| // storage_slot | Field | -| // context | PrivateContext -// | - -### deserialize - -```rust -deserialize(fields); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| fields | [Field; 2] | - -### serialize - -```rust -serialize(self); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| self | | - -### test_read - -```rust -test_read(); -``` - -Takes no parameters. - -### test_write - -```rust -test_write(); -``` - -Takes no parameters. - diff --git a/docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/state_vars/map.md b/docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/state_vars/map.md deleted file mode 100644 index 3060e29c96f3..000000000000 --- a/docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/state_vars/map.md +++ /dev/null @@ -1,40 +0,0 @@ -## Standalone Functions - -### new - -```rust -new(context, storage_slot, state_var_constructor, Field); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| context | Context | -| storage_slot | Field | -| state_var_constructor | fn(Context | -| Field | | - -### at - -```rust -at(self, key); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| self | | -| key | K | - -### derive_storage_slot_in_map - -```rust -derive_storage_slot_in_map(storage_slot, key); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| storage_slot | Field | -| key | K | - diff --git a/docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/state_vars/private_immutable.md b/docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/state_vars/private_immutable.md deleted file mode 100644 index 70c65259d2c2..000000000000 --- a/docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/state_vars/private_immutable.md +++ /dev/null @@ -1,71 +0,0 @@ -## Standalone Functions - -### new - -```rust -new(context, storage_slot); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| context | Context | -| storage_slot | Field | - -### compute_initialization_nullifier - -```rust -compute_initialization_nullifier(self); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| self | | - -### is_initialized - -```rust -is_initialized(self); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| self | | - -### initialize - -```rust -initialize(self, note, broadcast); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| self | | -| note | &mut Note | -| broadcast | bool | - -### get_note - -```rust -get_note(self); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| self | | - -### view_note - -```rust -view_note(self); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| self | | - diff --git a/docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/state_vars/private_mutable.md b/docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/state_vars/private_mutable.md deleted file mode 100644 index abf8070530ba..000000000000 --- a/docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/state_vars/private_mutable.md +++ /dev/null @@ -1,85 +0,0 @@ -## Standalone Functions - -### new - -```rust -new(context, storage_slot); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| context | Context | -| storage_slot | Field | - -### compute_initialization_nullifier - -```rust -compute_initialization_nullifier(self); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| self | | - -### is_initialized - -```rust -is_initialized(self); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| self | | - -### initialize - -```rust -initialize(self, note, broadcast); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| self | | -| note | &mut Note | -| broadcast | bool | - -### replace - -```rust -replace(self, new_note, broadcast); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| self | | -| new_note | &mut Note | -| broadcast | bool | - -### get_note - -```rust -get_note(self, broadcast); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| self | | -| broadcast | bool | - -### view_note - -```rust -view_note(self); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| self | | - diff --git a/docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/state_vars/private_set.md b/docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/state_vars/private_set.md deleted file mode 100644 index 3c9dcd5b1dcb..000000000000 --- a/docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/state_vars/private_set.md +++ /dev/null @@ -1,103 +0,0 @@ -## Standalone Functions - -### new - -```rust -new(context, storage_slot); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| context | Context | -| storage_slot | Field | - -### insert - -```rust -insert(self, note, broadcast); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| self | | -| note | &mut Note | -| broadcast | bool | - -### insert_from_public - -```rust -insert_from_public(self, note); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| self | | -| note | &mut Note | - -### assert_contains_and_remove - -```rust -assert_contains_and_remove(_self, _note, _nonce); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| _self | Self | -| _note | &mut Note | -| _nonce | Field | - -### assert_contains_and_remove_publicly_created - -```rust -assert_contains_and_remove_publicly_created(_self, _note); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| _self | Self | -| _note | &mut Note | - -### remove - -```rust -remove(self, note); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| self | | -| note | Note | - -### get_notes - -```rust -get_notes(self, options, N, FILTER_ARGS>); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| self | | -| options | NoteGetterOptions<Note | -| N | | -| FILTER_ARGS> | | - -### view_notes - -```rust -view_notes(self, options, N>); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| self | | -| options | NoteViewerOptions<Note | -| N> | | - diff --git a/docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/state_vars/public_immutable.md b/docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/state_vars/public_immutable.md deleted file mode 100644 index d5904c719532..000000000000 --- a/docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/state_vars/public_immutable.md +++ /dev/null @@ -1,36 +0,0 @@ -## Standalone Functions - -### new - -```rust -new(// Note); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| // Note | Passing the contexts to new(.. | - -### initialize - -```rust -initialize(self, value); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| self | | -| value | T | - -### read - -```rust -read(self); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| self | | - diff --git a/docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/state_vars/public_mutable.md b/docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/state_vars/public_mutable.md deleted file mode 100644 index 3297e68f154c..000000000000 --- a/docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/state_vars/public_mutable.md +++ /dev/null @@ -1,36 +0,0 @@ -## Standalone Functions - -### new - -```rust -new(// Note); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| // Note | Passing the contexts to new(.. | - -### read - -```rust -read(self); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| self | | - -### write - -```rust -write(self, value); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| self | | -| value | T | - diff --git a/docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/state_vars/shared_immutable.md b/docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/state_vars/shared_immutable.md deleted file mode 100644 index 283a1246a40b..000000000000 --- a/docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/state_vars/shared_immutable.md +++ /dev/null @@ -1,49 +0,0 @@ -## Standalone Functions - -### new - -```rust -new(// Note); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| // Note | Passing the contexts to new(.. | - -### initialize - -```rust -initialize(self, value); -``` - -Intended to be only called once. - -#### Parameters -| Name | Type | -| --- | --- | -| self | | -| value | T | - -### read_public - -```rust -read_public(self); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| self | | - -### read_private - -```rust -read_private(self); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| self | | - diff --git a/docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/state_vars/shared_mutable/scheduled_value_change.md b/docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/state_vars/shared_mutable/scheduled_value_change.md deleted file mode 100644 index 124c4982ba3c..000000000000 --- a/docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/state_vars/shared_mutable/scheduled_value_change.md +++ /dev/null @@ -1,193 +0,0 @@ -## Standalone Functions - -### new - -```rust -new(pre, post, block_of_change); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| pre | T | -| post | T | -| block_of_change | u32 | - -### get_current_at - -```rust -get_current_at(self, block_number); -``` - -/ equal to the block horizon (see `get_block_horizon()`). - -#### Parameters -| Name | Type | -| --- | --- | -| self | | -| block_number | u32 | - -### get_scheduled - -```rust -get_scheduled(self); -``` - -/ Additionally, further changes might be later scheduled, potentially canceling the one returned by this function. - -#### Parameters -| Name | Type | -| --- | --- | -| self | | - -### get_block_horizon - -```rust -get_block_horizon(self, historical_block_number, minimum_delay); -``` - -/ using the same historical block number. - -#### Parameters -| Name | Type | -| --- | --- | -| self | | -| historical_block_number | u32 | -| minimum_delay | u32 | - -### schedule_change - -```rust -schedule_change(&mut self, new_value, current_block_number, minimum_delay, block_of_change); -``` - -/ meaningful when called in public with the current block number. - -#### Parameters -| Name | Type | -| --- | --- | -| &mut self | | -| new_value | T | -| current_block_number | u32 | -| minimum_delay | u32 | -| block_of_change | u32 | - -### serialize - -```rust -serialize(self); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| self | | - -### deserialize - -```rust -deserialize(input); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| input | [Field; 3] | - -### min - -```rust -min(lhs, rhs); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| lhs | u32 | -| rhs | u32 | - -### test_min - -```rust -test_min(); -``` - -Takes no parameters. - -### test_get_current_at - -```rust -test_get_current_at(); -``` - -Takes no parameters. - -### test_get_scheduled - -```rust -test_get_scheduled(); -``` - -Takes no parameters. - -### assert_block_horizon_invariants - -```rust -assert_block_horizon_invariants(value, historical_block_number, block_horizon); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| value | &mut ScheduledValueChange<Field> | -| historical_block_number | u32 | -| block_horizon | u32 | - -### test_get_block_horizon_change_in_past - -```rust -test_get_block_horizon_change_in_past(); -``` - -Takes no parameters. - -### test_get_block_horizon_change_in_immediate_past - -```rust -test_get_block_horizon_change_in_immediate_past(); -``` - -Takes no parameters. - -### test_get_block_horizon_change_in_near_future - -```rust -test_get_block_horizon_change_in_near_future(); -``` - -Takes no parameters. - -### test_get_block_horizon_change_in_far_future - -```rust -test_get_block_horizon_change_in_far_future(); -``` - -Takes no parameters. - -### test_schedule_change_before_prior_change - -```rust -test_schedule_change_before_prior_change(); -``` - -Takes no parameters. - -### test_schedule_change_after_prior_change - -```rust -test_schedule_change_after_prior_change(); -``` - -Takes no parameters. - diff --git a/docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/state_vars/shared_mutable/shared_mutable.md b/docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/state_vars/shared_mutable/shared_mutable.md deleted file mode 100644 index efd4b7c4a7f9..000000000000 --- a/docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/state_vars/shared_mutable/shared_mutable.md +++ /dev/null @@ -1,185 +0,0 @@ -## Standalone Functions - -### new - -```rust -new(context, storage_slot); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| context | Context | -| storage_slot | Field | - -### schedule_value_change - -```rust -schedule_value_change(self, new_value); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| self | | -| new_value | T | - -### get_current_value_in_public - -```rust -get_current_value_in_public(self); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| self | | - -### get_scheduled_value_in_public - -```rust -get_scheduled_value_in_public(self); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| self | | - -### get_current_value_in_private - -```rust -get_current_value_in_private(self); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| self | | - -### historical_read_from_public_storage - -```rust -historical_read_from_public_storage(self, context); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| self | | -| context | PrivateContext | - -### get_derived_storage_slot - -```rust -get_derived_storage_slot(self); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| self | | - -### setup - -```rust -setup(private); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| private | bool | - -### create_context - -```rust -create_context(block_number, private); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| block_number | Field | -| private | bool | - -### test_get_current_value_in_public_before_change - -```rust -test_get_current_value_in_public_before_change(); -``` - -Takes no parameters. - -### test_get_current_value_in_public_at_change - -```rust -test_get_current_value_in_public_at_change(); -``` - -Takes no parameters. - -### test_get_current_value_in_public_after_change - -```rust -test_get_current_value_in_public_after_change(); -``` - -Takes no parameters. - -### test_get_scheduled_value_in_public_before_change - -```rust -test_get_scheduled_value_in_public_before_change(); -``` - -Takes no parameters. - -### test_get_scheduled_value_in_public_at_change - -```rust -test_get_scheduled_value_in_public_at_change(); -``` - -Takes no parameters. - -### test_get_scheduled_value_in_public_after_change - -```rust -test_get_scheduled_value_in_public_after_change(); -``` - -Takes no parameters. - -### test_schedule_value_change_before_change - -```rust -test_schedule_value_change_before_change(); -``` - -Takes no parameters. - -### test_schedule_value_change_at_change - -```rust -test_schedule_value_change_at_change(); -``` - -Takes no parameters. - -### test_schedule_value_change_after_change - -```rust -test_schedule_value_change_after_change(); -``` - -Takes no parameters. - -### test_get_current_value_in_private_before_change - -```rust -test_get_current_value_in_private_before_change(); -``` - -Takes no parameters. - diff --git a/docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/state_vars/shared_mutable/shared_mutable_private_getter.md b/docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/state_vars/shared_mutable/shared_mutable_private_getter.md deleted file mode 100644 index e279c62fd69a..000000000000 --- a/docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/state_vars/shared_mutable/shared_mutable_private_getter.md +++ /dev/null @@ -1,49 +0,0 @@ -## Standalone Functions - -### new - -```rust -new(context, other_contract_address, storage_slot); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| context | PrivateContext | -| other_contract_address | AztecAddress | -| storage_slot | Field | - -### get_current_value_in_private - -```rust -get_current_value_in_private(self); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| self | | - -### historical_read_from_public_storage - -```rust -historical_read_from_public_storage(self, context); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| self | | -| context | PrivateContext | - -### get_derived_storage_slot - -```rust -get_derived_storage_slot(self); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| self | | - diff --git a/docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/state_vars/storage.md b/docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/state_vars/storage.md deleted file mode 100644 index 58821394326a..000000000000 --- a/docs/docs/reference/reference/smart_contract_reference/aztec-nr/aztec/state_vars/storage.md +++ /dev/null @@ -1,13 +0,0 @@ -## Standalone Functions - -### get_storage_slot - -```rust -get_storage_slot(self); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| self | | - diff --git a/docs/docs/reference/reference/smart_contract_reference/aztec-nr/compressed-string/compressed_string.md b/docs/docs/reference/reference/smart_contract_reference/aztec-nr/compressed-string/compressed_string.md deleted file mode 100644 index f0e414e40216..000000000000 --- a/docs/docs/reference/reference/smart_contract_reference/aztec-nr/compressed-string/compressed_string.md +++ /dev/null @@ -1,78 +0,0 @@ -## Standalone Functions - -### from_string - -```rust -from_string(input_string); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| input_string | str<M> | - -### to_bytes - -```rust -to_bytes(self); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| self | | - -### serialize - -```rust -serialize(self); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| self | | - -### deserialize - -```rust -deserialize(input); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| input | [Field; N] | - -### test_short_string - -```rust -test_short_string(); -``` - -Takes no parameters. - -### test_long_string - -```rust -test_long_string(); -``` - -Takes no parameters. - -### test_long_string_work_with_too_many_fields - -```rust -test_long_string_work_with_too_many_fields(); -``` - -Takes no parameters. - -### test_long_string_fail_with_too_few_fields - -```rust -test_long_string_fail_with_too_few_fields(); -``` - -Takes no parameters. - diff --git a/docs/docs/reference/reference/smart_contract_reference/aztec-nr/compressed-string/field_compressed_string.md b/docs/docs/reference/reference/smart_contract_reference/aztec-nr/compressed-string/field_compressed_string.md deleted file mode 100644 index 63a7a35a9557..000000000000 --- a/docs/docs/reference/reference/smart_contract_reference/aztec-nr/compressed-string/field_compressed_string.md +++ /dev/null @@ -1,80 +0,0 @@ -# FieldCompressedString - -A Fixedsize Compressed String. Essentially a special version of Compressed String for practical use. - -## Fields -| Field | Type | -| --- | --- | -| value | Field | - -## Methods - -### is_eq - -```rust -FieldCompressedString::is_eq(self, other); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| self | | -| other | FieldCompressedString | - -### from_field - -```rust -FieldCompressedString::from_field(input_field); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| input_field | Field | - -### from_string - -```rust -FieldCompressedString::from_string(input_string); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| input_string | str<31> | - -### to_bytes - -```rust -FieldCompressedString::to_bytes(self); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| self | | - -## Standalone Functions - -### serialize - -```rust -serialize(self); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| self | | - -### deserialize - -```rust -deserialize(input); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| input | [Field; 1] | - diff --git a/docs/docs/reference/reference/smart_contract_reference/aztec-nr/easy-private-state/easy_private_uint.md b/docs/docs/reference/reference/smart_contract_reference/aztec-nr/easy-private-state/easy_private_uint.md deleted file mode 100644 index 4ddc9e319304..000000000000 --- a/docs/docs/reference/reference/smart_contract_reference/aztec-nr/easy-private-state/easy_private_uint.md +++ /dev/null @@ -1,53 +0,0 @@ -# EasyPrivateUint - -## Fields -| Field | Type | -| --- | --- | -| context | Context | -| set | PrivateSet<ValueNote> | -| storage_slot | Field | - -## Methods - -### new - -```rust -EasyPrivateUint::new(context, storage_slot); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| context | Context | -| storage_slot | Field | - -### add - -Very similar to `value_note::utils::increment`. - -```rust -EasyPrivateUint::add(self, addend, owner); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| self | | -| addend | u64 | -| owner | AztecAddress | - -### sub - -Very similar to `value_note::utils::decrement`. - -```rust -EasyPrivateUint::sub(self, subtrahend, owner); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| self | | -| subtrahend | u64 | -| owner | AztecAddress | - diff --git a/docs/docs/reference/reference/smart_contract_reference/aztec-nr/tests/mock/test_note.md b/docs/docs/reference/reference/smart_contract_reference/aztec-nr/tests/mock/test_note.md deleted file mode 100644 index b6a07d707eae..000000000000 --- a/docs/docs/reference/reference/smart_contract_reference/aztec-nr/tests/mock/test_note.md +++ /dev/null @@ -1,123 +0,0 @@ -# TestNote - -## Fields -| Field | Type | -| --- | --- | -| header | NoteHeader | -| value | Field | - -## Methods - -### new - -```rust -TestNote::new(value); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| value | Field | - -## Standalone Functions - -### serialize_content - -```rust -serialize_content(self); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| self | | - -### deserialize_content - -```rust -deserialize_content(fields); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| fields | [Field; TEST_NOTE_LENGTH] | - -### compute_note_content_hash - -```rust -compute_note_content_hash(self); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| self | | - -### get_header - -```rust -get_header(self); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| self | | - -### set_header - -```rust -set_header(&mut self, header); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| &mut self | | -| header | NoteHeader | - -### get_note_type_id - -```rust -get_note_type_id(); -``` - -Takes no parameters. - -### compute_nullifier - -```rust -compute_nullifier(self, _context); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| self | | -| _context | &mut PrivateContext | - -### compute_nullifier_without_context - -```rust -compute_nullifier_without_context(self); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| self | | - -### broadcast - -```rust -broadcast(self, context, slot); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| self | | -| context | &mut PrivateContext | -| slot | Field | - diff --git a/docs/docs/reference/reference/smart_contract_reference/aztec-nr/tests/note_getter_test.md b/docs/docs/reference/reference/smart_contract_reference/aztec-nr/tests/note_getter_test.md deleted file mode 100644 index 41bd9e57380f..000000000000 --- a/docs/docs/reference/reference/smart_contract_reference/aztec-nr/tests/note_getter_test.md +++ /dev/null @@ -1,58 +0,0 @@ -## Standalone Functions - -### sets_note_manually_and_fetches_it - -```rust -sets_note_manually_and_fetches_it(); -``` - -Takes no parameters. - -### cannot_return_zero_notes - -```rust -cannot_return_zero_notes(); -``` - -Takes no parameters. - -### mismatched_address - -```rust -mismatched_address(); -``` - -Takes no parameters. - -### mismatched_storage_slot - -```rust -mismatched_storage_slot(); -``` - -Takes no parameters. - -### invalid_selector - -```rust -invalid_selector(); -``` - -Takes no parameters. - -### invalid_note_order - -```rust -invalid_note_order(); -``` - -Takes no parameters. - -### sparse_notes_array - -```rust -sparse_notes_array(); -``` - -Takes no parameters. - diff --git a/docs/docs/reference/reference/smart_contract_reference/aztec-nr/value-note/balance_utils.md b/docs/docs/reference/reference/smart_contract_reference/aztec-nr/value-note/balance_utils.md deleted file mode 100644 index 95a96dbc6a16..000000000000 --- a/docs/docs/reference/reference/smart_contract_reference/aztec-nr/value-note/balance_utils.md +++ /dev/null @@ -1,25 +0,0 @@ -## Standalone Functions - -### get_balance - -```rust -get_balance(set); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| set | PrivateSet<ValueNote> | - -### get_balance_with_offset - -```rust -get_balance_with_offset(set, offset); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| set | PrivateSet<ValueNote> | -| offset | u32 | - diff --git a/docs/docs/reference/reference/smart_contract_reference/aztec-nr/value-note/filter.md b/docs/docs/reference/reference/smart_contract_reference/aztec-nr/value-note/filter.md deleted file mode 100644 index 15607ea4656b..000000000000 --- a/docs/docs/reference/reference/smart_contract_reference/aztec-nr/value-note/filter.md +++ /dev/null @@ -1,14 +0,0 @@ -## Standalone Functions - -### filter_notes_min_sum - -```rust -filter_notes_min_sum(notes, min_sum); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| notes | [Option<ValueNote>; MAX_NOTE_HASH_READ_REQUESTS_PER_CALL] | -| min_sum | Field | - diff --git a/docs/docs/reference/reference/smart_contract_reference/aztec-nr/value-note/utils.md b/docs/docs/reference/reference/smart_contract_reference/aztec-nr/value-note/utils.md deleted file mode 100644 index 320355e8bc0f..000000000000 --- a/docs/docs/reference/reference/smart_contract_reference/aztec-nr/value-note/utils.md +++ /dev/null @@ -1,75 +0,0 @@ -## Standalone Functions - -### create_note_getter_options_for_decreasing_balance - -```rust -create_note_getter_options_for_decreasing_balance(amount); -``` - -Pick the fewest notes whose sum is equal to or greater than `amount`. - -#### Parameters -| Name | Type | -| --- | --- | -| amount | Field | - -### increment - -```rust -increment(balance, amount, recipient); -``` - -Inserts it to the recipient's set of notes. - -#### Parameters -| Name | Type | -| --- | --- | -| balance | PrivateSet<ValueNote> | -| amount | Field | -| recipient | AztecAddress | - -### decrement - -```rust -decrement(balance, amount, owner); -``` - -Fail if the sum of the selected notes is less than the amount. - -#### Parameters -| Name | Type | -| --- | --- | -| balance | PrivateSet<ValueNote> | -| amount | Field | -| owner | AztecAddress | - -### decrement_by_at_most - -```rust -decrement_by_at_most(balance, max_amount, owner); -``` - -// It returns the decremented amount, which should be less than or equal to max_amount. - -#### Parameters -| Name | Type | -| --- | --- | -| balance | PrivateSet<ValueNote> | -| max_amount | Field | -| owner | AztecAddress | - -### destroy_note - -```rust -destroy_note(balance, owner, note); -``` - -Returns the value of the destroyed note. - -#### Parameters -| Name | Type | -| --- | --- | -| balance | PrivateSet<ValueNote> | -| owner | AztecAddress | -| note | ValueNote | - diff --git a/docs/docs/reference/reference/smart_contract_reference/aztec-nr/value-note/value_note.md b/docs/docs/reference/reference/smart_contract_reference/aztec-nr/value-note/value_note.md deleted file mode 100644 index 9e836ccdb291..000000000000 --- a/docs/docs/reference/reference/smart_contract_reference/aztec-nr/value-note/value_note.md +++ /dev/null @@ -1,72 +0,0 @@ -# ValueNote - -## Fields -| Field | Type | -| --- | --- | -| value | Field | -| owner | AztecAddress | -| randomness | Field | - -## Methods - -### new - -```rust -ValueNote::new(value, owner); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| value | Field | -| owner | AztecAddress | - -## Standalone Functions - -### compute_nullifier - -```rust -compute_nullifier(self, context); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| self | | -| context | &mut PrivateContext | - -### compute_nullifier_without_context - -```rust -compute_nullifier_without_context(self); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| self | | - -### broadcast - -```rust -broadcast(self, context, slot); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| self | | -| context | &mut PrivateContext | -| slot | Field | - -### serialize - -```rust -serialize(self); -``` - -#### Parameters -| Name | Type | -| --- | --- | -| self | | - From 462becb9be63fa492bbfffaab24cc4d805c5e111 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Pedro=20Sousa?= Date: Fri, 10 May 2024 10:29:46 +0100 Subject: [PATCH 7/8] Update boxes/README.md Co-authored-by: James Zaki --- boxes/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/boxes/README.md b/boxes/README.md index e1c4607d1d62..f7adc35ecb10 100644 --- a/boxes/README.md +++ b/boxes/README.md @@ -12,7 +12,7 @@ Boxes include the sandbox installation script and its start command. By choosing Because of the CI/CD nature of the monorepo, every box is tested against every merge on master. This drastically reduces their maintenance cost. Thus, some scripting is needed to make sure the user gets a working repository after "unboxing". -Most of the logic is in the `bin.js` file, where `commander` commands stuff. Here's a brief description on what the script exactly does: +Most of the logic is in the `bin.js` file, where `commander` commands stuff. The script does the following: - Prompts the user for options and commands - Inits some global variables such as a logger, a getter for the github repositories, the latest stable versions and tags, etc From 54666851e181c392430319bc18336a0011a57873 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Pedro=20Sousa?= Date: Fri, 10 May 2024 10:30:35 +0100 Subject: [PATCH 8/8] Update docs/docs/developers/getting_started/quickstart.md Co-authored-by: James Zaki --- docs/docs/developers/getting_started/quickstart.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/docs/developers/getting_started/quickstart.md b/docs/docs/developers/getting_started/quickstart.md index 6cc067c01517..8ad154578a90 100644 --- a/docs/docs/developers/getting_started/quickstart.md +++ b/docs/docs/developers/getting_started/quickstart.md @@ -25,7 +25,7 @@ You can also [install the sandbox manually](../sandbox/references/sandbox-refere ### Run the `npx` script -With the node installation, you now should have `npm` and be able to run `npx` scripts. You can do that running: +With the node installation, you now should have `npm` and be able to run `npx` scripts. You can do that by running: ```bash npx create-aztec-app