Skip to content

Commit

Permalink
docs: update hardhat pages (#206)
Browse files Browse the repository at this point in the history
# Description

Fix broken links for hardhat pages. 
Update firebase redirects for changed URLs for hardhat pages.
Undo the hardhat migration changes from recent PR. Content is not ready
for prod yet.
  • Loading branch information
itsacoyote authored Aug 30, 2024
1 parent b39f64f commit 5195544
Show file tree
Hide file tree
Showing 27 changed files with 63 additions and 35 deletions.
2 changes: 1 addition & 1 deletion content/00.build/00.index.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ zkvyper](/zk-stack/components/compiler/toolchain)**.
:check-icon Most contracts work out of the box so migrating projects is seamless.

:check-icon Use existing frameworks
like [Hardhat](/build/tooling/hardhat/getting-started), libraries like
like [Hardhat](/build/tooling/hardhat), libraries like
[Ethers](https://docs.ethers.org/v6/), [Viem](https://viem.sh/zksync), or
[web3.js](https://docs.web3js.org/), and tools like [theGraph](https://thegraph.com/),
[Thirdweb](https://thirdweb.com/zksync), or
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,7 @@ The template project contains another script to interact with the contract.

- To learn more about the ZKsync Hardhat plugins check out the [plugins documentation](/build/tooling/hardhat/guides/getting-started).
- If you want to know more about how to interact with ZKsync using Javascript,
check out the [zksync-ethers Javascript SDK documentation](https://sdk.zksync.io/js/ethers/v6/getting-started).
check out the [zksync-ethers Javascript SDK documentation](https://sdk.zksync.io/js/ethers).

::callout{icon="i-heroicons-light-bulb"}
Check the [installation guide](/build/tooling/hardhat/installation) for instructions!
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: Migrating to ZKsync
description: Learn how to migrate an existing Hardhat project to ZKsync Era.
description: Learn how to migrate an existing Hardhat project deploy scripts to ZKsync Era.
tags: ["migration", "hardhat", "zksync", "plugins", "ethereum"]
---

Expand All @@ -15,7 +15,7 @@ This guide shows you how to migrate an existing Hardhat project to ZKsync Era.

## Overview

ZKsync Era offers [multiple Hardhat plugins](/build/tooling/hardhat/getting-started) with different features.
ZKsync Era offers [multiple Hardhat plugins](/build/tooling/hardhat) with different features.
This guide details the one you need to migrate your project to ZKsync Era.

::callout{icon="i-heroicons-exclamation-triangle" color="amber"}
Expand Down Expand Up @@ -94,8 +94,8 @@ zksolc: {
},
```

For more advanced settings, check out the [Solidity](/build/tooling/hardhat/hardhat-zksync-solc)
or [Vyper](/build/tooling/hardhat/hardhat-zksync-vyper) plugins.
For more advanced settings, check out the [Solidity](/build/tooling/hardhat/plugins/hardhat-zksync-solc)
or [Vyper](/build/tooling/hardhat/plugins/hardhat-zksync-vyper) plugins.

### How to configure multiple compilation targets

Expand Down Expand Up @@ -183,7 +183,7 @@ Passing the `--network` flag we make sure Hardhat will use the zksolc compiler (
This command will compile all contracts in the `/contracts` folder and create the folders `artifacts-zk` and `cache-zk`.

If your contracts import any non-inlineable libraries, you need to configure them in the `hardhat.config.ts` file.
Find more info and examples about [compiling libraries here](/build/tooling/hardhat/compiling-libraries).
Find more info and examples about [compiling libraries here](/build/tooling/hardhat/guides/compiling-libraries).

## Deploy contracts

Expand Down Expand Up @@ -246,7 +246,7 @@ npm hardhat deploy-zksync --script SCRIPT_FILENAME.ts --network zkSyncTestnet

If you don't include the `--script` option, all script files inside the `deploy` folder will be executed in alphabetical order.

Check out a detailed [approach](/build/tooling/hardhat/hardhat-zksync-deploy) on how to use `hardhat-zksync-deploy` plugin.
Check out a detailed [approach](/build/tooling/hardhat/plugins/hardhat-zksync-deploy) on how to use `hardhat-zksync-deploy` plugin.

## Frontend integration

Expand All @@ -263,14 +263,14 @@ You also need to use the `contract ABI` from the `artifacts-zk` folder to instan

Apart from the same classes and methods provided by ethers, zksync-ethers includes additional methods for zksync-specific features.

You can read more in the [`zksync-ethers` documentation](https://sdk.zksync.io/js/ethers).
You can read more in the [`zksync-ethers` documentation](https://sdk.zksync.io/sdk/js/ethers).

## Verify contracts

To verify your contracts you have two options:

<!-- TODO: update link -->
<!-- - Explorer: verify your contracts manually in the [ZKsync explorer](../block-explorer/contract-verification.md) -->
- Plugin: verify your contracts programmatically using the [Hardhat verify plugin](/build/tooling/hardhat/hardhat-zksync-verify)
- Plugin: verify your contracts programmatically using the [Hardhat verify plugin](/build/tooling/hardhat/plugins/hardhat-zksync-verify)

If you have any problems migrating your project, [send us a message on Discord](https://join.zksync.dev/).
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
title: OLD - Migrating to ZKsync
description: Learn how to migrate an existing Hardhat project deploy scripts to ZKsync Era.
tags: ["migration", "hardhat", "zksync", "plugins", "ethereum"]
navigation: false
---

::callout{icon="i-heroicons-exclamation-triangle" color="amber"}
Expand All @@ -15,7 +16,7 @@ This guide shows you how to migrate an existing Hardhat project to ZKsync Era.

## Overview

ZKsync Era offers [multiple Hardhat plugins](/build/tooling/hardhat/getting-started) with different features.
ZKsync Era offers [multiple Hardhat plugins](/build/tooling/hardhat) with different features.
This guide details the one you need to migrate your project to ZKsync Era.

::callout{icon="i-heroicons-exclamation-triangle" color="amber"}
Expand Down Expand Up @@ -94,8 +95,8 @@ zksolc: {
},
```

For more advanced settings, check out the [Solidity](/build/tooling/hardhat/hardhat-zksync-solc)
or [Vyper](/build/tooling/hardhat/hardhat-zksync-vyper) plugins.
For more advanced settings, check out the [Solidity](/build/tooling/hardhat/plugins/hardhat-zksync-solc)
or [Vyper](/build/tooling/hardhat/plugins/hardhat-zksync-vyper) plugins.

### How to configure multiple compilation targets

Expand Down Expand Up @@ -183,7 +184,7 @@ Passing the `--network` flag we make sure Hardhat will use the zksolc compiler (
This command will compile all contracts in the `/contracts` folder and create the folders `artifacts-zk` and `cache-zk`.

If your contracts import any non-inlineable libraries, you need to configure them in the `hardhat.config.ts` file.
Find more info and examples about [compiling libraries here](/build/tooling/hardhat/compiling-libraries).
Find more info and examples about [compiling libraries here](/build/tooling/hardhat/guides/compiling-libraries).

## Deploy contracts

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ Message is using era.zksync.io -->
```sh
zksolc compiler detected missing libraries! For more details, visit: https://era.zksync.io/docs/tools/hardhat/compiling-libraries.html.
To compile and deploy libraries, please run: `yarn hardhat deploy-zksync:libraries`
For more details on how to use deploy-zksync:libraries task from hardhat-zksync-deploy plugin, visit: https://era.zksync.io/docs/tools/hardhat/hardhat-zksync-deploy.html.
For more details on how to use deploy-zksync:libraries task from hardhat-zksync-deploy plugin, visit: https://docs.zksync.io/tooling/hardhat/plugins/hardhat-zksync-deploy.html.
```

To address the error, you can follow the instructions provided in the output, which is the recommended approach.
Expand All @@ -99,7 +99,7 @@ Vyper does not support automatic deployment of missing libraries, and the proces
::

`hardhat-zksync-deploy` plugin has the capability to automatically deploy all missing libraries generated by compiler.
For additional information, you may refer to the [documentation](hardhat-zksync-deploy#compilation-and-deployment-support-for-missing-libraries).
For additional information, you may refer to the [documentation](/build/tooling/hardhat/plugins/hardhat-zksync-deploy#compilation-and-deployment-support-for-missing-libraries).
This documentation provides details on how the tool handles the compilation and deployment of libraries that are currently missing.

### Manual deployment
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ and address of deployed contract
- `loadArtifact(name: string)` - load `ZkSyncArtifact` from contract name
- `extractFactoryDeps(artifact: ZkSyncArtifact)` - extracts factory deps from artifact
<!-- markdownlint-disable-next-line MD013 -->
- `deployContract(artifact: ZkSyncArtifact, constructorArguments: any[], wallet?: zk.Wallet, overrides?: ethers.Overrides, additionalFactoryDeps?: ethers.BytesLike[])` - deploys contract, for more details check out the [deployment section of the quickstart](getting-started#compile-and-deploy-a-contract).
- `deployContract(artifact: ZkSyncArtifact, constructorArguments: any[], wallet?: zk.Wallet, overrides?: ethers.Overrides, additionalFactoryDeps?: ethers.BytesLike[])` - deploys contract, for more details check out the [deployment section of the quickstart](/build/tooling/hardhat/guides/getting-started#compile-and-deploy-a-contract).

::callout{icon="i-heroicons-information-circle" color="blue"}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ Compilers are no longer released as Docker images and its usage is no longer rec
If there isn't a compiler binary already installed, the plugin will automatically download it.
- `compilerPath` (optional) is a field with the path to the `zksolc` binary. By default, the binary in `$PATH` is used.
- `libraries` if your contract uses non-inlinable libraries as dependencies, they have to be defined here.
Learn more about [compiling libraries here](compiling-libraries)
Learn more about [compiling libraries here](/build/tooling/hardhat/guides/compiling-libraries)
- `missingLibrariesPath` (optional) serves as a cache that stores all the libraries that are missing or have dependencies on other libraries.
A `hardhat-zksync-deploy` plugin uses this cache later to compile and deploy the libraries,
especially when the `deploy-zksync:libraries` task is executed.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ class Deployer {
): Promise<zk.Contract>
```
To see an example script of how to use a `Deployer` class to deploy a contract, check out the [deployment section of the quickstart](getting-started#compile-and-deploy-a-contract).
To see an example script of how to use a `Deployer` class to deploy a contract, check out the [deployment section of the quickstart](/build/tooling/hardhat/guides/getting-started#compile-and-deploy-a-contract).
::callout{icon="i-heroicons-information-circle" color="blue"}
**contractNameOrArtifact parameter within the deploy method**
Expand Down Expand Up @@ -528,7 +528,8 @@ The default value for **tags** is `default`, and the default value for **priorit
This plugin facilitates the compilation and deployment of missing libraries for users.
By leveraging the `@matterlabs/hardhat-zksync-solc` plugin, users can obtain a file that not only contains specifics
about the missing libraries for compilation but also showcases how they interlink with other dependent libraries.
For more information about missing libraries during the compilation process, please refer to [this link](compiling-libraries).
For more information about missing libraries during the compilation process, please refer to
[Compiling libraries](/build/tooling/hardhat/guides/compiling-libraries).
::callout{icon="i-heroicons-exclamation-triangle" color="amber"}
Starting from version 1.13.14, the zksolc compiler has been enhanced to identify missing libraries.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,8 +128,8 @@ contract Box is Initializable{
```

In the examples below, we assume that the Box contract is compiled and its artifact loaded using
Deployer class from the [hardhat-zksync-deploy plugin](hardhat-zksync-deploy).
More info on how to compile and load the contract can be found in the [Hardhat getting started page](getting-started).
Deployer class from the [hardhat-zksync-deploy plugin](/build/tooling/hardhat/plugins/hardhat-zksync-deploy).
More info on how to compile and load the contract can be found in the [Hardhat getting started page](/build/tooling/hardhat/guides/getting-started).

## Transparent upgradable proxies

Expand Down
2 changes: 1 addition & 1 deletion content/00.build/40.tooling/30.foundry/10.overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ While `foundry-zksync` is **alpha stage**, there are some limitations to be awar
We are actively working on providing support for these feature types.
- **Compiling Libraries**: Compiling non-inlinable libraries requires deployment and adding to configuration.

For more information please refer to [official docs](/build/tooling/hardhat/compiling-libraries).
For more information please refer to [official docs](/build/tooling/hardhat/guides/compiling-libraries).

```toml
# In foundry.toml
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Let's get started!
1. **Docker and docker-compose**: Ensure that Docker and `docker-compose` are installed on your machine.
If you haven't already installed them, follow the [installation guide](https://docs.docker.com/get-docker/).
2. **ZKsync Hardhat plugins**: A foundational understanding of the ZKsync Hardhat plugins will be beneficial.
New to ZKsync development with Hardhat? Explore the [Getting Started section](/build/tooling/hardhat/getting-started).
New to ZKsync development with Hardhat? Explore the [Getting Started section](/build/tooling/hardhat).

::callout{icon="i-heroicons-exclamation-triangle" color="amber"}
The `matterlabs/local-node` Docker image is currently based on the protocol `Version19` (deprecated on February 5, 2024),
Expand Down
2 changes: 1 addition & 1 deletion content/00.build/60.test-and-debug/20.in-memory-node.md
Original file line number Diff line number Diff line change
Expand Up @@ -379,7 +379,7 @@ This section demonstrates how to author and execute tests locally against `era_t
### Project configuration
1. Start by creating a new Hardhat project. If you need guidance, follow the [getting started guide](/build/tooling/hardhat/getting-started).
1. Start by creating a new Hardhat project. If you need guidance, follow the [getting started guide](/build/tooling/hardhat/guides/getting-started).
1. To incorporate the test libraries, execute:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ in IRs: `linkersymbol` in Yul and `PUSHLIB` in EVM legacy assembly.

All linking happens at compile-time. Deploy-time linking is not supported.

For compiling non-linable libraries please refer to the documentation [here](/build/tooling/hardhat/compiling-libraries).
For compiling non-linable libraries please refer to the documentation [here](/build/tooling/hardhat/guides/compiling-libraries).
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ the transaction (as it's an [EIP712 transaction](/zk-stack/concepts/transaction-
(i.e. it can deploy other contracts), these contracts' bytecodes should be included
in the `factory_deps` as well.

We recommend using the [hardhat-zksync-deploy](/build/tooling/hardhat/getting-started) plugin, to
We recommend using the [hardhat-zksync-deploy](/build/tooling/hardhat) plugin, to
simplify the deployment process. It provides classes
and methods to take care of all the deployment requirements, like generating the
[bytecode hash of the contract](#contract-size-limit-and-format-of-bytecode-hash).
Expand Down Expand Up @@ -67,7 +67,7 @@ only store their hashes. That's why you need to include _all_ the bytecodes of t
dependencies in the `factory_deps` field.

Both of these examples are already seamlessly done under the hood by our
[hardhat-zksync-deploy](/build/tooling/hardhat/getting-started).
[hardhat-zksync-deploy](/build/tooling/hardhat).

Note that the factory deps do not necessarily have to be used by the transaction in
any way. These are just markers that these bytecodes should be published on L1 with
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ easier to maintain outside of the framework.

## Hardhat Plugins

We recommend using our IR compilers via [their corresponding Hardhat plugins](/build/tooling/hardhat/getting-started).
We recommend using our IR compilers via [their corresponding Hardhat plugins](/build/tooling/hardhat).
Add these plugins to the Hardhat's config file to compile new projects or migrate
existing ones to ZKsync Era. For a lower-level approach, download our compiler binaries via the
links above and use their CLI interfaces.
Expand All @@ -81,5 +81,5 @@ Add the plugins below to the Hardhat's config file to compile new projects or mi
existing ones to ZKsync Era. For a lower-level approach, download our compiler binaries
[links above](#ir-compilers) and use their CLI interfaces.

- [hardhat-zksync-solc documentation](/build/tooling/hardhat/hardhat-zksync-solc)
- [hardhat-zksync-vyper documentation](/build/tooling/hardhat/hardhat-zksync-vyper)
- [hardhat-zksync-solc documentation](/build/tooling/hardhat/plugins/hardhat-zksync-solc)
- [hardhat-zksync-vyper documentation](/build/tooling/hardhat/plugins/hardhat-zksync-vyper)
Original file line number Diff line number Diff line change
Expand Up @@ -118,4 +118,4 @@ The usage of libraries in Solidity is supported in ZKsync Era with the following
- If a Solidity library can be inlined (i.e. it only contains `private` or `internal` methods), it can be used without
any additional configuration.
- However, if a library contains at least one `public` or `external` method, it cannot be inlined and its address needs
to be passed explicitly to the compiler; see [compiling non-inlinable libraries](/build/tooling/hardhat/compiling-libraries#compiling-non-inlinable-libraries).
to be passed explicitly to the compiler; see [compiling non-inlinable libraries](/build/tooling/hardhat/guides/compiling-libraries#compiling-non-inlinable-libraries).
2 changes: 2 additions & 0 deletions cspell-config/cspell-misc.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,7 @@ Lukka
mathbb
mundo
permissioned
pnpx
Winternitz
zkicon
zkvm
29 changes: 27 additions & 2 deletions firebase.json
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,32 @@
},
{
"source": "/build/tooling/hardhat/getting-started.html",
"destination": "/build/tooling/hardhat/getting-started",
"destination": "/build/tooling/hardhat",
"type": 301
},
{
"source": "/build/tooling/hardhat/getting-started",
"destination": "/build/tooling/hardhat/guides/getting-started",
"type": 301
},
{
"source": "/build/tooling/hardhat/migrating-to-zksync",
"destination": "/build/tooling/hardhat/guides/migrating-to-zksync",
"type": 301
},
{
"source": "/build/tooling/hardhat/compiling-libraries",
"destination": "/build/tooling/hardhat/guides/compiling-libraries",
"type": 301
},
{
"source": "/build/tooling/hardhat/hardhat-:plugin",
"destination": "/build/tooling/hardhat/plugins/hardhat-:plugin",
"type": 301
},
{
"source": "/build/tooling/hardhat/other-plugins",
"destination": "/build/tooling/hardhat/plugins/other-plugins",
"type": 301
},
{
Expand Down Expand Up @@ -203,7 +228,7 @@
},
{
"source": "/build/tooling/hardhat/*.@(html|md)",
"destination": "/build/tooling/hardhat/getting-started",
"destination": "/build/tooling/hardhat",
"type": 301
},
{
Expand Down
1 change: 0 additions & 1 deletion nuxt.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ export default defineNuxtConfig({
routeRules: {
'/api/search.json': { prerender: true },
'/build/tooling': { redirect: '/build/tooling/zksync-block-explorers' },
'/build/tooling/hardhat': { redirect: '/build/tooling/hardhat/getting-started' },
'/build/tooling/foundry': { redirect: '/build/tooling/foundry/overview' },
'/build/developer-reference/ethereum-differences': {
redirect: '/build/developer-reference/ethereum-differences/evm-instructions',
Expand Down

0 comments on commit 5195544

Please sign in to comment.