Skip to content

Commit

Permalink
feat(deploy): include immutableReferences in extracted artifact (#622)
Browse files Browse the repository at this point in the history
  • Loading branch information
pasevin authored Nov 22, 2024
1 parent 98e4182 commit e8bf833
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 0 deletions.
5 changes: 5 additions & 0 deletions packages/deploy/src/models/deployment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,10 @@ export interface BlockExplorerVerification {

export type RequestArtifact = Pick<DeployContractRequest, 'artifactPayload' | 'contractName' | 'contractPath'>;

export type ImmutableReferences = {
[key: string]: Array<{ length: number; start: number }>;
};

export type ContractArtifact = {
abi: any;
evm: {
Expand All @@ -117,6 +121,7 @@ export type ContractArtifact = {
deployedBytecode: {
object: string;
linkReferences: any;
immutableReferences: ImmutableReferences;
};
};
metadata: string;
Expand Down
2 changes: 2 additions & 0 deletions packages/deploy/src/utils/deploy.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
1 change: 1 addition & 0 deletions packages/deploy/src/utils/deploy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit e8bf833

Please sign in to comment.