Skip to content

Commit

Permalink
feat: replacing the toolbox plugin with hardhat-zksync (#994)
Browse files Browse the repository at this point in the history
* feat: replacing the toolbox plugin with hardhat-zksync

* chore: run lint formatter

* fix: add @openzeppelin/contracts as a dependency

---------

Co-authored-by: Marko Arambasic <[email protected]>
  • Loading branch information
kiriyaga-txfusion and kiriyaga authored Apr 8, 2024
1 parent 5e0b8cd commit c8d8e6d
Show file tree
Hide file tree
Showing 26 changed files with 721 additions and 277 deletions.
4 changes: 2 additions & 2 deletions .github/release-please/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@
"release-type": "node",
"component": "@matterlabs/hardhat-zksync-verify"
},
"packages/hardhat-zksync-toolbox": {
"packages/hardhat-zksync": {
"release-type": "node",
"component": "@matterlabs/hardhat-zksync-toolbox"
"component": "@matterlabs/hardhat-zksync"
},
"packages/hardhat-zksync-node": {
"release-type": "node",
Expand Down
2 changes: 1 addition & 1 deletion .github/release-please/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"packages/hardhat-zksync-upgradable": "1.4.0",
"packages/hardhat-zksync-vyper": "1.0.8",
"packages/hardhat-zksync-verify": "1.4.2",
"packages/hardhat-zksync-toolbox": "1.3.0",
"packages/hardhat-zksync": "1.0.0",
"packages/hardhat-zksync-node": "1.0.3",
"packages/hardhat-zksync-chai-matchers": "1.3.0",
"packages/hardhat-zksync-ethers": "1.0.0",
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/npm-publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ on:
- hardhat-zksync-upgradable
- hardhat-zksync-vyper
- hardhat-zksync-verify
- hardhat-zksync-toolbox
- hardhat-zksync
- hardhat-zksync-node
- hardhat-zksync-chai-matchers
- hardhat-zksync-ethers
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ Here is an overview of the plugins currently available:
| hardhat-zksync-verify-vyper | Specialized for automating the verification of Vyper contracts on the zkSync network. |
| hardhat-zksync-vyper | Streamlines the compilation of Vyper contracts for deployment on the zkSync network. |
| hardhat-zksync-chai-matchers | Extends chai with additional matchers, aiding in testing zkSync-specific features more effectively. |
| hardhat-zksync-toolbox | Offers a suite of zkSync-related Hardhat plugins in one package, enhancing accessibility and efficiency. |
| hardhat-zksync | Offers a suite of zkSync-related Hardhat plugins in one package, enhancing accessibility and efficiency. |
| hardhat-zksync-upgradeable | Enables easier deployment and upgrading of smart contracts on the zkSync network, improving contract lifecycle management. |
| hardhat-zksync-node | Convenient plugin to run the zkSync era-test-node locally. |
| hardhat-zksync-ethers | A zksync-ethers SDK wrapper providing additional methods for accelerated development on zkSync. |
Expand All @@ -32,7 +32,7 @@ You can find more detailed explanations on how to use hardhat zkSync plugins on
[hardhat-zksync-verify-vyper](https://era.zksync.io/docs/tools/hardhat/hardhat-zksync-verify-vyper.html)\
[hardhat-zksync-vyper](https://era.zksync.io/docs/tools/hardhat/hardhat-zksync-vyper.html)\
[hardhat-zksync-chai-matchers](https://era.zksync.io/docs/tools/hardhat/hardhat-zksync-chai-matchers.html)\
[hardhat-zksync-toolbox](https://era.zksync.io/docs/tools/hardhat/plugins.html)\
[hardhat-zksync](https://era.zksync.io/docs/tools/hardhat/plugins.html)\
[hardhat-zksync-upgradeable](https://era.zksync.io/docs/tools/hardhat/hardhat-zksync-upgradable.html)\
[hardhat-zksync-node](https://era.zksync.io/docs/tools/hardhat/hardhat-zksync-node.html)\
[hardhat-zksync-ethers](https://era.zksync.io/docs/tools/hardhat/hardhat-zksync-ethers.html)
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
"wsrun": "^5.2.2"
},
"scripts": {
"build": "tsc --build packages/hardhat-zksync-solc packages/hardhat-zksync-deploy packages/hardhat-zksync-vyper packages/hardhat-zksync-chai-matchers packages/hardhat-zksync-verify packages/hardhat-zksync-upgradable packages/hardhat-zksync-verify-vyper packages/hardhat-zksync-node packages/hardhat-zksync-ethers packages/hardhat-zksync-toolbox",
"watch": "tsc --build --watch packages/hardhat-zksync-solc packages/hardhat-zksync-deploy packages/hardhat-zksync-vyper packages/hardhat-zksync-chai-matchers packages/hardhat-zksync-verify packages/hardhat-zksync-upgradable packages/hardhat-zksync-verify-vyper packages/hardhat-zksync-node packages/hardhat-zksync-ethers packages/hardhat-zksync-toolbox",
"build": "tsc --build packages/hardhat-zksync-solc packages/hardhat-zksync-deploy packages/hardhat-zksync-vyper packages/hardhat-zksync-chai-matchers packages/hardhat-zksync-verify packages/hardhat-zksync-upgradable packages/hardhat-zksync-verify-vyper packages/hardhat-zksync-node packages/hardhat-zksync-ethers packages/hardhat-zksync",
"watch": "tsc --build --watch packages/hardhat-zksync-solc packages/hardhat-zksync-deploy packages/hardhat-zksync-vyper packages/hardhat-zksync-chai-matchers packages/hardhat-zksync-verify packages/hardhat-zksync-upgradable packages/hardhat-zksync-verify-vyper packages/hardhat-zksync-node packages/hardhat-zksync-ethers packages/hardhat-zksync",
"clean": "wsrun --exclude-missing clean",
"lint": "wsrun --exclude-missing --stages lint",
"lint:fix": "wsrun --exclude-missing --stages lint:fix",
Expand Down
45 changes: 0 additions & 45 deletions packages/hardhat-zksync-toolbox/CHANGELOG.md

This file was deleted.

46 changes: 0 additions & 46 deletions packages/hardhat-zksync-toolbox/README.md

This file was deleted.

7 changes: 0 additions & 7 deletions packages/hardhat-zksync-toolbox/src/index.ts

This file was deleted.

51 changes: 0 additions & 51 deletions packages/hardhat-zksync-toolbox/test/tests.ts

This file was deleted.

File renamed without changes.
File renamed without changes.
File renamed without changes.
1 change: 1 addition & 0 deletions packages/hardhat-zksync/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# @matterlabs/hardhat-zksync
76 changes: 76 additions & 0 deletions packages/hardhat-zksync/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
# hardhat-zksync 🚀

zkSync Era [Hardhat](https://hardhat.org/) plugin provides a convenient method for bundling and accessing a range of zkSync-related Hardhat plugins.

![Era Logo](https://github.com/matter-labs/era-contracts/raw/main/eraLogo.svg)

## ⚠️ Version Compatibility Warning

Ensure you are using the correct version of the plugin with ethers:
- For plugin version **<1.0.0**:
- Compatible with ethers **v5**.

- For plugin version **≥1.0.0**:
- Compatible with ethers **v6** (⭐ Recommended)

## 📥 Installation

To install **hardhat-zksync** plugin, run:

`npm i -D @matterlabs/hardhat-zksync`

or

`yarn add -D @matterlabs/hardhat-zksync`

## Usage

Here is an overview of the plugins currently available in this package when installed:

| 🔌 Plugin | 📄 Description |
|-------------------------------|-----------------------------------------------------------------------------------------------------------------------------------|
| hardhat-zksync-solc | Simplifies compiling Solidity contracts for the zkSync network, streamlining deployment preparation. |
| hardhat-zksync-deploy | Facilitates the deployment of contracts on zkSync, utilizing artifacts from hardhat-zksync-solc. |
| hardhat-zksync-verify | Automates the process of verifying smart contracts on the zkSync network, enhancing transparency and trust. |
| hardhat-zksync-upgradeable | Enables easier deployment and upgrading of smart contracts on the zkSync network, improving contract lifecycle management. |
| hardhat-zksync-node | Convenient plugin to run the zkSync era-test-node locally. |
| hardhat-zksync-ethers | A zksync-ethers SDK wrapper providing additional methods for accelerated development on zkSync. |


This plugin enables access to all commands available for each specific plugin, making them readily accessible with just the usage of this plugin. To view the available commands and their descriptions, please refer to the [documentation](https://v2-docs.zksync.io/api/hardhat/plugins.html#plugins) for each individual plugin.

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](https://docs.zksync.io/build/tooling/hardhat/hardhat-zksync-deploy.html) and [hardhat-zksync-upgradable](https://docs.zksync.io/build/tooling/hardhat/hardhat-zksync-upgradable.html).

## 📝 Documentation

In addition to the [hardhat-zksync](http://docs.zksync.io/build/tooling/hardhat/hardhat-zksync.html), zkSync's Era [website](https://era.zksync.io/docs/) offers a variety of resources including:

[Guides to get started](https://era.zksync.io/docs/dev/building-on-zksync/hello-world.html): Learn how to start building on zkSync Era.\
[Hardhat zkSync Era plugins](https://era.zksync.io/docs/tools/hardhat/getting-started.html): Overview and guides for all Hardhat zkSync Era plugins.\
[Hyperscaling](https://era.zksync.io/docs/reference/concepts/hyperscaling.html#what-are-hyperchains): Deep dive into hyperscaling on zkSync Era.

## 🤝 Contributing

Contributions are always welcome! Feel free to open any issue or send a pull request.

Go to [CONTRIBUTING.md](https://github.com/matter-labs/hardhat-zksync/blob/main/.github/CONTRIBUTING.md) to learn about steps and best practices for contributing to zkSync hardhat tooling base repository.


## 🙌 Feedback, help and news

[zkSync Era Discord server](https://join.zksync.dev/): for questions and feedback.\
[Follow zkSync Era on Twitter](https://twitter.com/zksync)

## Happy building! 👷‍♀️👷‍♂️
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"name": "@matterlabs/hardhat-zksync-toolbox",
"version": "1.3.0",
"name": "@matterlabs/hardhat-zksync",
"version": "1.0.0",
"description": "zkSync bundle of Hardhat plugins",
"repository": "github:matter-labs/hardhat-zksync-toolbox",
"homepage": "https://github.com/matter-labs/hardhat-zksync/tree/main/packages/hardhat-zksync-toolbox",
"repository": "github:matter-labs/hardhat-zksync",
"homepage": "https://github.com/matter-labs/hardhat-zksync/tree/main/packages/hardhat-zksync",
"author": "Matter Labs",
"license": "MIT",
"main": "dist/src/index.js",
Expand Down Expand Up @@ -34,16 +34,25 @@
],
"dependencies": {
"hardhat": "^2.19.4",
"@matterlabs/hardhat-zksync-deploy": "^1.3.0",
"@matterlabs/hardhat-zksync-solc": "^1.1.4",
"@matterlabs/hardhat-zksync-verify": "^1.4.2",
"@matterlabs/hardhat-zksync-upgradable": "^1.4.0",
"@matterlabs/hardhat-zksync-node": "^1.0.3",
"@matterlabs/hardhat-zksync-ethers": "^1.0.0",
"@matterlabs/zksync-contracts": "^0.6.1",
"@nomicfoundation/hardhat-ethers": "^3.0.4",
"@nomicfoundation/hardhat-verify": "^2.0.0",
"@openzeppelin/upgrades-core": "^1.31.3",
"@openzeppelin/contracts-upgradeable": "^4.9.2",
"@openzeppelin/contracts": "^4.9.2",
"zksync-ethers": "^6.0.0",
"@nomicfoundation/hardhat-chai-matchers": "^2.0.2",
"chai": "^4.3.7"
"ethers": "^6.7.1",
"chai": "^4.3.7",
"sinon-chai": "^3.7.0",
"sinon": "^17.0.1"
},
"devDependencies": {
"@matterlabs/hardhat-zksync-chai-matchers": "^1.2.2",
"@matterlabs/hardhat-zksync-deploy": "^1.1.2",
"@matterlabs/hardhat-zksync-solc": "^1.1.2",
"@matterlabs/hardhat-zksync-verify": "^1.3.0",
"@nomicfoundation/hardhat-ethers": "^3.0.4",
"@types/chai": "^4.2.0",
"@types/mocha": "^9.1.0",
"@types/node": "^18.11.17",
Expand All @@ -55,7 +64,6 @@
"eslint-plugin-import": "2.29.0",
"eslint-plugin-no-only-tests": "3.1.0",
"eslint-plugin-prettier": "5.0.1",
"ethers": "^6.7.1",
"mocha": "^10.1.0",
"prettier": "3.1.0",
"rimraf": "^3.0.2",
Expand All @@ -64,10 +72,12 @@
"c8": "^8.0.1"
},
"peerDependencies": {
"@matterlabs/hardhat-zksync-chai-matchers": "^1.2.2",
"@matterlabs/hardhat-zksync-deploy": "^1.1.2",
"@matterlabs/hardhat-zksync-solc": "^1.1.2",
"@matterlabs/hardhat-zksync-verify": "^1.3.0"
"@matterlabs/hardhat-zksync-deploy": "^1.3.0",
"@matterlabs/hardhat-zksync-solc": "^1.1.4",
"@matterlabs/hardhat-zksync-verify": "^1.4.2",
"@matterlabs/hardhat-zksync-upgradable": "^1.4.0",
"@matterlabs/hardhat-zksync-node": "^1.0.3",
"@matterlabs/hardhat-zksync-ethers": "^1.0.0"
},
"prettier": {
"tabWidth": 4,
Expand All @@ -76,4 +86,4 @@
"singleQuote": true,
"bracketSpacing": true
}
}
}
Loading

0 comments on commit c8d8e6d

Please sign in to comment.