Skip to content

Commit 115742d

Browse files
Merge pull request 0xPolygon#7 from 0xPolygon/empieichO/zkevmdocs_edit
updating zkEVM 'Get started' and 'How to'
2 parents fc07101 + d93fdca commit 115742d

40 files changed

+2675
-35
lines changed

docs/tools/using-web3modal.md

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
2+
:::caution Risks
3+
4+
Check the list of potential risks associated with the use of Polygon zkEVM in the [<ins>Risks FAQ</ins>](/zkevm/risk-disclosure.md) section.
5+
6+
:::
7+
8+
9+
## Get Started with Web3Modal
10+
11+
:::caution Content disclaimer
12+
13+
Please view the third-party content disclaimer [<ins>here</ins>](https://github.com/0xPolygon/wiki/blob/master/CONTENT_DISCLAIMER.md).
14+
15+
:::
16+
17+
### Overview
18+
19+
[<ins>Web3Modal</ins>](https://web3modal.com/) is a simple and intuitive SDK that provides a drop-in UI to enable users of any wallet to seamlessly log in to applications, offering a unified and smooth experience. It features a streamlined wallet selection interface with automatic detection of various wallet types, including mobile, extension, desktop, and web app wallets.
20+
21+
### Code Sandbox for Polygon
22+
23+
The Web3Modal team has prepared a [<ins>Polygon Code Sandbox</ins>](https://codesandbox.io/p/sandbox/web3modal-v3-polygon-7264l5?file=/src/main.tsx:9,19-9,50). It’s a straightforward way for developers to integrate and get hands-on experience with Polygon.
24+
25+
### How to Integrate
26+
27+
1. **Visit Web3Modal:** Go to [<ins>Web3Modal's official website</ins>](https://web3modal.com/) to explore its features and capabilities.
28+
2. **Explore the Code Sandbox:** Utilize the [<ins>Polygon Code Sandbox</ins>](https://codesandbox.io/p/sandbox/web3modal-v3-polygon-7264l5?file=/src/main.tsx:9,19-9,50) to demo and understand the integration process.
29+
3. **Follow the Documentation:** Refer to the provided documentation and instructions to integrate Web3Modal into your projects and leverage its features effectively.
30+
31+
## zkEVM Support
32+
33+
If you need help with anything related to the Polygon zkEVM, you can raise a ticket on the [Polygon Support](https://support.polygon.technology/support/tickets/new) portal, and check out the [Knowledge base](https://support.polygon.technology/support/solutions/folders/82000694871) to view the most common queries about the zkEVM. Additionally, you can reach out to the support team available on the **#zkevm-support** channel on the [Polygon Discord server](https://discord.com/invite/XvpHAxZ). Instructions for raising a zkEVM support ticket are as follows:
34+
35+
1. Join the **Polygon Discord** server [here](https://discord.gg/0xPolygon).
36+
2. Accept the invite sent via DM.
37+
3. Take the **Member** role under **#roles**.
38+
4. Navigate to the **#zkevm-support** channel.
39+
40+
You can now contact the zkEVM support staff with your questions and concerns. We will actively monitor for issues and work to resolve them as soon as possible.
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
This document explains how to automatically write a smart contract using the OpenZeppelin Wizard. The resulting smart contract code can either be integrated with Remix by Clicking the **Open in Remix** button, or copied to a clipboard and pasted in the user's intended IDE.
2+
3+
## Getting Started
4+
5+
Navigate to the [OpenZeppelin Wizard](https://wizard.openzeppelin.com) in your browser. First thing to notice is the **Solidity Wizard** and **Cairo Wizard** buttons.
6+
7+
One can choose any of the following tabs to begin creating an out-of-box smart contract code in either Solidity (for EVM chains) or Cairo (useful for Starknet). These are:
8+
9+
- **ERC20** for writing an ERC-20 token smart contract
10+
- **ERC721** for writing an NFT token smart contract
11+
- **ERC1155** for writing an ERC-1155 token smart contract
12+
- **Governor** for creating a DAO
13+
- **Custom** for writing a customized smart contract
14+
15+
## Writing An NFT Contract
16+
17+
For illustration purposes, we will be creating a NFT smart contract.
18+
19+
Suppose you wanted to create a `Mintable`, `Burnable` ERC721 token and specify an appropriate license for it.
20+
21+
1. Select the **ERC721** tab.
22+
23+
2. Give your NFT a name and a symbol by filling the `Name` and `Symbol` fields.
24+
25+
3. Use the check-boxes on the left to select features of your token
26+
27+
- Put a tick on the `Mintable` check-box
28+
- Put a tick on the `Auto Increment Ids` check-box, this ensures uniqueness of each minted NFT
29+
- Put a tick on the `Burnable` check-box
30+
- Either leave the **default MIT license** or type the license of your choice
31+
32+
Notice that new lines of code are automatically written each time a feature is selected.
33+
34+
## Voila! Contract Ready
35+
36+
With the resulting lines of code, you now have the NFT token contract written in Solidity. As mentioned above, this source code can now be ported to an IDE of your choice or opened directly in Remix.
37+
38+
The below figure depicts the auto-written NFT smart contract code.
39+
40+
![The End-Product NFT Source Code](img/end-product-nft-code.png)

docs/zkEVM/bridge-to-zkevm.md

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
2+
:::caution Risks
3+
4+
Check the list of potential risks associated with the use of Polygon zkEVM in the [<ins>Disclosures</ins>](/troubleshooting/risk-disclosures.md) section.
5+
6+
:::
7+
8+
Users can deposit assets from Ethereum and transact off-chain on Polygon zkEVM. For moving assets across chains (L1 &harr; zkEVM), you will need to use the zkEVM Bridge. The bridge interface is available for both Mainnet Beta and Testnet in the [Polygon Wallet Suite](https://wallet.polygon.technology/zkEVM/bridge).
9+
10+
<!-- Also, bridging can be done with the help of [MaticJS](/docs/develop/ethereum-polygon/matic-js/zkevm/initialize-zkevm/) SDK. -->
11+
12+
The next video is a guide on how to bridge tokens from L1 to the zkEVM Testnet. The same video applies to the zkEVM Mainnet.
13+
14+
<video loop autoplay width="100%" height="100%" controls="true" >
15+
<source type="video/mp4" src="/zkEVM/img/zkevmwallettestnet.mp4"></source>
16+
<p>Your browser does not support the video element.</p>
17+
</video>
18+
19+
## Step-by-Step Guide
20+
21+
Follow this step-by-step guide on how to bridge assets from Ethereum to Polygon zkEVM Mainnet and vice-versa. Or, from an Ethereum testnet to zkEVM testnet, and conversely.
22+
23+
- On the [Polygon Wallet Suite website](https://wallet.polygon.technology/), select the zkEVM tab, which is next to the Proof-of-Stake tab:
24+
25+
![Figure: wallet](/zkEVM/img/zkwallet-1.jpg)
26+
27+
- Click on the **Bridge** module to access the zkEVM environment.
28+
29+
- Set the amount of tokens to transfer from Ethereum network to zkEVM Mainnet (Or, from an Ethereum testnet to zkEVM testnet).
30+
31+
![Figure: bridge2](/zkEVM/img/bridge2.jpg)
32+
33+
- Recent transactions and pending transactions can be viewed on the right hand side of the page.
34+
- Click the `Bridge ETH to zkEVM testnet` button to proceed. This is followed by Metamask's prompt to approve gas to be spent.
35+
36+
![Figure: metamask1](/zkEVM/img/metamask1.jpg)
37+
38+
- Click `Confirm` to approve the bridge transaction.
39+
40+
- And allow a few moments for your transaction to be processed.
41+
42+
- Once it is completed, past and pending transactions can be viewed by clicking the "Transactions" button located on the left side of the menu.
43+
44+
![Figure: tx-history](/zkEVM/img/transaction-history.jpg)

docs/zkEVM/connect-wallet.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
2+
:::caution Risks
3+
4+
Check the list of potential risks associated with the use of Polygon zkEVM in the [<ins>Disclosures</ins>](troubleshooting/risk-disclosures.md) section.
5+
6+
:::
7+
8+
9+
Add the **Polygon zkEVM** network to your wallet in order to interact with either the mainnet or the testnet.
10+
11+
Navigate to `Add network` in your wallet, and enter the respective network details as given in the below table:
12+
13+
| Network | RPC URL | ChainID | Block Explorer URL | Currency |
14+
| ------- | ------------------------------- | ---------------- | ---------------- | ----- |
15+
| Polygon zkEVM | `https://zkevm-rpc.com` | `1101` | `https://zkevm.polygonscan.com/` | **ETH** |
16+
| zkEVM Testnet | `https://rpc.public.zkevm-test.net` | `1442` | `https://testnet-zkevm.polygonscan.com` | **ETH** |
17+
18+
Here is a video tutorial on **how to add Polygon zkEVM Testnet to MetaMask and deploy smart contracts**:
19+
20+
<video loop width="100%" height="100%" controls="true" >
21+
<source type="video/mp4" src="/zkEVM/img/tutorial.mp4"></source>
22+
<p>Your browser does not support the video element.</p>
23+
</video>
24+
25+
Once the wallet is connected, the next step is to bridge crypto assets from Ethereum to zkEVM.
26+
27+
For testnet purposes, you can use the zkEVM faucet to get testnet tokens.
-156 KB
Binary file not shown.
-81.3 KB
Binary file not shown.
-145 KB
Binary file not shown.
-100 KB
Binary file not shown.
-210 KB
Binary file not shown.

docs/zkEVM/img/bridge2.jpg

88.3 KB
Loading

0 commit comments

Comments
 (0)