truffle-config.js 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210
  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. ropsten: {
  25. provider: () =>
  26. new HDWalletProvider(
  27. process.env.MNEMONIC,
  28. `https://ropsten.infura.io/v3/` + process.env.INFURA_KEY
  29. ),
  30. network_id: 3,
  31. gas: 5500000,
  32. confirmations: 2,
  33. timeoutBlocks: 200,
  34. skipDryRun: true,
  35. },
  36. rinkeby: {
  37. provider: () =>
  38. new HDWalletProvider(
  39. process.env.MNEMONIC,
  40. `https://rinkeby.infura.io/v3/` + process.env.INFURA_KEY
  41. ),
  42. network_id: 4,
  43. gas: 5500000,
  44. confirmations: 2,
  45. timeoutBlocks: 200,
  46. skipDryRun: true,
  47. },
  48. goerli: {
  49. provider: () => {
  50. return new HDWalletProvider(
  51. process.env.MNEMONIC,
  52. "https://goerli.infura.io/v3/" + process.env.INFURA_KEY
  53. );
  54. },
  55. network_id: "5",
  56. gas: 4465030,
  57. gasPrice: 10000000000,
  58. },
  59. bnb: {
  60. provider: () => {
  61. return new HDWalletProvider(
  62. process.env.MNEMONIC,
  63. "https://bsc-dataseed.binance.org/"
  64. );
  65. },
  66. network_id: "56",
  67. gas: 70000000,
  68. gasPrice: 8000000000,
  69. },
  70. bnb_testnet: {
  71. provider: () => new HDWalletProvider(
  72. process.env.MNEMONIC,
  73. "https://data-seed-prebsc-1-s1.binance.org:8545"
  74. ),
  75. network_id: "97",
  76. confirmations: 10,
  77. networkCheckTimeout: 1000000,
  78. timeoutBlocks: 1000,
  79. skipDryRun: true,
  80. },
  81. polygon: {
  82. provider: () => {
  83. return new HDWalletProvider(
  84. process.env.MNEMONIC,
  85. "https://polygon-rpc.com"
  86. );
  87. },
  88. network_id: "137",
  89. gas: 10000000,
  90. gasPrice: 700000000000,
  91. },
  92. mumbai: {
  93. provider: () => {
  94. return new HDWalletProvider(
  95. process.env.MNEMONIC,
  96. "https://matic-mumbai.chainstacklabs.com")
  97. },
  98. network_id: "80001",
  99. },
  100. avalanche: {
  101. provider: () => {
  102. return new HDWalletProvider(
  103. process.env.MNEMONIC,
  104. "https://api.avax.network/ext/bc/C/rpc"
  105. );
  106. },
  107. network_id: "43114",
  108. gas: 8000000,
  109. gasPrice: 26000000000,
  110. },
  111. fuji: {
  112. provider: () => new HDWalletProvider(
  113. process.env.MNEMONIC,
  114. "https://api.avax-test.network/ext/bc/C/rpc"
  115. ),
  116. network_id: "43113",
  117. },
  118. oasis: {
  119. provider: () => {
  120. return new HDWalletProvider(
  121. process.env.MNEMONIC,
  122. "https://emerald.oasis.dev/"
  123. );
  124. },
  125. network_id: 42262,
  126. gas: 4465030,
  127. gasPrice: 30000000000,
  128. },
  129. aurora: {
  130. provider: () => {
  131. return new HDWalletProvider(
  132. process.env.MNEMONIC,
  133. "https://mainnet.aurora.dev"
  134. );
  135. },
  136. network_id: 1313161554,
  137. },
  138. aurora_testnet: {
  139. provider: () => {
  140. return new HDWalletProvider(
  141. process.env.MNEMONIC,
  142. "https://testnet.aurora.dev"
  143. )
  144. },
  145. network_id: 0x4e454153,
  146. gas: 10000000,
  147. from: "0xC42e9476b0a458097087336e2395Dbf45B0BdC12", // public key
  148. },
  149. fantom: {
  150. provider: () => {
  151. return new HDWalletProvider(
  152. process.env.MNEMONIC,
  153. "https://rpc.ftm.tools/"
  154. )
  155. },
  156. network_id: 250,
  157. gas: 8000000,
  158. gasPrice: 3000000000000,
  159. timeoutBlocks: 15000,
  160. },
  161. fantom_testnet: {
  162. provider: () => {
  163. return new HDWalletProvider(
  164. process.env.MNEMONIC,
  165. "https://rpc.testnet.fantom.network/"
  166. )
  167. },
  168. network_id: 0xfa2,
  169. gas: 4465030,
  170. gasPrice: 300000000000,
  171. },
  172. celo: {
  173. provider: () => {
  174. return new HDWalletProvider(
  175. process.env.MNEMONIC,
  176. "https://forno.celo.org"
  177. )
  178. },
  179. network_id: 42220,
  180. },
  181. celo_alfajores_testnet: {
  182. provider: () => {
  183. return new HDWalletProvider(
  184. process.env.MNEMONIC,
  185. "https://alfajores-forno.celo-testnet.org"
  186. )
  187. },
  188. network_id: 44787,
  189. },
  190. },
  191. compilers: {
  192. solc: {
  193. version: "0.8.4",
  194. settings: {
  195. optimizer: {
  196. enabled: true,
  197. runs: 200,
  198. },
  199. },
  200. },
  201. },
  202. plugins: ["@chainsafe/truffle-plugin-abigen", "truffle-plugin-verify"],
  203. api_keys: {
  204. etherscan: process.env.ETHERSCAN_KEY,
  205. },
  206. };