truffle-config.js 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178
  1. require("dotenv").config({ path: ".env" });
  2. const HDWalletProvider = require("@truffle/hdwallet-provider");
  3. module.exports = {
  4. migrations_directory: process.env.MIGRATIONS_DIR,
  5. networks: {
  6. development: {
  7. host: "127.0.0.1",
  8. port: 8545,
  9. network_id: "*",
  10. },
  11. mainnet: {
  12. provider: () =>
  13. new HDWalletProvider(
  14. process.env.MNEMONIC,
  15. `https://mainnet.infura.io/v3/` + process.env.INFURA_KEY
  16. ),
  17. network_id: 1,
  18. gas: 10000000,
  19. gasPrice: 191000000000,
  20. confirmations: 1,
  21. timeoutBlocks: 200,
  22. skipDryRun: false,
  23. },
  24. rinkeby: {
  25. provider: () =>
  26. new HDWalletProvider(
  27. process.env.MNEMONIC,
  28. `https://rinkeby.infura.io/v3/` + process.env.INFURA_KEY
  29. ),
  30. network_id: 4,
  31. gas: 5500000,
  32. confirmations: 2,
  33. timeoutBlocks: 200,
  34. skipDryRun: true,
  35. },
  36. goerli: {
  37. provider: () => {
  38. return new HDWalletProvider(
  39. process.env.MNEMONIC,
  40. "https://goerli.infura.io/v3/" + process.env.INFURA_KEY
  41. );
  42. },
  43. network_id: "5",
  44. gas: 4465030,
  45. gasPrice: 10000000000,
  46. },
  47. binance: {
  48. provider: () => {
  49. return new HDWalletProvider(
  50. process.env.MNEMONIC,
  51. "https://bsc-dataseed.binance.org/"
  52. );
  53. },
  54. network_id: "56",
  55. gas: 70000000,
  56. gasPrice: 8000000000,
  57. },
  58. binance_testnet: {
  59. provider: () => new HDWalletProvider(
  60. process.env.MNEMONIC,
  61. "https://data-seed-prebsc-1-s1.binance.org:8545/"
  62. ),
  63. network_id: "97",
  64. gas: 70000000,
  65. gasPrice: 8000000000,
  66. },
  67. polygon: {
  68. provider: () => {
  69. return new HDWalletProvider(
  70. process.env.MNEMONIC,
  71. "https://polygon-rpc.com"
  72. );
  73. },
  74. network_id: "137",
  75. gas: 10000000,
  76. gasPrice: 700000000000,
  77. },
  78. mumbai: {
  79. provider: () => {
  80. return new HDWalletProvider(
  81. process.env.MNEMONIC,
  82. "https://polygon-mumbai.infura.io/v3/" + process.env.INFURA_KEY)
  83. },
  84. network_id: "80001",
  85. },
  86. avalanche: {
  87. provider: () => {
  88. return new HDWalletProvider(
  89. process.env.MNEMONIC,
  90. "https://api.avax.network/ext/bc/C/rpc"
  91. );
  92. },
  93. network_id: "43114",
  94. gas: 8000000,
  95. gasPrice: 26000000000,
  96. },
  97. fuji: {
  98. provider: () => new HDWalletProvider(
  99. process.env.MNEMONIC,
  100. "https://api.avax-test.network/ext/bc/C/rpc"
  101. ),
  102. network_id: "43113",
  103. },
  104. oasis: {
  105. provider: () => {
  106. return new HDWalletProvider(
  107. process.env.MNEMONIC,
  108. "https://emerald.oasis.dev/"
  109. );
  110. },
  111. network_id: 42262,
  112. gas: 4465030,
  113. gasPrice: 30000000000,
  114. },
  115. aurora: {
  116. provider: () => {
  117. return new HDWalletProvider(
  118. process.env.MNEMONIC,
  119. "https://mainnet.aurora.dev"
  120. );
  121. },
  122. network_id: 1313161554,
  123. },
  124. aurora_testnet: {
  125. provider: () => {
  126. return new HDWalletProvider(
  127. process.env.MNEMONIC,
  128. "https://testnet.aurora.dev"
  129. )
  130. },
  131. network_id: 0x4e454153,
  132. gas: 70000000,
  133. gasPrice: 8000000000,
  134. },
  135. fantom: {
  136. provider: () => {
  137. return new HDWalletProvider(
  138. process.env.MNEMONIC,
  139. "https://rpc.ftm.tools/"
  140. )
  141. },
  142. network_id: 250,
  143. gas: 8000000,
  144. gasPrice: 3000000000000,
  145. timeoutBlocks: 15000,
  146. },
  147. fantom_testnet: {
  148. provider: () => {
  149. return new HDWalletProvider(
  150. process.env.MNEMONIC,
  151. "https://rpc.testnet.fantom.network/"
  152. )
  153. },
  154. network_id: 0xfa2,
  155. gas: 4465030,
  156. gasPrice: 300000000000,
  157. },
  158. },
  159. compilers: {
  160. solc: {
  161. version: "0.8.4",
  162. settings: {
  163. optimizer: {
  164. enabled: true,
  165. runs: 200,
  166. },
  167. },
  168. },
  169. },
  170. plugins: ["@chainsafe/truffle-plugin-abigen", "truffle-plugin-verify"],
  171. api_keys: {
  172. etherscan: process.env.ETHERSCAN_KEY,
  173. },
  174. };