truffle-config.js 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177
  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: 191000000000,
  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. binance_testnet: {
  58. provider: () => new HDWalletProvider(
  59. process.env.MNEMONIC,
  60. "https://data-seed-prebsc-1-s1.binance.org:8545/"
  61. ),
  62. network_id: "97",
  63. gas: 70000000,
  64. gasPrice: 8000000000,
  65. },
  66. polygon: {
  67. provider: () => {
  68. return new HDWalletProvider(
  69. process.env.MNEMONIC,
  70. "https://polygon-rpc.com"
  71. );
  72. },
  73. network_id: "137",
  74. gas: 10000000,
  75. gasPrice: 700000000000,
  76. },
  77. mumbai: {
  78. provider: () => {
  79. return new HDWalletProvider(
  80. process.env.MNEMONIC,
  81. "https://polygon-mumbai.infura.io/v3/" + process.env.INFURA_KEY)
  82. },
  83. network_id: "80001",
  84. },
  85. avalanche: {
  86. provider: () => {
  87. return new HDWalletProvider(
  88. process.env.MNEMONIC,
  89. "https://api.avax.network/ext/bc/C/rpc"
  90. );
  91. },
  92. network_id: "43114",
  93. gas: 8000000,
  94. gasPrice: 26000000000,
  95. },
  96. fuji: {
  97. provider: () => new HDWalletProvider(
  98. process.env.MNEMONIC,
  99. "https://api.avax-test.network/ext/bc/C/rpc"
  100. ),
  101. network_id: "43113",
  102. },
  103. oasis: {
  104. provider: () => {
  105. return new HDWalletProvider(
  106. process.env.MNEMONIC,
  107. "https://emerald.oasis.dev/"
  108. );
  109. },
  110. network_id: 42262,
  111. gas: 4465030,
  112. gasPrice: 30000000000,
  113. },
  114. aurora: {
  115. provider: () => {
  116. return new HDWalletProvider(
  117. process.env.MNEMONIC,
  118. "https://mainnet.aurora.dev"
  119. );
  120. },
  121. network_id: 1313161554,
  122. },
  123. aurora_testnet: {
  124. provider: () => {
  125. return new HDWalletProvider(
  126. process.env.MNEMONIC,
  127. "https://testnet.aurora.dev"
  128. )
  129. },
  130. network_id: 0x4e454153,
  131. gas: 70000000,
  132. gasPrice: 8000000000,
  133. },
  134. fantom: {
  135. provider: () => {
  136. return new HDWalletProvider(
  137. process.env.MNEMONIC,
  138. "https://rpc.ftm.tools/"
  139. )
  140. },
  141. network_id: 250,
  142. gas: 8000000,
  143. gasPrice: 3000000000000,
  144. timeoutBlocks: 15000,
  145. },
  146. fantom_testnet: {
  147. provider: () => {
  148. return new HDWalletProvider(
  149. process.env.MNEMONIC,
  150. "https://rpc.testnet.fantom.network/"
  151. )
  152. },
  153. network_id: 0xfa2,
  154. gas: 4465030,
  155. gasPrice: 300000000000,
  156. },
  157. },
  158. compilers: {
  159. solc: {
  160. version: "0.8.4",
  161. settings: {
  162. optimizer: {
  163. enabled: true,
  164. runs: 200,
  165. },
  166. },
  167. },
  168. },
  169. plugins: ["@chainsafe/truffle-plugin-abigen", "truffle-plugin-verify"],
  170. api_keys: {
  171. etherscan: process.env.ETHERSCAN_KEY,
  172. },
  173. };