-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into update-the-js-v5-page
- Loading branch information
Showing
12 changed files
with
1,232 additions
and
509 deletions.
There are no files selected for viewing
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
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
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,48 +1,46 @@ | ||
--- | ||
title: Accounts | L1<->L2 Transactions | ||
description: | ||
title: Account Management | L1-L2 Transactions | ||
description: Methods for handling transactions between L1 and L2 networks with ZKsync. | ||
tags: ["zksync", "l1 to l2 transactions", "cryptocurrency", "ethereum", "wallet"] | ||
--- | ||
|
||
This section explores the methods which allow the | ||
[account](/sdk/js/ethers/v6/accounts) to send transactions among both L1 to L2 networks. | ||
Learn the methods for managing accounts and facilitating transactions between Layer 1 (L1) and Layer 2 (L2) | ||
networks using ZKsync. | ||
|
||
If you want some background on how L1<->L2 interaction works on ZKsync, go through the | ||
[introduction](https://docs.zksync.io/build/developer-reference/l1-l2-interop.html). | ||
For an overview of L1-L2 interactions on ZKsync, visit the [Developer Reference](https://docs.zksync.io/build/developer-reference/l1-l2-interoperability). | ||
|
||
Full examples of actions below are available on the [getting started](/sdk/js/ethers/v6/getting-started) page. | ||
The examples of the following actions can be found on the [getting started](/sdk/js/ethers/v6/getting-started) page. | ||
|
||
## Deposit | ||
|
||
`Wallet` and `L1Signer` objects provide a deposit workflow. | ||
For more information, please refer to the method specification [`Deposit`](/sdk/js/ethers/v6/accounts#deposit). | ||
The `Wallet` and `L1Signer` classes offer a seamless deposit workflow. Detailed information can be found in | ||
the [`Deposit`](/sdk/js/ethers/v6/accounts#deposit-1) method specification. | ||
|
||
For a complete example of how to execute the deposit workflow, take a look at the following: | ||
[Deposit ETH and ERC20 token](https://github.com/zksync-sdk/zksync2-examples/blob/main/js/src/01_deposit.ts). | ||
For a guide on executing deposits, refer to this example: [Deposit ETH and ERC20 token](https://github.com/zksync-sdk/zksync2-examples/blob/main/js/src/01_deposit.ts). | ||
|
||
## Request execute | ||
## Request execution | ||
|
||
`Wallet` and `L1Signer` objects provide an option to request execution of L2 transaction from L1. For more information, | ||
please refer to the method specification [`requestExecute`](/sdk/js/ethers/v6/accounts#requestexecute). | ||
Using `Wallet` and `L1Signer`, you can request the execution of L2 transactions from L1. More details are available | ||
in the [`requestExecute`](/sdk/js/ethers/v6/accounts#requestexecute) method specification. | ||
|
||
## Base cost | ||
## Calculate base cost | ||
|
||
`Wallet` and `L1Signer` objects provide an option to calculate base cost for L2 transaction. For more information, | ||
please refer to the method specification [`getBaseCost`](/sdk/js/ethers/v6/accounts#getbasecost). | ||
The `Wallet` and `L1Signer` classes also provide a way to calculate the base cost for L2 transactions. Refer to | ||
the [`getBaseCost`](/sdk/js/ethers/v6/accounts#getbasecost) method specification for further details. | ||
|
||
## Claim failed deposit | ||
|
||
`Wallet` and `L1Signer` objects provide a claim fail deposit workflow. For more information, | ||
please refer to the method specification [`claimFailedDeposit`](/sdk/js/ethers/v6/accounts#claimfaileddeposit). | ||
In the event of a failed deposit, `Wallet` and `L1Signer` offer a recovery workflow. More information can be | ||
found in the [`claimFailedDeposit`](/sdk/js/ethers/v6/accounts#claimfaileddeposit) method specification. | ||
|
||
## Finalize withdraw | ||
## Finalize withdrawal | ||
|
||
`Wallet` and `L1Signer` objects provide a finalize withdraw workflow. For more information, | ||
please refer to the method specification [`finalizeWithdrawal`](/sdk/js/ethers/v6/accounts#finalizewithdrawal). | ||
`Wallet` and `L1Signer` support the workflow for finalizing withdrawals. Detailed instructions are available | ||
in the [`finalizeWithdrawal`](/sdk/js/ethers/v6/accounts#finalizewithdrawal) method specification. | ||
|
||
## Withdrawal | ||
## Withdraw | ||
|
||
`Wallet` and `Signer` objects provide a withdrawal workflow. For more information, | ||
please refer to the method specification [`Withdraw`](/sdk/js/ethers/v6/accounts#withdraw). | ||
Both `Wallet` and `Signer` classes support withdrawal workflows. For more details, see | ||
the [`Withdraw`](/sdk/js/ethers/v6/accounts#withdraw) method specification. | ||
|
||
For a complete example of how to execute the deposit workflow, take a look at the following: | ||
[Withdraw ETH and ERC20 token](https://github.com/zksync-sdk/zksync2-examples/blob/main/js/src/04_withdraw.ts). | ||
For a complete walkthrough on executing withdrawals, check out this example: [Withdraw ETH and ERC20 token](https://github.com/zksync-sdk/zksync2-examples/blob/main/js/src/04_withdraw.ts). |
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,25 @@ | ||
--- | ||
title: Contracts | ||
description: | ||
title: Contract | ||
description: Managing and deploying smart contracts with ZKsync. | ||
tags: ["zksync", "smart contracts", "ethereum", "contractfactory", "erc20 tokens"] | ||
--- | ||
|
||
`zksync-ethers` does not implement any new `Contract` class, since `ethers.Contract` fully works out of the box. | ||
However, for convenience, the library still re-exports this class. | ||
The `zksync-ethers` library leverages the existing `ethers.Contract` class for smart contract management, ensuring | ||
full compatibility out of the box. For convenience, this class is re-exported within the library. | ||
|
||
Since deploying smart contracts on ZKsync has some differences from deploying on Ethereum, | ||
there is a need for a specific `ContractFactory` method. It supports the same interface as `ethers.ContractFactory`. | ||
## Deploying smart contracts | ||
|
||
In order to pay for smart contract interactions in ERC20 tokens, `customData` override should be used. | ||
You can read more about accessing ZKsync features in [the features chapter](/sdk/js/ethers/v6/features). | ||
Deploying smart contracts on ZKsync differs slightly from Ethereum. To accommodate these differences, a | ||
specific `ContractFactory` method is provided. This method supports the same interface as `ethers.ContractFactory`. | ||
|
||
### ContractFactory | ||
|
||
The `ContractFactory` method facilitates the deployment of smart contracts on the ZKsync network. This method is | ||
essential due to the unique requirements of deploying contracts on ZKsync compared to Ethereum. | ||
|
||
### Paying with ERC20 tokens | ||
|
||
To pay for smart contract interactions using ERC20 tokens, the `customData` override should be utilized. This | ||
feature allows for more flexible payment options within the ZKsync network. | ||
|
||
For more details on accessing ZKsync-specific features, refer to the [ZKsync Era Features](/sdk/js/ethers/v6/features). |
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
Oops, something went wrong.