Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
async loadCompilation(compilationConfig: CompilationConfigObject) {
const compilationOutput = await Contracts.compile(compilationConfig);
const contracts = compilationOutput.compilations;
const compilationObjects = await Promise.all(
Object.values(contracts)
.filter(contracts => contracts["contracts"].length > 0)
.map(({ contracts }) => {
return this.setCompilation(contracts);
})
);
const compilations = await this.db.query(AddCompilation, {
compilations: compilationObjects
});
return { compilations, contracts };
}