Skip to content

Commit

Permalink
Auto stash before merge of "tincho/general-improvements" and "origin/…
Browse files Browse the repository at this point in the history
…tincho/general-improvements"
  • Loading branch information
MBerguer committed Jan 3, 2025
1 parent 17bc4a9 commit 5b04fdd
Show file tree
Hide file tree
Showing 8 changed files with 18 additions and 18 deletions.
Binary file added src/.DS_Store
Binary file not shown.
16 changes: 9 additions & 7 deletions src/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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).
>
<br>
> <br>
**_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/).***
<!--
<!--
**[Forge Overview](forge)**
This overview will cover everything you need to know about how to use `forge` to develop, test, and deploy smart contracts.
The overview will give you all you need to know about how to use `forge` to develop, test, and deploy smart contracts.
**[Cast Overview](cast)**
Learn to use `cast` to interact with smart contracts, send transactions, and get chain data from the command line.
Learn how to use `cast` to interact with smart contracts, send transactions, and get chain data from the command-line.
**[Anvil Overview](anvil)**
Expand Down Expand Up @@ -71,7 +73,7 @@ Tutorials on building smart contracts with Foundry.
- [Testing EIP-712 Signatures](./tutorials/testing-eip712.md)
- [Solidity Scripting](./tutorials/solidity-scripting.md)
- [Forking Mainnet with Cast and Anvil](./tutorials/forking-mainnet-with-cast-anvil.md)
<!-- - [Incremental Adoption]()
<!-- - [Incremental Adoption]()
**Contributing**
Expand All @@ -93,4 +95,4 @@ References, troubleshooting, and more.
- [Miscellaneous](misc)
<br>
-->
-->
Binary file added src/images/.DS_Store
Binary file not shown.
Binary file modified src/images/key-features.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified src/images/lifetime/step-3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions src/projects/working-on-an-existing-project.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
```
Expand All @@ -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
Expand Down
10 changes: 4 additions & 6 deletions src/zksync-specifics/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand All @@ -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.
6 changes: 3 additions & 3 deletions src/zksync-specifics/examples/smart-account.md
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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));
Expand Down

0 comments on commit 5b04fdd

Please sign in to comment.