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 {