Skip to content

Migrate examples to Aztec v3.0.0-devnet.20251212#21

Merged
critesjosh merged 4 commits intomainfrom
jc/update-examples-v3-devnet-20251212-clean
Jan 14, 2026
Merged

Migrate examples to Aztec v3.0.0-devnet.20251212#21
critesjosh merged 4 commits intomainfrom
jc/update-examples-v3-devnet-20251212-clean

Conversation

@critesjosh
Copy link
Copy Markdown
Contributor

Summary

  • Update custom-note, account-contract, test-wallet-webapp, and note-send-proof examples to use Aztec v3.0.0-devnet.20251212
  • All contracts compile successfully and tests pass

Changes by Project

custom-note

  • Update Nargo.toml to v3.0.0-devnet.20251212
  • Rename contract to CustomNoteContract to avoid naming conflict with CustomNote struct
  • Update storage to use Owned<PrivateSet<CustomNote, Context>, Context> pattern
  • Add randomness field to CustomNote for privacy
  • Use .deliver(MessageDelivery.UNCONSTRAINED_ONCHAIN) for note delivery

account-contract

  • Update Nargo.toml to v3.0.0-devnet.20251212, remove external poseidon dependency
  • Change imports from dep::aztec to aztec
  • Use poseidon2_hash from aztec::protocol_types::hash
  • Update TypeScript imports for v3 API paths
  • Fix DeployMethod callback signature: (instance, wallet) => ... instead of (address) => ...

test-wallet-webapp

  • Update all @aztec/* dependencies to 3.0.0-devnet.20251212

note-send-proof

  • Major migration from v2.0.3 to v3.0.0-devnet.20251212
  • Rewrite contract to use BalanceSet pattern from aztec-nr
  • Update TypeScript tests for v3 TestWallet API
  • Add postinstall script to workaround bb.js native module path issue
  • Switch from npm to yarn

Test plan

  • aztec compile succeeds for all Noir contracts
  • aztec test passes for custom-note (0 tests)
  • aztec test passes for account-contract (0 tests)
  • yarn build succeeds for test-wallet-webapp
  • yarn test passes for note-send-proof (3 tests)
  • npx tsx ts/deploy-account-contract.ts deploys successfully

🤖 Generated with Claude Code

Update four example projects to use the latest Aztec devnet version:

- custom-note: Update contract to use Owned<PrivateSet> pattern, add
  randomness to CustomNote, use .deliver() for message delivery
- account-contract: Update imports from dep::aztec to aztec, use
  poseidon2_hash, fix TypeScript API for v3 DeployMethod signature
- test-wallet-webapp: Update package dependencies
- note-send-proof: Major migration from v2 to v3, rewrite contract to
  use BalanceSet pattern, add postinstall workaround for bb.js native
  module path issue, update tests to use Jest with yarn

All contracts compile and tests pass.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@critesjosh critesjosh requested a review from sklppy88 January 14, 2026 17:38
critesjosh and others added 2 commits January 14, 2026 12:42
- note-send-proof: Update from v2.0.3 to v3.0.0-devnet.20251212, use local-network instead of sandbox, use `aztec compile` instead of `aztec-nargo compile`
- test-wallet-webapp: Update from v3.0.0-devnet.5 to v3.0.0-devnet.20251212, use local-network instead of sandbox

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Use TestWallet instead of createPXEClient (removed in v3)
- Use getInitialTestAccountsData and wallet.createSchnorrAccount
- Update imports to use v3 subpaths
- Fix storage slot reference to use user_balances

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Copy link
Copy Markdown
Collaborator

@sklppy88 sklppy88 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think note send proof has lost its intended purpose with these changes

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I feel like these tests have completely changed semantically


#[private]
#[external("private")]
fn create_note_for_user(value: u128) {
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This function shouldn't be changed this much. It changes the way we test it and the purpose / meaning of the contract itself

Comment thread note-send-proof/readme.md
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The filename change makes this diff 😢

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

renamed it back to the old name :) we can rename it once its merged

…cation

This commit restores the original intent of the note-send-proof example by
implementing a custom UintNote with controlled randomness. The key changes:

- Create custom uint-note library with create_note_with_randomness function
- Use fixed randomness (6969) to enable reproducible hash computation
- Update contract to use simple storage slot instead of Map
- Update tests to verify computed hash matches on-chain hash
- Update generate_data.ts with v3 hash formula ([owner, storage_slot, randomness])
- Update README with v3 hash computation documentation
- Fix tsconfig.json moduleResolution for v3 package exports

The example now demonstrates:
1. Creating private notes with known parameters
2. Computing the note hash chain (inner -> siloed -> unique)
3. Verifying the computed hash matches what's stored on-chain

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
nonceGenerator,
INDEX_OF_NOTE_HASH_IN_TRANSACTION
);
test('should create note with different value and verify hash', async () => {
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can probably refactor this to use it.each given most if not all of this is the same, but no need to do in this pr

@critesjosh critesjosh merged commit 42c7773 into main Jan 14, 2026
2 checks passed
@critesjosh critesjosh deleted the jc/update-examples-v3-devnet-20251212-clean branch January 14, 2026 18:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants