-
Notifications
You must be signed in to change notification settings - Fork 585
docs: update Aztec.nr contract structure and state variables #19726
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: next
Are you sure you want to change the base?
Conversation
docs/docs-developers/docs/aztec-nr/framework-description/contract_structure.md
Outdated
Show resolved
Hide resolved
docs/docs-developers/docs/aztec-nr/framework-description/state_variables.md
Outdated
Show resolved
Hide resolved
docs/docs-developers/docs/aztec-nr/framework-description/state_variables.md
Outdated
Show resolved
Hide resolved
docs/docs-developers/docs/aztec-nr/framework-description/state_variables.md
Outdated
Show resolved
Hide resolved
docs/docs-developers/docs/aztec-nr/framework-description/state_variables.md
Show resolved
Hide resolved
docs/docs-developers/docs/aztec-nr/framework-description/state_variables.md
Outdated
Show resolved
Hide resolved
docs/docs-developers/docs/aztec-nr/framework-description/state_variables.md
Outdated
Show resolved
Hide resolved
docs/docs-developers/docs/aztec-nr/framework-description/state_variables.md
Show resolved
Hide resolved
critesjosh
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some minor suggestions. I think having Claude do a pass on your PR would helpful as well to catch grammatical errors. I suggest telling it to use the guidelines defined in docs/CLAUDE.md
…act_structure.md Co-authored-by: josh crites <[email protected]>
…_variables.md Co-authored-by: josh crites <[email protected]>
…_variables.md Co-authored-by: josh crites <[email protected]>
…_variables.md Co-authored-by: josh crites <[email protected]>
noir-projects/noir-contracts/contracts/test/test_contract/src/main.nr
Outdated
Show resolved
Hide resolved
docs/docs-developers/docs/aztec-nr/framework-description/contract_structure.md
Outdated
Show resolved
Hide resolved
docs/docs-developers/docs/aztec-nr/framework-description/contract_structure.md
Outdated
Show resolved
Hide resolved
docs/docs-developers/docs/aztec-nr/framework-description/contract_structure.md
Outdated
Show resolved
Hide resolved
docs/docs-developers/docs/aztec-nr/framework-description/contract_structure.md
Outdated
Show resolved
Hide resolved
docs/docs-developers/docs/aztec-nr/framework-description/contract_structure.md
Outdated
Show resolved
Hide resolved
docs/docs-developers/docs/aztec-nr/framework-description/contract_structure.md
Outdated
Show resolved
Hide resolved
|
Also have Claude do a pass, following the guidelines in docs/CLAUDE.md for grammar and style consistency |
docs/docs-developers/docs/aztec-nr/framework-description/contract_structure.md
Show resolved
Hide resolved
noir-projects/noir-contracts/contracts/test/pending_note_hashes_contract/src/main.nr
Show resolved
Hide resolved
docs/docs-developers/docs/aztec-nr/framework-description/contract_structure.md
Outdated
Show resolved
Hide resolved
docs/docs-developers/docs/aztec-nr/framework-description/state_variables.md
Outdated
Show resolved
Hide resolved
docs/docs-developers/docs/aztec-nr/framework-description/state_variables.md
Show resolved
Hide resolved
docs/docs-developers/docs/aztec-nr/framework-description/state_variables.md
Show resolved
Hide resolved
…main.nr Co-authored-by: josh crites <[email protected]>
…act_structure.md Co-authored-by: josh crites <[email protected]>
…act_structure.md Co-authored-by: josh crites <[email protected]>
…act_structure.md Co-authored-by: josh crites <[email protected]>
Co-authored-by: Nicolás Venturo <[email protected]>
Co-authored-by: Nicolás Venturo <[email protected]>
…act_structure.md Co-authored-by: josh crites <[email protected]>
…act_structure.md Co-authored-by: josh crites <[email protected]>
…aztec-packages into docs/nico-changes
c7b1de3 to
8d575aa
Compare
| // A private numeric value which can change over time. This value will be hidden, and only those with the secret can know its current value. | ||
| my_private_state_variable: Owned<PrivateMutable<NoteType, Context>>, | ||
| // A public numeric value which can change over time. This value will be known to everyone and is equivalent to the Solidity example above. | ||
| my_public_state_variable: Owned<PublicMutable<NoteType, Context>>, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
public mutables arent owned. also it may be confusing to call the type a NoteType since public state doesnt actually use notes
| #### Delivery Methods | ||
|
|
||
| Private notes need to be communicated to their recipients so they know the note exists and can use it. The [`NoteMessage`](https://docs.aztec.network/aztec-nr-api/nightly/noir_aztec/note/struct.notemessage) wrapper forces you to make an explicit choice about how this happens: | ||
| [ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| [ |
| } | ||
| ``` | ||
|
|
||
| In Aztec.nr, we define a [`struct`](https://noir-lang.org/docs/noir/concepts/data_types/structs) that holds _all_ state variables. This struct is called **the storage struct**, and it is identified by having the [`#[storage]` macro](https://docs.aztec.network/aztec-nr-api/nightly/noir_aztec/macros/storage/fn.storage) applied to it. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this should be a relative link to the appropriate version. wdyt about adding a preprocessing macro, something like (to include_version.js?
// New macro for API ref paths
const apiRefVersion = releaseType === "nightly" ? "nightly"
: releaseType === "devnet" ? "devnet"
: "next";
markdownContent = markdownContent.replaceAll(`#api_ref_version`, apiRefVersion); Then links could be:
"[#[storage] macro] (/aztec-nr-api/#api_ref_version/noir_aztec/macros/storage/fn.storage)"
Add Nico's detailed Aztec.nr content