Skip to content

This is a simple example of how to use zkSync Era with Hardhat. It will help you to deploy your first zkSync smart contracts and interact with them.

License

Notifications You must be signed in to change notification settings

pcheremu/zkSync-era-smartContracts-deployment

 
 

Repository files navigation

zkSync Era Hardhat Example

This is a simple example of how to use zkSync Era with Hardhat. It will help you to deploy your first zkSync smart contracts, interact with them, and automatically verify its source code on zkSync Era Block Explorer.

Setup

  1. Install dependencies
    npm install
  2. Rename or copy file .env.example to .env and fill in the private key of the account you want to use for deployment.

Deploying contracts

  1. Compile contracts

    npm run compile
  2. Deploy contracts:

  • Greeter - this is a simple contract that allows you to set a greeting message and read it. It will also log SetGreeting event when you set a new greeting message.

    npm run deploy greeter.ts
  • ERC20 Token - this is a multifile contract that will let you deploy your own custom token to zkSync 2.0.

    • Fill in the values for your token in deploy/erc20.ts
    • Deploy the contract
      npm run deploy erc20.ts

Useful links

About

This is a simple example of how to use zkSync Era with Hardhat. It will help you to deploy your first zkSync smart contracts and interact with them.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • TypeScript 90.8%
  • Solidity 9.2%