Skip to content

Commit

Permalink
docs: updates for how-to tutorials
Browse files Browse the repository at this point in the history
  • Loading branch information
amelnytskyi committed May 31, 2024
1 parent 0e745a8 commit 49be537
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 9 deletions.
1 change: 1 addition & 0 deletions content/tutorials/how-to-deploy-contract/10.index.md
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@ const config: HardhatUserConfig = {
},
},
};
export default config;
```

In the configuration above we have some important fields such as:
Expand Down
2 changes: 1 addition & 1 deletion content/tutorials/how-to-deposit-erc20/10.index.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ dotenv.config();

// HTTP RPC endpoints
const L1_RPC_ENDPOINT = process.env.L1_RPC_ENDPOINT || ""; // or an RPC endpoint from Infura/Chainstack/QuickNode/etc.
const L2_RPC_ENDPOINT = process.env.L2_RPC_ENDPOINT || "https://testnet.era.zksync.dev"; // or the zkSync Era mainnet
const L2_RPC_ENDPOINT = process.env.L2_RPC_ENDPOINT || "https://sepolia.era.zksync.dev"; // or the zkSync Era mainnet

// ERC-20 Token (DAI) address in L1
const TOKEN_ADDRESS = "0x5C221E77624690fff6dd741493D735a17716c26B";
Expand Down
2 changes: 1 addition & 1 deletion content/tutorials/how-to-deposit-eth/10.index.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ dotenv.config();

// HTTP RPC endpoints
const L1_RPC_ENDPOINT = process.env.L1_RPC_ENDPOINT || ""; // or an RPC endpoint from Infura/Chainstack/QuickNode/etc.
const L2_RPC_ENDPOINT = process.env.L2_RPC_ENDPOINT || "https://testnet.era.zksync.dev"; // or the zkSync Era mainnet
const L2_RPC_ENDPOINT = process.env.L2_RPC_ENDPOINT || "https://sepolia.era.zksync.dev"; // or the zkSync Era mainnet

// Amount in ETH
const AMOUNT = "0.00001";
Expand Down
3 changes: 1 addition & 2 deletions content/tutorials/how-to-test-contracts/10.index.md
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ With the previous steps completed, your `hardhat.config.ts` file should now be p
```ts [hardhat.config.ts]
import { HardhatUserConfig } from "hardhat/config";

import "@matterlabs/hardhat-zksync
import "@matterlabs/hardhat-zksync"
import "@nomicfoundation/hardhat-chai-matchers";

const config: HardhatUserConfig = {
Expand Down Expand Up @@ -194,7 +194,6 @@ import { expect } from "chai";
import { Wallet, Provider, Contract } from "zksync-ethers";
import { Deployer } from "@matterlabs/hardhat-zksync";
import { ZkSyncArtifact } from "@matterlabs/hardhat-zksync/src/types";
import "@matterlabs/hardhat-zksync/dist/type-extensions";

const RICH_PRIVATE_KEY = "0x7726827caac94a7f9e1b160f7ea819f172f7b6f9d2a97f992c38edeab82d4110";

Expand Down
6 changes: 3 additions & 3 deletions content/tutorials/how-to-withdraw-erc20/10.index.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ dotenv.config();

// HTTP RPC endpoints
const L1_RPC_ENDPOINT = process.env.L1_RPC_ENDPOINT || ""; // or an RPC endpoint from Infura/Chainstack/QuickNode/etc.
const L2_RPC_ENDPOINT = process.env.L2_RPC_ENDPOINT || "https://testnet.era.zksync.dev"; // or the zkSync Era mainnet
const L2_RPC_ENDPOINT = process.env.L2_RPC_ENDPOINT || "https://sepolia.era.zksync.dev"; // or the zkSync Era mainnet

// ERC-20 Token address in L2
const TOKEN_ADDRESS = "<TOKEN_ADDRESS>";
Expand All @@ -98,7 +98,7 @@ async function main() {
console.log(`Running script to bridge ERC-20 to L1`);

// Initialize the wallet.
const l1provider = new ethers.Provider(L1_RPC_ENDPOINT);
const l1provider = new Provider(L1_RPC_ENDPOINT);
const l2provider = new Provider(L2_RPC_ENDPOINT);
const wallet = new Wallet(WALLET_PRIV_KEY, l2provider, l1provider);

Expand Down Expand Up @@ -127,7 +127,7 @@ main()
Execute the script using the following command:

```sh
npx ts-node withdraw.ts
npx ts-node withdraw-erc20.ts
```

## Verify the Output
Expand Down
4 changes: 2 additions & 2 deletions content/tutorials/how-to-withdraw-eth/10.index.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ dotenv.config();

// HTTP RPC endpoints
const L1_RPC_ENDPOINT = process.env.L1_RPC_ENDPOINT || ""; // or an RPC endpoint from Infura/Chainstack/QuickNode/etc.
const L2_RPC_ENDPOINT = process.env.L2_RPC_ENDPOINT || "https://testnet.era.zksync.dev"; // or the zkSync Era mainnet
const L2_RPC_ENDPOINT = process.env.L2_RPC_ENDPOINT || "https://sepolia.era.zksync.dev"; // or the zkSync Era mainnet

// Wallet
const WALLET_PRIV_KEY = process.env.WALLET_PRIV_KEY || "";
Expand Down Expand Up @@ -104,7 +104,7 @@ async function main() {
const withdrawHandle = await wallet.withdraw({
to: wallet.address, // can bridge to a different address in L1
token: utils.ETH_ADDRESS,
amount: ethers.utils.parseEther(AMOUNT),
amount: ethers.parseEther(AMOUNT),
});
console.log(`Withdraw transaction sent ${withdrawHandle.hash}`);
} catch (error: any) {
Expand Down

0 comments on commit 49be537

Please sign in to comment.