feat(aztec)!: add counter template for aztec init#22751
Open
nchamo wants to merge 1 commit intomerge-train/fairiesfrom
Open
feat(aztec)!: add counter template for aztec init#22751nchamo wants to merge 1 commit intomerge-train/fairiesfrom
nchamo wants to merge 1 commit intomerge-train/fairiesfrom
Conversation
critesjosh
reviewed
Apr 23, 2026
| #[storage] | ||
| struct Storage<Context> { | ||
| // Each owner has their own counter, stored as private encrypted notes. | ||
| // Owned: only the owner can interact with their own counter. |
Contributor
There was a problem hiding this comment.
it might be worth clarifying that "ownership" is achieved via readability (encryption) rather than access control (e.g. "Owned dictates who will receive the encrypted notes")
Contributor
Author
There was a problem hiding this comment.
You are right, definitely worth mentioning
dbanks12
reviewed
Apr 23, 2026
Contributor
dbanks12
left a comment
There was a problem hiding this comment.
LGTM once @critesjosh and others are happy!
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.
Why we are doing this
The default project scaffolded by
aztec initwas too minimal -- it created a blank contract with no callable functions, making it hard for new developers to understand how Aztec contracts work.How it worked before
aztec initcreated a workspace with a blank contract (emptyimplblock) and a basic testaztec new <name>created the same blank contract, either as a new project or adding to an existing workspaceWhat changes
aztec newstays the same -- it scaffolds a blank contract, either as a new standalone project or as a new crate added to an existing workspaceaztec initnow scaffolds a Counter example with:Owned<BalanceSet>for encrypted stateconstructor,increment,get_counter) with short docs explaining privacy model and execution contextTechnical details
We used to build the blank project directly from the bash script. Now we have templates we can simply copy, instead of containing the entire code inside the .sh file
What doesn't change
The existing Counter tutorial docs remain valid since they use
aztec new, which still scaffolds the blank template.Feedback wanted
Please let me know if you have any suggestions on the template content, comments or anything else.
Fixes F-581