Skip to content

Commit

Permalink
PR feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
MBerguer committed Jan 2, 2025
1 parent 9b2c900 commit 5d40b61
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 14 deletions.
2 changes: 1 addition & 1 deletion src/getting-started/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
### Precompiled Binaries

Precompiled binaries can be downloaded from the [GitHub releases page](https://github.com/matter-labs/foundry-zksync/releases). We recommend using [Foundryup](#using-foundryup-zksync) for easier management.
We are working on a polished versioning approach that will be released soon. However, we are also in a phase of active development, so it's recommended that you use the latest commit available in the repo.
We are working on a polished versioning approach that will be released soon. However, we are also in a phase of active development.

### Using Foundryup-zksync

Expand Down
7 changes: 3 additions & 4 deletions src/zksync-specifics/cheatcodes/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
## Additional Cheatcodes

A few new cheatcodes have been added to the existing [Cheatcodes](../../cheatcodes/README.md) list to help within the ZKsync context,
A few new cheatcodes have been added to the existing [Cheatcodes](../../cheatcodes/README.md) list to help within the ZKsync context,

### Cheatcodes Interface

Expand Down Expand Up @@ -29,13 +29,12 @@ interface CheatCodesExt {
/// Enables the use of a paymaster for the next transaction.
function zkUsePaymaster(address paymaster, bytes calldata paymaster_input) external pure;
/// Sets a flag on a given contract as a factory dependency only for the next `CREATE` or `CALL` operation
/// Marks a given contract as a factory dependency only for the next CREATE or CALL operation
function zkUseFactoryDep(string calldata name) external pure;
}
```


### Usage

Refer to the [forge-zksync-std](../forge-zksync-std.md) section on accessing these cheatcodes in your tests.
Refer to the [forge-zksync-std](../forge-zksync-std.md) section on accessing these cheatcodes in your tests.
2 changes: 1 addition & 1 deletion src/zksync-specifics/cheatcodes/zk-use-factory-dep.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ function zkUseFactoryDep(string calldata name) external pure;

### Description

Sets a flag on a given contract as a factory dependency only for the next `CREATE` or `CALL` operation, clearing the flag afterward, similar to [`prank`](../../cheatcodes/prank.md).
Marks a given contract as a factory dependency only for the next CREATE or CALL, unmarking it afterward, similar to [`prank`](../../cheatcodes/prank.md).

This cheatcode is useful when deploying contracts through factories that do not directly depend on a given contract, as it allows explicitly marking this type of contract as a factory dependency, enabling the factory to deploy the contract.
More information on factory dependencies can be found in the [official ZKsync docs](https://docs.zksync.io/build/developer-reference/ethereum-differences/contract-deployment#note-on-factory_deps).
Expand Down
8 changes: 3 additions & 5 deletions src/zksync-specifics/examples/general-paymaster.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
## Using the zkUsePaymaster Cheatcode in General Flow Paymaster Contracts

This example covers the use of a general flow paymaster contract.
This example covers the use of a general flow paymaster contract.
For this example, we will use the `GaslessPaymaster` contract from the paymaster example repository [here](https://github.com/matter-labs/paymaster-examples).


```solidity
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
Expand Down Expand Up @@ -37,7 +36,7 @@ contract GaslessPaymaster is IPaymaster, Ownable {
onlyBootloader
returns (bytes4 magic, bytes memory context)
{
// By default, we consider the transaction accepted.
// By default we consider the transaction as accepted.
magic = PAYMASTER_VALIDATION_SUCCESS_MAGIC;
require(
_transaction.paymasterInput.length >= 4,
Expand Down Expand Up @@ -145,6 +144,5 @@ The key part of this script is encoding the paymaster call with the `general(byt
paymaster_encoded_input
);
```
After calling the `zkUsePaymaster` cheatcode, the paymaster will pay for the following transaction.


After calling the `zkUsePaymaster` cheatcode, the paymaster will pay for the following transaction.
2 changes: 1 addition & 1 deletion src/zksync-specifics/examples/smart-account.md
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ contract TwoUserMultisig is IAccount, IERC1271 {
Transaction calldata _transaction
) internal returns (bytes4 magic) {
// Incrementing the nonce of the account.
// Note that reserved[0] by convention is currently equal to the nonce passed in the transaction
// Note, that reserved[0] by convention is currently equal to the nonce passed in the transaction
SystemContractsCaller.systemCallWithPropagatedRevert(
uint32(gasleft()),
address(NONCE_HOLDER_SYSTEM_CONTRACT),
Expand Down
2 changes: 1 addition & 1 deletion src/zksync-specifics/gas.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Running in zkEVM mode is analogous to running in `isolate` mode, but using the z

1. Intrinsic costs: Overhead charged on each transaction.
2. Validation costs: Gas spent on transaction validation. It may vary depending on the account making the transaction. See [Account Abstraction](https://docs.zksync.io/build/developer-reference/account-abstraction) docs.
3. Execution costs: Gas spent on marking factory dips and executing the transaction.
3. Execution costs: Gas spent on marking factory dependencies and executing the transaction.
4. Pubdata costs: Gas spent on publishing pubdata is influenced by the `gasPerPubdata` network value.

More info about ZKSync Era's fee model can be found [here](https://docs.zksync.io/build/developer-reference/fee-model).
Expand Down
2 changes: 1 addition & 1 deletion src/zksync-specifics/paymaster-overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ cast send 0xdb8bA5F5DfB1636361d2fE851d7D3ed93acfc487 "increment()" --rpc-url htt

`forge create` is a command-line tool for deploying smart contracts using the Foundry framework. The documentation can be found [here](../reference/forge/forge-create.md).

The paymaster contract address must be specified in the command to deploy a paymaster contract using `forge create`.
The paymaster contract address must be specified in the command to deploy any other contract using `forge create`.

The flags for this are:

Expand Down

0 comments on commit 5d40b61

Please sign in to comment.