Skip to content

Commit 434cafd

Browse files
authored
Merge pull request #38 from AztecProtocol/update-examples-to-v5.0.0-rc.1
Update all examples to Aztec v5.0.0-rc.1
2 parents 69fefc3 + cf7f073 commit 434cafd

60 files changed

Lines changed: 3161 additions & 12322 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
name: Custom Note Tests
2+
3+
on:
4+
push:
5+
branches:
6+
- next
7+
pull_request:
8+
branches:
9+
- next
10+
paths:
11+
- "custom-note/**"
12+
- ".github/workflows/custom-note-tests.yml"
13+
workflow_dispatch:
14+
15+
jobs:
16+
custom-note-tests:
17+
name: Custom Note Tests
18+
runs-on: ubuntu-latest
19+
env:
20+
AZTEC_VERSION: 5.0.0-rc.1
21+
22+
steps:
23+
- name: Checkout repository
24+
uses: actions/checkout@v5
25+
26+
- name: Set up Node.js
27+
uses: actions/setup-node@v4
28+
with:
29+
node-version: "22"
30+
31+
- name: Enable Corepack for Yarn
32+
run: corepack enable
33+
34+
- name: Install Aztec CLI
35+
run: |
36+
INSTALL_URL="https://install.aztec.network/${{ env.AZTEC_VERSION }}/"
37+
curl -sL $INSTALL_URL > tmp.sh
38+
VERSION=${{ env.AZTEC_VERSION }} bash tmp.sh <<< yes "yes"
39+
40+
- name: Update path
41+
run: |
42+
echo "$HOME/.aztec/current/bin" >> $GITHUB_PATH
43+
echo "$HOME/.aztec/current/internal-bin" >> $GITHUB_PATH
44+
echo "$HOME/.aztec/current/node_modules/.bin" >> $GITHUB_PATH
45+
echo "$HOME/.aztec/bin" >> $GITHUB_PATH
46+
47+
# custom-note is a contract-only example — compiling it is the smoke test
48+
# (no local network or JS dependencies required).
49+
- name: Compile custom-note contract
50+
working-directory: custom-note
51+
run: |
52+
ulimit -s unlimited
53+
script -e -c "aztec compile"

.github/workflows/note-send-proof-tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
runs-on: ubuntu-latest
1919
env:
2020
AZTEC_ENV: local-network
21-
AZTEC_VERSION: 4.3.0
21+
AZTEC_VERSION: 5.0.0-rc.1
2222

2323
steps:
2424
- name: Checkout repository

.github/workflows/prediction-market-tests.yml

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
runs-on: ubuntu-latest
1919
env:
2020
AZTEC_ENV: local-network
21-
AZTEC_VERSION: 4.3.0
21+
AZTEC_VERSION: 5.0.0-rc.1
2222

2323
steps:
2424
- name: Checkout repository
@@ -29,10 +29,8 @@ jobs:
2929
with:
3030
node-version: "22"
3131

32-
- name: Setup Bun
33-
uses: oven-sh/setup-bun@v2
34-
with:
35-
bun-version: 1.1.36
32+
- name: Enable Corepack for Yarn
33+
run: corepack enable
3634

3735
- name: Install Foundry
3836
uses: foundry-rs/foundry-toolchain@v1
@@ -67,7 +65,7 @@ jobs:
6765
6866
- name: Install project dependencies
6967
working-directory: prediction-market
70-
run: bun install
68+
run: yarn install
7169

7270
- name: Run Noir unit tests
7371
working-directory: prediction-market
@@ -85,7 +83,7 @@ jobs:
8583
8684
- name: Run end-to-end tests
8785
working-directory: prediction-market
88-
run: bun test
86+
run: yarn test
8987
timeout-minutes: 15
9088

9189
- name: Upload test results if failed

.github/workflows/recursive-verification-tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
runs-on: ubuntu-latest
1919
env:
2020
AZTEC_ENV: local-network
21-
AZTEC_VERSION: 4.3.0
21+
AZTEC_VERSION: 5.0.0-rc.1
2222

2323
steps:
2424
- name: Checkout repository

.github/workflows/test-wallet-webapp-tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
name: Test Wallet Webapp Tests
1818
runs-on: ubuntu-latest
1919
env:
20-
AZTEC_VERSION: 4.3.0
20+
AZTEC_VERSION: 5.0.0-rc.1
2121

2222
steps:
2323
- name: Checkout repository

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,4 @@ target
22
.DS_Store
33
ivc
44
node_modules
5+
.playwright-mcp

CLAUDE.md

Lines changed: 30 additions & 71 deletions
Original file line numberDiff line numberDiff line change
@@ -21,28 +21,23 @@ This is a collection of Aztec smart contract examples written in Noir, designed
2121

2222
```
2323
aztec-examples/
24-
├── recursive_verification/ # Noir proof verification in Aztec contracts example
24+
├── custom-note/ # Defining a custom private note type
25+
├── note-send-proof/ # Off-chain note-hash proofs + Vite frontend
26+
│ ├── circuits/ # Vanilla Noir circuit (aztec-nargo)
27+
│ ├── uint-note/ # Local copy of the uint-note note library
28+
│ ├── sample-contract/ # Aztec contract under test
29+
│ ├── scripts/ # Proof/data generation (TypeScript)
30+
│ ├── tests/ # Jest integration tests
31+
│ └── vite/ # React frontend
32+
├── prediction-market/ # Private CSMM prediction market (uint-note partial notes)
33+
├── recursive_verification/ # Verify Noir UltraHonk proofs inside an Aztec contract
2534
│ ├── circuit/ # Noir circuit that generates proofs (proves x ≠ y)
26-
│ ├── contract/ # Aztec contract that verifies Noir proofs
27-
│ ├── scripts/ # TypeScript utilities for proof generation and deployment
28-
│ ├── tests/ # Integration test suite
29-
│ ├── data.json # Generated proof data (created by `yarn data`)
30-
│ ├── README.md # Comprehensive documentation
31-
│ ├── CLAUDE.md # Project-specific AI guidance
32-
│ ├── EXPLAINER.md # Technical deep-dive explanation
33-
│ └── run-tests.sh # Local test runner script
34-
├── starter-token/ # Token contract example with start-here and reference implementations
35-
│ ├── start-here/ # Template for implementing a token
36-
│ │ ├── contract/ # Noir contract code
37-
│ │ ├── external-call-contract/ # Cross-contract calls
38-
│ │ └── ts/ # TypeScript client code
39-
│ └── reference/ # Complete reference implementation
40-
│ ├── contract/ # Full token implementation
41-
│ ├── external-call-contract/ # Cross-contract example
42-
│ └── ts/ # TypeScript client
43-
└── .github/ # CI/CD configuration
44-
└── workflows/
45-
└── recursive-verification-tests.yml # Automated testing workflow
35+
│ ├── contract/ # Aztec contract that verifies Noir proofs
36+
│ ├── scripts/ # TypeScript utilities for proof generation and deployment
37+
│ ├── tests/ # Vitest integration test suite
38+
│ └── data.json # Generated proof data (created by `yarn data`)
39+
├── test-wallet-webapp/ # Vite/React app: embedded wallet + deploy + tx
40+
└── .github/workflows/ # CI: one *-tests.yml per tested example
4641
```
4742

4843
## Development Commands
@@ -54,7 +49,7 @@ aztec-examples/
5449
bash -i <(curl -s https://install.aztec.network)
5550

5651
# Set specific version (examples may require different versions)
57-
aztec-up 4.3.0 # For recursive_verification
52+
aztec-up 5.0.0-rc.1 # For recursive_verification
5853
```
5954

6055
### Building Contracts
@@ -71,7 +66,7 @@ yarn ccc # Compiles contract and generates TypeScript bindings
7166

7267
### Building Vanilla Noir Circuits
7368

74-
The compatible `nargo` (version 1.0.0-beta.21) is bundled with the Aztec CLI at `~/.aztec/current/bin/aztec-nargo`. As of Aztec v4.3.0, bundled binaries are exposed only under their `aztec-` prefixed names — invoke `aztec-nargo` (a drop-in for `nargo`) rather than the bare name, which is no longer on `PATH`. Ensure `~/.aztec/current/bin` is on your `PATH` (the Aztec installer adds this automatically).
69+
The compatible `nargo` (version 1.0.0-beta.22) is bundled with the Aztec CLI at `~/.aztec/current/bin/aztec-nargo`. As of Aztec v4.3.0, bundled binaries are exposed only under their `aztec-` prefixed names — invoke `aztec-nargo` (a drop-in for `nargo`) rather than the bare name, which is no longer on `PATH`. Ensure `~/.aztec/current/bin` is on your `PATH` (the Aztec installer adds this automatically).
7570

7671
```bash
7772
# Verify nargo is available
@@ -177,22 +172,6 @@ yarn test
177172
cd circuit && aztec-nargo test
178173
```
179174

180-
### Starter Token Example
181-
182-
```bash
183-
# Navigate to reference implementation
184-
cd starter-token/reference
185-
186-
# Build the contract
187-
cd contract && aztec compile && cd ..
188-
189-
# Build and run TypeScript client
190-
cd ts
191-
npm install
192-
npm run build
193-
npm start
194-
```
195-
196175
## Contract Architecture
197176

198177
### Aztec Contract Structure
@@ -216,19 +195,10 @@ The recursive verification example demonstrates:
216195

217196
- **Off-chain proof generation**: Noir circuits compiled and executed with Barretenberg
218197
- **On-chain verification**: Using `bb_proof_verification::verify_honk_proof` in Aztec contracts
219-
- **UltraHonk proving system**: Generates proofs with 508 field elements, verification keys with 115 fields
198+
- **UltraHonk proving system**: Generates proofs with 458 field elements, verification keys with 115 fields
220199
- **VK Hash Storage**: Verification key hash stored in `PublicImmutable` storage, readable from private context
221200
- **Public state management**: Using `PublicMutable` for per-user counters
222201

223-
### Token Pattern (starter-token)
224-
225-
The token example showcases:
226-
227-
- **Dual balance system**: Public and private token balances
228-
- **State management**: Using `PublicMutable` and `Map` for storage
229-
- **Access control**: Owner-based permissions for minting
230-
- **Cross-contract calls**: External contract interactions
231-
232202
### Testing Pattern
233203

234204
Tests use the Testing Execution Environment (TXE):
@@ -256,13 +226,13 @@ Aztec contracts specify dependencies in `Nargo.toml`:
256226

257227
```toml
258228
[dependencies]
259-
aztec = { git = "https://github.com/AztecProtocol/aztec-packages/", tag = "vX.X.X", directory = "noir-projects/aztec-nr/aztec" }
260-
easy_private_state = { git = "https://github.com/AztecProtocol/aztec-packages/", tag = "vX.X.X", directory = "noir-projects/aztec-nr/easy-private-state" }
229+
aztec = { git = "https://github.com/AztecProtocol/aztec-nr/", tag = "v5.0.0-rc.1", directory = "aztec" }
230+
uint_note = { git = "https://github.com/AztecProtocol/aztec-nr/", tag = "v5.0.0-rc.1", directory = "uint-note" }
261231
```
262232

263233
**Version Compatibility**: All examples use the same Aztec version:
264234

265-
- All examples: v4.3.0
235+
- All examples: v5.0.0-rc.1
266236

267237
### JavaScript/TypeScript Dependencies
268238

@@ -276,32 +246,21 @@ TypeScript projects use:
276246
### Runtime Requirements
277247

278248
- **Node.js**: v22+ for all TypeScript examples
279-
- **yarn**: Package manager for recursive_verification example
280-
- **npm**: Package manager for starter-token example
249+
- **yarn**: Package manager used across the TypeScript examples
281250
- **Docker**: Required for running Aztec local network
282251
- **Memory**: 8GB+ RAM recommended for proof generation
283252

284253
## CI/CD
285254

286-
The repository includes GitHub Actions workflows for automated testing:
287-
288-
### recursive-verification-tests.yml
289-
290-
Runs on:
291-
292-
- Push to next branch
293-
- Pull requests modifying `recursive_verification/**`
294-
- Manual workflow dispatch
255+
GitHub Actions workflows automatically test examples on pull requests to `next` (and pushes to `next`). Each tested example has its own workflow under `.github/workflows/`:
295256

296-
Steps:
257+
- `recursive-verification-tests.yml`
258+
- `prediction-market-tests.yml`
259+
- `note-send-proof-tests.yml`
260+
- `test-wallet-webapp-tests.yml`
261+
- `custom-note-tests.yml`
297262

298-
1. Sets up Node.js (v22) and yarn
299-
2. Installs Aztec CLI
300-
3. Starts Aztec local network
301-
4. Compiles circuits and contracts
302-
5. Generates proof data
303-
6. Runs integration tests
304-
7. Uploads test artifacts on failure
263+
Each workflow installs the pinned Aztec CLI (`AZTEC_VERSION`), starts a local network when the example's tests need one, compiles circuits/contracts, and runs that example's tests (uploading logs on failure). The `custom-note` workflow is contract-only, so it just compiles.
305264

306265
## Common Issues and Solutions
307266

README.md

Lines changed: 18 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ A collection of example Aztec smart contracts and circuits written in Noir, desi
66

77
## Overview
88

9-
This repository contains practical examples demonstrating various features of Aztec's zero-knowledge smart contract platform, from basic token implementations to advanced proof verification patterns.
9+
This repository contains practical examples demonstrating various features of Aztec's zero-knowledge smart contract platform, from custom notes to advanced proof verification patterns.
1010

1111
You can find additional examples in the Aztec monorepo [docs examples folder](https://github.com/AztecProtocol/aztec-packages/tree/next/docs/examples), including:
1212

@@ -16,25 +16,27 @@ You can find additional examples in the Aztec monorepo [docs examples folder](ht
1616

1717
## Examples
1818

19-
### 1. [Recursive Verification](./recursive_verification)
19+
All examples target **Aztec v5.0.0-rc.1**.
2020

21-
**Aztec Version**: 4.3.0
21+
### [custom-note](./custom-note)
2222

23-
Demonstrates how to verify Noir circuit proofs within Aztec smart contracts using the UltraHonk proving system. This example showcases:
23+
Defining a custom private note type with the `#[note]` macro and inserting it from a contract.
2424

25-
- Zero-knowledge proof generation from Noir circuits
26-
- On-chain proof verification in private smart contracts
27-
- Private state management using `EasyPrivateUint`
28-
- Integration between off-chain proving and on-chain verification
25+
### [note-send-proof](./note-send-proof)
2926

30-
**Key features**:
27+
Creating private notes and proving facts about their note hashes off-chain (with `bb.js` / `noir_js`), then verifying them on-chain. Includes a Vite/React frontend.
3128

32-
- Circuit that proves two values are not equal (x ≠ y)
33-
- Smart contract that verifies proofs and maintains private counters
34-
- Comprehensive test suite and GitHub Actions CI/CD pipeline
35-
- TypeScript utilities for proof generation and contract deployment
29+
### [prediction-market](./prediction-market)
3630

37-
[View README](./recursive_verification/README.md)
31+
A private prediction market built on a constant-sum market maker (CSMM), using `uint_note` partial notes for private deposits, withdrawals, and outcome purchases.
32+
33+
### [recursive_verification](./recursive_verification)
34+
35+
Verifying Noir UltraHonk proofs _inside_ an Aztec contract: off-chain proof generation, on-chain verification with `bb_proof_verification::verify_honk_proof`, VK-hash storage in `PublicImmutable`, and per-user private counters.
36+
37+
### [test-wallet-webapp](./test-wallet-webapp)
38+
39+
A minimal Vite/React app that connects to an embedded Aztec wallet/PXE, creates an initializerless Schnorr account, deploys a contract, and sends transactions.
3840

3941
## Quick Start
4042

@@ -45,7 +47,7 @@ Demonstrates how to verify Noir circuit proofs within Aztec smart contracts usin
4547
bash -i <(curl -s https://install.aztec.network)
4648

4749
# Set specific Aztec version (if needed)
48-
aztec-up 4.3.0
50+
aztec-up 5.0.0-rc.1
4951
```
5052

5153
## Development Workflow
@@ -63,7 +65,7 @@ Each example includes its own test suite:
6365
```bash
6466
# Recursive Verification tests
6567
cd recursive_verification
66-
bun test
68+
yarn test
6769

6870
# Run with CI-like environment
6971
./run-tests.sh

account-contract/.gitignore

Lines changed: 0 additions & 1 deletion
This file was deleted.

account-contract/.yarnrc.yml

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)