Skip to content

Commit 13acdc0

Browse files
authored
docs: Add disclaimer to migrating-to-zksync.md (#470)
# Description Based on a user-reported issue with `matterlabs/hardhat-zksync`, we realized that executing `deployProxy` on non-ZKsync chains requires the `@openzeppelin/hardhat-upgrades` package to be installed. ## Linked Issues matter-labs/hardhat-zksync#1863 ## Additional context
1 parent 998732c commit 13acdc0

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

content/00.zksync-network/40.tooling/20.hardhat/20.guides/20.migrating-to-zksync.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,13 +56,15 @@ You can learn more about each plugin in the [Getting started section](/zksync-ne
5656

5757
- `@nomicfoundation/hardhat-ethers`: `@matterlabs/hardhat-zksync` includes `hardhat-ethers` extended with support for ZKsync and non-ZKsync networks.
5858
- `@openzeppelin/hardhat-upgrades`: `@matterlabs/hardhat-zksync` includes `hardhat-upgrades` extended with support for ZKsync and non-ZKsync networks.
59+
- **For multichain projects** that deploy to both ZKsync and regular Ethereum networks, `@openzeppelin/hardhat-upgrades`
60+
must still be installed as the ZKsync plugin delegates to it for non-ZKsync networks.
5961
- `@nomicfoundation/hardhat-toolbox`: this plugin includes `@nomicfoundation/hardhat-ethers` which can cause conflicts. Import necessary
6062
components separately excluding `@nomicfoundation/hardhat-ethers`.
6163

6264
```ts
6365
// import "@nomicfoundation/hardhat-toolbox"
6466
// import "@nomicfoundation/hardhat-ethers"
65-
// import "@openzeppelin/hardhat-upgrades"
67+
// import "@openzeppelin/hardhat-upgrades" // Keep this import for multichain projects
6668
:code-import{filePath="hardhat-sol-template/hardhat.config.ts:zksync-import"}
6769
```
6870

@@ -395,6 +397,9 @@ The [following example project](https://github.com/uF4No/hardhat-evm-zksync-exam
395397
Here are some recommendations for projects that target multiple chains:
396398

397399
- Add the desired ZKsync networks with the `zksync:true` flag to the `hardhat.config.ts`.
400+
- Install `@openzeppelin/hardhat-upgrades` explicitly if you're using proxy contracts and deploying to both ZKsync and regular Ethereum networks.
401+
The `@matterlabs/hardhat-zksync` plugin uses its own implementation for ZKsync networks but delegates to OpenZeppelin's implementation
402+
for non-ZKsync networks.
398403
- Make sure to run the compilation task with the `--network` flag when targeting ZKsync networks to use the custom compiler.
399404
- When targeting ZKsync chains, the `@matterlabs/hardhat-zksync` plugin overrides the following plugins: `@nomiclabs/hardhat-ethers`, `@openzeppelin/hardhat-upgrades`.
400405
- To avoid typescript collision errors between `@nomiclabs/hardhat-ethers` and

0 commit comments

Comments
 (0)