Skip to content

fix(docs): fix token contract tutorial setup issues#22195

Merged
AztecBot merged 1 commit into
nextfrom
josh/fix-token-tutorial-docs
Apr 1, 2026
Merged

fix(docs): fix token contract tutorial setup issues#22195
AztecBot merged 1 commit into
nextfrom
josh/fix-token-tutorial-docs

Conversation

@critesjosh

@critesjosh critesjosh commented Mar 31, 2026

Copy link
Copy Markdown
Contributor

Summary

Fixes several issues in the Private Token Contract tutorial discovered during a walkthrough:

  • Add missing @aztec/wallets package to the yarn add command — the tutorial's index.ts imports from @aztec/wallets/embedded but the install command didn't include it, causing a Cannot find module error (blocker)
  • Use aztec new instead of aztec init — aligns with all other tutorials and scaffolds the correct type = "contract" project structure
  • Fix Nargo.toml path referencesaztec new creates a flat structure, so references should be Nargo.toml not bob_token_contract/Nargo.toml (since the user has already cd'd into the project)
  • Clarify balance_set dependency instruction — explicitly say to replace the [dependencies] section rather than implying it's already present
  • Improve tsx tip — explain that npx auto-installs it and how to install explicitly

Changes applied to both the source docs and the v4.2.0-aztecnr-rc.2 versioned docs.

Verified

Followed the updated tutorial end-to-end: aztec new, compile, codegen, deploy, and ran the full interaction script (public mint, public transfer, public-to-private, private transfer, private-to-public, private mint). All operations succeeded with correct balances.

Test plan

  • aztec new bob_token creates correct project structure
  • yarn add with all four packages installs without errors
  • aztec compile succeeds
  • aztec codegen generates BobToken.ts
  • npx tsx index.ts deploys and runs all operations successfully

@critesjosh critesjosh requested a review from a team March 31, 2026 17:47
## Summary

Fixes several issues in the Private Token Contract tutorial discovered during a walkthrough:

- **Add missing `@aztec/wallets` package** to the `yarn add` command — the tutorial's `index.ts` imports from `@aztec/wallets/embedded` but the install command didn't include it, causing a `Cannot find module` error (blocker)
- **Use `aztec new` instead of `aztec init`** — aligns with all other tutorials and scaffolds the correct `type = "contract"` project structure
- **Fix `Nargo.toml` path references** — `aztec new` creates a flat structure, so references should be `Nargo.toml` not `bob_token_contract/Nargo.toml` (since the user has already cd'd into the project)
- **Clarify `balance_set` dependency instruction** — explicitly say to replace the `[dependencies]` section rather than implying it's already present
- **Improve `tsx` tip** — explain that `npx` auto-installs it and how to install explicitly

Changes applied to both the source docs and the v4.2.0-aztecnr-rc.2 versioned docs.

## Verified

Followed the updated tutorial end-to-end: `aztec new`, compile, codegen, deploy, and ran the full interaction script (public mint, public transfer, public-to-private, private transfer, private-to-public, private mint). All operations succeeded with correct balances.

## Test plan

- [x] `aztec new bob_token` creates correct project structure
- [x] `yarn add` with all four packages installs without errors
- [x] `aztec compile` succeeds
- [x] `aztec codegen` generates `BobToken.ts`
- [x] `npx tsx index.ts` deploys and runs all operations successfully
@AztecBot AztecBot force-pushed the josh/fix-token-tutorial-docs branch from 43b1617 to c049adf Compare April 1, 2026 13:19
@AztecBot AztecBot added this pull request to the merge queue Apr 1, 2026
Merged via the queue into next with commit 1aea470 Apr 1, 2026
19 checks passed
@AztecBot AztecBot deleted the josh/fix-token-tutorial-docs branch April 1, 2026 13:54
@AztecBot

AztecBot commented Apr 1, 2026

Copy link
Copy Markdown
Collaborator

❌ Failed to cherry-pick to v4-next due to conflicts. (🤖) View backport run.

critesjosh added a commit that referenced this pull request Apr 1, 2026
…to v4-next) (#22225)

## Summary

Backport of #22195
to v4-next.

Fixes several issues in the Private Token Contract tutorial:
- Add missing `@aztec/wallets` package to the `yarn add` command
- Use `aztec new` instead of `aztec init`
- Fix `Nargo.toml` path references
- Clarify `balance_set` dependency instruction
- Improve `tsx` tip

## Conflict resolution

The versioned docs file
(`docs/developer_versioned_docs/version-v4.2.0-aztecnr-rc.2/.../token_contract.md`)
was deleted on v4-next but modified by the PR. Resolution: accepted the
deletion since the versioned docs don't exist on this branch. The main
docs file (`docs/docs-developers/.../token_contract.md`) applied
cleanly.

ClaudeBox log: https://claudebox.work/s/e987e6392893261f?run=1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants