Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const { solcSnapshot, fromCache } = await compiler.loadSolcVersion(
releases[version]
);
spinner.succeed(
fromCache
? `Loaded solc v${version} from local cache`
: `Downloaded solc v${version} and saved to local cache`
);
spinner.start('Resolving imports');
/**
* Resolve imported sources and read source code for each file.
*/
const resolvedSources = await Profiler.resolveAllSources(
resolver,
[solidityFilePath],
solcSnapshot
);
spinner.stop();
spinner.start('Compiling source(s)');
const allSources = {};
for (const file in resolvedSources) {
allSources[file] = { content: resolvedSources[file].body };
}
/* Get the input config for the Solidity Compiler */