From e8bf8339fe781f99fa114966ca616cc8e604d31a Mon Sep 17 00:00:00 2001 From: Aleksandr Pasevin Date: Fri, 22 Nov 2024 13:21:47 +0100 Subject: [PATCH] feat(deploy): include immutableReferences in extracted artifact (#622) --- packages/deploy/src/models/deployment.ts | 5 +++++ packages/deploy/src/utils/deploy.test.ts | 2 ++ packages/deploy/src/utils/deploy.ts | 1 + 3 files changed, 8 insertions(+) diff --git a/packages/deploy/src/models/deployment.ts b/packages/deploy/src/models/deployment.ts index 3f991a1b..236c622a 100644 --- a/packages/deploy/src/models/deployment.ts +++ b/packages/deploy/src/models/deployment.ts @@ -107,6 +107,10 @@ export interface BlockExplorerVerification { export type RequestArtifact = Pick; +export type ImmutableReferences = { + [key: string]: Array<{ length: number; start: number }>; +}; + export type ContractArtifact = { abi: any; evm: { @@ -117,6 +121,7 @@ export type ContractArtifact = { deployedBytecode: { object: string; linkReferences: any; + immutableReferences: ImmutableReferences; }; }; metadata: string; diff --git a/packages/deploy/src/utils/deploy.test.ts b/packages/deploy/src/utils/deploy.test.ts index cfb3c5b6..acbb0bc1 100644 --- a/packages/deploy/src/utils/deploy.test.ts +++ b/packages/deploy/src/utils/deploy.test.ts @@ -34,6 +34,8 @@ describe('Deploy utilities', () => { object: artifact.output.contracts['contracts/Box.sol'].Box.evm.deployedBytecode.object, linkReferences: artifact.output.contracts['contracts/Box.sol'].Box.evm.deployedBytecode.linkReferences, + immutableReferences: + artifact.output.contracts['contracts/Box.sol'].Box.evm.deployedBytecode.immutableReferences, }, }, metadata: artifact.output.contracts['contracts/Box.sol'].Box.metadata, diff --git a/packages/deploy/src/utils/deploy.ts b/packages/deploy/src/utils/deploy.ts index 5a6d8556..a2cbc81d 100644 --- a/packages/deploy/src/utils/deploy.ts +++ b/packages/deploy/src/utils/deploy.ts @@ -37,6 +37,7 @@ export function extractArtifact({ deployedBytecode: { object: contract.evm.deployedBytecode.object, linkReferences: contract.evm.deployedBytecode.linkReferences, + immutableReferences: contract.evm.deployedBytecode.immutableReferences, }, }, metadata: contract.metadata,