truffle-config.js 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  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. }