forked from foundry-rs/book
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #56 from matter-labs/tincho/general-improvements
General improvements
- Loading branch information
Showing
34 changed files
with
214 additions
and
162 deletions.
There are no files selected for viewing
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,36 @@ | ||
# ZKSync Specifics | ||
|
||
- [Execution Overview](execution-overview.md) | ||
- [Compilation Overview](compilation-overview.md) | ||
- [Limitations](limitations/README.md) | ||
- [General](limitations/general.md) | ||
- [Compilation](limitations/compilation.md) | ||
- [Broadcast](limitations/broadcast.md) | ||
- [Cheatcodes](limitations/cheatcodes.md) | ||
- [Additional Cheatcodes](cheatcodes/README.md) | ||
- [zkVm](cheatcodes/zkvm.md) | ||
- [Gas Overview](gas.md) | ||
- [Paymaster Overview](paymaster-overview.md) | ||
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 | ||
|
||
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 | ||
|
||
![alt text](../images/lifetime/step-1.png) | ||
|
||
**Step 2)** Intercept: Overriding `CALL`s and `CREATE`s (see [limitations](limitations/README.md) for more details) | ||
|
||
![alt text](../images/lifetime/step-2.png) | ||
|
||
**Step 3)**: Assimilate: One-shot zkEVM execution (see [Standard Library](forge-zksync-std.md) for more details) | ||
|
||
![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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,10 @@ | ||
## Configuration Overview | ||
|
||
Foundry-ZKsync adds additional configuration options that can be specified in the `foundry.toml`. | ||
Foundry-ZKsync adds some new configuration options that can be specified in the `foundry.toml`. | ||
|
||
These include the following: | ||
|
||
- [Project Configuration](../reference/config/project.md#zksync-settings) | ||
- [Project Configuration](../reference/config/project.md) | ||
- [Testing Configuration](../reference/config/testing.md) | ||
- [Fuzz](../reference/config/testing.md#no_zksync_reserved_addresses) | ||
- [Invariant](../reference/config/testing.md#no_zksync_reserved_addresses-1) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,10 @@ | ||
# ZKsync specific examples | ||
|
||
- [Paymaster Approval Based](paymaster-approval-based.md) | ||
- [General Flow Paymaster](general-paymaster.md) | ||
Here, you can see a few short examples of the tool running so you could experience the magic right away. | ||
|
||
- [Paymaster Approval Based](paymaster-approval-based.md): use of an approval-based paymaster contract | ||
- [General Flow Paymaster](general-paymaster.md): use of a general flow paymaster contract. | ||
- [Ledger](ledger.md): use a Ledger device to interact with ZKsync network. | ||
- [Smart Account](smart-account.md): configuration and deployment of a multisig smart account. | ||
|
||
Enjoy! |
Oops, something went wrong.