Home
Hardhat plugins for zkSync 2.0
JS Web3 SDK
  • JS Web3 SDK
  • Getting started
  • Providers
  • Accounts: overview
  • Accounts: L1->L2 transactions
  • Contracts
  • zkSync features
  • Utilities
  • Types
  • Front-end integration
  • Home
  • /
  • JS Web3 SDK
  • /
  • Utilities

Utilities

What's on the page
  • The "address" of Ether ERC20 smart contract
  • ABI of zkSync smart contract
  • IERC20 interface

zksync-web3 provides some useful utilities for zkSync builders. They can be imported the following way:

import { utils } from "zksync-web3";

Most of the utilities are used internally by the zkSync team. So this document will describe only those which should be helpful for you.

The "address" of Ether ERC20 smart contract

In zkSync, all the native tokens are ERC20. Thus, there needs to be a smart contract

export const ETH_ADDRESS = "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE";

ABI of zkSync smart contract

export const ZKSYNC_MAIN_ABI = new utils.Interface(require("../abi/ZkSync.json"));

IERC20 interface

Convenient when interacting with native tokens on zkSync.

export const IERC20 = new utils.Interface(require("../abi/IERC20.json"));
Last updated: 7/5/2022, 1:42:16 PM
Previous
zkSync features
Next
Types
Edit on GitHub
  • The "address" of Ether ERC20 smart contract
  • ABI of zkSync smart contract
  • IERC20 interface