truffle-config.js 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. require('dotenv').config()
  2. const HDWalletProvider = require('@truffle/hdwallet-provider')
  3. const utils = require('web3-utils')
  4. module.exports = {
  5. /**
  6. * Networks define how you connect to your ethereum client and let you set the
  7. * defaults web3 uses to send transactions. If you don't specify one truffle
  8. * will spin up a development blockchain for you on port 9545 when you
  9. * run `develop` or `test`. You can ask a truffle command to use a specific
  10. * network from the command line, e.g
  11. *
  12. * $ truffle test --network <network-name>
  13. */
  14. networks: {
  15. development: {
  16. host: '127.0.0.1', // Localhost (default: none)
  17. port: 8545, // Standard Ethereum port (default: none)
  18. network_id: '*', // Any network (default: none)
  19. },
  20. kovan: {
  21. provider: () =>
  22. new HDWalletProvider(
  23. process.env.PRIVATE_KEY,
  24. 'https://kovan.infura.io/v3/97c8bf358b9942a9853fab1ba93dc5b3',
  25. ),
  26. network_id: 42,
  27. gas: 6000000,
  28. gasPrice: utils.toWei('1', 'gwei'),
  29. // confirmations: 0,
  30. // timeoutBlocks: 200,
  31. skipDryRun: true,
  32. },
  33. goerli: {
  34. provider: () =>
  35. new HDWalletProvider(
  36. process.env.PRIVATE_KEY,
  37. 'https://goerli.infura.io/v3/d34c08f2cb7c4111b645d06ac7e35ba8',
  38. ),
  39. network_id: 5,
  40. gas: 6000000,
  41. gasPrice: utils.toWei('1', 'gwei'),
  42. // confirmations: 0,
  43. // timeoutBlocks: 200,
  44. skipDryRun: true,
  45. },
  46. rinkeby: {
  47. provider: () =>
  48. new HDWalletProvider(
  49. process.env.PRIVATE_KEY,
  50. 'https://rinkeby.infura.io/v3/97c8bf358b9942a9853fab1ba93dc5b3',
  51. ),
  52. network_id: 4,
  53. gas: 6000000,
  54. gasPrice: utils.toWei('1', 'gwei'),
  55. // confirmations: 0,
  56. // timeoutBlocks: 200,
  57. skipDryRun: true,
  58. },
  59. mainnet: {
  60. provider: () => new HDWalletProvider(process.env.PRIVATE_KEY, 'http://ethereum-rpc.trustwalletapp.com'),
  61. network_id: 1,
  62. gas: 6000000,
  63. gasPrice: utils.toWei('2', 'gwei'),
  64. // confirmations: 0,
  65. // timeoutBlocks: 200,
  66. skipDryRun: true,
  67. },
  68. },
  69. mocha: {
  70. // timeout: 100000
  71. },
  72. // Configure your compilers
  73. compilers: {
  74. solc: {
  75. version: '0.7.6',
  76. settings: {
  77. optimizer: {
  78. enabled: true,
  79. runs: 200,
  80. },
  81. },
  82. },
  83. external: {
  84. command: 'node ./scripts/compileHasher.js',
  85. targets: [
  86. {
  87. path: './build/Hasher.json',
  88. },
  89. ],
  90. },
  91. },
  92. plugins: ['solidity-coverage'],
  93. }