Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
Object.values(SUPPORTED_NETWORKS).map(network => {
// add the synth contract as well (target addresses are their proxies, and source is the synth contract)
const synthContracts = snx.getSynths({ network }).reduce((memo, { name, subclass }) => {
memo[name] = { target: `Proxy${name}`, source: subclass || 'Synth' };
return memo;
}, {});
const allContracts = Object.assign({}, contracts, synthContracts);
const importStringForHeaders = `import ${network} from './${network}';`;
indexFileHeader.push(importStringForHeaders);
const srcNetworkIndexFileHeader = [];
const abiNetworkIndexFileHeader = [];
const contractsInNetwork = [];
const sourcesInNetwork = [];
Object.keys(allContracts).forEach(contractName => {
let target = contractName;
let source = contractName;
.map(network => {
const synths = snx.getSynths({ network });
return `
const ${network.toUpperCase()}_SYNTHS = ${util.inspect(synths, {
showHidden: false,
depth: null,
})}
`;
})
.join('\n\n');