Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions content/00.zksync-network/00.index.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ description: Welcome to the ZKsync Docs.
The **ZKsync Network** is a system of interconnected chains (rollups or validiums), also known as the **Elastic Network**.
ZKsync chains use cryptographic validity proofs to provide scalable and low-cost transactions on Ethereum.
The first chain in this network is **ZKsync Era**, a Layer 2
**[ZK rollup](/zksync-protocol/glossary#zk-rollup)**.
**ZK rollup**.

[See the full list of chains here](/zksync-network/environment).

Expand Down Expand Up @@ -66,7 +66,7 @@ ZKsync chains are built to provide a similar developer experience as Ethereum.
:check-icon Use standard `solc` and `vyper` compilers for EVM bytecode execution via [the EVM Interpreter](../zksync-network/unique-features/evm-interpreter/evm-interpreter).

:check-icon Use custom compilers **[zksolc and
zkvyper](/zksync-protocol/compiler/toolchain)** to compile contracts to native EraVM bytecode for more efficient execution.
zkvyper](/zksync-protocol/zksync-era/compiler/toolchain)** to compile contracts to native EraVM bytecode for more efficient execution.

:check-icon Most contracts work out of the box so migrating projects is seamless.

Expand All @@ -90,7 +90,7 @@ On **ZKsync chains**:
- Transactions have instant confirmations and fast finality on L1.
- Transaction fees are extremely low ([average transaction costs](https://www.growthepie.xyz/fundamentals/transaction-costs)).
- Transaction fees can be conveniently paid with ERC20 tokens (e.g. USDC) thanks to
**[native account abstraction and paymasters](/zksync-protocol/account-abstraction)**.
**[native account abstraction and paymasters](/zksync-protocol/zksync-era/account-abstraction)**.
- Support for existing Ethereum-based wallets like Metamask, TrustWallet, Zerion, Rabby, etc.

::callout{icon="i-heroicons-cube-transparent-solid" color="blue"}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ title: EraVM Quickstart with Remix

::callout{icon="i-heroicons-light-bulb"}
Behind the scenes, Remix is using the ZKsync Era custom solidity compiler
(named `zksolc`) to generate ZKsync VM compatible bytecode. [Learn more about ZKsync custom compilers](/zksync-protocol/compiler/toolchain).
(named `zksolc`) to generate ZKsync VM compatible bytecode. [Learn more about ZKsync custom compilers](/zksync-protocol/zksync-era/compiler/toolchain).
::

### Deploy the contract
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ interactions. This feature enhances user engagement and adoption of dApps.
## Next Steps

- **Learn more about Paymasters:** Read further on our section on
[Paymasters](/zksync-protocol/account-abstraction/paymasters)
[Paymasters](/zksync-protocol/zksync-era/account-abstraction/paymasters)
to deepen your understanding.
- **Experiment with Different Paymaster Contracts:** Now that you are familiar with both approval-based and general
paymaster flows, you can experiment with these contracts by deploying them under various conditions
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ description: Learn about Native Account Abstraction in ZKsync Era
ZKsync Era natively supports Account Abstraction, making it possible to implement smart accounts
that contain arbitrary logic, making features like account recovery, native multi-sig accounts, and others.

To learn more about the design of Account Abstraction, see the [Protocol documentation](/zksync-protocol/account-abstraction).
To learn more about the design of Account Abstraction, see the [Protocol documentation](/zksync-protocol/zksync-era/account-abstraction).

If you prefer learning from tutorials, you can check out the following ones:

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ This feature can be used for things like:

...and many others.

If you want to learn about Paymaster design, see the [protocol documentation](/zksync-protocol/account-abstraction/paymasters).
If you want to learn about Paymaster design, see the [protocol documentation](/zksync-protocol/zksync-era/account-abstraction/paymasters).

## Testnet Paymaster

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ for [plugins](./../../tooling/hardhat/plugins/hardhat-zksync) or [custom version
All while maintaining the core functionalities of EraVM, like [native account abstraction](./../account-abstraction).

::callout{icon="i-heroicons-exclamation-triangle" color="amber"}
For a more detailed information about the EVM interpreter, read the [protocol documentation](../../../zksync-protocol/evm-interpreter/overview) and
the [Frequently Asked Questions](./faq).
For a more detailed information about the EVM interpreter, read the [protocol documentation](../../../zksync-protocol/zksync-era/evm-interpreter/overview)
and the [Frequently Asked Questions](./faq).
::

## Main Features
Expand All @@ -21,17 +21,17 @@ the [Frequently Asked Questions](./faq).
- **Tooling Compatibility**: Development tools such as Foundry, Hardhat, and Remix work without requiring additional plugins or modifications.
- **Address Derivation Consistency**: Addresses generated using `create` and `create2` match the behavior on the EVM.
- **Pre Deployed Contracts**: Provides contracts such as `create2` , `multicall3` and
`singletonFactory` (ERC2470). Refer to the [protocol documentation](../../../zksync-protocol/evm-interpreter/pre-deployed-contracts) for
`singletonFactory` (ERC2470). Refer to the [protocol documentation](../../../zksync-protocol/zksync-era/evm-interpreter/pre-deployed-contracts) for
the full list.

## Limitations

- **Debugging**: EVM-compatible debugging is not supported yet due to EraVM-specific nuances of the system.
- **Gas Model**: EVM gas model is interpreted on top of EraVM for compatibility. Actual costs are paid in EraVM native gas. For details see [EVM gas interpretation](../../../zksync-protocol/evm-interpreter/evm-gas-interpretation).
- **Gas Model**: EVM gas model is interpreted on top of EraVM for compatibility. Actual costs are paid in EraVM native gas. For details see [EVM gas interpretation](../../../zksync-protocol/zksync-era/evm-interpreter/evm-gas-interpretation).
- **Unsupported Opcodes**: The same opcodes unsupported in EraVM remain unsupported: `CALLCODE`, `SELFDESTRUCT`, `BLOBHASH`, `BLOBBASEFEE`.
- **Transaction Costs**: Instruction translation increases transaction fees, typically by 1.5x to 4x, depending on the complexity of the operation.

Learn more about the [differences from Ethereum (Cancun)](../../../zksync-protocol/evm-interpreter/evm-differences).
Learn more about the [differences from Ethereum (Cancun)](../../../zksync-protocol/zksync-era/evm-interpreter/evm-differences).

## Considerations for Developers

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,13 @@ as calldata) and use tools like Hardhat and Foundry out of the box (no plugins n

#### How does the interpreter contract get invoked on execution?
Invoking the EVM interpreter is handled behind the scenes by the protocol. Developers don’t need to take any extra steps.
If you want to learn more, check [the protocol documentation](../../../zksync-protocol/evm-interpreter/overview).
If you want to learn more, check [the protocol documentation](../../../zksync-protocol/zksync-era/evm-interpreter/overview).

#### Are EVM-bytecode contracts and EraVM-bytecode contracts allowed to interact with each other transparently?
Contracts deployed with EVM bytecode can interact with contracts deployed with EraVM bytecode, **except for delegate calls**,
which are prohibited between EraVM and EVM bytecode contracts.

Find more details in [EraVM-EVM interactions](../../../zksync-protocol/evm-interpreter/era-evm-interactions.md).
Find more details in [EraVM-EVM interactions](../../../zksync-protocol/zksync-era/evm-interpreter/era-evm-interactions.md).

#### Will address derivation with regular `create` and `create2` be the same as on other EVM chains?
Yes.
Expand All @@ -40,7 +40,7 @@ function `isAccountEVM(address)` that returns `true/false`.
No. Although interpretation covers most developers' needs, there are limitations due to the underlying EraVM, such as unsupported opcodes or gas differences.
Full EVM equivalence is expected with the next proving system in **2025**.

See [differences from Ethereum (Cancun) in the documentation](../../../zksync-protocol/evm-interpreter/evm-differences).
See [differences from Ethereum (Cancun) in the documentation](../../../zksync-protocol/zksync-era/evm-interpreter/evm-differences).

#### What's the behavior of `block.gaslimit`? Does it return the batch limit or the transaction limit?
It returns `1125899906842624n` directly from underlying EraVM. In practice this is meaningless value and should not be used.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ There are three steps planned for rolling out full interoperability:
1. Crosschain transactions

Currently only messaging is available as a part of the `v29` upgrade.
Only chains that settle on top of [Gateway](/zksync-protocol/gateway/overview) have access to interop messaging.
Only chains that settle on top of [Gateway](/zksync-protocol/gateway) have access to interop messaging.
To see which chains use ZKsync Gateway, check the [Elastic Network Chains](/zksync-network/environment) table.

Limitations for this first state of interop include:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ Hardhat. For Windows users, using Windows Subsystem for Linux (WSL 2) is highly
### Basic knowledge of Ethereum development

- Familiarity with Ethereum development, including deploying smart contracts. If you are new to this, review
the [Contract Deployment](/zksync-protocol/differences/contract-deployment) documentation.
the [Contract Deployment](/zksync-protocol/zksync-era/differences/contract-deployment) documentation.

### Wallet and testnet funds

Expand Down Expand Up @@ -107,7 +107,7 @@ This will compile your contracts and generate the necessary artifacts in the `ar
::callout{icon="i-heroicons-exclamation-triangle" color="amber"}

- Contracts must be compiled using the
[official ZKsync Era compilers](/zksync-protocol/compiler/toolchain), with their respective Hardhat plugins.
[official ZKsync Era compilers](/zksync-protocol/zksync-era/compiler/toolchain), with their respective Hardhat plugins.

- Contracts compiled with other compilers will fail to deploy to ZKsync Era.
::
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ To automatically deploy all non-inlineable libraries, follow these steps:
### Troubleshoting

**Use of unsupported opcodes like SELFDESTRUCT or EXTCODECOPY.** The compiler will throw an error if any unsupported opcodes is used in one of the contracts.
See differences with EVM opcodes in [EVM instructions](/zksync-protocol/differences/evm-instructions#coinbase).
See differences with EVM opcodes in [EVM instructions](/zksync-protocol/zksync-era/differences/evm-instructions#coinbase).

## Testing

Expand Down Expand Up @@ -240,7 +240,7 @@ networks: {

Smart contract deployment on ZKsync Era (and chains built with ZK Stack) differ from Ethereum
as they are handled by the `ContractDeployer` system contract
(see [Ethereum differences](/zksync-protocol/differences/contract-deployment)).
(see [Ethereum differences](/zksync-protocol/zksync-era/differences/contract-deployment)).

There are different approaches for contract deployment:

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ Different options to export smart contract ABIs.

### hardhat-gas-reporter

Although this plugin works out of the box, ZKsync Era has a [different fee model](/zksync-protocol/rollup/fee-model) than Ethereum.
Although this plugin works out of the box, ZKsync Era has a [different fee model](/zksync-protocol/zksync-era/transactions/fee-model) than Ethereum.
Users should consider this when analysing the report generated by this plugin.

In addition, make sure to read about [local testing](/zksync-network/tooling/local-setup/).
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ Compiles all the smart contracts in the `contracts` directory and creates the `a
including factory dependencies for the contracts, which could be used for contract deployment.

To understand what the factory dependencies are, read more about them
[here](/zksync-protocol/differences/contract-deployment#note-on-factory-deps) documentation.
[here](/zksync-protocol/zksync-era/differences/contract-deployment#note-on-factory-deps) documentation.

## Usage

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ In Ethereum, you might have code that calculates the address of a contract deplo
```

This method won’t work in ZKsync because the address derivation logic is different. To learn more about these differences refer to the documentation on
[Differences with address derivation](/zksync-protocol/differences/evm-instructions#address-derivation).
[Differences with address derivation](/zksync-protocol/zksync-era/differences/evm-instructions#address-derivation).

#### Error

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ const walletClient = createWalletClient({

### 2. Use Actions

Now that you have a Client set up, you can send a transaction on ZKsync using a [paymaster](/zksync-protocol/account-abstraction/paymasters)!
Now that you have a Client set up, you can send a transaction on ZKsync using a [paymaster](/zksync-protocol/zksync-era/account-abstraction/paymasters)!

```js
const hash = await walletClient.sendTransaction({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ enabling paymaster support.

These differences require extending standard Ethereum transactions with new custom fields. Such extended transactions
are called EIP712 transactions since [EIP712](https://eips.ethereum.org/EIPS/eip-712) is used to sign them. More
details on EIP712 transactions can be found in the [ZKstack transaction lifecycle](/zksync-protocol/rollup/transaction-lifecycle#eip-712-0x71).
details on EIP712 transactions can be found in the [ZKstack transaction lifecycle](/zksync-protocol/zksync-era/transactions/transaction-lifecycle#eip-712-0x71).

## Overrides in transactions

Expand Down Expand Up @@ -95,7 +95,7 @@ To use a custom signature and paymaster:

While the paymaster feature by itself does not impose any limitations on values of the `paymasterInput`, the Matter
Labs team endorses certain types
of [paymaster flows](/zksync-protocol/account-abstraction/paymasters)
of [paymaster flows](/zksync-protocol/zksync-era/account-abstraction/paymasters)
that are processable by EOAs.

The ZKsync SDK provides a utility method that can be used to get the correctly formed `paymasterParams` object:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -983,7 +983,7 @@ console.log(`Raw block transactions: ${utils.toJSON(await provider.getRawBlockTr

### `getTestnetPaymasterAddress`

Returns the [testnet paymaster](/zksync-protocol/account-abstraction/paymasters)
Returns the [testnet paymaster](/zksync-protocol/zksync-era/account-abstraction/paymasters)
address if available, or null.

```ts
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ function getGeneralPaymasterInput(paymasterInput: GeneralPaymasterInput): BytesL

### `getPaymasterParams`

Returns a correctly-formed `paymasterParams` object for common [paymaster flows](/zksync-protocol/account-abstraction/paymasters#built-in-paymaster-flows).
Returns a correctly-formed `paymasterParams` object for common [paymaster flows](/zksync-protocol/zksync-era/account-abstraction/paymasters#built-in-paymaster-flows).

#### Inputs

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -996,7 +996,7 @@ console.log(`Raw block transactions: ${utils.toJSON(await provider.getRawBlockTr

### `getTestnetPaymasterAddress`

Returns the [testnet paymaster](/zksync-protocol/account-abstraction/paymasters)
Returns the [testnet paymaster](/zksync-protocol/zksync-era/account-abstraction/paymasters)
address if available, or null.

```ts
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ function getGeneralPaymasterInput(paymasterInput: GeneralPaymasterInput): BytesL

### `getPaymasterParams`

Returns a correctly-formed `paymasterParams` object for common [paymaster flows](/zksync-protocol/account-abstraction/paymasters#built-in-paymaster-flows).
Returns a correctly-formed `paymasterParams` object for common [paymaster flows](/zksync-protocol/zksync-era/account-abstraction/paymasters#built-in-paymaster-flows).

#### Inputs

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ description: Use a paymaster to pay transaction fees
tags: ["zksync", "sdks", "zksync era sdk", "ethereum", "era network", "web3.js", "web3.js plugin", "paymaster"]
---

[Paymasters](/zksync-protocol/account-abstraction/paymasters) are specialized accounts
[Paymasters](/zksync-protocol/zksync-era/account-abstraction/paymasters) are specialized accounts
that are designed to subsidize transaction costs and can be used to make transactions free for end-users.

## Use a paymaster to pay transaction fees
Expand All @@ -15,9 +15,9 @@ to the [transaction's custom data](/zksync-network/sdk/js/web3js/custom-data). T
[`getPaymasterParams` helper function](https://chainsafe.github.io/web3-plugin-zksync/functions/getPaymasterParams.html),
which expects two parameters: the address of the paymaster account and an object that implements either the
[`ApprovalBasedPaymasterInput` interface](https://chainsafe.github.io/web3-plugin-zksync/interfaces/types.ApprovalBasedPaymasterInput.html)
(for [approval-based paymaster flows](/zksync-protocol/account-abstraction/paymasters#approval-based-paymaster-flow))
(for [approval-based paymaster flows](/zksync-protocol/zksync-era/account-abstraction/paymasters#approval-based-paymaster-flow))
or the [`GeneralPaymasterInput` interface](https://chainsafe.github.io/web3-plugin-zksync/interfaces/types.GeneralPaymasterInput.html)
(for [general paymaster flows](/zksync-protocol/account-abstraction/paymasters#general-paymaster-flow)).
(for [general paymaster flows](/zksync-protocol/zksync-era/account-abstraction/paymasters#general-paymaster-flow)).

The following code snippet demonstrates using an approval-based paymaster to cover the fees of a transaction:

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ four deployment types supported by the ZKsync Era network:

- `create`: Deploy a regular smart contract with a non-deterministic address. (default deployment type)
- `create2`: Deploy a regular smart contract with a deterministic address.
- `createAccount`: Deploy a smart contract for a [smart account](/zksync-protocol/account-abstraction)
- `createAccount`: Deploy a smart contract for a [smart account](/zksync-protocol/zksync-era/account-abstraction)
with a non-deterministic address.
- `create2Account`: Deploy a smart contract for a [smart account](/zksync-protocol/account-abstraction)
- `create2Account`: Deploy a smart contract for a [smart account](/zksync-protocol/zksync-era/account-abstraction)
with a deterministic address.

::callout{icon="i-heroicons-light-bulb"}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ description: Create and interact with smart accounts, including multi-signature
tags: ["zksync", "sdks", "zksync era sdk", "ethereum", "era network", "web3.js", "web3.js plugin", "smart account", "multisig"]
---

The Web3.js plugin for ZKsync allows users to create [ZKsync smart accounts](/zksync-protocol/account-abstraction)
The Web3.js plugin for ZKsync allows users to create [ZKsync smart accounts](/zksync-protocol/zksync-era/account-abstraction)
with custom logic for building and signing transactions.

## Create a smart account
Expand Down
Loading
Loading