hardhat.config.ts 2.4 KB

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