Skip to content
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

chore(aztec-noir)!: rename noir-aztec to aztec-noir #2071

Merged
merged 5 commits into from
Sep 11, 2023
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions docs/docs/dev_docs/contracts/state_variables.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,15 @@ The BoolSerialisationMethods is part of the Aztec stdlib:

It contains methods that instruct its PublicState wrapper how to serialise and deserialise a boolean to and from a Field, which is the data type being saved in the public state tree.

The Aztec stdlib provides serialization methods for various common types. Check [here](https://github.com/AztecProtocol/aztec-packages/blob/master/yarn-project/noir-libs/noir-aztec/src/types/type_serialisation) for the complete list.
The Aztec stdlib provides serialization methods for various common types. Check [here](https://github.com/AztecProtocol/aztec-packages/blob/master/yarn-project/noir-libs/aztec-noir/src/types/type_serialisation) for the complete list.

### Custom types

It's possible to create a public state for any types. Simply define methods that guide the PublicState wrapper in serialising the custom type to field(s) to store in the public state tree, and deserialising the field(s) retrieved from the tree back to the custom type.

The methods should be implemented in a struct that conforms to the following interface:

#include_code TypeSerialisationInterface /yarn-project/noir-libs/noir-aztec/src/types/type_serialisation.nr rust
#include_code TypeSerialisationInterface /yarn-project/noir-libs/aztec-noir/src/types/type_serialisation.nr rust

For example, to create a public state for the following type:

Expand Down Expand Up @@ -115,7 +115,7 @@ Notes are the fundamental elements in the private world.

A note should conform to the following interface:

#include_code NoteInterface /yarn-project/noir-libs/noir-aztec/src/note/note_interface.nr rust
#include_code NoteInterface /yarn-project/noir-libs/aztec-noir/src/note/note_interface.nr rust

The interplay between a private state variable and its notes can be confusing. Here's a summary to aid intuition:

Expand Down Expand Up @@ -239,7 +239,7 @@ Because of this limit, we should always consider using the second argument `Note

`NoteGetterOptions` encapsulates a set of configurable options for filtering and retrieving a selection of notes from a database:

#include_code NoteGetterOptions /yarn-project/noir-libs/noir-aztec/src/note/note_getter_options.nr rust
#include_code NoteGetterOptions /yarn-project/noir-libs/aztec-noir/src/note/note_getter_options.nr rust

Developers can design instances of `NoteGetterOptions`, to determine how notes should be filtered and returned to the functions of their smart contracts.

Expand Down
2 changes: 1 addition & 1 deletion docs/docs/dev_docs/getting_started/noir_contracts.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ compiler_version = "0.1"
type = "contract"

[dependencies]
aztec = { git="https://github.com/AztecProtocol/aztec-packages", tag="master", directory="yarn-project/noir-libs/noir-aztec" }
aztec = { git="https://github.com/AztecProtocol/aztec-packages", tag="master", directory="yarn-project/noir-libs/aztec-noir" }
```

You are now ready to write your own contracts!
Expand Down
4 changes: 2 additions & 2 deletions docs/docs/dev_docs/wallets/writing_an_account_contract.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ Public Key: 0x0ede151adaef1cfcc1b3e152ea39f00c5cda3f3857cef00decb049d283672dc71

The important part of this contract is the `entrypoint` function, which will be the first function executed in any transaction originated from this account. This function has two main responsibilities: 1) authenticating the transaction and 2) executing calls. It receives a `payload` with the list of function calls to execute, as well as a signature over that payload.

#include_code entrypoint-struct yarn-project/noir-libs/noir-aztec/src/entrypoint.nr rust
#include_code entrypoint-struct yarn-project/noir-libs/aztec-noir/src/entrypoint.nr rust

:::info
Using the `EntrypointPayload` struct is not mandatory. You can package the instructions to be carried out by your account contract however you want. However, the entrypoint payload already provides a set of helper functions, both in Noir and Typescript, that can save you a lot of time when writing a new account contract.
Expand All @@ -48,7 +48,7 @@ We authenticate the transaction. To do this, we serialise and Pedersen-hash the

Last, we execute the calls in the payload struct. The `execute_calls` helper function runs through the private and public calls included in the entrypoint payload and executes them:

#include_code entrypoint-execute-calls yarn-project/noir-libs/noir-aztec/src/entrypoint.nr rust
#include_code entrypoint-execute-calls yarn-project/noir-libs/aztec-noir/src/entrypoint.nr rust

Note the usage of the `_with_packed_args` variant of [`call_public_function` and `call_private_function`](../contracts/functions.md#calling-functions). Due to Noir limitations, we cannot include more than a small number of arguments in a function call. However, we can bypass this restriction by using a hash of the arguments in a function call, which gets automatically expanded to the full set of arguments when the nested call is executed. We call this _argument packing_.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { FunctionCall, PackedArguments, emptyFunctionCall } from '@aztec/types';

import partition from 'lodash.partition';

// These must match the values defined in yarn-project/noir-libs/noir-aztec/src/entrypoint.nr
// These must match the values defined in yarn-project/noir-libs/aztec-noir/src/entrypoint.nr
export const ACCOUNT_MAX_PRIVATE_CALLS = 2;
export const ACCOUNT_MAX_PUBLIC_CALLS = 2;

Expand Down
2 changes: 1 addition & 1 deletion yarn-project/circuits.js/src/cbind/constants.in.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ async function main(): Promise<void> {
processEnumNoir(privateStateNoteGeneratorIndexEnum, 'PRIVATE_STATE_NOTE_GENERATOR_INDEX__') +
processEnumNoir(privateStateTypeEnum, 'PRIVATE_STATE_TYPE__');

const noirTargetPath = join(__dirname, '../../../noir-libs/noir-aztec/src/constants_gen.nr');
const noirTargetPath = join(__dirname, '../../../noir-libs/aztec-noir/src/constants_gen.nr');
fs.writeFileSync(noirTargetPath, resultNoir);

// Solidity
Expand Down
2 changes: 1 addition & 1 deletion yarn-project/noir-contracts/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ It has prebuilt binaries and is super easy to install using `noirup`
compiler_version = "0.7.1"

[dependencies]
aztec = { path = "../../../../noir-libs/noir-aztec" }
aztec = { path = "../../../../noir-libs/aztec-noir" }
```

4. Replace the content of the generated `example_contract/src/main.nr` file with your contract code.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ compiler_version = "0.1"
type = "contract"

[dependencies]
aztec = { path = "../../../../noir-libs/noir-aztec" }
aztec = { path = "../../../../noir-libs/aztec-noir" }
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ compiler_version = "0.1"
type = "contract"

[dependencies]
aztec = { path = "../../../../noir-libs/noir-aztec" }
aztec = { path = "../../../../noir-libs/aztec-noir" }
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@ compiler_version = "0.1"
type = "contract"

[dependencies]
aztec = { path = "../../../../noir-libs/noir-aztec" }
aztec = { path = "../../../../noir-libs/aztec-noir" }
value_note = { path = "../../../../noir-libs/value-note"}
easy_private_state = { path = "../../../../noir-libs/easy-private-state"}
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ compiler_version = "0.1"
type = "contract"

[dependencies]
aztec = { path = "../../../../noir-libs/noir-aztec" }
aztec = { path = "../../../../noir-libs/aztec-noir" }
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ compiler_version = "0.1"
type = "contract"

[dependencies]
aztec = { path = "../../../../noir-libs/noir-aztec" }
aztec = { path = "../../../../noir-libs/aztec-noir" }
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ compiler_version = "0.1"
type = "contract"

[dependencies]
aztec = { path = "../../../../noir-libs/noir-aztec" }
aztec = { path = "../../../../noir-libs/aztec-noir" }
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ compiler_version = "0.1"
type = "contract"

[dependencies]
aztec = { path = "../../../../noir-libs/noir-aztec" }
aztec = { path = "../../../../noir-libs/aztec-noir" }
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ compiler_version = "0.1"
type = "contract"

[dependencies]
aztec = { path = "../../../../noir-libs/noir-aztec" }
aztec = { path = "../../../../noir-libs/aztec-noir" }
safe_math = { path = "../../../../noir-libs/safe-math" }
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ compiler_version = "0.1"
type = "contract"

[dependencies]
aztec = { path = "../../../../noir-libs/noir-aztec" }
aztec = { path = "../../../../noir-libs/aztec-noir" }
value_note = { path = "../../../../noir-libs/value-note"}
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@ compiler_version = "0.1"
type = "contract"

[dependencies]
aztec = { path = "../../../../noir-libs/noir-aztec" }
aztec = { path = "../../../../noir-libs/aztec-noir" }
value_note = { path = "../../../../noir-libs/value-note"}
non_native = { path = "../non_native_token_contract"}
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ compiler_version = "0.1"
type = "contract"

[dependencies]
aztec = { path = "../../../../noir-libs/noir-aztec" }
aztec = { path = "../../../../noir-libs/aztec-noir" }
value_note = { path = "../../../../noir-libs/value-note"}
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ compiler_version = "0.1"
type = "contract"

[dependencies]
aztec = { path = "../../../../noir-libs/noir-aztec" }
aztec = { path = "../../../../noir-libs/aztec-noir" }
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ compiler_version = "0.1"
type = "contract"

[dependencies]
aztec = { path = "../../../../noir-libs/noir-aztec" }
aztec = { path = "../../../../noir-libs/aztec-noir" }
value_note = { path = "../../../../noir-libs/value-note"}
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ compiler_version = "0.1"
type = "contract"

[dependencies]
aztec = { path = "../../../../noir-libs/noir-aztec" }
aztec = { path = "../../../../noir-libs/aztec-noir" }
value_note = { path = "../../../../noir-libs/value-note"}
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ compiler_version = "0.1"
type = "contract"

[dependencies]
aztec = { path = "../../../../noir-libs/noir-aztec" }
aztec = { path = "../../../../noir-libs/aztec-noir" }
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ compiler_version = "0.1"
type = "contract"

[dependencies]
aztec = { path = "../../../../noir-libs/noir-aztec" }
aztec = { path = "../../../../noir-libs/aztec-noir" }
value_note = { path = "../../../../noir-libs/value-note"}
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@ type = "contract"

[dependencies]
# highlight-next-line:importing-aztec
aztec = { path = "../../../../noir-libs/noir-aztec" }
aztec = { path = "../../../../noir-libs/aztec-noir" }
value_note = { path = "../../../../noir-libs/value-note"}
# docs:end:importing-aztec
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ compiler_version = "0.1"
type = "contract"

[dependencies]
aztec = { path = "../../../../noir-libs/noir-aztec" }
aztec = { path = "../../../../noir-libs/aztec-noir" }
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ compiler_version = "0.1"
type = "contract"

[dependencies]
aztec = { path = "../../../../noir-libs/noir-aztec" }
aztec = { path = "../../../../noir-libs/aztec-noir" }
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ compiler_version = "0.1"
type = "contract"

[dependencies]
aztec = { path = "../../../../noir-libs/noir-aztec" }
aztec = { path = "../../../../noir-libs/aztec-noir" }
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ compiler_version = "0.1"
type = "contract"

[dependencies]
aztec = { path = "../../../../noir-libs/noir-aztec" }
aztec = { path = "../../../../noir-libs/aztec-noir" }
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ compiler_version = "0.1"
type = "contract"

[dependencies]
aztec = { path = "../../../../noir-libs/noir-aztec" }
aztec = { path = "../../../../noir-libs/aztec-noir" }
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ compiler_version = "0.1"
type = "contract"

[dependencies]
aztec = { path = "../../../../noir-libs/noir-aztec" }
aztec = { path = "../../../../noir-libs/aztec-noir" }
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ compiler_version = "0.1"
type = "contract"

[dependencies]
aztec = { path = "../../../../noir-libs/noir-aztec" }
aztec = { path = "../../../../noir-libs/aztec-noir" }
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
// docs:start:oracles-module
/// Oracles module
// docs:end:oracles-module

mod arguments;
mod call_private_function;
mod context;
Expand Down
2 changes: 1 addition & 1 deletion yarn-project/noir-libs/easy-private-state/Nargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ compiler_version = "0.7.1"
type = "lib"

[dependencies]
aztec = { path = "../noir-aztec" }
aztec = { path = "../aztec-noir" }
value_note = { path = "../value-note" }
2 changes: 1 addition & 1 deletion yarn-project/noir-libs/value-note/Nargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ compiler_version = "0.7.1"
type = "lib"

[dependencies]
aztec = { path = "../noir-aztec" }
aztec = { path = "../aztec-noir" }