hardhat-external-artifacts 0.0.4 → 0.0.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/artifacts/converter.d.ts +5 -3
- package/dist/artifacts/converter.d.ts.map +1 -1
- package/dist/artifacts/converter.js +241 -157
- package/dist/artifacts/converter.js.map +1 -1
- package/dist/artifacts/converter.test.d.ts +2 -0
- package/dist/artifacts/converter.test.d.ts.map +1 -0
- package/dist/artifacts/converter.test.js +226 -0
- package/dist/artifacts/converter.test.js.map +1 -0
- package/dist/artifacts/loader.d.ts.map +1 -1
- package/dist/artifacts/loader.js +2 -0
- package/dist/artifacts/loader.js.map +1 -1
- package/dist/artifacts/types.d.ts +20 -2
- package/dist/artifacts/types.d.ts.map +1 -1
- package/dist/artifacts/types.js +19 -3
- package/dist/artifacts/types.js.map +1 -1
- package/dist/hooks/network.d.ts.map +1 -1
- package/dist/hooks/network.js +20 -5
- package/dist/hooks/network.js.map +1 -1
- package/package.json +6 -3
- package/src/artifacts/converter.test.ts +294 -0
- package/src/artifacts/converter.ts +280 -176
- package/src/artifacts/loader.ts +2 -0
- package/src/artifacts/types.ts +26 -4
- package/src/hooks/network.ts +19 -4
|
@@ -20,6 +20,8 @@ interface CompilerInput {
|
|
|
20
20
|
useLiteralContent?: boolean;
|
|
21
21
|
bytecodeHash?: string;
|
|
22
22
|
};
|
|
23
|
+
evmVersion?: string;
|
|
24
|
+
viaIR?: boolean;
|
|
23
25
|
};
|
|
24
26
|
}
|
|
25
27
|
interface CompilerOutput {
|
|
@@ -54,9 +56,9 @@ interface BytecodeOutput {
|
|
|
54
56
|
}
|
|
55
57
|
/**
|
|
56
58
|
* Convert artifacts to compilation format.
|
|
57
|
-
*
|
|
58
|
-
*
|
|
59
|
+
* Flexibly extracts data from each artifact - uses solcInput if available,
|
|
60
|
+
* falls back to metadata for settings, or synthesizes minimal compilation.
|
|
59
61
|
*/
|
|
60
|
-
export declare function artifactsToCompilations(artifacts: ExternalArtifact[], defaultSolcVersion: string): SyntheticCompilation[];
|
|
62
|
+
export declare function artifactsToCompilations(artifacts: ExternalArtifact[], defaultSolcVersion: string, debug?: boolean): SyntheticCompilation[];
|
|
61
63
|
export {};
|
|
62
64
|
//# sourceMappingURL=converter.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"converter.d.ts","sourceRoot":"","sources":["../../src/artifacts/converter.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,gBAAgB,EAAgB,cAAc,EAAC,MAAM,YAAY,CAAC;AAG/E,MAAM,WAAW,oBAAoB;IACpC,WAAW,EAAE,MAAM,CAAC;IACpB,aAAa,EAAE,aAAa,CAAC;IAC7B,cAAc,EAAE,cAAc,CAAC;CAC/B;AAED,UAAU,aAAa;IACtB,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE;QAAC,OAAO,EAAE,MAAM,CAAA;KAAC,CAAC,CAAC;IAC3C,QAAQ,EAAE;QACT,SAAS,EAAE;YAAC,OAAO,EAAE,OAAO,CAAC;YAAC,IAAI,CAAC,EAAE,MAAM,CAAA;SAAC,CAAC;QAC7C,eAAe,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,CAAC,CAAC;QAC1D,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;QACtB,QAAQ,CAAC,EAAE;YAAC,iBAAiB,CAAC,EAAE,OAAO,CAAC;YAAC,YAAY,CAAC,EAAE,MAAM,CAAA;SAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"converter.d.ts","sourceRoot":"","sources":["../../src/artifacts/converter.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,gBAAgB,EAAgB,cAAc,EAAC,MAAM,YAAY,CAAC;AAG/E,MAAM,WAAW,oBAAoB;IACpC,WAAW,EAAE,MAAM,CAAC;IACpB,aAAa,EAAE,aAAa,CAAC;I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E,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;IAClB,cAAc,EAAE,cAAc,CAAC;IAC/B,mBAAmB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC;QAAC,KAAK,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAC,CAAC,CAAC,CAAC;IAC7E,gBAAgB,CAAC,EAAE,GAAG,EAAE,CAAC;IACzB,iBAAiB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;CACxC;AA0LD;;;;GAIG;AACH,wBAAgB,uBAAuB,CACtC,SAAS,EAAE,gBAAgB,EAAE,EAC7B,kBAAkB,EAAE,MAAM,EAC1B,KAAK,GAAE,OAAe,GACpB,oBAAoB,EAAE,CA6CxB"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { hasSolcInput, hasMetadata, hasEvmData } from './types.js';
|
|
2
2
|
/**
|
|
3
3
|
* Creates a minimal valid AST for a source file.
|
|
4
4
|
* This is needed because Hardhat's contract decoder expects a valid AST structure.
|
|
@@ -34,139 +34,192 @@ function createMinimalAst(sourceName, sourceId, contracts) {
|
|
|
34
34
|
};
|
|
35
35
|
}
|
|
36
36
|
/**
|
|
37
|
-
*
|
|
38
|
-
*
|
|
39
|
-
* Otherwise, synthesize a minimal compilation.
|
|
37
|
+
* Extract compilation context from an artifact.
|
|
38
|
+
* Tries solcInput first, then falls back to metadata, then defaults.
|
|
40
39
|
*/
|
|
41
|
-
|
|
42
|
-
//
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
40
|
+
function extractCompilationContext(artifact, defaultSolcVersion, debug = false) {
|
|
41
|
+
// Try to extract from solcInput first (most complete)
|
|
42
|
+
if (hasSolcInput(artifact)) {
|
|
43
|
+
try {
|
|
44
|
+
const compilerInput = JSON.parse(artifact.solcInput);
|
|
45
|
+
const solcVersion = extractVersionFromMetadata(artifact.metadata) ?? defaultSolcVersion;
|
|
46
|
+
// Use a hash of settings to group artifacts with same compilation context
|
|
47
|
+
const settingsKey = JSON.stringify(compilerInput.settings);
|
|
48
|
+
return {
|
|
49
|
+
solcVersion,
|
|
50
|
+
compilerInput,
|
|
51
|
+
groupKey: `solcInput:${solcVersion}:${hashString(settingsKey)}`,
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
catch (e) {
|
|
55
|
+
if (debug) {
|
|
56
|
+
console.log(`[external-artifacts] Failed to parse solcInput for ${artifact.contractName}: ${e}`);
|
|
57
|
+
}
|
|
58
|
+
// Fall through to metadata extraction
|
|
51
59
|
}
|
|
52
60
|
}
|
|
53
|
-
//
|
|
54
|
-
if (
|
|
55
|
-
compilations.push(synthesizeCompilation(simpleArtifacts, defaultSolcVersion));
|
|
56
|
-
}
|
|
57
|
-
return compilations;
|
|
58
|
-
}
|
|
59
|
-
/**
|
|
60
|
-
* Convert a rich artifact (with embedded solcInput) to a compilation.
|
|
61
|
-
* Uses the embedded solcInput directly for maximum fidelity.
|
|
62
|
-
*/
|
|
63
|
-
function richArtifactToCompilation(artifact) {
|
|
64
|
-
if (!artifact.solcInput) {
|
|
65
|
-
return null;
|
|
66
|
-
}
|
|
67
|
-
// Parse the embedded solcInput
|
|
68
|
-
const compilerInput = JSON.parse(artifact.solcInput);
|
|
69
|
-
// Extract solc version from metadata
|
|
70
|
-
let solcVersion = '0.8.20'; // Default
|
|
71
|
-
if (artifact.metadata) {
|
|
61
|
+
// Try to extract from metadata (partial but useful)
|
|
62
|
+
if (hasMetadata(artifact)) {
|
|
72
63
|
try {
|
|
73
64
|
const metadata = JSON.parse(artifact.metadata);
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
65
|
+
const solcVersion = extractVersionFromMetadataObject(metadata) ?? defaultSolcVersion;
|
|
66
|
+
const compilerInput = metadataToCompilerInput(metadata);
|
|
67
|
+
if (compilerInput) {
|
|
68
|
+
const settingsKey = JSON.stringify(compilerInput.settings);
|
|
69
|
+
return {
|
|
70
|
+
solcVersion,
|
|
71
|
+
compilerInput,
|
|
72
|
+
groupKey: `metadata:${solcVersion}:${hashString(settingsKey)}`,
|
|
73
|
+
};
|
|
77
74
|
}
|
|
78
75
|
}
|
|
79
|
-
catch {
|
|
80
|
-
|
|
76
|
+
catch (e) {
|
|
77
|
+
if (debug) {
|
|
78
|
+
console.log(`[external-artifacts] Failed to parse metadata for ${artifact.contractName}: ${e}`);
|
|
79
|
+
}
|
|
80
|
+
// Fall through to defaults
|
|
81
81
|
}
|
|
82
82
|
}
|
|
83
|
-
//
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
contracts: {},
|
|
83
|
+
// Default: no compiler input available, use defaults
|
|
84
|
+
return {
|
|
85
|
+
solcVersion: defaultSolcVersion,
|
|
86
|
+
compilerInput: null,
|
|
87
|
+
groupKey: `default:${defaultSolcVersion}`,
|
|
89
88
|
};
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
89
|
+
}
|
|
90
|
+
/**
|
|
91
|
+
* Extract solc version from metadata string.
|
|
92
|
+
*/
|
|
93
|
+
function extractVersionFromMetadata(metadataStr) {
|
|
94
|
+
if (!metadataStr)
|
|
95
|
+
return null;
|
|
96
|
+
try {
|
|
97
|
+
const metadata = JSON.parse(metadataStr);
|
|
98
|
+
return extractVersionFromMetadataObject(metadata);
|
|
96
99
|
}
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
100
|
+
catch {
|
|
101
|
+
return null;
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
/**
|
|
105
|
+
* Extract solc version from parsed metadata object.
|
|
106
|
+
*/
|
|
107
|
+
function extractVersionFromMetadataObject(metadata) {
|
|
108
|
+
if (metadata?.compiler?.version) {
|
|
109
|
+
// Format: "0.8.10+commit.fc410830" -> extract "0.8.10"
|
|
110
|
+
return metadata.compiler.version.split('+')[0];
|
|
111
|
+
}
|
|
112
|
+
return null;
|
|
113
|
+
}
|
|
114
|
+
/**
|
|
115
|
+
* Convert metadata to compiler input.
|
|
116
|
+
* Metadata contains settings but not full source content.
|
|
117
|
+
*/
|
|
118
|
+
function metadataToCompilerInput(metadata) {
|
|
119
|
+
if (!metadata?.settings)
|
|
120
|
+
return null;
|
|
121
|
+
const settings = metadata.settings;
|
|
122
|
+
const sources = {};
|
|
123
|
+
// Metadata has source hashes but not content
|
|
124
|
+
// We'll add empty placeholders that get filled in later
|
|
125
|
+
if (metadata.sources) {
|
|
126
|
+
for (const sourceName of Object.keys(metadata.sources)) {
|
|
127
|
+
// Some metadata includes content in keccak256 only
|
|
128
|
+
// We use empty content as placeholder
|
|
129
|
+
sources[sourceName] = { content: '' };
|
|
130
|
+
}
|
|
110
131
|
}
|
|
111
|
-
// Build bytecode output, ensuring proper format
|
|
112
|
-
// Standard solc output has bytecode.object without 0x prefix
|
|
113
|
-
const bytecode = {
|
|
114
|
-
object: stripHexPrefix(artifact.evm?.bytecode?.object ?? artifact.bytecode ?? '0x'),
|
|
115
|
-
opcodes: artifact.evm?.bytecode?.opcodes ?? '',
|
|
116
|
-
sourceMap: artifact.evm?.bytecode?.sourceMap ?? '',
|
|
117
|
-
linkReferences: artifact.evm?.bytecode?.linkReferences ?? artifact.linkReferences ?? {},
|
|
118
|
-
generatedSources: artifact.evm?.bytecode?.generatedSources,
|
|
119
|
-
functionDebugData: artifact.evm?.bytecode?.functionDebugData,
|
|
120
|
-
};
|
|
121
|
-
const deployedBytecode = {
|
|
122
|
-
object: stripHexPrefix(artifact.evm?.deployedBytecode?.object ??
|
|
123
|
-
artifact.deployedBytecode ??
|
|
124
|
-
'0x'),
|
|
125
|
-
opcodes: artifact.evm?.deployedBytecode?.opcodes ?? '',
|
|
126
|
-
sourceMap: artifact.evm?.deployedBytecode?.sourceMap ?? '',
|
|
127
|
-
linkReferences: artifact.evm?.deployedBytecode?.linkReferences ??
|
|
128
|
-
artifact.deployedLinkReferences ??
|
|
129
|
-
{},
|
|
130
|
-
immutableReferences: artifact.evm?.deployedBytecode?.immutableReferences ??
|
|
131
|
-
artifact.immutableReferences ??
|
|
132
|
-
{},
|
|
133
|
-
generatedSources: artifact.evm?.deployedBytecode?.generatedSources,
|
|
134
|
-
functionDebugData: artifact.evm?.deployedBytecode?.functionDebugData,
|
|
135
|
-
};
|
|
136
|
-
// IMPORTANT: Do NOT provide method identifiers - let EDR compute them
|
|
137
|
-
// EDR has internal "selector fixup" logic for function overloading that can fail
|
|
138
|
-
// if we provide method identifiers that it then tries to reconcile with AST info.
|
|
139
|
-
// The error "Failed to fix up the selector for ... #supportsInterface" happens
|
|
140
|
-
// when EDR can't match provided selectors with overloaded functions.
|
|
141
|
-
// By providing an empty object, EDR will compute selectors from the ABI directly.
|
|
142
|
-
const methodIdentifiers = {};
|
|
143
|
-
compilerOutput.contracts[sourceName][artifact.contractName] = {
|
|
144
|
-
abi: artifact.abi,
|
|
145
|
-
evm: {
|
|
146
|
-
bytecode,
|
|
147
|
-
deployedBytecode,
|
|
148
|
-
methodIdentifiers,
|
|
149
|
-
},
|
|
150
|
-
metadata: artifact.metadata,
|
|
151
|
-
devdoc: artifact.devdoc,
|
|
152
|
-
userdoc: artifact.userdoc,
|
|
153
|
-
storageLayout: artifact.storageLayout,
|
|
154
|
-
};
|
|
155
132
|
return {
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
133
|
+
language: metadata.language ?? 'Solidity',
|
|
134
|
+
sources,
|
|
135
|
+
settings: {
|
|
136
|
+
optimizer: settings.optimizer ?? { enabled: false },
|
|
137
|
+
outputSelection: settings.outputSelection ?? {
|
|
138
|
+
'*': { '*': ['abi', 'evm.bytecode', 'evm.deployedBytecode'] },
|
|
139
|
+
},
|
|
140
|
+
remappings: settings.remappings,
|
|
141
|
+
metadata: settings.metadata,
|
|
142
|
+
evmVersion: settings.evmVersion,
|
|
143
|
+
viaIR: settings.viaIR,
|
|
144
|
+
},
|
|
159
145
|
};
|
|
160
146
|
}
|
|
161
147
|
/**
|
|
162
|
-
*
|
|
163
|
-
* Used when artifacts don't have embedded solcInput.
|
|
148
|
+
* Simple string hash for grouping.
|
|
164
149
|
*/
|
|
165
|
-
function
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
150
|
+
function hashString(str) {
|
|
151
|
+
let hash = 0;
|
|
152
|
+
for (let i = 0; i < str.length; i++) {
|
|
153
|
+
const char = str.charCodeAt(i);
|
|
154
|
+
hash = ((hash << 5) - hash) + char;
|
|
155
|
+
hash = hash & hash; // Convert to 32-bit integer
|
|
156
|
+
}
|
|
157
|
+
return hash.toString(16);
|
|
158
|
+
}
|
|
159
|
+
/**
|
|
160
|
+
* Convert artifacts to compilation format.
|
|
161
|
+
* Flexibly extracts data from each artifact - uses solcInput if available,
|
|
162
|
+
* falls back to metadata for settings, or synthesizes minimal compilation.
|
|
163
|
+
*/
|
|
164
|
+
export function artifactsToCompilations(artifacts, defaultSolcVersion, debug = false) {
|
|
165
|
+
if (debug) {
|
|
166
|
+
console.log(`[external-artifacts] Processing ${artifacts.length} artifacts`);
|
|
167
|
+
}
|
|
168
|
+
// Extract context from each artifact and group by compilation context
|
|
169
|
+
const artifactsByContext = new Map();
|
|
170
|
+
for (const artifact of artifacts) {
|
|
171
|
+
const context = extractCompilationContext(artifact, defaultSolcVersion, debug);
|
|
172
|
+
const richArt = artifact;
|
|
173
|
+
const immRefs = richArt.evm?.deployedBytecode?.immutableReferences ?? artifact.immutableReferences;
|
|
174
|
+
const immCount = immRefs ? Object.keys(immRefs).length : 0;
|
|
175
|
+
if (debug) {
|
|
176
|
+
console.log(` - ${artifact.contractName}: solcInput=${hasSolcInput(artifact)}, metadata=${hasMetadata(artifact)}, immutableReferences=${immCount} keys, group=${context.groupKey}`);
|
|
177
|
+
}
|
|
178
|
+
const existing = artifactsByContext.get(context.groupKey);
|
|
179
|
+
if (existing) {
|
|
180
|
+
existing.artifacts.push(artifact);
|
|
181
|
+
}
|
|
182
|
+
else {
|
|
183
|
+
artifactsByContext.set(context.groupKey, {
|
|
184
|
+
context,
|
|
185
|
+
artifacts: [artifact],
|
|
186
|
+
});
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
if (debug) {
|
|
190
|
+
console.log(`[external-artifacts] Grouped into ${artifactsByContext.size} compilations`);
|
|
191
|
+
}
|
|
192
|
+
// Convert each group to a compilation
|
|
193
|
+
const compilations = [];
|
|
194
|
+
for (const { context, artifacts: groupArtifacts } of artifactsByContext.values()) {
|
|
195
|
+
const compilation = buildCompilation(groupArtifacts, context, debug);
|
|
196
|
+
compilations.push(compilation);
|
|
197
|
+
}
|
|
198
|
+
return compilations;
|
|
199
|
+
}
|
|
200
|
+
/**
|
|
201
|
+
* Build a compilation from a group of artifacts sharing the same context.
|
|
202
|
+
* Flexibly extracts available data from each artifact.
|
|
203
|
+
*/
|
|
204
|
+
function buildCompilation(artifacts, context, debug = false) {
|
|
205
|
+
// Start with context's compiler input or create a minimal one
|
|
206
|
+
const compilerInput = context.compilerInput
|
|
207
|
+
? { ...context.compilerInput, sources: { ...context.compilerInput.sources } }
|
|
208
|
+
: {
|
|
209
|
+
language: 'Solidity',
|
|
210
|
+
sources: {},
|
|
211
|
+
settings: {
|
|
212
|
+
optimizer: { enabled: false },
|
|
213
|
+
outputSelection: {
|
|
214
|
+
'*': { '*': ['abi', 'evm.bytecode', 'evm.deployedBytecode'] },
|
|
215
|
+
},
|
|
216
|
+
},
|
|
217
|
+
};
|
|
218
|
+
const compilerOutput = {
|
|
219
|
+
sources: {},
|
|
220
|
+
contracts: {},
|
|
221
|
+
};
|
|
222
|
+
// Group artifacts by source for AST generation
|
|
170
223
|
const contractsBySource = {};
|
|
171
224
|
for (const artifact of artifacts) {
|
|
172
225
|
if (!contractsBySource[artifact.sourceName]) {
|
|
@@ -177,64 +230,95 @@ function synthesizeCompilation(artifacts, solcVersion) {
|
|
|
177
230
|
artifact,
|
|
178
231
|
});
|
|
179
232
|
}
|
|
180
|
-
// Track IDs
|
|
181
|
-
let
|
|
182
|
-
|
|
233
|
+
// Track source IDs - use existing ones from compiler input if available
|
|
234
|
+
let nextSourceId = 0;
|
|
235
|
+
const sourceIds = {};
|
|
236
|
+
for (const srcName of Object.keys(compilerInput.sources)) {
|
|
237
|
+
sourceIds[srcName] = nextSourceId++;
|
|
238
|
+
}
|
|
239
|
+
// Track node IDs for AST
|
|
240
|
+
let nextNodeId = nextSourceId + 1000; // Offset to avoid conflicts
|
|
241
|
+
// Process each source
|
|
183
242
|
for (const [sourceName, sourceContracts] of Object.entries(contractsBySource)) {
|
|
184
|
-
|
|
185
|
-
sources[sourceName]
|
|
186
|
-
|
|
243
|
+
// Ensure source exists in compiler input
|
|
244
|
+
if (!compilerInput.sources[sourceName]) {
|
|
245
|
+
compilerInput.sources[sourceName] = { content: '' };
|
|
246
|
+
}
|
|
247
|
+
// Get or assign source ID
|
|
248
|
+
const sourceId = sourceIds[sourceName] ?? nextSourceId++;
|
|
249
|
+
sourceIds[sourceName] = sourceId;
|
|
187
250
|
// Create contract nodes for AST
|
|
188
251
|
const contractNodes = [];
|
|
189
252
|
for (const { name } of sourceContracts) {
|
|
190
|
-
|
|
191
|
-
contractNodes.push({ name, nodeId });
|
|
253
|
+
contractNodes.push({ name, nodeId: nextNodeId++ });
|
|
192
254
|
}
|
|
193
|
-
|
|
255
|
+
compilerOutput.sources[sourceName] = {
|
|
194
256
|
id: sourceId,
|
|
195
257
|
ast: createMinimalAst(sourceName, sourceId, contractNodes),
|
|
196
258
|
};
|
|
259
|
+
compilerOutput.contracts[sourceName] = {};
|
|
197
260
|
// Add contract outputs
|
|
198
261
|
for (const { name, artifact } of sourceContracts) {
|
|
199
|
-
|
|
262
|
+
const richArtifact = artifact;
|
|
263
|
+
// Build bytecode output, extracting from evm if available
|
|
264
|
+
const bytecode = {
|
|
265
|
+
object: stripHexPrefix(richArtifact.evm?.bytecode?.object ?? artifact.bytecode ?? '0x'),
|
|
266
|
+
opcodes: richArtifact.evm?.bytecode?.opcodes ?? '',
|
|
267
|
+
sourceMap: richArtifact.evm?.bytecode?.sourceMap ?? '',
|
|
268
|
+
linkReferences: richArtifact.evm?.bytecode?.linkReferences ?? artifact.linkReferences ?? {},
|
|
269
|
+
generatedSources: richArtifact.evm?.bytecode?.generatedSources,
|
|
270
|
+
functionDebugData: richArtifact.evm?.bytecode?.functionDebugData,
|
|
271
|
+
};
|
|
272
|
+
const immutableReferences = richArtifact.evm?.deployedBytecode?.immutableReferences ??
|
|
273
|
+
artifact.immutableReferences ??
|
|
274
|
+
{};
|
|
275
|
+
const deployedBytecode = {
|
|
276
|
+
object: stripHexPrefix(richArtifact.evm?.deployedBytecode?.object ??
|
|
277
|
+
artifact.deployedBytecode ??
|
|
278
|
+
'0x'),
|
|
279
|
+
opcodes: richArtifact.evm?.deployedBytecode?.opcodes ?? '',
|
|
280
|
+
sourceMap: richArtifact.evm?.deployedBytecode?.sourceMap ?? '',
|
|
281
|
+
linkReferences: richArtifact.evm?.deployedBytecode?.linkReferences ??
|
|
282
|
+
artifact.deployedLinkReferences ??
|
|
283
|
+
{},
|
|
284
|
+
immutableReferences,
|
|
285
|
+
generatedSources: richArtifact.evm?.deployedBytecode?.generatedSources,
|
|
286
|
+
functionDebugData: richArtifact.evm?.deployedBytecode?.functionDebugData,
|
|
287
|
+
};
|
|
288
|
+
// IMPORTANT: Do NOT provide method identifiers - let EDR compute them
|
|
289
|
+
// EDR has internal "selector fixup" logic for function overloading that can fail
|
|
290
|
+
// if we provide method identifiers that it then tries to reconcile with AST info.
|
|
291
|
+
compilerOutput.contracts[sourceName][name] = {
|
|
200
292
|
abi: artifact.abi,
|
|
201
293
|
evm: {
|
|
202
|
-
bytecode
|
|
203
|
-
|
|
204
|
-
opcodes: '',
|
|
205
|
-
sourceMap: '',
|
|
206
|
-
linkReferences: artifact.linkReferences ?? {},
|
|
207
|
-
},
|
|
208
|
-
deployedBytecode: {
|
|
209
|
-
object: stripHexPrefix(artifact.deployedBytecode),
|
|
210
|
-
opcodes: '',
|
|
211
|
-
sourceMap: '',
|
|
212
|
-
linkReferences: artifact.deployedLinkReferences ?? {},
|
|
213
|
-
immutableReferences: artifact.immutableReferences ?? {},
|
|
214
|
-
},
|
|
215
|
-
// Empty object - let EDR compute selectors to avoid selector fixup issues
|
|
216
|
-
// with overloaded functions (consistent with richArtifactToCompilation)
|
|
294
|
+
bytecode,
|
|
295
|
+
deployedBytecode,
|
|
217
296
|
methodIdentifiers: {},
|
|
218
297
|
},
|
|
298
|
+
metadata: richArtifact.metadata,
|
|
299
|
+
devdoc: richArtifact.devdoc,
|
|
300
|
+
userdoc: richArtifact.userdoc,
|
|
301
|
+
storageLayout: richArtifact.storageLayout,
|
|
219
302
|
};
|
|
303
|
+
if (debug) {
|
|
304
|
+
const immRefKeys = Object.keys(immutableReferences);
|
|
305
|
+
console.log(`[external-artifacts] Built artifact: ${name}`);
|
|
306
|
+
console.log(` - sourceName: ${sourceName}`);
|
|
307
|
+
console.log(` - hasSolcInput: ${hasSolcInput(artifact)}`);
|
|
308
|
+
console.log(` - hasMetadata: ${hasMetadata(artifact)}`);
|
|
309
|
+
console.log(` - hasEvmData: ${hasEvmData(artifact)}`);
|
|
310
|
+
console.log(` - immutableReferences keys: ${immRefKeys.length}`);
|
|
311
|
+
if (immRefKeys.length > 0) {
|
|
312
|
+
console.log(` - immutableReferences sample:`, JSON.stringify(immutableReferences, null, 2).slice(0, 500));
|
|
313
|
+
}
|
|
314
|
+
console.log(` - deployedBytecode length: ${deployedBytecode.object.length / 2} bytes`);
|
|
315
|
+
}
|
|
220
316
|
}
|
|
221
317
|
}
|
|
222
318
|
return {
|
|
223
|
-
solcVersion,
|
|
224
|
-
compilerInput
|
|
225
|
-
|
|
226
|
-
sources,
|
|
227
|
-
settings: {
|
|
228
|
-
optimizer: { enabled: false },
|
|
229
|
-
outputSelection: {
|
|
230
|
-
'*': { '*': ['abi', 'evm.bytecode', 'evm.deployedBytecode'] },
|
|
231
|
-
},
|
|
232
|
-
},
|
|
233
|
-
},
|
|
234
|
-
compilerOutput: {
|
|
235
|
-
sources: outputSources,
|
|
236
|
-
contracts,
|
|
237
|
-
},
|
|
319
|
+
solcVersion: context.solcVersion,
|
|
320
|
+
compilerInput,
|
|
321
|
+
compilerOutput,
|
|
238
322
|
};
|
|
239
323
|
}
|
|
240
324
|
function stripHexPrefix(hex) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"converter.js","sourceRoot":"","sources":["../../src/artifacts/converter.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,
|
|
1
|
+
{"version":3,"file":"converter.js","sourceRoot":"","sources":["../../src/artifacts/converter.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,YAAY,EAAE,WAAW,EAAE,UAAU,EAAC,MAAM,YAAY,CAAC;AAgEjE;;;GAGG;AACH,SAAS,gBAAgB,CACxB,UAAkB,EAClB,QAAgB,EAChB,SAAiD;IAEjD,MAAM,KAAK,GAAa,EAAE,CAAC;IAC3B,MAAM,eAAe,GAA6B,EAAE,CAAC;IAErD,4CAA4C;IAC5C,IAAI,SAAS,EAAE,CAAC;QACf,KAAK,MAAM,QAAQ,IAAI,SAAS,EAAE,CAAC;YAClC,KAAK,CAAC,IAAI,CAAC;gBACV,QAAQ,EAAE,oBAAoB;gBAC9B,EAAE,EAAE,QAAQ,CAAC,MAAM;gBACnB,GAAG,EAAE,OAAO,QAAQ,EAAE;gBACtB,IAAI,EAAE,QAAQ,CAAC,IAAI;gBACnB,YAAY,EAAE,UAAU;gBACxB,QAAQ,EAAE,KAAK;gBACf,gBAAgB,EAAE,IAAI;gBACtB,uBAAuB,EAAE,CAAC,QAAQ,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