wighawag / hardhat-deploy

hardhat deployment plugin
MIT License
1.19k stars 292 forks source link

Fix zksync deployment #437

Closed mpavlovic-txfusion closed 1 year ago

mpavlovic-txfusion commented 1 year ago

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

It fixes 2 issues:

wighawag commented 1 year ago

looks good, thanks @mpavlovic-txfusion !

Going to do do a release soon and put that in

wighawag commented 1 year ago

Live on v.0.11.26

ofumbi commented 1 year ago

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 commented 1 year ago

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 commented 1 year ago

481

berlinp-wombat commented 1 year ago

zksync deployment do not working with upgradable contract https://github.com/wighawag/hardhat-deploy/issues/453