From e7548862413626db98fd8ae35307126d0e341f38 Mon Sep 17 00:00:00 2001 From: mpavlovic-txfusion Date: Sun, 2 Apr 2023 12:19:05 +0200 Subject: [PATCH 1/2] Bump zksync-web3 version --- package.json | 4 ++-- yarn.lock | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/package.json b/package.json index 9ec51fa1..fb656cfb 100644 --- a/package.json +++ b/package.json @@ -70,7 +70,7 @@ "match-all": "^1.2.6", "murmur-128": "^0.2.1", "qs": "^6.9.4", - "zksync-web3": "^0.8.1" + "zksync-web3": "^0.14.3" }, "scripts": { "prepare": "node ./.setup.js", @@ -85,4 +85,4 @@ "publish:release": "npm publish", "prepublishOnly": "npm run build" } -} \ No newline at end of file +} diff --git a/yarn.lock b/yarn.lock index 82637eff..63d282f8 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5124,7 +5124,7 @@ yocto-queue@^0.1.0: resolved "https://registry.yarnpkg.com/yocto-queue/-/yocto-queue-0.1.0.tgz#0294eb3dee05028d31ee1a5fa2c556a6aaf10a1b" integrity sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q== -zksync-web3@^0.8.1: - version "0.8.1" - resolved "https://registry.yarnpkg.com/zksync-web3/-/zksync-web3-0.8.1.tgz#db289d8f6caf61f4d5ddc471fa3448d93208dc14" - integrity sha512-1A4aHPQ3MyuGjpv5X/8pVEN+MdZqMjfVmiweQSRjOlklXYu65wT9BGEOtCmMs5d3gIvLp4ssfTeuR5OCKOD2kw== +zksync-web3@^0.14.3: + version "0.14.3" + resolved "https://registry.yarnpkg.com/zksync-web3/-/zksync-web3-0.14.3.tgz#64ac2a16d597464c3fc4ae07447a8007631c57c9" + integrity sha512-hT72th4AnqyLW1d5Jlv8N2B/qhEnl2NePK2A3org7tAa24niem/UAaHMkEvmWI3SF9waYUPtqAtjpf+yvQ9zvQ== From 4a8fa9e4ed18652721d52550466c73b746c00659 Mon Sep 17 00:00:00 2001 From: mpavlovic-txfusion Date: Sun, 2 Apr 2023 14:17:45 +0200 Subject: [PATCH 2/2] Fix zksync factory dependencies comparison --- src/DeploymentsManager.ts | 3 +++ src/helpers.ts | 11 +++++------ types.ts | 2 ++ 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/src/DeploymentsManager.ts b/src/DeploymentsManager.ts index 0c3a54fb..07e60bbb 100644 --- a/src/DeploymentsManager.ts +++ b/src/DeploymentsManager.ts @@ -883,6 +883,9 @@ export class DeploymentsManager { gasEstimates: deployment.gasEstimates, // TODO double check : use evm field ? }) ); + if (deployment.factoryDeps?.length) { + obj.factoryDeps = deployment.factoryDeps; + } this.db.deployments[name] = obj; if (obj.address === undefined && obj.transactionHash !== undefined) { let receiptFetched; diff --git a/src/helpers.ts b/src/helpers.ts index d95e0e4a..114150b4 100644 --- a/src/helpers.ts +++ b/src/helpers.ts @@ -548,13 +548,14 @@ export function addHelpers( }; let factory; + let factoryDeps: string[] = []; if (network.zksync) { factory = new zk.ContractFactory( linkedArtifact.abi, linkedArtifact.bytecode, ethersSigner as zk.Signer ); - const factoryDeps = await extractFactoryDeps(linkedArtifact); + factoryDeps = await extractFactoryDeps(linkedArtifact); const customData = { customData: { factoryDeps, @@ -676,6 +677,7 @@ export function addHelpers( receipt, transactionHash: receipt.transactionHash, libraries: options.libraries, + factoryDeps, }; await saveDeployment(name, deployment); if (options.log || hardwareWallet) { @@ -956,13 +958,10 @@ export function addHelpers( }); const newData = newTransaction.data?.toString(); - const deserialize = zk.utils.parseTransaction( - transaction.data - ) as any; - const desFlattened = hexConcat(deserialize.customData.factoryDeps); + const oldFlattened = hexConcat(deployment.factoryDeps || []); const newFlattened = hexConcat(factoryDeps); - if (deserialize.data !== newData || desFlattened != newFlattened) { + if (transaction.data !== newData || oldFlattened != newFlattened) { return {differences: true, address: deployment.address}; } return {differences: false, address: deployment.address}; diff --git a/types.ts b/types.ts index f9b167b3..aae0311b 100644 --- a/types.ts +++ b/types.ts @@ -349,6 +349,7 @@ export interface DeploymentSubmission { storageLayout?: any; libraries?: Libraries; gasEstimates?: any; + factoryDeps?: string[]; } // export type LibraryReferences = { @@ -376,6 +377,7 @@ export interface Deployment { facets?: Facet[]; storageLayout?: any; gasEstimates?: any; + factoryDeps?: string[]; } export interface DeterministicDeploymentInfo {