Skip to content

Commit

Permalink
chore: fix based on feedback
Browse files Browse the repository at this point in the history
- fixed links for token list
- removed ` from titles
- removed from featured list
- fixed typos
- provided links to contracts
- added note about creating a new project
  directory and running commands in that directory
- add note about `era_test_node` version
  • Loading branch information
bxpana committed Oct 1, 2024
1 parent 190630b commit 0308acc
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 15 deletions.
22 changes: 11 additions & 11 deletions content/tutorials/foundry-era-test-node/10.index.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
title: Interacting with Uniswap on a Fork of ZKsync Era Using `era_test_node` and Foundry
title: Interacting with Uniswap on a Fork of ZKsync Era Using era_test_node and Foundry
description: A step-by-step guide to set up a fork of ZKsync Era mainnet and interact with the Uniswap contract to perform token swaps using Foundry.
---

Expand Down Expand Up @@ -27,7 +27,7 @@ Let's get started!
- [Hex to Decimal Converter](https://www.rapidtables.com/convert/number/hex-to-decimal.html) for number conversions.
- **ZKsync Era Explorer**:
- [ZKsync Era Explorer](https://era.zksync.io/) to view contracts.
- [Tokens List](https://era.zksync.io/tokens) to find token addresses.
- [Tokens List](https://explorer.zksync.io/tokens) to find token addresses.
- **Uniswap Pool Explorer**:
- [Uniswap Pools on ZKsync Era](https://app.uniswap.org/explore/pools/zksync) to find pools for swapping.
- **Price Conversion Tool**:
Expand All @@ -47,13 +47,13 @@ section of the docs for a more secure way to manage your private keys.

### Fork ZKsync Era Mainnet

Start `era_test_node` and fork the ZKsync Era mainnet:
Start `era_test_node` and fork ZKsync Era mainnet:

```bash
era_test_node fork mainnet
```

For debug mode (provides more transaction details):
For debug mode (provides more transaction details and requires version `v0.1.0-alpha.27` or higher):

```bash
era_test_node -d fork mainnet
Expand All @@ -63,25 +63,25 @@ era_test_node -d fork mainnet

## 2. Streamlining with Environment Variables

Create a `.env` file in your project directory to store environment variables:
Create a new project directory and a `.env` file in your project directory to store environment variables:

```bash
ETH_RPC_URL=http://localhost:8011
PRIVATE_KEY=rich_wallet_private_key_here
ETH_GAS_LIMIT=10000000 # Optional
WETH=0x5AEa5775959fBC2557Cc8789bC1bf90A239D9a91
MY_ADDRESS=your_wallet_address_here
MY_ADDRESS=address_of_the_rich_wallet
SWAP_ROUTER=0x99c56385daBCE3E81d8499d0b8d0257aBC07E8A3
```

- **ETH_RPC_URL**: The URL of your local `era_test_node` instance.
- **PRIVATE_KEY**: One of the private keys from the `era_test_node` accounts.
- **ETH_GAS_LIMIT**: Optional gas limit for transactions.
- **WETH**: WETH token address on ZKsync Era.
- **MY_ADDRESS**: Your wallet address.
- **SWAP_ROUTER**: Uniswap Swap Router contract address on ZKsync Era.
- **WETH**: [WETH token address on ZKsync Era](https://era.zksync.network/address/0x5AEa5775959fBC2557Cc8789bC1bf90A239D9a91).
- **MY_ADDRESS**: The address of the rich wallet private key.
- **SWAP_ROUTER**: [Uniswap Swap Router contract address on ZKsync Era](https://docs.uniswap.org/contracts/v3/reference/deployments/ZKsync-deployments).

Load the environment variables:
Run the following in your terminal in your project directory to load the environment variables:

```bash
source .env
Expand Down Expand Up @@ -160,7 +160,7 @@ cast send $WETH "approve(address,uint256)" $SWAP_ROUTER <AMOUNT_TO_APPROVE> --pr

### Find an ERC20 Token

- Use the [ZKsync Era Tokens List](https://era.zksync.io/tokens) to choose an ERC20 token.
- Use the [ZKsync Era Tokens List](https://explorer.zksync.io/tokens) to choose an ERC20 token.
- Set the ERC20 token address in your `.env` file:

```bash
Expand Down
8 changes: 4 additions & 4 deletions content/tutorials/foundry-era-test-node/_dir.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
title: Interacting with Uniswap on a Fork of ZKsync Era Using `era_test_node` and Foundry
featured: true
title: Interacting with Uniswap on a Fork of ZKsync Era Using era_test_node and Foundry
featured: false
authors:
- name: bxpana
url: https://github.com/bxpana
Expand All @@ -13,11 +13,11 @@ tags:
- tutorial
summary: Set up a local ZKsync Era environment and perform token swaps using Foundry.
description: |
In this tutorial, you will set up a local ZKsync Era environment using `era_test_node`, leverage Foundry's `cast` tool to interact with contracts, and perform token swaps on Uniswap. You will learn how to check balances, deposit ETH for WETH, transfer WETH, and swap tokens using Uniswap's Swap Router.
In this tutorial, you will set up a local ZKsync Era environment using era_test_node, leverage Foundry's cast tool to interact with contracts, and perform token swaps on Uniswap. You will learn how to check balances, deposit ETH for WETH, transfer WETH, and swap tokens using Uniswap's Swap Router.
what_you_will_learn:
- How to set up and fork a local ZKsync Era environment.
- How to use environment variables to streamline your workflow.
- How to check balances using `cast`.
- How to check balances using cast.
- How to deposit ETH for WETH and transfer WETH.
- How to approve tokens and perform swaps on Uniswap using the Swap Router.
updated: 2024-09-26
Expand Down

0 comments on commit 0308acc

Please sign in to comment.