fix(docs): fix token contract tutorial setup issues#22195
Merged
Conversation
sklppy88
approved these changes
Apr 1, 2026
9617a85 to
43b1617
Compare
## 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
43b1617 to
c049adf
Compare
Collaborator
|
❌ Failed to cherry-pick to |
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes several issues in the Private Token Contract tutorial discovered during a walkthrough:
@aztec/walletspackage to theyarn addcommand — the tutorial'sindex.tsimports from@aztec/wallets/embeddedbut the install command didn't include it, causing aCannot find moduleerror (blocker)aztec newinstead ofaztec init— aligns with all other tutorials and scaffolds the correcttype = "contract"project structureNargo.tomlpath references —aztec newcreates a flat structure, so references should beNargo.tomlnotbob_token_contract/Nargo.toml(since the user has already cd'd into the project)balance_setdependency instruction — explicitly say to replace the[dependencies]section rather than implying it's already presenttsxtip — explain thatnpxauto-installs it and how to install explicitlyChanges 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_tokencreates correct project structureyarn addwith all four packages installs without errorsaztec compilesucceedsaztec codegengeneratesBobToken.tsnpx tsx index.tsdeploys and runs all operations successfully