[Deployment] Non-inlinable library address should be configured per network #763
-
Team or ProjectTreasure EnvironmentMainnet L2 block numberNo response zkSolc Versionzksolc-1.5.7 zksync-ethers VersionMinimal Reproducible Code or Repo LinkDoes this work on other EVMs? (If yes, please list at least 1 of them)Not applicable Description of What Your Contract DoesNon-inlinable libraries have to be deployed separately, and added to the compiler settings in the hardhat config. This is problematic when working with more than 1 deployment targets, let it be a testnet + mainnet, or different chains built with ZK Stack. Right now there's no way to set different addresses for different networks. Ideally a mapping could be provided with an address for each network, instead of a single address. Additional DetailsNo response |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 1 reply
-
To address the issue of configuring non-inlinable library addresses for different networks in your ZKsync deployment, you can indeed set up a network-specific configuration in your Here’s a general approach to achieve this:
This setup allows you to maintain different library addresses for different networks within the same project configuration, making it easier to manage deployments across various environments. For more detailed guidance on configuring your Hardhat project for ZKsync, you can refer to the ZKsync Hardhat integration documentation. If you need further assistance or have more specific requirements, please visit the ZKsync developers discussions on Github for more in-depth support. Your feedback helps us serve you better. If this fully addresses your question, please give it a thumbs up. If it doesn't, please give it a thumbs down. This will inform the community and team so we can improve our support. |
Beta Was this translation helpful? Give feedback.
-
I don't think the answer by gleenAI is valid. |
Beta Was this translation helpful? Give feedback.
-
A workaround is to have a separate For example, you can have It effectively removes the need for the It also deals with local node-related data being committed to a repo, as local config does not need to be committed (and should not be, as each dev would have different library addresses in their config). Unfortunately, a mapping solution proposed in the issue desc. does not account for this. |
Beta Was this translation helpful? Give feedback.
-
@vmaark updating this to a feature request. This is something we will think about as its becoming quite relevant. Thank you for the post 🙏 |
Beta Was this translation helpful? Give feedback.
Opened a feature request here: matter-labs/hardhat-zksync#1531 . Feel free to add any relevant discussion points there. Thanks again for posting 🙏