hardhat/types#TaskArguments TypeScript Examples

The following examples show how to use hardhat/types#TaskArguments. 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: compile.ts    From eth with GNU General Public License v3.0 6 votes vote down vote up
async function copyAbi(
  args: HardhatArguments,
  hre: HardhatRuntimeEnvironment,
  runSuper: RunSuperFunction<TaskArguments>
) {
  const out = await runSuper(args);

  const { abi } = await hre.artifacts.readArtifact(hre.config.diamondAbi.name);
  const abisDir = path.join(hre.packageDirs['@darkforest_eth/contracts'], 'abis');

  // workaround for: https://github.com/graphprotocol/graph-cli/issues/588
  // just remove calls we cant process, note makes them unusable from within
  // graph but largely dont need these

  const filteredDiamondAbi = abi.filter(abiFilter);

  await fs.writeFile(
    path.join(abisDir, 'DarkForest_stripped.json'),
    prettier.format(JSON.stringify(filteredDiamondAbi), {
      semi: false,
      parser: 'json',
    })
  );

  return out;
}