hardhat/builtin-tasks/task-names#TASK_COMPILE_SOLIDITY_COMPILE TypeScript Examples

The following examples show how to use hardhat/builtin-tasks/task-names#TASK_COMPILE_SOLIDITY_COMPILE. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: index.ts    From openzeppelin-upgrades with MIT License 6 votes vote down vote up
subtask(TASK_COMPILE_SOLIDITY_COMPILE, async (args: RunCompilerArgs, hre, runSuper) => {
  const { validate, solcInputOutputDecoder } = await import('@openzeppelin/upgrades-core');
  const { writeValidations } = await import('./utils/validations');

  // TODO: patch input
  const { output, solcBuild } = await runSuper();

  const { isFullSolcOutput } = await import('./utils/is-full-solc-output');
  if (isFullSolcOutput(output)) {
    const decodeSrc = solcInputOutputDecoder(args.input, output);
    const validations = validate(output, decodeSrc);
    await writeValidations(hre, validations);
  }

  return { output, solcBuild };
});
Example #2
Source File: subtasks.ts    From index-coop-smart-contracts with Apache License 2.0 5 votes vote down vote up
// Use native solc if available locally at config specified version
internalTask(TASK_COMPILE_SOLIDITY_COMPILE).setAction(setupNativeSolc);