-
Notifications
You must be signed in to change notification settings - Fork 41
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: add tooling docs for hardhat and foundry #15
Conversation
6f70d61
to
b416680
Compare
ade811f
to
e15eb7f
Compare
Visit the preview URL for this PR (updated for commit 61e9600): https://zksync-docs-staging-5eb09--pr15-sf-tooling-docs-nd1g5rw7.web.app (expires Tue, 23 Apr 2024 15:19:11 GMT) 🔥 via Firebase Hosting GitHub Action 🌎 Sign: bfaafba5fa82d4f63473aaa76a21fabf1fbb3a11 |
::callout{icon="i-heroicons-exclamation-triangle" color="amber"} | ||
The `zksync2-js` SDK is now deprecated. | ||
|
||
In line with this, the `hardhat-zksync-zksync2js` package will also be deprecated. | ||
|
||
Moving forward, this package will be renamed to `hardhat-zksync-ethers` and will utilize the newly introduced `zksync-ethers` SDK. | ||
|
||
Please update your dependencies accordingly to ensure compatibility and continued support. | ||
:: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's remove. Not relevant anymore as zksync2-js is long gone.
::callout{icon="i-heroicons-exclamation-triangle" color="amber"} | ||
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) | ||
|
||
Examples are adopted for plugin version **>=1.0.0** | ||
:: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a theme that appears A LOT. Perhaps we use a tab to illustrate the different installation command. For example,
v6
bun install --dev @matter-labs/[email protected]
v5
bun install --dev @matter-labs/[email protected]
Wdyt?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I need to sit on it a bit and think it over. The docs are oriented for >=1.0.0 with this as just a callout. So in that sense, we should maybe make it a separate page that clarifies this, or something simple?
|
||
Add the latest version of this plugin to your project with the following command: | ||
|
||
::code-group |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should keep the code groups consistent and include pnpm and bun. Perhaps we can introduce a component here for reusability.
::callout{icon="i-heroicons-exclamation-triangle" color="amber"} | ||
The zkSync Era In-memory node binaries are not supported on Windows at the moment. | ||
As an alternative, users can utilize the Windows Subsystem for Linux (WSL). | ||
:: | ||
|
||
::callout{icon="i-heroicons-exclamation-triangle" color="amber"} | ||
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) | ||
|
||
:: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also by utilizing tabs for plugin version differences for v5 / v6 it prevents double callouts back to back
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep, agreed, but I notice there are just these callouts but the guides are all oriented to explaining >=1.0.0
::code-group | ||
|
||
```bash [yarn] | ||
yarn add -D @matterlabs/hardhat-zksync-deploy @matterlabs/hardhat-zksync-solc |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yarn add -D @matterlabs/hardhat-zksync-deploy @matterlabs/hardhat-zksync-solc | |
yarn add -D @matterlabs/hardhat-zksync |
``` | ||
|
||
```bash [npm] | ||
npm i -D @matterlabs/hardhat-zksync-deploy @matterlabs/hardhat-zksync-solc |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
npm i -D @matterlabs/hardhat-zksync-deploy @matterlabs/hardhat-zksync-solc | |
npm i -D @matterlabs/hardhat-zksync |
import "@matterlabs/hardhat-zksync-deploy"; | ||
import "@matterlabs/hardhat-zksync-solc"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
import "@matterlabs/hardhat-zksync-deploy"; | |
import "@matterlabs/hardhat-zksync-solc"; | |
import "@matterlabs/hardhat-zksync" |
import "@matterlabs/hardhat-zksync-deploy"; | ||
import "@matterlabs/hardhat-zksync-solc"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
import "@matterlabs/hardhat-zksync-deploy"; | |
import "@matterlabs/hardhat-zksync-solc"; | |
import "@matterlabs/hardhat-zksync" |
import { utils, Wallet } from "zksync-ethers"; | ||
import * as ethers from "ethers"; | ||
import { HardhatRuntimeEnvironment } from "hardhat/types"; | ||
import { Deployer } from "@matterlabs/hardhat-zksync-deploy"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
import { Deployer } from "@matterlabs/hardhat-zksync-deploy"; | |
import { Deployer } from "@matterlabs/hardhat-zksync"; |
#### Using hardhat-zksync-solc version < 0.4.2 | ||
|
||
Following error: | ||
|
||
```sh | ||
Error in plugin @matterlabs/hardhat-zksync-solc: LLVM("Library `contracts/MiniMath.sol:MiniMath` not found") | ||
|
||
``` | ||
|
||
The error indicates that the compilation process is expecting the address of the MiniMath library, but it is not being provided. | ||
|
||
To resolve the error, it's necessary to manually resolve the libraries. For detailed instructions, please refer to [this section](#automatic-deployment). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we can remove this section.
|
||
To resolve the error, it's necessary to manually resolve the libraries. For detailed instructions, please refer to [this section](#automatic-deployment). | ||
|
||
## Non-inline libraries deployment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This section needs to be re-written. I will add a TODO for myself. https://linear.app/matterlabs/issue/DEVRL-488/re-write-non-linable-libs-compiling-section
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a few comments. Outside the documentation for a given plugin we should now always make use of or reference @matter-labs/hardhat-zksync
plugin instead of the individual plugins. Excludes vyper related documentation.
What 💻