prepare-docs-solc.js 663 B

12345678910111213141516
  1. const hre = require('hardhat');
  2. const { getCompilersDir } = require('hardhat/internal/util/global-dir');
  3. const { CompilerDownloader } = require('hardhat/internal/solidity/compiler/downloader');
  4. const { Compiler } = require('hardhat/internal/solidity/compiler');
  5. const [{ version }] = hre.config.solidity.compilers;
  6. async function getSolc () {
  7. const downloader = new CompilerDownloader(await getCompilersDir(), { forceSolcJs: true });
  8. const { compilerPath } = await downloader.getDownloadedCompilerPath(version);
  9. const compiler = new Compiler(compilerPath);
  10. return compiler.getSolc();
  11. }
  12. module.exports = Object.assign(getSolc(), { __esModule: true });