-
Notifications
You must be signed in to change notification settings - Fork 228
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
hre.ethers.ContractFactory
and hre.zksyncEthers.ContractFactory
don't work with zksync nodes
#1420
Comments
Hello @mmv08 , Which versions of |
zksync-ethers@6.11.2 For the github repo you can try safe-global/safe-smart-account@7975f52 (notice the commit hash) The function for getting the contract factory is in |
Hey @mmv08, please use the latest release of Also, in your code, you dont have to use |
thnaks, I've just tested it and it works |
This PR: - Partially solves #767 (test updates for `SafeToL2Upgrade` are still pending) - It is based on version 1.5.0 because 1.4.1 cannot be compiled at the moment because we used `.send` in there, and hardhat zksync compiler plugin needs to be updated to support suppressing errors. I will cherry-pick it later. - I updated the `deployContract` function name and return type to be more self-explanatory - The main changes were around adding zksync compatible bytecode and also using the ContractFactory from the "zksync-ethers" package because in ZkSync you need to interact with a system contract to deploy contracts and not just send a transaction with the bytecode and `to` address omitted. One bug found: matter-labs/hardhat-zksync#1420
This PR: - Partially solves #767 (test updates for `SafeToL2Upgrade` are still pending) - It is based on version 1.5.0 because 1.4.1 cannot be compiled at the moment because we used `.send` in there, and hardhat zksync compiler plugin needs to be updated to support suppressing errors. I will cherry-pick it later. - I updated the `deployContract` function name and return type to be more self-explanatory - The main changes were around adding zksync compatible bytecode and also using the ContractFactory from the "zksync-ethers" package because in ZkSync you need to interact with a system contract to deploy contracts and not just send a transaction with the bytecode and `to` address omitted. One bug found: matter-labs/hardhat-zksync#1420
This PR: - Partially solves safe-global/safe-smart-account#767 (test updates for `SafeToL2Upgrade` are still pending) - It is based on version 1.5.0 because 1.4.1 cannot be compiled at the moment because we used `.send` in there, and hardhat zksync compiler plugin needs to be updated to support suppressing errors. I will cherry-pick it later. - I updated the `deployContract` function name and return type to be more self-explanatory - The main changes were around adding zksync compatible bytecode and also using the ContractFactory from the "zksync-ethers" package because in ZkSync you need to interact with a system contract to deploy contracts and not just send a transaction with the bytecode and `to` address omitted. One bug found: matter-labs/hardhat-zksync#1420
🐛 Bug Report for hardaht-zksync plugins
💥 Plugin name
I guess it's
hardhat-zksync-ethers
📝 Description
I needed to deploy a contract from the bytecode in tests, and I tried using:
All approaches failed with an error:
Importing the
ContractFactory
directly from zksync-ethers worked.🔄 Reproduction Steps
So, for me, the main bug here is that `hre.zksyncEthers.ContractFactory is not working as expected, all others are nice-to-haves. Therefore I'm only describing reproduction steps for that issue.
🤔 Expected Behavior
The contract is deployed and no error is thrown
😯 Current Behavior
🖥️ Environment
The text was updated successfully, but these errors were encountered: