diff --git a/packages/workflow-compile/index.js b/packages/workflow-compile/index.js index b737f28d3c7..d41adbf2483 100644 --- a/packages/workflow-compile/index.js +++ b/packages/workflow-compile/index.js @@ -106,9 +106,6 @@ const WorkflowCompile = { await fse.ensureDir(config.contracts_build_directory); - const artifacts = contracts.map(Shims.NewToLegacy.forContract); - await config.artifactor.saveAll(artifacts); - if (options.db && options.db.enabled === true && contracts.length > 0) { const db = connect(config); const project = await Project.initialize({ @@ -117,10 +114,13 @@ const WorkflowCompile = { directory: config.working_directory } }); - await project.loadCompile({ + ({contracts} = await project.loadCompile({ result: {contracts, compilations} - }); + })); } + + const artifacts = contracts.map(Shims.NewToLegacy.forContract); + await config.artifactor.saveAll(artifacts); } };