|
|
|
@ -108,10 +108,11 @@ export class FoundryClient extends PluginClient { |
|
|
|
|
|
|
|
|
|
async feedContractArtifactFile (path, content, compilationResultPart) { |
|
|
|
|
const contentJSON = JSON.parse(content) |
|
|
|
|
if (path.endsWith('.metadata.json')) { |
|
|
|
|
|
|
|
|
|
// extract source and version
|
|
|
|
|
compilationResultPart.solcVersion = contentJSON.compiler.version |
|
|
|
|
for (const path in contentJSON.sources) { |
|
|
|
|
const metadata = contentJSON.metadata |
|
|
|
|
compilationResultPart.solcVersion = metadata.compiler.version |
|
|
|
|
for (const path in metadata.sources) { |
|
|
|
|
const absPath = utils.absolutePath(path, this.currentSharedFolder) |
|
|
|
|
try { |
|
|
|
|
const content = await fs.readFile(absPath, { encoding: 'utf-8' }) |
|
|
|
@ -120,7 +121,9 @@ export class FoundryClient extends PluginClient { |
|
|
|
|
compilationResultPart.input[path] = { content: '' } |
|
|
|
|
} |
|
|
|
|
}
|
|
|
|
|
} else { |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
const contractName = basename(path).replace('.json', '') |
|
|
|
|
compilationResultPart.compilationTarget = contentJSON.ast.absolutePath |
|
|
|
|
// extract data
|
|
|
|
@ -142,7 +145,6 @@ export class FoundryClient extends PluginClient { |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
async sync () { |
|
|
|
|
console.log('syncing from Foundry') |
|
|
|
|