diff --git a/src/.DS_Store b/src/.DS_Store new file mode 100644 index 000000000..675619f8a Binary files /dev/null and b/src/.DS_Store differ diff --git a/src/README.md b/src/README.md index cc01e7342..f993cb6fc 100644 --- a/src/README.md +++ b/src/README.md @@ -9,6 +9,7 @@ Foundry-ZKsync manages your dependencies, compiles your project, runs tests, dep > ⚠️ **Alpha Stage:** The project is in alpha, so you might encounter issues. For more information or reporting bugs, please visit the [Foundry-ZKsync GitHub repository](https://github.com/matter-labs/foundry-zksync). ## Sections + **[Getting Started](getting-started/installation.md)** To start with Foundry-ZKsync, install Foundry-ZKsync and set up your first project. @@ -31,17 +32,18 @@ This section comprehensively reviews all the Foundry commands supported in the F > > Feedback and contributions are welcome. You can contribute to this book on [Foundry-ZKSync Book GitHub repository](https://github.com/matter-labs/foundry-zksync-book). > -
+>
+ +**_For general information about Foundry, see the [Foundry Book](https://book.getfoundry.sh/)._** -***For general information about Foundry, see the [Foundry Book](https://book.getfoundry.sh/).*** - \ No newline at end of file +--> diff --git a/src/images/.DS_Store b/src/images/.DS_Store new file mode 100644 index 000000000..3c3e8e25b Binary files /dev/null and b/src/images/.DS_Store differ diff --git a/src/images/key-features.png b/src/images/key-features.png index c2bf0ae21..bb5b8951b 100644 Binary files a/src/images/key-features.png and b/src/images/key-features.png differ diff --git a/src/images/lifetime/step-3.png b/src/images/lifetime/step-3.png index ea7517fb3..e5f839aea 100644 Binary files a/src/images/lifetime/step-3.png and b/src/images/lifetime/step-3.png differ diff --git a/src/projects/working-on-an-existing-project.md b/src/projects/working-on-an-existing-project.md index 17404fa71..e3c5cdd16 100644 --- a/src/projects/working-on-an-existing-project.md +++ b/src/projects/working-on-an-existing-project.md @@ -8,7 +8,7 @@ First, clone the project and run [`forge install`][install] inside the project d ```sh $ git clone https://github.com/PaulRBerg/foundry-template -$ cd foundry-template +$ cd foundry-template $ forge install $ bun install # install Solhint, Prettier, and other Node.js deps ``` @@ -28,9 +28,9 @@ And to test, use [`forge test`][test]: ``` > ℹ️ **Note** +> > If you are already familiar with the foundry, you will notice the `—-zksync` flag; we’ll cover it in detail in the following sections. - [paul]: https://github.com/PaulRBerg [template]: https://github.com/PaulRBerg/foundry-template [install]: ../reference/forge/forge-install.md diff --git a/src/zksync-specifics/README.md b/src/zksync-specifics/README.md index 4d27efa2e..ebe43d818 100644 --- a/src/zksync-specifics/README.md +++ b/src/zksync-specifics/README.md @@ -2,19 +2,18 @@ This section covers the specific parts of ZKSync foundry, how it works, insight into compilation, and custom cheatcodes to help work with contracts specifically in ZKSync. +## Context -## To-start Context Foundry-zkSync tests are initially [executed](execution-overview.md) in the EVM context (the traditional execution environment for Ethereum smart contracts). This is done to maintain compatibility with Ethereum tooling and to leverage Foundry features like [Cheatcodes](limitations/cheatcodes.md). - ![Features](../images/key-features.png) ### Lifetime Execution + A forge test begins execution in the EVM context but can switch to the EraVM context during the test for zkSync-specific features. Selecting the EraVM context ensures all calls and deployments are executed within zkSync. There are mainly three steps -**Step 1)** Aggregate: [Dual compiling](compilation-overview.md) contracts - +**Step 1)** Aggregate: [Dual compiling](compilation-overview.md) contracts ![alt text](../images/lifetime/step-1.png) @@ -26,13 +25,12 @@ There are mainly three steps ![alt text](../images/lifetime/step-3.png) - ### Additional Information. + It is essential before deep diving in to the details of how to run the tool. You significantly understand how [ZKsync](https://docs.zksync.io/) works. Don't hesitate to ask if you have specific questions regarding the tool or feature requests. - ### Having issues? If you have issues with the tool or don't know where to start, we strongly suggest you look at our [repo](https://github.com/matter-labs/foundry-zksync) and [closed issues](https://github.com/matter-labs/foundry-zksync/issues?q=is%3Aissue+is%3Aclosed), where we usually get deep dive into implementation details. diff --git a/src/zksync-specifics/examples/smart-account.md b/src/zksync-specifics/examples/smart-account.md index 1eaa345f3..09b465db3 100644 --- a/src/zksync-specifics/examples/smart-account.md +++ b/src/zksync-specifics/examples/smart-account.md @@ -165,7 +165,7 @@ contract TwoUserMultisig is IAccount, IERC1271 { if (to == address(DEPLOYER_SYSTEM_CONTRACT)) { uint32 gas = Utils.safeCastToU32(gasleft()); - // Note that the deployer contract can only be called + // Note, that the deployer contract can only be called // with a "systemCall" flag. SystemContractsCaller.systemCallWithPropagatedRevert( gas, @@ -207,10 +207,10 @@ contract TwoUserMultisig is IAccount, IERC1271 { if (_signature.length != 130) { // Signature is invalid anyway, but we need to proceed with the signature verification as usual - //for the fee estimation to work correctly + // in order for the fee estimation to work correctly _signature = new bytes(130); - // Making sure that the signatures look like valid ECDSA signatures and are accepted right away + // Making sure that the signatures look like a valid ECDSA signature and are not rejected rightaway // while skipping the main verification process. _signature[64] = bytes1(uint8(27)); _signature[129] = bytes1(uint8(27));