-
Notifications
You must be signed in to change notification settings - Fork 227
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
npm warn ERESOLVE overriding peer dependency if your project requires @openzeppelin/contracts
less than v4.6.0
#1227
Comments
Hello @mmv08 , |
The problem is that it requires a dependency to function properly, but for some reason, it expects the dependency supplied by the host project. |
The problem we're having can be easily solved by switching |
Yes, I understand your point. hardhat-zksync is our umbrella plugin designed to gather all libraries useful for ZKSync-specific processes. One of the packages listed as a dependency is @matterlabs/zksync-contracts, which provides all ZKSync-specific contracts that users are using and where the OpenZeppelin version matters for them to work correctly. This package has a peer dependency on @openzeppelin/contracts version 4.6.0, causing these warnings. |
Could you please explain why it requires the dependency to be provided by the host project if it is required for the plugin to function? Why is it not a What if I want to use a different openzeppelin contracts library version in my project and use the plugin as well? |
No hardhat plugin should dictate which smart contract library the project should use. It may require a specific hardhat version since it's a hardhat plugin, this is all right. But if the plugin requires a specific smart contract library version, the smart contract library should be a dependency of the plugin. |
Thanks for pointing out that the hardhat-zksync-upgradable plugin is missing the OpenZeppelin contracts dependency, which is essential for tasks such as compile, deploy, and upgrade processes. Older versions, like OpenZeppelin contracts 4.5.0, lack some necessary contracts, so it's important to specify a specific version to ensure proper functionality. We will fix this and include it in the next release. |
Thank you very much @kiriyaga-txfusion I believe this results in a much more positive developer experience. |
🐛 Bug Report for hardaht-zksync plugins
💥 Plugin name
@matterlabs/hardhat-zksync
📝 Description
I'm trying to follow https://docs.zksync.io/build/tooling/hardhat/migrating-to-zksync#install-dependencies. After doing the first two steps, my project can't be compiled anymore (because the peer dependency won't be installed):
🔄 Reproduction Steps
mkdir npm-hardhat-zksync-bug-reproduction && cd npm-hardhat-zksync-bug-reproduction && npm init -y && npm i @matterlabs/hardhat-zksync @openzeppelin/[email protected]
🤔 Expected Behavior
Our project depends on an @openzeppelin/contracts version v3.9.2 due to compiler specifics, and we also don't want our resulting bytecode to be changed since the contract has already been deployed to many EVM networks. Installing a hardhat plugin shouldn't force me to use a specific version of the library that my contracts can depend on. If a specific version is required for the plugin to work, it should be a dependency of the plugin and not a peer dependency.
😯 Current Behavior
🖥️ Environment
📋 Additional Context
📎 Log Output
The text was updated successfully, but these errors were encountered: