truffle-config.js 4.1 KB

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