Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
Original file line number Diff line number Diff line change
Expand Up @@ -123,8 +123,11 @@ The package ships the L1 contract sources under `@aztec/l1-artifacts/l1-contract
```bash
git clone https://github.com/critesjosh/hardhat-aztec-example
cd hardhat-aztec-example
git checkout 3be1b31f8054cd4a81817b6940171849950b8dfb
```

The `git checkout` pins the starter to a commit we reviewed, so the tutorial always uses reviewed code.

When complete, your project will have this structure:

```
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,12 @@ We want to add a few more dependencies now before we start:

```bash
cd hardhat-aztec-example
git checkout 3be1b31f8054cd4a81817b6940171849950b8dfb
yarn add @aztec/aztec.js@5.2.0 @aztec/accounts@5.2.0 @aztec/stdlib@5.2.0 @aztec/wallets@5.2.0 @aztec/viem@2.38.2 tsx
```

The `git checkout` pins the starter to a commit we reviewed, so the tutorial always uses reviewed code.

:::note Use `@aztec/l1-artifacts` for the L1 interfaces
The starter repo may still pin `@aztec/l1-contracts` as a git dependency; that repository is no longer updated. In `package.json`, replace it with the `@aztec/l1-artifacts` npm package at the version used in this tutorial, then run `yarn install` again:

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,8 +115,11 @@ This template is a community-maintained starter. If the repository is unavailabl
```bash
git clone https://github.com/critesjosh/hardhat-aztec-example
cd hardhat-aztec-example
git checkout 3be1b31f8054cd4a81817b6940171849950b8dfb
```

The `git checkout` pins the starter to a commit we reviewed, so the tutorial always uses reviewed code.

Before adding dependencies, make the starter install with yarn 4 (4.14 or later): create the `.yarnrc.yml`, swap `@aztec/l1-contracts` for `@aztec-foundation/l1-artifacts`, point the `postinstall` remappings at the new package, and add the root `remappings.txt`. These are the first three steps of the [Token Bridge tutorial's project setup](./token_bridge.md#project-setup); without them `yarn add` fails on the starter's git dependencies and `npx hardhat compile` cannot resolve the `@aztec/*` imports.

Then delete the starter's `Counter` contracts. They import the old `@aztec/l1-contracts/src/...` paths, which the new remapping does not resolve, so `npx hardhat compile` fails on them:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,15 @@ Let's start simple. Since this is an Ethereum project, it's easier to just start

```bash
git clone https://github.com/critesjosh/hardhat-aztec-example
cd hardhat-aztec-example
git checkout 3be1b31f8054cd4a81817b6940171849950b8dfb
```

You're cloning a repo here to make it easier for Aztec's `l1-contracts` to be mapped correctly. You should now have a `hardhat-aztec-example` folder with Hardhat's default starter, with a few changes in `package.json`.
You're cloning a repo here to make it easier for Aztec's `l1-contracts` to be mapped correctly. You should now have a `hardhat-aztec-example` folder with Hardhat's default starter, with a few changes in `package.json`. The `git checkout` pins the starter to a commit we reviewed, so the tutorial always uses reviewed code.

We want to add a few more dependencies now before we start. The starter needs four changes before it installs with yarn 4. They need yarn 4.14 or later (check with `yarn --version`): the `approvedGitRepositories` setting below arrived in 4.14, earlier 4.x releases reject the whole `.yarnrc.yml` because of it, and from 4.14 on yarn refuses any git dependency the setting does not list.

First, from the `hardhat-aztec-example` directory (`cd hardhat-aztec-example`), tell yarn to install into `node_modules` (the starter's scripts and Hardhat expect a real `node_modules` tree) and allow the starter's one git dependency, `forge-std`. Create `.yarnrc.yml`:
First, from the `hardhat-aztec-example` directory, tell yarn to install into `node_modules` (the starter's scripts and Hardhat expect a real `node_modules` tree) and allow the starter's one git dependency, `forge-std`. Create `.yarnrc.yml`:

```yaml
nodeLinker: node-modules
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,8 +115,11 @@ This template is a community-maintained starter. If the repository is unavailabl
```bash
git clone https://github.com/critesjosh/hardhat-aztec-example
cd hardhat-aztec-example
git checkout 3be1b31f8054cd4a81817b6940171849950b8dfb
```

The `git checkout` pins the starter to a commit we reviewed, so the tutorial always uses reviewed code.

Before adding dependencies, make the starter install with yarn 4: create the `.yarnrc.yml`, swap `@aztec/l1-contracts` for `@aztec-foundation/l1-artifacts`, point the `postinstall` remappings at the new package, and add the root `remappings.txt`. These are the first three steps of the [Token Bridge tutorial's project setup](./token_bridge.md#project-setup); without them `yarn add` fails on the starter's git dependencies and `npx hardhat compile` cannot resolve the `@aztec/*` imports.

When complete, your project will have this structure:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,15 @@ Let's start simple. Since this is an Ethereum project, it's easier to just start

```bash
git clone https://github.com/critesjosh/hardhat-aztec-example
cd hardhat-aztec-example
git checkout 3be1b31f8054cd4a81817b6940171849950b8dfb
```

You're cloning a repo here to make it easier for Aztec's `l1-contracts` to be mapped correctly. You should now have a `hardhat-aztec-example` folder with Hardhat's default starter, with a few changes in `package.json`.
You're cloning a repo here to make it easier for Aztec's `l1-contracts` to be mapped correctly. You should now have a `hardhat-aztec-example` folder with Hardhat's default starter, with a few changes in `package.json`. The `git checkout` pins the starter to a commit we reviewed, so the tutorial always uses reviewed code.

We want to add a few more dependencies now before we start. The starter needs four changes before it installs with yarn 4.

First, from the `hardhat-aztec-example` directory (`cd hardhat-aztec-example`), tell yarn to install into `node_modules` (the starter's scripts and Hardhat expect a real `node_modules` tree) and allow the starter's one git dependency, `forge-std`. Create `.yarnrc.yml`:
First, from the `hardhat-aztec-example` directory, tell yarn to install into `node_modules` (the starter's scripts and Hardhat expect a real `node_modules` tree) and allow the starter's one git dependency, `forge-std`. Create `.yarnrc.yml`:

```yaml
nodeLinker: node-modules
Expand Down
Loading