# @zoroprotocol/hardhat-zksync-web3

> Hardhat plugin that extends the Hardhat Runtime Environment with the zksync-web3 wallet

Latest version **1.0.0** (published 2023-09-27) · MIT license · 0 weekly downloads

## Install

```sh
npm install @zoroprotocol/hardhat-zksync-web3
pnpm add @zoroprotocol/hardhat-zksync-web3
yarn add @zoroprotocol/hardhat-zksync-web3
bun add @zoroprotocol/hardhat-zksync-web3
```

## Health

**Score 20/100 (F)** — status: abandoned.

Positive: has types; no vulnerabilities.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.0 |
| Published | 2023-09-27 |
| First published | 2023-09-27 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 16.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 2 |
| Author | Zoro Protocol |
| Maintainers | 0xuncleenzo |
| Keywords | ethereum, smart-contracts, hardhat, hardhat-plugin, zkSync |

## Links

- npm: https://www.npmjs.com/package/@zoroprotocol/hardhat-zksync-web3
- Repository: https://github.com/zoro-protocol/hardhat-zksync-web3
- Issues: https://github.com/zoro-protocol/hardhat-zksync-web3/issues
- npm.io page: https://npm.io/package/@zoroprotocol/hardhat-zksync-web3

## Recent versions

- 1.0.0 (latest) — 2023-09-27

## README

# hardhat-zksync-web3

[Hardhat](https://hardhat.org/) plugin that extends the [Hardhat Runtime Environment](https://hardhat.org/advanced/hardhat-runtime-environment) with the [`zksync-web3`](https://era.zksync.io/docs/api/js/) wallet.

Developers can create the `zksync-web3.Wallet` with either a private key or keystore file. If a keystore file is used, the user is prompted for the keystore password. Keystores are best for secure scripts that do not pollute project directories with plaintext private keys stored in `.env` files.

## Installation

```bash
npm install hardhat-zksync-web3 hardhat @nomiclabs/hardhat-ethers ethers @matterlabs/hardhat-zksync-deploy zksync-web3
```

Import the plugin in your `hardhat.config.js`:

```js
require("hardhat-zksync-web3");
```

Or if you are using TypeScript, in your `hardhat.config.ts`:

```ts
import "hardhat-zksync-web3";
```

## Required plugins

- [@nomiclabs/hardhat-ethers](https://github.com/NomicFoundation/hardhat/tree/main/packages/hardhat-ethers)
- [@matterlabs/hardhat-zksync-deploy](https://github.com/matter-labs/hardhat-zksync/tree/main/packages/hardhat-zksync-deploy)

## Environment extensions

This plugin extends the Hardhat Runtime Environment by adding a `getZkWallet()` function that returns a `zksync-web3.Wallet` connected to a `zksync-web3.Provider` and `ethers.Provider` for the current L1 and L2 network.

## Configuration

This plugin extends the `HardhatUserConfig`'s `NetworkUserConfig` object with an optional
`zkWallet` field.

This is an example of how to set it:

```ts
const config: HardhatUserConfig = {
  networks: {
    zkLocal: {
      url: "http://localhost:3050",
      ethNetwork: "http://localhost:8545",
      chainId: 270,
      zksync: true,
      zkWallet: {
        privateKey: ETH_PK // Account private key
      }
    },
    zkTestnet: {
      url: "https://testnet.era.zksync.dev",
      ethNetwork: "goerli", // RPC URL of the network (e.g. `https://goerli.infura.io/v3/<API_KEY>`)
      chainId: 280,
      zksync: true,
      verifyURL:
        "https://zksync2-testnet-explorer.zksync.dev/contract_verification", // Verification endpoint
      zkWallet: {
        keystore: ETH_KEYSTORE // Path to password protected keystore file
      }
    }
  }
};
```

## Usage

There are no additional steps you need to take for this plugin to work.

Install it and access the wallet through the Hardhat Runtime Environment anywhere
you need it (tasks, scripts, tests, etc).

If using a keystore file, enter the password when prompted by the task, script, test, etc.

---
_Source: https://npm.io/package/@zoroprotocol/hardhat-zksync-web3 · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
