From 0b5960dc9effbf8b4079d1bc08ae8ec5859e7e8f Mon Sep 17 00:00:00 2001 From: Jrigada Date: Tue, 10 Dec 2024 15:41:16 -0300 Subject: [PATCH] Add forge init --zksync documentation --- scripts/gen_output/forge.sh | 2 +- src/projects/creating-a-new-project.md | 4 ++-- src/projects/working-on-an-existing-project.md | 6 +++--- src/reference/forge/forge-init.md | 5 +++++ 4 files changed, 11 insertions(+), 6 deletions(-) diff --git a/scripts/gen_output/forge.sh b/scripts/gen_output/forge.sh index 10ba3fc34..d586ef153 100644 --- a/scripts/gen_output/forge.sh +++ b/scripts/gen_output/forge.sh @@ -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 diff --git a/src/projects/creating-a-new-project.md b/src/projects/creating-a-new-project.md index 23e367f38..6f972bc91 100644 --- a/src/projects/creating-a-new-project.md +++ b/src/projects/creating-a-new-project.md @@ -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: @@ -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: diff --git a/src/projects/working-on-an-existing-project.md b/src/projects/working-on-an-existing-project.md index 59786451f..c82f2778c 100644 --- a/src/projects/working-on-an-existing-project.md +++ b/src/projects/working-on-an-existing-project.md @@ -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 diff --git a/src/reference/forge/forge-init.md b/src/reference/forge/forge-init.md index 2fc7e9eb0..b66e77a43 100644 --- a/src/reference/forge/forge-init.md +++ b/src/reference/forge/forge-init.md @@ -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.