truffle-config.js 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. require("dotenv").config({ path: ".env" });
  2. const HDWalletProvider = require("@truffle/hdwallet-provider");
  3. module.exports = {
  4. networks: {
  5. development: {
  6. host: "127.0.0.1",
  7. port: 8545,
  8. network_id: "*",
  9. },
  10. mainnet: {
  11. provider: () =>
  12. new HDWalletProvider(
  13. process.env.MNEMONIC,
  14. `https://mainnet.infura.io/v3/` + process.env.INFURA_KEY
  15. ),
  16. network_id: 1,
  17. gas: 10000000,
  18. gasPrice: 101000000000,
  19. confirmations: 1,
  20. timeoutBlocks: 200,
  21. skipDryRun: false,
  22. },
  23. rinkeby: {
  24. provider: () =>
  25. new HDWalletProvider(
  26. process.env.MNEMONIC,
  27. `https://rinkeby.infura.io/v3/` + process.env.INFURA_KEY
  28. ),
  29. network_id: 4,
  30. gas: 5500000,
  31. confirmations: 2,
  32. timeoutBlocks: 200,
  33. skipDryRun: true,
  34. },
  35. goerli: {
  36. provider: () => {
  37. return new HDWalletProvider(
  38. process.env.MNEMONIC,
  39. "https://goerli.infura.io/v3/" + process.env.INFURA_KEY
  40. );
  41. },
  42. network_id: "5",
  43. gas: 4465030,
  44. gasPrice: 10000000000,
  45. },
  46. binance: {
  47. provider: () => {
  48. return new HDWalletProvider(
  49. process.env.MNEMONIC,
  50. "https://bsc-dataseed.binance.org/"
  51. );
  52. },
  53. network_id: "56",
  54. gas: 70000000,
  55. gasPrice: 8000000000,
  56. },
  57. oasis: {
  58. provider: () => {
  59. return new HDWalletProvider(
  60. process.env.MNEMONIC,
  61. "https://emerald.oasis.dev/"
  62. );
  63. },
  64. network_id: 42262,
  65. gas: 4465030,
  66. gasPrice: 30000000000,
  67. },
  68. },
  69. compilers: {
  70. solc: {
  71. version: "0.8.4",
  72. settings: {
  73. optimizer: {
  74. enabled: true,
  75. runs: 200,
  76. },
  77. },
  78. },
  79. },
  80. plugins: ["@chainsafe/truffle-plugin-abigen", "truffle-plugin-verify"],
  81. api_keys: {
  82. etherscan: process.env.ETHERSCAN_KEY,
  83. },
  84. };