Skip to content
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

Fix zksync deployment #437

Merged
merged 2 commits into from
Apr 8, 2023
Merged

Conversation

mpavlovic-txfusion
Copy link

@mpavlovic-txfusion mpavlovic-txfusion commented Apr 2, 2023

This PR is the addition to the original PR #276 that enabled support for zkSync deployments.

It fixes 2 issues:

  • Upgrades the version of the zksync-web3 package to the latest (0.14.3) version.
  • Extends the save deployments data with factoryDeps for zkSync networks - The reason to add this is that on zkSync, contract bytecodes are supplied in the factory_deps custom field of the EIP-712 transaction and in order to compare the previous deployment transaction with the new one, plugin needs to compare the base deploy transaction data (containing the bytecode hash in case of zkSync) as well as the factory deps. However, provider.getTransaction(txHash) method that is used to fetch previous deploy transaction data based on transactionHash (that is cached in the deployments folder) doesn't return custom data of the EIP-712 transaction. In order to obtain this data easily for the previous deployments on zkSync, this PR aims to extend the saved deployments data with the factoryDeps field.

@wighawag wighawag merged commit 83e16e1 into wighawag:master Apr 8, 2023
@wighawag
Copy link
Owner

wighawag commented Apr 8, 2023

looks good, thanks @mpavlovic-txfusion !

Going to do do a release soon and put that in

@wighawag
Copy link
Owner

wighawag commented Apr 8, 2023

Live on v.0.11.26

@ofumbi
Copy link

ofumbi commented Apr 12, 2023

Seems its not working on zk-sync era
I get this error

Error: ERROR processing /Users/steve/sites/multicall/deploy/multical3.js:
Error: The bytecode length in bytes must be divisible by 32
    at hashBytecode (/Users/steve/sites/multicall/node_modules/zksync-web3/build/src/utils.js:187:15)
    at ContractFactory.getDeployTransaction (/Users/steve/sites/multicall/node_modules/zksync-web3/build/src/contract.js:42:55)
    at _deploy (/Users/steve/sites/multicall/node_modules/hardhat-deploy/src/helpers.ts:584:32)
    at processTicksAndRejections (node:internal/process/task_queues:95:5)
    at _deployOne (/Users/steve/sites/multicall/node_modules/hardhat-deploy/src/helpers.ts:1004:16)
    at Object.module.exports [as func] (/Users/steve/sites/multicall/deploy/multical3.js:4:5)
    at DeploymentsManager.executeDeployScripts (/Users/steve/sites/multicall/node_modules/hardhat-deploy/src/DeploymentsManager.ts:1222:22)
    at DeploymentsManager.runDeploy (/Users/steve/sites/multicall/node_modules/hardhat-deploy/src/DeploymentsManager.ts:1055:5)
    at SimpleTaskDefinition.action (/Users/steve/sites/multicall/node_modules/hardhat-deploy/src/index.ts:438:5)
    at Environment._runTaskDefinition (/Users/steve/sites/multicall/node_modules/hardhat/src/internal/core/runtime-environment.ts:308:14)
    at DeploymentsManager.executeDeployScripts (/Users/steve/sites/multicall/node_modules/hardhat-deploy/src/DeploymentsManager.ts:1225:19)
    at processTicksAndRejections (node:internal/process/task_queues:95:5)
    at DeploymentsManager.runDeploy (/Users/steve/sites/multicall/node_modules/hardhat-deploy/src/DeploymentsManager.ts:1055:5)
    at SimpleTaskDefinition.action (/Users/steve/sites/multicall/node_modules/hardhat-deploy/src/index.ts:438:5)
    at Environment._runTaskDefinition (/Users/steve/sites/multicall/node_modules/hardhat/src/internal/core/runtime-environment.ts:308:14)
    at Environment.run (/Users/steve/sites/multicall/node_modules/hardhat/src/internal/core/runtime-environment.ts:156:14)
    at SimpleTaskDefinition.action (/Users/steve/sites/multicall/node_modules/hardhat-deploy/src/index.ts:584:32)
    at Environment._runTaskDefinition (/Users/steve/sites/multicall/node_modules/hardhat/src/internal/core/runtime-environment.ts:308:14)
    at Environment.run (/Users/steve/sites/multicall/node_modules/hardhat/src/internal/core/runtime-environment.ts:156:14)
    at SimpleTaskDefinition.action (/Users/steve/sites/multicall/node_modules/hardhat-deploy/src/index.ts:669:5)
steve@Stephens-MacBook-Pro multicall % 

@ofumbi
Copy link

ofumbi commented Apr 13, 2023

Seems its not working on zk-sync era I get this error

Error: ERROR processing /Users/steve/sites/multicall/deploy/multical3.js:
Error: The bytecode length in bytes must be divisible by 32
    at hashBytecode (/Users/steve/sites/multicall/node_modules/zksync-web3/build/src/utils.js:187:15)
    at ContractFactory.getDeployTransaction (/Users/steve/sites/multicall/node_modules/zksync-web3/build/src/contract.js:42:55)
    at _deploy (/Users/steve/sites/multicall/node_modules/hardhat-deploy/src/helpers.ts:584:32)
    at processTicksAndRejections (node:internal/process/task_queues:95:5)
    at _deployOne (/Users/steve/sites/multicall/node_modules/hardhat-deploy/src/helpers.ts:1004:16)
    at Object.module.exports [as func] (/Users/steve/sites/multicall/deploy/multical3.js:4:5)
    at DeploymentsManager.executeDeployScripts (/Users/steve/sites/multicall/node_modules/hardhat-deploy/src/DeploymentsManager.ts:1222:22)
    at DeploymentsManager.runDeploy (/Users/steve/sites/multicall/node_modules/hardhat-deploy/src/DeploymentsManager.ts:1055:5)
    at SimpleTaskDefinition.action (/Users/steve/sites/multicall/node_modules/hardhat-deploy/src/index.ts:438:5)
    at Environment._runTaskDefinition (/Users/steve/sites/multicall/node_modules/hardhat/src/internal/core/runtime-environment.ts:308:14)
    at DeploymentsManager.executeDeployScripts (/Users/steve/sites/multicall/node_modules/hardhat-deploy/src/DeploymentsManager.ts:1225:19)
    at processTicksAndRejections (node:internal/process/task_queues:95:5)
    at DeploymentsManager.runDeploy (/Users/steve/sites/multicall/node_modules/hardhat-deploy/src/DeploymentsManager.ts:1055:5)
    at SimpleTaskDefinition.action (/Users/steve/sites/multicall/node_modules/hardhat-deploy/src/index.ts:438:5)
    at Environment._runTaskDefinition (/Users/steve/sites/multicall/node_modules/hardhat/src/internal/core/runtime-environment.ts:308:14)
    at Environment.run (/Users/steve/sites/multicall/node_modules/hardhat/src/internal/core/runtime-environment.ts:156:14)
    at SimpleTaskDefinition.action (/Users/steve/sites/multicall/node_modules/hardhat-deploy/src/index.ts:584:32)
    at Environment._runTaskDefinition (/Users/steve/sites/multicall/node_modules/hardhat/src/internal/core/runtime-environment.ts:308:14)
    at Environment.run (/Users/steve/sites/multicall/node_modules/hardhat/src/internal/core/runtime-environment.ts:156:14)
    at SimpleTaskDefinition.action (/Users/steve/sites/multicall/node_modules/hardhat-deploy/src/index.ts:669:5)
steve@Stephens-MacBook-Pro multicall % 

OK I was able to get it to work by installing @matterlabs/hardhat-zksync-solc and importing it in hardhat.config.js

@davidaucoin7377
Copy link

#481

@berlinp-wombat
Copy link

zksync deployment do not working with upgradable contract
#453

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants