hardhat-zksync

Guide on using the hardhat-zksync plugin.

The hardhat-zksync plugin provides a convenient method for bundling and accessing a range of ZKsync-related Hardhat plugins. This approach simplifies the process of utilizing these plugins and promotes ease of use.

List of contained plugins:

Popular Hardhat plugins: You can find a list of all official plugins. Also, ZKsync supports some other popular plugins that can be used.

Prerequisite

To use hardhat-zksync in your project, ensure the following:

  • Node.js version 18 or higher is installed.
  • Hardhat version 2.18.0 or higher is installed as a dependency.

Installation

Add the latest version of this plugin to your project with the following command:

yarn add -D @matterlabs/hardhat-zksync

Usage

After installing it, add the plugin to your Hardhat config:

import "@matterlabs/hardhat-zksync";

With the hardhat-zksync plugin installed and imported, you will have access to all of the supported plugins and will be able to use them as needed in your project. This plugin enables access to all commands available for each specific plugin, making them readily accessible with just the usage of this plugin.

To learn more about using any of the plugins that are supported by the hardhat-zksync plugin, you can refer to their documentation above.

For certain tasks present in the plugins encompassed by this plugin, it overrides them with new features and parameters. These tasks streamline common functionalities into a simplified workflow.

Here is a list of overriden tasks where this plugin adds new optional parameter --verify:

  • deploy-zksync:contract
  • deploy-zksync:proxy
  • upgrade-zksync:proxy
  • deploy-zksync:beacon
  • upgrade-zksync:beacon

The --verify parameter allow the task to immediately verify all deployed and upgraded contracts when task is called.

To check other parameters present in these tasks, please check the documentation pages for hardhat-zksync-deploy and hardhat-zksync-upgradable.


Made with ❤️ by the ZKsync Community