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: AGENTS.md
+11-4Lines changed: 11 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,22 +1,29 @@
1
1
# Repository guidelines for Codex agents
2
2
3
-
This repository contains TypeScript scripts and Noir contracts for the Aztec local network.
3
+
This repository contains TypeScript scripts and Noir contracts for the Aztec network.
4
4
Follow these guidelines when contributing:
5
5
6
6
## Setup
7
7
- Use **Node.js v22** with Yarn.
8
8
- Install dependencies with `yarn install`.
9
-
- Start the Aztec local network using `aztec start --local-network` before running tests or scripts.
9
+
- The Aztec CLI (`aztec`) must be installed at the version matching `Nargo.toml` and `package.json`.
10
+
- Start the Aztec local network with `aztec start --local-network` before running E2E tests or scripts. This is **not** needed for compilation or Noir unit tests.
11
+
- After restarting the local network, always run `rm -rf ./store` to clear stale PXE data.
10
12
11
13
## Development
14
+
- This is an ESM project (`"type": "module"` in `package.json`).
12
15
- Compile contracts with `yarn compile` and generate TypeScript artifacts with `yarn codegen`.
13
16
- Use four spaces for indentation in TypeScript and scripts.
14
17
- Do not commit generated artifacts (`src/artifacts`, `target`, or `store` folders).
18
+
- Never edit `src/artifacts/PodRacing.ts` directly; it is generated by `yarn codegen`.
19
+
- To target devnet instead of local network, set `AZTEC_ENV=devnet` (e.g. `AZTEC_ENV=devnet yarn deploy`).
15
20
16
21
## Testing
17
-
- Run `yarn test` and ensure it passes before committing. This runs both the TypeScript tests and Noir tests.
22
+
There are two independent test systems:
23
+
-**Noir TXE tests** (`yarn test:nr`): Run in the TXE simulator, no network required.
24
+
-**TypeScript E2E tests** (`yarn test:js`): Require a running local network.
25
+
-`yarn test` runs both. Ensure tests pass before committing.
18
26
19
27
## Pull Requests
20
28
- Use clear commit messages and provide a concise description in the PR body about the change.
@@ -58,7 +52,7 @@ This project uses JSON configuration files to manage environment-specific settin
58
52
-`config/local-network.json` - Configuration for local network development
59
53
-`config/devnet.json` - Configuration for devnet deployment
60
54
61
-
The system automatically loads the appropriate configuration file based on the `ENV` environment variable. If `ENV` is not set, it defaults to `local-network`.
55
+
The system automatically loads the appropriate configuration file based on the `AZTEC_ENV` environment variable. If `AZTEC_ENV` is not set, it defaults to `local-network`.
62
56
63
57
The configuration files contain network URLs, timeouts, and environment-specific settings. You can modify these files to customize your development environment.
yarn interaction-existing-contract::devnet # Interact with devnet contracts
90
84
```
91
85
92
-
The `::devnet` suffix automatically sets `ENV=devnet`, loading configuration from `config/devnet.json`.
86
+
The `::devnet` suffix automatically sets `AZTEC_ENV=devnet`, loading configuration from `config/devnet.json`.
93
87
94
88
---
95
89
@@ -163,9 +157,9 @@ Then test with:
163
157
yarn test
164
158
```
165
159
166
-
Testing will run the **TypeScript tests** defined in `index.test.ts` inside `./src/test/e2e`, as well as the [Aztec Testing eXecution Environment (TXE)](https://docs.aztec.network/developers/guides/smart_contracts/testing) tests defined in [`first.nr`](./src/test/first.nr) (imported in the contract file with `mod test;`).
160
+
Testing will run the **TypeScript E2E tests** defined in `./src/test/e2e/`, as well as the [Aztec Testing eXecution Environment (TXE)](https://docs.aztec.network/developers/guides/smart_contracts/testing) tests defined in [`./src/test/`](./src/test/) (imported in the contract file with `mod test;`).
167
161
168
-
Note: The Typescript tests spawn an instance of the local network to test against, and close it once the TS tests are complete.
162
+
Note: The TypeScript tests require a running local network. The Noir TXE tests (`yarn test:nr`) run without a network.
169
163
170
164
---
171
165
@@ -186,7 +180,7 @@ You can find a handful of scripts in the `./scripts` folder.
186
180
The `./src/utils/` folder contains utility functions:
187
181
188
182
-`./src/utils/create_account_from_env.ts` provides functions to create Schnorr accounts from environment variables (SECRET, SIGNING_KEY, and SALT), useful for account management across different environments.
189
-
-`./src/utils/setup_wallet.ts` provides a function to set up and configure the TestWallet with proper configuration based on the environment.
183
+
-`./src/utils/setup_wallet.ts` provides a function to set up and configure the EmbeddedWallet with proper configuration based on the environment.
190
184
-`./src/utils/deploy_account.ts` provides a function to deploy Schnorr accounts to the network with sponsored fee payment, including key generation and deployment verification.
191
185
-`./src/utils/sponsored_fpc.ts` provides functions to deploy and manage the SponsoredFPC (Fee Payment Contract) for handling sponsored transaction fees.
192
186
-`./config/config.ts` provides environment-aware configuration loading, automatically selecting the correct JSON config file based on the `ENV` variable.
@@ -195,24 +189,13 @@ The `./src/utils/` folder contains utility functions:
195
189
196
190
:warning: Tests and scripts set up and run the Private Execution Environment (PXE) and store PXE data in the `./store` directory. If you restart the local network, you will need to delete the `./store` directory to avoid errors.
197
191
198
-
### 🔄 **Update Node.js and Noir Dependencies**
199
-
200
-
```bash
201
-
yarn update
202
-
```
203
-
204
-
### 🔄 **Update Contract**
205
-
206
-
Get the **contract code from the monorepo**. The script will look at the versions defined in `./Nargo.toml` and fetch that version of the code from the monorepo.
207
-
208
-
```bash
209
-
yarn update
210
-
```
192
+
### 🔄 **Update Contract from Monorepo**
211
193
212
-
You may need to update permissions with:
194
+
Get the **contract code from the monorepo**. The script will look at the versions defined in `./Nargo.toml` and fetch that version of the code from the monorepo:
0 commit comments