Skip to content

Commit

Permalink
Add forge init --zksync documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
Jrigada committed Dec 10, 2024
1 parent d5a11f8 commit 0b5960d
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 6 deletions.
2 changes: 1 addition & 1 deletion scripts/gen_output/forge.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ gen_forge() {

in_temp hello_foundry
run_command "$OUTPUT_DIR/hello_foundry/forge-init" \
forge init hello_foundry
forge init --zksync hello_foundry
cd hello_foundry
run_command "$OUTPUT_DIR/hello_foundry/tree" \
tree . -d -L 1
Expand Down
4 changes: 2 additions & 2 deletions src/projects/creating-a-new-project.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ This creates a new directory `hello_foundry` from the default template. This als
If you want to create a new project using a different template, you would pass the `--template` flag, like so:

```sh
$ forge init --template https://github.com/foundry-rs/forge-template hello_template
$ forge init --zksync --template https://github.com/foundry-rs/forge-template hello_template
```

For now, let's check what the default template looks like:
Expand All @@ -21,7 +21,7 @@ $ cd hello_foundry
{{#include ../output/hello_foundry/tree:all}}
```

The default template comes with one dependency installed: Forge Standard Library. This is the preferred testing library used for Foundry projects. Additionally, the template also comes with an empty starter contract and a simple test.
The default template comes with two dependencies installed: Forge Standard Library and Forge-ZKsync Standard Library. This is the preferred testing library used for Foundry projects. Additionally, the template also comes with an empty starter contract and a simple test.

Let's build the project:

Expand Down
6 changes: 3 additions & 3 deletions src/projects/working-on-an-existing-project.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,6 @@ And to test, use [`forge test`][test]:

[paul]: https://github.com/PaulRBerg
[template]: https://github.com/PaulRBerg/foundry-template
[install]: ../reference/forge/forge-install.md
[build]: ../reference/forge/forge-build.md
[test]: ../reference/forge/forge-test.md
[install]: ../reference/cli/forge/install.md
[build]: ../src/reference/cli/forge/build.md
[test]: ../reference/cli/forge/test.md
5 changes: 5 additions & 0 deletions src/reference/forge/forge-init.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,15 @@ By default, `forge init` will also initialize a new git repository, install some

If you do not want this behavior, pass `--no-git`.

If you want to create a project a ZKsync template, you can use the `--zksync` flag. This will download the [forge-zksync-std](https://github.com/Moonsong-Labs/forge-zksync-std) library and add it to the project and also populate the `.gitignore` file with zksync specific output directories.

### OPTIONS

#### Init Options

`--zksync`
    Create the project with zksync template.

`--force`
    Create the project even if the specified root directory is not empty.

Expand Down

0 comments on commit 0b5960d

Please sign in to comment.