You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/docs-developers/docs/aztec-nr/framework-description/contract_structure.md
+12-4Lines changed: 12 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -10,15 +10,23 @@ High-level structure of how Aztec smart contracts including the different compon
10
10
11
11
## Directory structure
12
12
13
-
Here's a common layout for a basic Aztec.nr Contract project:
13
+
When you create a new project with `aztec new`, it generates a workspace with two crates: a `contract` crate for your smart contract and a `test` crate for Noir tests.
14
14
15
15
```text title="layout of an aztec contract project"
16
16
─── my_aztec_contract_project
17
-
├── src
18
-
│ └── main.nr <-- your contract
19
-
└── Nargo.toml <-- package and dependency management
17
+
├── Nargo.toml <-- workspace root
18
+
├── contract
19
+
│ ├── src
20
+
│ │ └── main.nr <-- your contract
21
+
│ └── Nargo.toml <-- contract package and dependencies
22
+
└── test
23
+
├── src
24
+
│ └── lib.nr <-- your tests
25
+
└── Nargo.toml <-- test package and dependencies
20
26
```
21
27
28
+
The workspace root `Nargo.toml` declares both crates as workspace members. The contract code lives in `contract/src/main.nr`, and tests live in a separate `test` crate that depends on the contract crate.
29
+
22
30
See the vanilla Noir docs for [more info on packages](https://noir-lang.org/docs/noir/modules_packages_crates/crates_and_packages).
0 commit comments