Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const contract = (json = {}, networkType = "ethereum") => {
const normalizedArtifactObject = Object.assign({}, Schema.normalize(json), {
networkType
});
// Note we don't use `new` here at all. This will cause the class to
// "mutate" instead of instantiate an instance.
return Contract.clone(normalizedArtifactObject);
};
async function processTargets(targets, cwd, logger) {
const contracts = {};
for (let target of targets) {
let targetContracts = await processTarget(target, cwd, logger);
for (let [name, contract] of Object.entries(targetContracts)) {
contracts[name] = Schema.validate(contract);
}
}
return contracts;
}