-
Notifications
You must be signed in to change notification settings - Fork 3
chore: update the js v6 page #56
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
25 commits
Select commit
Hold shift + click to select a range
e6a15eb
chore: update the js v6 page
Ngozi-Txfusion 4e5df6e
chore: remove error handling
Ngozi-Txfusion dda1eda
Update content/sdk/10.js/00.ethers/20.v6/00.getting-started.md
Ngozi-Txfusion d99bd95
Update content/sdk/10.js/00.ethers/20.v6/03.providers.md
Ngozi-Txfusion f680489
Update content/sdk/10.js/00.ethers/20.v6/03.providers.md
Ngozi-Txfusion 0c6e612
Update content/sdk/10.js/00.ethers/20.v6/03.providers.md
Ngozi-Txfusion 47ff836
Update content/sdk/10.js/00.ethers/20.v6/11.migration.md
Ngozi-Txfusion 7fef9cf
Update content/sdk/10.js/00.ethers/20.v6/08.paymaster-utils.md
Ngozi-Txfusion a09f71f
Update content/sdk/10.js/00.ethers/20.v6/07.utils.md
Ngozi-Txfusion 06a6474
Update content/sdk/10.js/00.ethers/20.v6/03.providers.md
Ngozi-Txfusion b67864e
Update content/sdk/10.js/00.ethers/20.v6/11.migration.md
Ngozi-Txfusion 3d0d585
Update content/sdk/10.js/00.ethers/20.v6/03.providers.md
Ngozi-Txfusion 7fe50cd
Update content/sdk/10.js/00.ethers/20.v6/03.providers.md
Ngozi-Txfusion cd2dca7
chore: update provider v6
Ngozi-Txfusion 664dc12
Update content/sdk/10.js/00.ethers/20.v6/03.providers.md
Ngozi-Txfusion 15fef4b
chore: update lint
Ngozi-Txfusion b689630
chore: remove the double optional
Ngozi-Txfusion 0762e0f
Update content/sdk/10.js/00.ethers/20.v6/05.accounts-l1-l2.md
Ngozi-Txfusion c5f4371
chore: update field group and collapsible
Ngozi-Txfusion 3c87bb7
Merge branch 'main' into update-the-js-v6-page
Ngozi-Txfusion 6bcbd4c
Update content/sdk/10.js/00.ethers/20.v6/04.accounts.md
Ngozi-Txfusion 89ea868
chore: updated missing provider content
Ngozi-Txfusion c8fd2b6
chore: update types
Ngozi-Txfusion c790697
chore: added callout
Ngozi-Txfusion 424a5ca
Merge branch 'main' into update-the-js-v6-page
danijelTxFusion File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.