hardhat.config.ts 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. /**
  2. * @type import('hardhat/config').HardhatUserConfig
  3. */
  4. import "@nomiclabs/hardhat-ethers";
  5. import "@nomiclabs/hardhat-etherscan";
  6. import "@nomiclabs/hardhat-solhint";
  7. import "@typechain/hardhat";
  8. import "dotenv/config";
  9. import "hardhat-deploy";
  10. import "solidity-coverage";
  11. import "./tasks/accounts";
  12. import "./tasks/balance";
  13. import "./tasks/block-number";
  14. import "./tasks/create-collectibles";
  15. const MAINNET_RPC_URL =
  16. process.env.MAINNET_RPC_URL ||
  17. process.env.ALCHEMY_MAINNET_RPC_URL ||
  18. "https://eth-mainnet.alchemyapi.io/v2/your-api-key";
  19. const RINKEBY_RPC_URL =
  20. process.env.RINKEBY_RPC_URL ||
  21. "https://eth-rinkeby.alchemyapi.io/v2/your-api-key";
  22. const KOVAN_RPC_URL =
  23. process.env.KOVAN_RPC_URL ||
  24. "https://eth-kovan.alchemyapi.io/v2/your-api-key";
  25. const MNEMONIC = process.env.MNEMONIC || "your mnemonic";
  26. const ETHERSCAN_API_KEY =
  27. process.env.ETHERSCAN_API_KEY || "Your etherscan API key";
  28. // optional
  29. const PRIVATE_KEY = process.env.PRIVATE_KEY || "your private key";
  30. const PINATA_API_KEY = process.env.PINATA_API_KEY;
  31. const PINATA_API_SECRET = process.env.PINATA_API_SECRET;
  32. module.exports = {
  33. defaultNetwork: "hardhat",
  34. networks: {
  35. hardhat: {
  36. // // If you want to do some forking, uncomment this
  37. // forking: {
  38. // url: MAINNET_RPC_URL
  39. // }
  40. },
  41. localhost: {},
  42. kovan: {
  43. url: KOVAN_RPC_URL,
  44. // accounts: [PRIVATE_KEY],
  45. accounts: {
  46. mnemonic: MNEMONIC,
  47. },
  48. saveDeployments: true,
  49. },
  50. rinkeby: {
  51. url: RINKEBY_RPC_URL,
  52. // accounts: [PRIVATE_KEY],
  53. accounts: {
  54. mnemonic: MNEMONIC,
  55. },
  56. saveDeployments: true,
  57. },
  58. ganache: {
  59. url: "http://localhost:8545",
  60. accounts: {
  61. mnemonic: MNEMONIC,
  62. },
  63. },
  64. },
  65. etherscan: {
  66. // Your API key for Etherscan
  67. // Obtain one at https://etherscan.io/
  68. apiKey: ETHERSCAN_API_KEY,
  69. },
  70. namedAccounts: {
  71. deployer: {
  72. default: 0, // here this will by default take the first account as deployer
  73. 1: 0, // similarly on mainnet it will take the first account as deployer.
  74. },
  75. feeCollector: {
  76. default: 1,
  77. },
  78. },
  79. solidity: {
  80. compilers: [
  81. {
  82. version: "0.8.4",
  83. },
  84. ],
  85. },
  86. mocha: {
  87. timeout: 100000,
  88. },
  89. typechain: {
  90. outDir: "typechain",
  91. target: "ethers-v5",
  92. },
  93. };