hardhat.config.js 809 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. const fs = require('fs');
  2. const path = require('path');
  3. require('@nomiclabs/hardhat-truffle5');
  4. require('@nomiclabs/hardhat-solhint');
  5. require('solidity-coverage');
  6. require('hardhat-gas-reporter');
  7. for (const f of fs.readdirSync(path.join(__dirname, 'hardhat'))) {
  8. require(path.join(__dirname, 'hardhat', f));
  9. }
  10. const enableGasReport = !!process.env.ENABLE_GAS_REPORT;
  11. /**
  12. * @type import('hardhat/config').HardhatUserConfig
  13. */
  14. module.exports = {
  15. solidity: {
  16. version: '0.8.0',
  17. settings: {
  18. optimizer: {
  19. enabled: enableGasReport,
  20. runs: 200,
  21. },
  22. },
  23. },
  24. networks: {
  25. hardhat: {
  26. blockGasLimit: 10000000,
  27. },
  28. },
  29. gasReporter: {
  30. enable: enableGasReport,
  31. currency: 'USD',
  32. outputFile: process.env.CI ? 'gas-report.txt' : undefined,
  33. },
  34. };