Skip to content
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

Merged
merged 4 commits into from
Apr 16, 2024
Merged

Conversation

itsacoyote
Copy link
Contributor

@itsacoyote itsacoyote commented Apr 12, 2024

What 💻

  • Add doc sections for Hardhat and Foundry

Base automatically changed from sf-zksync-cli-docs to staging April 12, 2024 20:18
@itsacoyote itsacoyote marked this pull request as ready for review April 15, 2024 18:04
@itsacoyote itsacoyote requested a review from a team as a code owner April 15, 2024 18:04
@itsacoyote itsacoyote requested a review from dutterbutter April 15, 2024 18:04
Copy link

github-actions bot commented Apr 15, 2024

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

Comment on lines 6 to 14
::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.
::
Copy link
Contributor

@dutterbutter dutterbutter Apr 16, 2024

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.

Comment on lines +16 to +27
::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**
::
Copy link
Contributor

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?

Copy link
Contributor Author

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
Copy link
Contributor

@dutterbutter dutterbutter Apr 16, 2024

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.

Comment on lines +8 to +23
::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)

::
Copy link
Contributor

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

Copy link
Contributor Author

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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
npm i -D @matterlabs/hardhat-zksync-deploy @matterlabs/hardhat-zksync-solc
npm i -D @matterlabs/hardhat-zksync

Comment on lines 54 to 55
import "@matterlabs/hardhat-zksync-deploy";
import "@matterlabs/hardhat-zksync-solc";
Copy link
Contributor

@dutterbutter dutterbutter Apr 16, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
import "@matterlabs/hardhat-zksync-deploy";
import "@matterlabs/hardhat-zksync-solc";
import "@matterlabs/hardhat-zksync"

Comment on lines 124 to 125
import "@matterlabs/hardhat-zksync-deploy";
import "@matterlabs/hardhat-zksync-solc";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
import { Deployer } from "@matterlabs/hardhat-zksync-deploy";
import { Deployer } from "@matterlabs/hardhat-zksync";

Comment on lines 84 to 95
#### 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).
Copy link
Contributor

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
Copy link
Contributor

@dutterbutter dutterbutter Apr 16, 2024

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

Copy link
Contributor

@dutterbutter dutterbutter left a 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.

@itsacoyote itsacoyote merged commit c583f87 into staging Apr 16, 2024
7 checks passed
@itsacoyote itsacoyote deleted the sf-tooling-docs branch April 16, 2024 15:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants