diff --git a/.github/workflows/mirror_repos.yml b/.github/workflows/mirror_repos.yml index c3cec86a551..f93244bbce2 100644 --- a/.github/workflows/mirror_repos.yml +++ b/.github/workflows/mirror_repos.yml @@ -12,7 +12,7 @@ concurrency: on: schedule: # Run the workflow every night at 2:00 AM UTC. - cron: '0 2 * * *' + - cron: '0 2 * * *' jobs: mirror-to-docs-repo: @@ -77,3 +77,24 @@ jobs: git commit --amend -m "$(git log -1 --pretty=%B) [skip ci]" git push fi + + mirror-to-aztec-nr-repo: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v3 + with: + fetch-depth: 0 + token: ${{ secrets.AZTEC_BOT_GITHUB_TOKEN }} + - name: Push to aztec-nr repo + run: | + SUBREPO_PATH=yarn-project/aztec-nr + git config --global user.name AztecBot + git config --global user.email tech@aztecprotocol.com + + if ./scripts/git_subrepo.sh push $SUBREPO_PATH --branch=main; then + git fetch # in case a commit came after this + git rebase origin/master + git commit --amend -m "$(git log -1 --pretty=%B) [skip ci]" + git push + fi \ No newline at end of file diff --git a/build_manifest.json b/build_manifest.json index db71326fe07..0f7316595d7 100644 --- a/build_manifest.json +++ b/build_manifest.json @@ -102,7 +102,7 @@ "^l1-contracts/", "^yarn-project/l1-artifacts/", "^yarn-project/noir-contracts/", - "^yarn-project/noir-libs/", + "^yarn-project/aztec-nr/", "^yarn-project/noir-compiler/", "^yarn-project/yarn-project-base/", "^yarn-project/yarn.lock" @@ -199,7 +199,7 @@ "dockerfile": "noir-contracts/Dockerfile.build", "rebuildPatterns": [ "^yarn-project/noir-contracts/", - "^yarn-project/noir-libs/" + "^yarn-project/aztec-nr/" ] }, "noir-contracts": { @@ -208,7 +208,7 @@ "dockerfile": "noir-contracts/Dockerfile", "rebuildPatterns": [ "^yarn-project/noir-contracts/", - "^yarn-project/noir-libs/" + "^yarn-project/aztec-nr/" ] }, "noir-compiler": { diff --git a/docs/docs/concepts/foundation/accounts/keys.md b/docs/docs/concepts/foundation/accounts/keys.md index 9f7ca23f581..2fb19d87860 100644 --- a/docs/docs/concepts/foundation/accounts/keys.md +++ b/docs/docs/concepts/foundation/accounts/keys.md @@ -71,7 +71,7 @@ In a future version, encryption keys will be differentiated between incoming and An application in Aztec.nr can access the encryption public key for a given address using the oracle call `get_public_key`, which you can then use for calls such as `emit_encrypted_log`: -#include_code encrypted /yarn-project/noir-libs/value-note/src/utils.nr rust +#include_code encrypted /yarn-project/aztec-nr/value-note/src/utils.nr rust :::info In order to be able to provide the public encryption key for a given address, that public key needs to have been registered in advance. At the moment, there is no broadcasting mechanism for public keys, which means that you will need to manually register all addresses you intend to send encrypted notes to. You can do this via the `registerRecipient` method of the Aztec RPC server, callable either via aztec.js or the CLI. Note that any accounts you own that have been added to the RPC server are automatically registered. @@ -83,7 +83,7 @@ In addition to deriving encryption keys, the privacy master key is used for deri An application in Aztec.nr can request a nullifier from the current user for computing the nullifier of a note via the `get_secret_key` oracle call: -#include_code nullifier /yarn-project/noir-libs/value-note/src/value_note.nr rust +#include_code nullifier /yarn-project/aztec-nr/value-note/src/value_note.nr rust ### Scoped keys diff --git a/docs/docs/dev_docs/contracts/events.md b/docs/docs/dev_docs/contracts/events.md index 1f12b91c8e5..88eaf3b2396 100644 --- a/docs/docs/dev_docs/contracts/events.md +++ b/docs/docs/dev_docs/contracts/events.md @@ -44,11 +44,11 @@ await aztecRpc.registerRecipient(completeAddress); To emit encrypted logs first import the `emit_encrypted_log` utility function inside your contract: -#include_code encrypted_import /yarn-project/noir-libs/value-note/src/utils.nr rust +#include_code encrypted_import /yarn-project/aztec-nr/value-note/src/utils.nr rust Then you can call the function: -#include_code encrypted /yarn-project/noir-libs/value-note/src/utils.nr rust +#include_code encrypted /yarn-project/aztec-nr/value-note/src/utils.nr rust ### Unencrypted Events diff --git a/docs/docs/dev_docs/contracts/portals/main.md b/docs/docs/dev_docs/contracts/portals/main.md index b1ead86a80e..67074e53aab 100644 --- a/docs/docs/dev_docs/contracts/portals/main.md +++ b/docs/docs/dev_docs/contracts/portals/main.md @@ -37,7 +37,7 @@ As time passes, a sequencer will see your tx, the juicy fee provided and include To consume the message, we can use the `consume_l1_to_l2_message` function within the `context` struct. The `msg_key` is the hash of the message produced from the `sendL2Message` call, the `content` is the content of the message, and the `secret` is the pre-image hashed to compute the `secretHash`. -#include_code context_consume_l1_to_l2_message /yarn-project/noir-libs/aztec-noir/src/context.nr rust +#include_code context_consume_l1_to_l2_message /yarn-project/aztec-nr/aztec/src/context.nr rust Computing the `content` might be a little clunky in its current form, as we are still adding a number of bytes utilities. A good example exists within the [Non-native token example](https://github.com/AztecProtocol/aztec-packages/blob/master/yarn-project/noir-contracts/src/contracts/non_native_token_contract/src/hash.nr). @@ -63,7 +63,7 @@ The portal must ensure that the sender is as expected. One way to do this, is to To send a message to L1 from your Aztec contract, you must use the `message_portal` function on the `context`. When messaging to L1, only the `content` is required (as field). -#include_code context_message_portal /yarn-project/noir-libs/aztec-noir/src/context.nr rust +#include_code context_message_portal /yarn-project/aztec-nr/aztec/src/context.nr rust When sending a message from L2 to L1 we don't need to pass recipient, deadline, secret nor fees. Recipient is populated with the attached portal and the remaining values are not needed as the message is inserted into the outbox at the same time as it was included in a block (for the inbox it could be inserted and then only included in rollup block later). diff --git a/docs/docs/dev_docs/contracts/state_variables.md b/docs/docs/dev_docs/contracts/state_variables.md index d11e7fb8b2d..db6ac3f6289 100644 --- a/docs/docs/dev_docs/contracts/state_variables.md +++ b/docs/docs/dev_docs/contracts/state_variables.md @@ -28,7 +28,7 @@ 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/aztec-noir/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/aztec-nr/aztec/src/types/type_serialisation) for the complete list. ### Custom types @@ -36,7 +36,7 @@ It's possible to create a public state for any types. Simply define methods that The methods should be implemented in a struct that conforms to the following interface: -#include_code TypeSerialisationInterface /yarn-project/noir-libs/aztec-noir/src/types/type_serialisation.nr rust +#include_code TypeSerialisationInterface /yarn-project/aztec-nr/aztec/src/types/type_serialisation.nr rust For example, to create a public state for the following type: @@ -118,7 +118,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/aztec-noir/src/note/note_interface.nr rust +#include_code NoteInterface /yarn-project/aztec-nr/aztec/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: @@ -243,7 +243,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/aztec-noir/src/note/note_getter_options.nr rust +#include_code NoteGetterOptions /yarn-project/aztec-nr/aztec/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. diff --git a/docs/docs/dev_docs/contracts/syntax.md b/docs/docs/dev_docs/contracts/syntax.md index a5d5008e78d..584bdeab7ae 100644 --- a/docs/docs/dev_docs/contracts/syntax.md +++ b/docs/docs/dev_docs/contracts/syntax.md @@ -2,7 +2,7 @@ [Noir](https://noir-lang.org/) is a language which is agnostic to proof systems and use cases. Rather than baking Aztec-specific keywords and smart contract types directly into Noir (which would break this agnosticism), we have developed a library -- written in Noir -- whose types and methods provide rich smart contract semantics. -On top of [Noir's stdlib](https://noir-lang.org/standard_library/array_methods), we provide [Aztec.nr](https://github.com/AztecProtocol/aztec-packages/tree/master/yarn-project/noir-libs) for writing contracts on Aztec. +On top of [Noir's stdlib](https://noir-lang.org/standard_library/array_methods), we provide [Aztec.nr](https://github.com/AztecProtocol/aztec-packages/tree/master/yarn-project/aztec-nr) for writing contracts on Aztec. Aztec.nr contains abstractions which remove the need to understand the low-level Aztec protocol. Notably, it provides: diff --git a/docs/docs/dev_docs/dapps/testing.md b/docs/docs/dev_docs/dapps/testing.md index c8395ae51a6..ec59f1d7516 100644 --- a/docs/docs/dev_docs/dapps/testing.md +++ b/docs/docs/dev_docs/dapps/testing.md @@ -133,7 +133,7 @@ To query storage directly, you'll need to know the slot you want to access. This Private state in the Aztec Network is represented via sets of [private notes](../../concepts/foundation/state_model.md#private-state). In our token contract example, the balance of a user is represented as a set of unspent value notes, each with their own corresponding numeric value. -#include_code value-note-def yarn-project/noir-libs/value-note/src/value_note.nr rust +#include_code value-note-def yarn-project/aztec-nr/value-note/src/value_note.nr rust We can query the RPC server for all notes encrypted for a given user in a contract slot. For this example, we'll get all notes encrypted for the `owner` user that are stored on the token contract address and on the slot we calculated earlier. To calculate the actual balance, we extract the `value` of each note, which is the first element, and sum them up. diff --git a/docs/docs/dev_docs/dapps/tutorials/contract_deployment.md b/docs/docs/dev_docs/dapps/tutorials/contract_deployment.md index 9bbbbdc3669..d78a68969fd 100644 --- a/docs/docs/dev_docs/dapps/tutorials/contract_deployment.md +++ b/docs/docs/dev_docs/dapps/tutorials/contract_deployment.md @@ -19,8 +19,8 @@ Then, open the `contracts/private_token/Nargo.toml` configuration file, and add ```toml [dependencies] -aztec = { git="https://github.com/AztecProtocol/aztec-packages", tag="master", directory="yarn-project/noir-libs/noir-aztec" } -value_note = { git="https://github.com/AztecProtocol/aztec-packages", tag="master", directory="yarn-project/noir-libs/value-note" } +aztec = { git="https://github.com/AztecProtocol/aztec-packages", tag="master", directory="yarn-project/aztec-nr/noir-aztec" } +value_note = { git="https://github.com/AztecProtocol/aztec-packages", tag="master", directory="yarn-project/aztec-nr/value-note" } ``` Last, copy-paste the code from the `PrivateToken` contract into `contracts/private_token/main.nr`: diff --git a/docs/docs/dev_docs/getting_started/noir_contracts.md b/docs/docs/dev_docs/getting_started/noir_contracts.md index e6b9e3a96f8..65e27c14643 100644 --- a/docs/docs/dev_docs/getting_started/noir_contracts.md +++ b/docs/docs/dev_docs/getting_started/noir_contracts.md @@ -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/aztec-noir" } +aztec = { git="https://github.com/AztecProtocol/aztec-packages", tag="master", directory="yarn-project/aztec-nr/aztec" } ``` You are now ready to write your own contracts! diff --git a/docs/docs/dev_docs/wallets/writing_an_account_contract.md b/docs/docs/dev_docs/wallets/writing_an_account_contract.md index b1f02e156f7..4e42ae43efa 100644 --- a/docs/docs/dev_docs/wallets/writing_an_account_contract.md +++ b/docs/docs/dev_docs/wallets/writing_an_account_contract.md @@ -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/aztec-noir/src/entrypoint.nr rust +#include_code entrypoint-struct yarn-project/aztec-nr/aztec/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. @@ -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/aztec-noir/src/entrypoint.nr rust +#include_code entrypoint-execute-calls yarn-project/aztec-nr/aztec/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_. diff --git a/yarn-project/aztec-nr/.gitrepo b/yarn-project/aztec-nr/.gitrepo new file mode 100644 index 00000000000..9b54eedeb04 --- /dev/null +++ b/yarn-project/aztec-nr/.gitrepo @@ -0,0 +1,12 @@ +; DO NOT EDIT (unless you know what you are doing) +; +; This subdirectory is a git "subrepo", and this file is maintained by the +; git-subrepo command. See https://github.com/ingydotnet/git-subrepo#readme +; +[subrepo] + remote = git@github.com:AztecProtocol/aztec-nr.git + branch = master + commit = f662901567fa19e205062d84180763f06cddd641 + method = merge + cmdver = 0.4.6 + parent = 8df8fa7351ca79c022e2eb7dddfd7cf0145876df diff --git a/yarn-project/aztec-nr/LICENCE b/yarn-project/aztec-nr/LICENCE new file mode 100644 index 00000000000..7a4a3ea2424 --- /dev/null +++ b/yarn-project/aztec-nr/LICENCE @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. \ No newline at end of file diff --git a/yarn-project/aztec-nr/README.md b/yarn-project/aztec-nr/README.md new file mode 100644 index 00000000000..c137de45e0c --- /dev/null +++ b/yarn-project/aztec-nr/README.md @@ -0,0 +1,66 @@ +
+ + +

Aztec.nr

+ +

+ Aztec Smart Contract Development Framework +

+ +

+ Build Status + Aztec Website + Discord Chat + License +

+
+ + +# Aztec.nr + +`Aztec-nr` is a [Noir](https://noir-lang.org) framework for contract development on [Aztec](aztec.network). + +### Directory Structure +``` +. +├── aztec // The core of the aztec framework +├── easy-private-state // A library for easily creating private state +├── safe-math // A library for safe arithmetic +└── value-note // A library for storing arbitrary values +``` + +## Installing Aztec-nr libraries + +```toml +[package] +name = "your_contract" +authors = ["you! ;) "] +compiler_version = "" +type = "contract" + +[dependencies] +# To install the aztec framework (required to create aztec contracts). +aztec = { git = "https://github.com/AztecProtocol/aztec-nr", tag = "master" , directory = "aztec" } + +# Optional libraries +easy_private_state = { git = "https://github.com/AztecProtocol/aztec-nr", tag = "master" , directory = "easy-private-state" } +safe_math = { git = "https://github.com/AztecProtocol/aztec-nr", tag = "master" , directory = "safe-math" } +value_note = { git = "https://github.com/AztecProtocol/aztec-nr", tag = "master" , directory = "value-note" } +``` + + +## Prerequisites +To use `Aztec.nr` you must have [Noir](https://noir-lang.org/) installed. Noir is a general purpose programming language for creating zero-knowledge-proofs. `Aztec.nr` supercharges the Noir language with Aztec Smart Contract capabilities. + +### Quick Installation +The fastest way to install is with [noirup](https://noir-lang.org/getting_started/nargo_installation#option-1-noirup). + +To use `Aztec-nr` the `aztec` version of `Noir` is required (Note; this version is temporarily required if you would like to use `#[aztec()]` macros). + +Once noirup is installed, you can run the following: +```bash +noirup -v aztec +``` + +For more installation options, please view [Noir's getting started.](https://noir-lang.org/getting_started/nargo_installation) + diff --git a/yarn-project/aztec-nr/assets/Aztec_banner.png b/yarn-project/aztec-nr/assets/Aztec_banner.png new file mode 100644 index 00000000000..503202966b9 Binary files /dev/null and b/yarn-project/aztec-nr/assets/Aztec_banner.png differ diff --git a/yarn-project/noir-libs/aztec-noir/Nargo.toml b/yarn-project/aztec-nr/aztec/Nargo.toml similarity index 100% rename from yarn-project/noir-libs/aztec-noir/Nargo.toml rename to yarn-project/aztec-nr/aztec/Nargo.toml diff --git a/yarn-project/noir-libs/aztec-noir/src/abi.nr b/yarn-project/aztec-nr/aztec/src/abi.nr similarity index 100% rename from yarn-project/noir-libs/aztec-noir/src/abi.nr rename to yarn-project/aztec-nr/aztec/src/abi.nr diff --git a/yarn-project/noir-libs/aztec-noir/src/auth.nr b/yarn-project/aztec-nr/aztec/src/auth.nr similarity index 100% rename from yarn-project/noir-libs/aztec-noir/src/auth.nr rename to yarn-project/aztec-nr/aztec/src/auth.nr diff --git a/yarn-project/noir-libs/aztec-noir/src/constants_gen.nr b/yarn-project/aztec-nr/aztec/src/constants_gen.nr similarity index 100% rename from yarn-project/noir-libs/aztec-noir/src/constants_gen.nr rename to yarn-project/aztec-nr/aztec/src/constants_gen.nr diff --git a/yarn-project/noir-libs/aztec-noir/src/context.nr b/yarn-project/aztec-nr/aztec/src/context.nr similarity index 100% rename from yarn-project/noir-libs/aztec-noir/src/context.nr rename to yarn-project/aztec-nr/aztec/src/context.nr diff --git a/yarn-project/noir-libs/aztec-noir/src/entrypoint.nr b/yarn-project/aztec-nr/aztec/src/entrypoint.nr similarity index 100% rename from yarn-project/noir-libs/aztec-noir/src/entrypoint.nr rename to yarn-project/aztec-nr/aztec/src/entrypoint.nr diff --git a/yarn-project/noir-libs/aztec-noir/src/lib.nr b/yarn-project/aztec-nr/aztec/src/lib.nr similarity index 100% rename from yarn-project/noir-libs/aztec-noir/src/lib.nr rename to yarn-project/aztec-nr/aztec/src/lib.nr diff --git a/yarn-project/noir-libs/aztec-noir/src/log.nr b/yarn-project/aztec-nr/aztec/src/log.nr similarity index 100% rename from yarn-project/noir-libs/aztec-noir/src/log.nr rename to yarn-project/aztec-nr/aztec/src/log.nr diff --git a/yarn-project/noir-libs/aztec-noir/src/messaging.nr b/yarn-project/aztec-nr/aztec/src/messaging.nr similarity index 100% rename from yarn-project/noir-libs/aztec-noir/src/messaging.nr rename to yarn-project/aztec-nr/aztec/src/messaging.nr diff --git a/yarn-project/noir-libs/aztec-noir/src/messaging/l1_to_l2_message.nr b/yarn-project/aztec-nr/aztec/src/messaging/l1_to_l2_message.nr similarity index 100% rename from yarn-project/noir-libs/aztec-noir/src/messaging/l1_to_l2_message.nr rename to yarn-project/aztec-nr/aztec/src/messaging/l1_to_l2_message.nr diff --git a/yarn-project/noir-libs/aztec-noir/src/messaging/l1_to_l2_message_getter_data.nr b/yarn-project/aztec-nr/aztec/src/messaging/l1_to_l2_message_getter_data.nr similarity index 100% rename from yarn-project/noir-libs/aztec-noir/src/messaging/l1_to_l2_message_getter_data.nr rename to yarn-project/aztec-nr/aztec/src/messaging/l1_to_l2_message_getter_data.nr diff --git a/yarn-project/noir-libs/aztec-noir/src/note.nr b/yarn-project/aztec-nr/aztec/src/note.nr similarity index 100% rename from yarn-project/noir-libs/aztec-noir/src/note.nr rename to yarn-project/aztec-nr/aztec/src/note.nr diff --git a/yarn-project/noir-libs/aztec-noir/src/note/lifecycle.nr b/yarn-project/aztec-nr/aztec/src/note/lifecycle.nr similarity index 100% rename from yarn-project/noir-libs/aztec-noir/src/note/lifecycle.nr rename to yarn-project/aztec-nr/aztec/src/note/lifecycle.nr diff --git a/yarn-project/noir-libs/aztec-noir/src/note/note_getter.nr b/yarn-project/aztec-nr/aztec/src/note/note_getter.nr similarity index 100% rename from yarn-project/noir-libs/aztec-noir/src/note/note_getter.nr rename to yarn-project/aztec-nr/aztec/src/note/note_getter.nr diff --git a/yarn-project/noir-libs/aztec-noir/src/note/note_getter_options.nr b/yarn-project/aztec-nr/aztec/src/note/note_getter_options.nr similarity index 100% rename from yarn-project/noir-libs/aztec-noir/src/note/note_getter_options.nr rename to yarn-project/aztec-nr/aztec/src/note/note_getter_options.nr diff --git a/yarn-project/noir-libs/aztec-noir/src/note/note_hash.nr b/yarn-project/aztec-nr/aztec/src/note/note_hash.nr similarity index 100% rename from yarn-project/noir-libs/aztec-noir/src/note/note_hash.nr rename to yarn-project/aztec-nr/aztec/src/note/note_hash.nr diff --git a/yarn-project/noir-libs/aztec-noir/src/note/note_header.nr b/yarn-project/aztec-nr/aztec/src/note/note_header.nr similarity index 100% rename from yarn-project/noir-libs/aztec-noir/src/note/note_header.nr rename to yarn-project/aztec-nr/aztec/src/note/note_header.nr diff --git a/yarn-project/noir-libs/aztec-noir/src/note/note_interface.nr b/yarn-project/aztec-nr/aztec/src/note/note_interface.nr similarity index 100% rename from yarn-project/noir-libs/aztec-noir/src/note/note_interface.nr rename to yarn-project/aztec-nr/aztec/src/note/note_interface.nr diff --git a/yarn-project/noir-libs/aztec-noir/src/note/note_viewer_options.nr b/yarn-project/aztec-nr/aztec/src/note/note_viewer_options.nr similarity index 100% rename from yarn-project/noir-libs/aztec-noir/src/note/note_viewer_options.nr rename to yarn-project/aztec-nr/aztec/src/note/note_viewer_options.nr diff --git a/yarn-project/noir-libs/aztec-noir/src/note/utils.nr b/yarn-project/aztec-nr/aztec/src/note/utils.nr similarity index 100% rename from yarn-project/noir-libs/aztec-noir/src/note/utils.nr rename to yarn-project/aztec-nr/aztec/src/note/utils.nr diff --git a/yarn-project/noir-libs/aztec-noir/src/oracle.nr b/yarn-project/aztec-nr/aztec/src/oracle.nr similarity index 100% rename from yarn-project/noir-libs/aztec-noir/src/oracle.nr rename to yarn-project/aztec-nr/aztec/src/oracle.nr diff --git a/yarn-project/noir-libs/aztec-noir/src/oracle/arguments.nr b/yarn-project/aztec-nr/aztec/src/oracle/arguments.nr similarity index 100% rename from yarn-project/noir-libs/aztec-noir/src/oracle/arguments.nr rename to yarn-project/aztec-nr/aztec/src/oracle/arguments.nr diff --git a/yarn-project/noir-libs/aztec-noir/src/oracle/call_private_function.nr b/yarn-project/aztec-nr/aztec/src/oracle/call_private_function.nr similarity index 100% rename from yarn-project/noir-libs/aztec-noir/src/oracle/call_private_function.nr rename to yarn-project/aztec-nr/aztec/src/oracle/call_private_function.nr diff --git a/yarn-project/noir-libs/aztec-noir/src/oracle/compute_selector.nr b/yarn-project/aztec-nr/aztec/src/oracle/compute_selector.nr similarity index 100% rename from yarn-project/noir-libs/aztec-noir/src/oracle/compute_selector.nr rename to yarn-project/aztec-nr/aztec/src/oracle/compute_selector.nr diff --git a/yarn-project/noir-libs/aztec-noir/src/oracle/context.nr b/yarn-project/aztec-nr/aztec/src/oracle/context.nr similarity index 100% rename from yarn-project/noir-libs/aztec-noir/src/oracle/context.nr rename to yarn-project/aztec-nr/aztec/src/oracle/context.nr diff --git a/yarn-project/noir-libs/aztec-noir/src/oracle/create_commitment.nr b/yarn-project/aztec-nr/aztec/src/oracle/create_commitment.nr similarity index 100% rename from yarn-project/noir-libs/aztec-noir/src/oracle/create_commitment.nr rename to yarn-project/aztec-nr/aztec/src/oracle/create_commitment.nr diff --git a/yarn-project/noir-libs/aztec-noir/src/oracle/debug_log.nr b/yarn-project/aztec-nr/aztec/src/oracle/debug_log.nr similarity index 100% rename from yarn-project/noir-libs/aztec-noir/src/oracle/debug_log.nr rename to yarn-project/aztec-nr/aztec/src/oracle/debug_log.nr diff --git a/yarn-project/noir-libs/aztec-noir/src/oracle/enqueue_public_function_call.nr b/yarn-project/aztec-nr/aztec/src/oracle/enqueue_public_function_call.nr similarity index 100% rename from yarn-project/noir-libs/aztec-noir/src/oracle/enqueue_public_function_call.nr rename to yarn-project/aztec-nr/aztec/src/oracle/enqueue_public_function_call.nr diff --git a/yarn-project/noir-libs/aztec-noir/src/oracle/get_l1_to_l2_message.nr b/yarn-project/aztec-nr/aztec/src/oracle/get_l1_to_l2_message.nr similarity index 100% rename from yarn-project/noir-libs/aztec-noir/src/oracle/get_l1_to_l2_message.nr rename to yarn-project/aztec-nr/aztec/src/oracle/get_l1_to_l2_message.nr diff --git a/yarn-project/noir-libs/aztec-noir/src/oracle/get_public_key.nr b/yarn-project/aztec-nr/aztec/src/oracle/get_public_key.nr similarity index 100% rename from yarn-project/noir-libs/aztec-noir/src/oracle/get_public_key.nr rename to yarn-project/aztec-nr/aztec/src/oracle/get_public_key.nr diff --git a/yarn-project/noir-libs/aztec-noir/src/oracle/get_secret_key.nr b/yarn-project/aztec-nr/aztec/src/oracle/get_secret_key.nr similarity index 100% rename from yarn-project/noir-libs/aztec-noir/src/oracle/get_secret_key.nr rename to yarn-project/aztec-nr/aztec/src/oracle/get_secret_key.nr diff --git a/yarn-project/noir-libs/aztec-noir/src/oracle/logs.nr b/yarn-project/aztec-nr/aztec/src/oracle/logs.nr similarity index 100% rename from yarn-project/noir-libs/aztec-noir/src/oracle/logs.nr rename to yarn-project/aztec-nr/aztec/src/oracle/logs.nr diff --git a/yarn-project/noir-libs/aztec-noir/src/oracle/notes.nr b/yarn-project/aztec-nr/aztec/src/oracle/notes.nr similarity index 100% rename from yarn-project/noir-libs/aztec-noir/src/oracle/notes.nr rename to yarn-project/aztec-nr/aztec/src/oracle/notes.nr diff --git a/yarn-project/noir-libs/aztec-noir/src/oracle/public_call.nr b/yarn-project/aztec-nr/aztec/src/oracle/public_call.nr similarity index 100% rename from yarn-project/noir-libs/aztec-noir/src/oracle/public_call.nr rename to yarn-project/aztec-nr/aztec/src/oracle/public_call.nr diff --git a/yarn-project/noir-libs/aztec-noir/src/oracle/rand.nr b/yarn-project/aztec-nr/aztec/src/oracle/rand.nr similarity index 100% rename from yarn-project/noir-libs/aztec-noir/src/oracle/rand.nr rename to yarn-project/aztec-nr/aztec/src/oracle/rand.nr diff --git a/yarn-project/noir-libs/aztec-noir/src/oracle/storage.nr b/yarn-project/aztec-nr/aztec/src/oracle/storage.nr similarity index 100% rename from yarn-project/noir-libs/aztec-noir/src/oracle/storage.nr rename to yarn-project/aztec-nr/aztec/src/oracle/storage.nr diff --git a/yarn-project/noir-libs/aztec-noir/src/private_call_stack_item.nr b/yarn-project/aztec-nr/aztec/src/private_call_stack_item.nr similarity index 100% rename from yarn-project/noir-libs/aztec-noir/src/private_call_stack_item.nr rename to yarn-project/aztec-nr/aztec/src/private_call_stack_item.nr diff --git a/yarn-project/noir-libs/aztec-noir/src/public_call_stack_item.nr b/yarn-project/aztec-nr/aztec/src/public_call_stack_item.nr similarity index 100% rename from yarn-project/noir-libs/aztec-noir/src/public_call_stack_item.nr rename to yarn-project/aztec-nr/aztec/src/public_call_stack_item.nr diff --git a/yarn-project/noir-libs/aztec-noir/src/state_vars.nr b/yarn-project/aztec-nr/aztec/src/state_vars.nr similarity index 100% rename from yarn-project/noir-libs/aztec-noir/src/state_vars.nr rename to yarn-project/aztec-nr/aztec/src/state_vars.nr diff --git a/yarn-project/noir-libs/aztec-noir/src/state_vars/immutable_singleton.nr b/yarn-project/aztec-nr/aztec/src/state_vars/immutable_singleton.nr similarity index 100% rename from yarn-project/noir-libs/aztec-noir/src/state_vars/immutable_singleton.nr rename to yarn-project/aztec-nr/aztec/src/state_vars/immutable_singleton.nr diff --git a/yarn-project/noir-libs/aztec-noir/src/state_vars/map.nr b/yarn-project/aztec-nr/aztec/src/state_vars/map.nr similarity index 100% rename from yarn-project/noir-libs/aztec-noir/src/state_vars/map.nr rename to yarn-project/aztec-nr/aztec/src/state_vars/map.nr diff --git a/yarn-project/noir-libs/aztec-noir/src/state_vars/public_state.nr b/yarn-project/aztec-nr/aztec/src/state_vars/public_state.nr similarity index 100% rename from yarn-project/noir-libs/aztec-noir/src/state_vars/public_state.nr rename to yarn-project/aztec-nr/aztec/src/state_vars/public_state.nr diff --git a/yarn-project/noir-libs/aztec-noir/src/state_vars/set.nr b/yarn-project/aztec-nr/aztec/src/state_vars/set.nr similarity index 100% rename from yarn-project/noir-libs/aztec-noir/src/state_vars/set.nr rename to yarn-project/aztec-nr/aztec/src/state_vars/set.nr diff --git a/yarn-project/noir-libs/aztec-noir/src/state_vars/singleton.nr b/yarn-project/aztec-nr/aztec/src/state_vars/singleton.nr similarity index 100% rename from yarn-project/noir-libs/aztec-noir/src/state_vars/singleton.nr rename to yarn-project/aztec-nr/aztec/src/state_vars/singleton.nr diff --git a/yarn-project/noir-libs/aztec-noir/src/types.nr b/yarn-project/aztec-nr/aztec/src/types.nr similarity index 100% rename from yarn-project/noir-libs/aztec-noir/src/types.nr rename to yarn-project/aztec-nr/aztec/src/types.nr diff --git a/yarn-project/noir-libs/aztec-noir/src/types/grumpkin_scalar.nr b/yarn-project/aztec-nr/aztec/src/types/grumpkin_scalar.nr similarity index 100% rename from yarn-project/noir-libs/aztec-noir/src/types/grumpkin_scalar.nr rename to yarn-project/aztec-nr/aztec/src/types/grumpkin_scalar.nr diff --git a/yarn-project/noir-libs/aztec-noir/src/types/point.nr b/yarn-project/aztec-nr/aztec/src/types/point.nr similarity index 100% rename from yarn-project/noir-libs/aztec-noir/src/types/point.nr rename to yarn-project/aztec-nr/aztec/src/types/point.nr diff --git a/yarn-project/noir-libs/aztec-noir/src/types/type_serialisation.nr b/yarn-project/aztec-nr/aztec/src/types/type_serialisation.nr similarity index 100% rename from yarn-project/noir-libs/aztec-noir/src/types/type_serialisation.nr rename to yarn-project/aztec-nr/aztec/src/types/type_serialisation.nr diff --git a/yarn-project/noir-libs/aztec-noir/src/types/type_serialisation/bool_serialisation.nr b/yarn-project/aztec-nr/aztec/src/types/type_serialisation/bool_serialisation.nr similarity index 100% rename from yarn-project/noir-libs/aztec-noir/src/types/type_serialisation/bool_serialisation.nr rename to yarn-project/aztec-nr/aztec/src/types/type_serialisation/bool_serialisation.nr diff --git a/yarn-project/noir-libs/aztec-noir/src/types/type_serialisation/field_serialisation.nr b/yarn-project/aztec-nr/aztec/src/types/type_serialisation/field_serialisation.nr similarity index 100% rename from yarn-project/noir-libs/aztec-noir/src/types/type_serialisation/field_serialisation.nr rename to yarn-project/aztec-nr/aztec/src/types/type_serialisation/field_serialisation.nr diff --git a/yarn-project/noir-libs/aztec-noir/src/types/type_serialisation/u32_serialisation.nr b/yarn-project/aztec-nr/aztec/src/types/type_serialisation/u32_serialisation.nr similarity index 100% rename from yarn-project/noir-libs/aztec-noir/src/types/type_serialisation/u32_serialisation.nr rename to yarn-project/aztec-nr/aztec/src/types/type_serialisation/u32_serialisation.nr diff --git a/yarn-project/noir-libs/aztec-noir/src/types/vec.nr b/yarn-project/aztec-nr/aztec/src/types/vec.nr similarity index 100% rename from yarn-project/noir-libs/aztec-noir/src/types/vec.nr rename to yarn-project/aztec-nr/aztec/src/types/vec.nr diff --git a/yarn-project/noir-libs/aztec-noir/src/utils.nr b/yarn-project/aztec-nr/aztec/src/utils.nr similarity index 100% rename from yarn-project/noir-libs/aztec-noir/src/utils.nr rename to yarn-project/aztec-nr/aztec/src/utils.nr diff --git a/yarn-project/noir-libs/easy-private-state/Nargo.toml b/yarn-project/aztec-nr/easy-private-state/Nargo.toml similarity index 81% rename from yarn-project/noir-libs/easy-private-state/Nargo.toml rename to yarn-project/aztec-nr/easy-private-state/Nargo.toml index eef8798d8c8..c6364218f27 100644 --- a/yarn-project/noir-libs/easy-private-state/Nargo.toml +++ b/yarn-project/aztec-nr/easy-private-state/Nargo.toml @@ -5,5 +5,5 @@ compiler_version = "0.7.1" type = "lib" [dependencies] -aztec = { path = "../aztec-noir" } +aztec = { path = "../aztec" } value_note = { path = "../value-note" } \ No newline at end of file diff --git a/yarn-project/noir-libs/easy-private-state/src/easy_private_state.nr b/yarn-project/aztec-nr/easy-private-state/src/easy_private_state.nr similarity index 100% rename from yarn-project/noir-libs/easy-private-state/src/easy_private_state.nr rename to yarn-project/aztec-nr/easy-private-state/src/easy_private_state.nr diff --git a/yarn-project/noir-libs/easy-private-state/src/lib.nr b/yarn-project/aztec-nr/easy-private-state/src/lib.nr similarity index 100% rename from yarn-project/noir-libs/easy-private-state/src/lib.nr rename to yarn-project/aztec-nr/easy-private-state/src/lib.nr diff --git a/yarn-project/noir-libs/safe-math/Nargo.toml b/yarn-project/aztec-nr/safe-math/Nargo.toml similarity index 100% rename from yarn-project/noir-libs/safe-math/Nargo.toml rename to yarn-project/aztec-nr/safe-math/Nargo.toml diff --git a/yarn-project/noir-libs/safe-math/src/lib.nr b/yarn-project/aztec-nr/safe-math/src/lib.nr similarity index 100% rename from yarn-project/noir-libs/safe-math/src/lib.nr rename to yarn-project/aztec-nr/safe-math/src/lib.nr diff --git a/yarn-project/noir-libs/safe-math/src/safe_u120.nr b/yarn-project/aztec-nr/safe-math/src/safe_u120.nr similarity index 100% rename from yarn-project/noir-libs/safe-math/src/safe_u120.nr rename to yarn-project/aztec-nr/safe-math/src/safe_u120.nr diff --git a/yarn-project/noir-libs/value-note/Nargo.toml b/yarn-project/aztec-nr/value-note/Nargo.toml similarity index 76% rename from yarn-project/noir-libs/value-note/Nargo.toml rename to yarn-project/aztec-nr/value-note/Nargo.toml index 7f527d67f21..d0e7bb52461 100644 --- a/yarn-project/noir-libs/value-note/Nargo.toml +++ b/yarn-project/aztec-nr/value-note/Nargo.toml @@ -5,4 +5,4 @@ compiler_version = "0.7.1" type = "lib" [dependencies] -aztec = { path = "../aztec-noir" } \ No newline at end of file +aztec = { path = "../aztec" } \ No newline at end of file diff --git a/yarn-project/noir-libs/value-note/src/balance_utils.nr b/yarn-project/aztec-nr/value-note/src/balance_utils.nr similarity index 100% rename from yarn-project/noir-libs/value-note/src/balance_utils.nr rename to yarn-project/aztec-nr/value-note/src/balance_utils.nr diff --git a/yarn-project/noir-libs/value-note/src/filter.nr b/yarn-project/aztec-nr/value-note/src/filter.nr similarity index 100% rename from yarn-project/noir-libs/value-note/src/filter.nr rename to yarn-project/aztec-nr/value-note/src/filter.nr diff --git a/yarn-project/noir-libs/value-note/src/lib.nr b/yarn-project/aztec-nr/value-note/src/lib.nr similarity index 100% rename from yarn-project/noir-libs/value-note/src/lib.nr rename to yarn-project/aztec-nr/value-note/src/lib.nr diff --git a/yarn-project/noir-libs/value-note/src/utils.nr b/yarn-project/aztec-nr/value-note/src/utils.nr similarity index 100% rename from yarn-project/noir-libs/value-note/src/utils.nr rename to yarn-project/aztec-nr/value-note/src/utils.nr diff --git a/yarn-project/noir-libs/value-note/src/value_note.nr b/yarn-project/aztec-nr/value-note/src/value_note.nr similarity index 100% rename from yarn-project/noir-libs/value-note/src/value_note.nr rename to yarn-project/aztec-nr/value-note/src/value_note.nr diff --git a/yarn-project/aztec.js/src/account/entrypoint/entrypoint_payload.ts b/yarn-project/aztec.js/src/account/entrypoint/entrypoint_payload.ts index 56bc26c9207..6d41291437b 100644 --- a/yarn-project/aztec.js/src/account/entrypoint/entrypoint_payload.ts +++ b/yarn-project/aztec.js/src/account/entrypoint/entrypoint_payload.ts @@ -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/aztec-noir/src/entrypoint.nr +// These must match the values defined in yarn-project/aztec-nr/aztec/src/entrypoint.nr export const ACCOUNT_MAX_PRIVATE_CALLS = 2; export const ACCOUNT_MAX_PUBLIC_CALLS = 2; diff --git a/yarn-project/aztec.js/src/utils/cheat_codes.ts b/yarn-project/aztec.js/src/utils/cheat_codes.ts index d5e644e6ff4..fc3fe96c080 100644 --- a/yarn-project/aztec.js/src/utils/cheat_codes.ts +++ b/yarn-project/aztec.js/src/utils/cheat_codes.ts @@ -234,7 +234,7 @@ export class AztecCheatCodes { */ public computeSlotInMap(baseSlot: Fr | bigint, key: Fr | bigint | AztecAddress): Fr { // Based on `at` function in - // aztec3-packages/yarn-project/noir-libs/aztec-noir/src/state_vars/map.nr + // aztec3-packages/yarn-project/aztec-nr/aztec/src/state_vars/map.nr return Fr.fromBuffer( pedersenPlookupCommitInputs( this.wasm, diff --git a/yarn-project/circuits.js/src/cbind/constants.in.ts b/yarn-project/circuits.js/src/cbind/constants.in.ts index 68bf902704b..300e676a207 100644 --- a/yarn-project/circuits.js/src/cbind/constants.in.ts +++ b/yarn-project/circuits.js/src/cbind/constants.in.ts @@ -39,7 +39,7 @@ async function main(): Promise { processEnumNoir(privateStateNoteGeneratorIndexEnum, 'PRIVATE_STATE_NOTE_GENERATOR_INDEX__') + processEnumNoir(privateStateTypeEnum, 'PRIVATE_STATE_TYPE__'); - const noirTargetPath = join(__dirname, '../../../noir-libs/aztec-noir/src/constants_gen.nr'); + const noirTargetPath = join(__dirname, '../../../aztec-nr/aztec/src/constants_gen.nr'); fs.writeFileSync(noirTargetPath, resultNoir); // Solidity diff --git a/yarn-project/noir-contracts/README.md b/yarn-project/noir-contracts/README.md index 33d3ea1518b..7a227dddf9b 100644 --- a/yarn-project/noir-contracts/README.md +++ b/yarn-project/noir-contracts/README.md @@ -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/aztec-noir" } + aztec = { path = "../../../../aztec-nr/aztec" } ``` 4. Replace the content of the generated `example_contract/src/main.nr` file with your contract code. diff --git a/yarn-project/noir-contracts/scripts/get_all_libraries.sh b/yarn-project/noir-contracts/scripts/get_all_libraries.sh index e1aa684e3fa..3220187ae3c 100755 --- a/yarn-project/noir-contracts/scripts/get_all_libraries.sh +++ b/yarn-project/noir-contracts/scripts/get_all_libraries.sh @@ -1,3 +1,3 @@ #!/bin/bash -# Utility to get the names of all noir libaries located in ../noir-libs -echo $(ls -d ../noir-libs/*/Nargo.toml | sed -r "s/..\\/noir-libs\\/(.+)\\/Nargo.toml/\\1/") \ No newline at end of file +# Utility to get the names of all noir libaries located in ../aztec-nr +echo $(ls -d ../aztec-nr/*/Nargo.toml | sed -r "s/..\\/aztec-nr\\/(.+)\\/Nargo.toml/\\1/") \ No newline at end of file diff --git a/yarn-project/noir-contracts/scripts/nargo_test.sh b/yarn-project/noir-contracts/scripts/nargo_test.sh index 5635759ff73..8468c19f492 100755 --- a/yarn-project/noir-contracts/scripts/nargo_test.sh +++ b/yarn-project/noir-contracts/scripts/nargo_test.sh @@ -38,7 +38,7 @@ test() { nargo test --package ${PROJECT_NAME}_contract else echo "Testing library $PROJECT_NAME..." - cd ../noir-libs/$PROJECT_NAME + cd ../aztec-nr/$PROJECT_NAME nargo test fi } diff --git a/yarn-project/noir-contracts/src/contracts/card_game_contract/Nargo.toml b/yarn-project/noir-contracts/src/contracts/card_game_contract/Nargo.toml index 58853dc1a57..566a99dc488 100644 --- a/yarn-project/noir-contracts/src/contracts/card_game_contract/Nargo.toml +++ b/yarn-project/noir-contracts/src/contracts/card_game_contract/Nargo.toml @@ -5,5 +5,5 @@ compiler_version = "0.1" type = "contract" [dependencies] -aztec = { path = "../../../../noir-libs/aztec-noir" } -value_note = { path = "../../../../noir-libs/value-note"} +aztec = { path = "../../../../aztec-nr/aztec" } +value_note = { path = "../../../../aztec-nr/value-note"} diff --git a/yarn-project/noir-contracts/src/contracts/child_contract/Nargo.toml b/yarn-project/noir-contracts/src/contracts/child_contract/Nargo.toml index 013af3ce22e..fe50f619436 100644 --- a/yarn-project/noir-contracts/src/contracts/child_contract/Nargo.toml +++ b/yarn-project/noir-contracts/src/contracts/child_contract/Nargo.toml @@ -5,4 +5,4 @@ compiler_version = "0.1" type = "contract" [dependencies] -aztec = { path = "../../../../noir-libs/aztec-noir" } +aztec = { path = "../../../../aztec-nr/aztec" } diff --git a/yarn-project/noir-contracts/src/contracts/docs_example_contract/Nargo.toml b/yarn-project/noir-contracts/src/contracts/docs_example_contract/Nargo.toml index 7826fffbf0d..f5870a5a735 100644 --- a/yarn-project/noir-contracts/src/contracts/docs_example_contract/Nargo.toml +++ b/yarn-project/noir-contracts/src/contracts/docs_example_contract/Nargo.toml @@ -5,4 +5,4 @@ compiler_version = "0.1" type = "contract" [dependencies] -aztec = { path = "../../../../noir-libs/aztec-noir" } \ No newline at end of file +aztec = { path = "../../../../aztec-nr/aztec" } \ No newline at end of file diff --git a/yarn-project/noir-contracts/src/contracts/easy_private_token_contract/Nargo.toml b/yarn-project/noir-contracts/src/contracts/easy_private_token_contract/Nargo.toml index 4b8208cc51b..e8651b9783a 100644 --- a/yarn-project/noir-contracts/src/contracts/easy_private_token_contract/Nargo.toml +++ b/yarn-project/noir-contracts/src/contracts/easy_private_token_contract/Nargo.toml @@ -5,6 +5,6 @@ compiler_version = "0.1" type = "contract" [dependencies] -aztec = { path = "../../../../noir-libs/aztec-noir" } -value_note = { path = "../../../../noir-libs/value-note"} -easy_private_state = { path = "../../../../noir-libs/easy-private-state"} \ No newline at end of file +aztec = { path = "../../../../aztec-nr/aztec" } +value_note = { path = "../../../../aztec-nr/value-note"} +easy_private_state = { path = "../../../../aztec-nr/easy-private-state"} \ No newline at end of file diff --git a/yarn-project/noir-contracts/src/contracts/ecdsa_account_contract/Nargo.toml b/yarn-project/noir-contracts/src/contracts/ecdsa_account_contract/Nargo.toml index 999b75a218a..b0e030b7808 100644 --- a/yarn-project/noir-contracts/src/contracts/ecdsa_account_contract/Nargo.toml +++ b/yarn-project/noir-contracts/src/contracts/ecdsa_account_contract/Nargo.toml @@ -5,4 +5,4 @@ compiler_version = "0.1" type = "contract" [dependencies] -aztec = { path = "../../../../noir-libs/aztec-noir" } +aztec = { path = "../../../../aztec-nr/aztec" } diff --git a/yarn-project/noir-contracts/src/contracts/escrow_contract/Nargo.toml b/yarn-project/noir-contracts/src/contracts/escrow_contract/Nargo.toml index 4077357a075..6278ae9ddfb 100644 --- a/yarn-project/noir-contracts/src/contracts/escrow_contract/Nargo.toml +++ b/yarn-project/noir-contracts/src/contracts/escrow_contract/Nargo.toml @@ -5,4 +5,4 @@ compiler_version = "0.1" type = "contract" [dependencies] -aztec = { path = "../../../../noir-libs/aztec-noir" } +aztec = { path = "../../../../aztec-nr/aztec" } diff --git a/yarn-project/noir-contracts/src/contracts/import_test_contract/Nargo.toml b/yarn-project/noir-contracts/src/contracts/import_test_contract/Nargo.toml index 21840bab59b..a00b14498de 100644 --- a/yarn-project/noir-contracts/src/contracts/import_test_contract/Nargo.toml +++ b/yarn-project/noir-contracts/src/contracts/import_test_contract/Nargo.toml @@ -5,4 +5,4 @@ compiler_version = "0.1" type = "contract" [dependencies] -aztec = { path = "../../../../noir-libs/aztec-noir" } \ No newline at end of file +aztec = { path = "../../../../aztec-nr/aztec" } \ No newline at end of file diff --git a/yarn-project/noir-contracts/src/contracts/lending_contract/Nargo.toml b/yarn-project/noir-contracts/src/contracts/lending_contract/Nargo.toml index 8233a8c530c..dbdd8a1c4b2 100644 --- a/yarn-project/noir-contracts/src/contracts/lending_contract/Nargo.toml +++ b/yarn-project/noir-contracts/src/contracts/lending_contract/Nargo.toml @@ -5,5 +5,5 @@ compiler_version = "0.1" type = "contract" [dependencies] -aztec = { path = "../../../../noir-libs/aztec-noir" } -safe_math = { path = "../../../../noir-libs/safe-math" } \ No newline at end of file +aztec = { path = "../../../../aztec-nr/aztec" } +safe_math = { path = "../../../../aztec-nr/safe-math" } \ No newline at end of file diff --git a/yarn-project/noir-contracts/src/contracts/multi_transfer_contract/Nargo.toml b/yarn-project/noir-contracts/src/contracts/multi_transfer_contract/Nargo.toml index 86574e53fc1..cccba64b2ea 100644 --- a/yarn-project/noir-contracts/src/contracts/multi_transfer_contract/Nargo.toml +++ b/yarn-project/noir-contracts/src/contracts/multi_transfer_contract/Nargo.toml @@ -5,4 +5,4 @@ compiler_version = "0.1" type = "contract" [dependencies] -aztec = { path = "../../../../noir-libs/aztec-noir" } \ No newline at end of file +aztec = { path = "../../../../aztec-nr/aztec" } \ No newline at end of file diff --git a/yarn-project/noir-contracts/src/contracts/native_token_contract/Nargo.toml b/yarn-project/noir-contracts/src/contracts/native_token_contract/Nargo.toml index 42a0a9313a4..05cf9a92810 100644 --- a/yarn-project/noir-contracts/src/contracts/native_token_contract/Nargo.toml +++ b/yarn-project/noir-contracts/src/contracts/native_token_contract/Nargo.toml @@ -5,6 +5,6 @@ compiler_version = "0.1" type = "contract" [dependencies] -aztec = { path = "../../../../noir-libs/aztec-noir" } -value_note = { path = "../../../../noir-libs/value-note"} +aztec = { path = "../../../../aztec-nr/aztec" } +value_note = { path = "../../../../aztec-nr/value-note"} non_native = { path = "../non_native_token_contract"} \ No newline at end of file diff --git a/yarn-project/noir-contracts/src/contracts/non_native_token_contract/Nargo.toml b/yarn-project/noir-contracts/src/contracts/non_native_token_contract/Nargo.toml index d6c7fef03e1..5e51ed65b25 100644 --- a/yarn-project/noir-contracts/src/contracts/non_native_token_contract/Nargo.toml +++ b/yarn-project/noir-contracts/src/contracts/non_native_token_contract/Nargo.toml @@ -5,5 +5,5 @@ compiler_version = "0.1" type = "contract" [dependencies] -aztec = { path = "../../../../noir-libs/aztec-noir" } -value_note = { path = "../../../../noir-libs/value-note"} \ No newline at end of file +aztec = { path = "../../../../aztec-nr/aztec" } +value_note = { path = "../../../../aztec-nr/value-note"} \ No newline at end of file diff --git a/yarn-project/noir-contracts/src/contracts/parent_contract/Nargo.toml b/yarn-project/noir-contracts/src/contracts/parent_contract/Nargo.toml index 850b3ad14e5..bde7ef065d0 100644 --- a/yarn-project/noir-contracts/src/contracts/parent_contract/Nargo.toml +++ b/yarn-project/noir-contracts/src/contracts/parent_contract/Nargo.toml @@ -5,4 +5,4 @@ compiler_version = "0.1" type = "contract" [dependencies] -aztec = { path = "../../../../noir-libs/aztec-noir" } +aztec = { path = "../../../../aztec-nr/aztec" } diff --git a/yarn-project/noir-contracts/src/contracts/pending_commitments_contract/Nargo.toml b/yarn-project/noir-contracts/src/contracts/pending_commitments_contract/Nargo.toml index 1c0e84969da..c692b32fad3 100644 --- a/yarn-project/noir-contracts/src/contracts/pending_commitments_contract/Nargo.toml +++ b/yarn-project/noir-contracts/src/contracts/pending_commitments_contract/Nargo.toml @@ -5,5 +5,5 @@ compiler_version = "0.1" type = "contract" [dependencies] -aztec = { path = "../../../../noir-libs/aztec-noir" } -value_note = { path = "../../../../noir-libs/value-note"} +aztec = { path = "../../../../aztec-nr/aztec" } +value_note = { path = "../../../../aztec-nr/value-note"} diff --git a/yarn-project/noir-contracts/src/contracts/pokeable_token_contract/Nargo.toml b/yarn-project/noir-contracts/src/contracts/pokeable_token_contract/Nargo.toml index 4a8af37b776..6b07ad277f4 100644 --- a/yarn-project/noir-contracts/src/contracts/pokeable_token_contract/Nargo.toml +++ b/yarn-project/noir-contracts/src/contracts/pokeable_token_contract/Nargo.toml @@ -5,5 +5,5 @@ compiler_version = "0.1" type = "contract" [dependencies] -aztec = { path = "../../../../noir-libs/aztec-noir" } -value_note = { path = "../../../../noir-libs/value-note"} \ No newline at end of file +aztec = { path = "../../../../aztec-nr/aztec" } +value_note = { path = "../../../../aztec-nr/value-note"} \ No newline at end of file diff --git a/yarn-project/noir-contracts/src/contracts/price_feed_contract/Nargo.toml b/yarn-project/noir-contracts/src/contracts/price_feed_contract/Nargo.toml index be6246ac397..b414ff04bf7 100644 --- a/yarn-project/noir-contracts/src/contracts/price_feed_contract/Nargo.toml +++ b/yarn-project/noir-contracts/src/contracts/price_feed_contract/Nargo.toml @@ -5,4 +5,4 @@ compiler_version = "0.1" type = "contract" [dependencies] -aztec = { path = "../../../../noir-libs/aztec-noir" } +aztec = { path = "../../../../aztec-nr/aztec" } diff --git a/yarn-project/noir-contracts/src/contracts/private_token_airdrop_contract/Nargo.toml b/yarn-project/noir-contracts/src/contracts/private_token_airdrop_contract/Nargo.toml index 9f21c40d77e..c41c12b4351 100644 --- a/yarn-project/noir-contracts/src/contracts/private_token_airdrop_contract/Nargo.toml +++ b/yarn-project/noir-contracts/src/contracts/private_token_airdrop_contract/Nargo.toml @@ -5,5 +5,5 @@ compiler_version = "0.1" type = "contract" [dependencies] -aztec = { path = "../../../../noir-libs/aztec-noir" } -value_note = { path = "../../../../noir-libs/value-note"} \ No newline at end of file +aztec = { path = "../../../../aztec-nr/aztec" } +value_note = { path = "../../../../aztec-nr/value-note"} \ No newline at end of file diff --git a/yarn-project/noir-contracts/src/contracts/private_token_contract/Nargo.toml b/yarn-project/noir-contracts/src/contracts/private_token_contract/Nargo.toml index 0eb35564eec..f3e29ac1bf5 100644 --- a/yarn-project/noir-contracts/src/contracts/private_token_contract/Nargo.toml +++ b/yarn-project/noir-contracts/src/contracts/private_token_contract/Nargo.toml @@ -7,6 +7,6 @@ type = "contract" [dependencies] # highlight-next-line:importing-aztec -aztec = { path = "../../../../noir-libs/aztec-noir" } -value_note = { path = "../../../../noir-libs/value-note"} +aztec = { path = "../../../../aztec-nr/aztec" } +value_note = { path = "../../../../aztec-nr/value-note"} # docs:end:importing-aztec \ No newline at end of file diff --git a/yarn-project/noir-contracts/src/contracts/public_token_contract/Nargo.toml b/yarn-project/noir-contracts/src/contracts/public_token_contract/Nargo.toml index 04489c04c7e..c3098dda9ee 100644 --- a/yarn-project/noir-contracts/src/contracts/public_token_contract/Nargo.toml +++ b/yarn-project/noir-contracts/src/contracts/public_token_contract/Nargo.toml @@ -5,4 +5,4 @@ compiler_version = "0.1" type = "contract" [dependencies] -aztec = { path = "../../../../noir-libs/aztec-noir" } \ No newline at end of file +aztec = { path = "../../../../aztec-nr/aztec" } \ No newline at end of file diff --git a/yarn-project/noir-contracts/src/contracts/schnorr_account_contract/Nargo.toml b/yarn-project/noir-contracts/src/contracts/schnorr_account_contract/Nargo.toml index 84c123fadee..4ac82f6b7e6 100644 --- a/yarn-project/noir-contracts/src/contracts/schnorr_account_contract/Nargo.toml +++ b/yarn-project/noir-contracts/src/contracts/schnorr_account_contract/Nargo.toml @@ -5,4 +5,4 @@ compiler_version = "0.1" type = "contract" [dependencies] -aztec = { path = "../../../../noir-libs/aztec-noir" } \ No newline at end of file +aztec = { path = "../../../../aztec-nr/aztec" } \ No newline at end of file diff --git a/yarn-project/noir-contracts/src/contracts/schnorr_auth_witness_account_contract/Nargo.toml b/yarn-project/noir-contracts/src/contracts/schnorr_auth_witness_account_contract/Nargo.toml index 77bd89399b3..9ff8c965953 100644 --- a/yarn-project/noir-contracts/src/contracts/schnorr_auth_witness_account_contract/Nargo.toml +++ b/yarn-project/noir-contracts/src/contracts/schnorr_auth_witness_account_contract/Nargo.toml @@ -5,4 +5,4 @@ compiler_version = "0.1" type = "contract" [dependencies] -aztec = { path = "../../../../noir-libs/aztec-noir" } +aztec = { path = "../../../../aztec-nr/aztec" } diff --git a/yarn-project/noir-contracts/src/contracts/schnorr_hardcoded_account_contract/Nargo.toml b/yarn-project/noir-contracts/src/contracts/schnorr_hardcoded_account_contract/Nargo.toml index 218d93ac79d..586e246467d 100644 --- a/yarn-project/noir-contracts/src/contracts/schnorr_hardcoded_account_contract/Nargo.toml +++ b/yarn-project/noir-contracts/src/contracts/schnorr_hardcoded_account_contract/Nargo.toml @@ -5,4 +5,4 @@ compiler_version = "0.1" type = "contract" [dependencies] -aztec = { path = "../../../../noir-libs/aztec-noir" } \ No newline at end of file +aztec = { path = "../../../../aztec-nr/aztec" } \ No newline at end of file diff --git a/yarn-project/noir-contracts/src/contracts/schnorr_single_key_account_contract/Nargo.toml b/yarn-project/noir-contracts/src/contracts/schnorr_single_key_account_contract/Nargo.toml index d1eff41f9ae..d02343f7772 100644 --- a/yarn-project/noir-contracts/src/contracts/schnorr_single_key_account_contract/Nargo.toml +++ b/yarn-project/noir-contracts/src/contracts/schnorr_single_key_account_contract/Nargo.toml @@ -5,4 +5,4 @@ compiler_version = "0.1" type = "contract" [dependencies] -aztec = { path = "../../../../noir-libs/aztec-noir" } +aztec = { path = "../../../../aztec-nr/aztec" } diff --git a/yarn-project/noir-contracts/src/contracts/test_contract/Nargo.toml b/yarn-project/noir-contracts/src/contracts/test_contract/Nargo.toml index 1d564c16ddd..c4818f6ba32 100644 --- a/yarn-project/noir-contracts/src/contracts/test_contract/Nargo.toml +++ b/yarn-project/noir-contracts/src/contracts/test_contract/Nargo.toml @@ -5,4 +5,4 @@ compiler_version = "0.1" type = "contract" [dependencies] -aztec = { path = "../../../../noir-libs/aztec-noir" } +aztec = { path = "../../../../aztec-nr/aztec" } diff --git a/yarn-project/noir-contracts/src/contracts/token_contract/Nargo.toml b/yarn-project/noir-contracts/src/contracts/token_contract/Nargo.toml index cece7de949c..6bc97909172 100644 --- a/yarn-project/noir-contracts/src/contracts/token_contract/Nargo.toml +++ b/yarn-project/noir-contracts/src/contracts/token_contract/Nargo.toml @@ -5,6 +5,6 @@ compiler_version = "0.1" type = "contract" [dependencies] -aztec = { path = "../../../../noir-libs/aztec-noir" } -value_note = { path = "../../../../noir-libs/value-note"} -safe_math = { path = "../../../../noir-libs/safe-math" } \ No newline at end of file +aztec = { path = "../../../../aztec-nr/aztec" } +value_note = { path = "../../../../aztec-nr/value-note"} +safe_math = { path = "../../../../aztec-nr/safe-math" } \ No newline at end of file diff --git a/yarn-project/noir-contracts/src/contracts/uniswap_contract/Nargo.toml b/yarn-project/noir-contracts/src/contracts/uniswap_contract/Nargo.toml index 21daac464fd..110b8eb98fe 100644 --- a/yarn-project/noir-contracts/src/contracts/uniswap_contract/Nargo.toml +++ b/yarn-project/noir-contracts/src/contracts/uniswap_contract/Nargo.toml @@ -5,4 +5,4 @@ compiler_version = "0.1" type = "contract" [dependencies] -aztec = { path = "../../../../noir-libs/aztec-noir" } +aztec = { path = "../../../../aztec-nr/aztec" }