truffle-config.js 9.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367
  1. require("dotenv").config({ path: ".env" });
  2. const HDWalletProvider = require("@truffle/hdwallet-provider");
  3. const KLAYHDWalletProvider = require("truffle-hdwallet-provider-klaytn");
  4. const Caver = require("caver-js");
  5. module.exports = {
  6. networks: {
  7. development: {
  8. host: "127.0.0.1",
  9. port: 8545,
  10. network_id: "*",
  11. },
  12. // test network is the same as development but allows us to omit certain migrations
  13. test: {
  14. host: "127.0.0.1",
  15. port: 8545,
  16. network_id: "*",
  17. },
  18. ethereum: {
  19. provider: () =>
  20. new HDWalletProvider(
  21. process.env.MNEMONIC,
  22. "https://rpc.ankr.com/eth",
  23. ),
  24. network_id: 1,
  25. confirmations: 1,
  26. timeoutBlocks: 200,
  27. skipDryRun: false,
  28. },
  29. rinkeby: {
  30. provider: () =>
  31. new HDWalletProvider(
  32. process.env.MNEMONIC,
  33. "https://rpc.ankr.com/eth_rinkeby",
  34. ),
  35. network_id: 4,
  36. gas: 5500000,
  37. confirmations: 2,
  38. timeoutBlocks: 200,
  39. skipDryRun: true,
  40. },
  41. ethereum_testnet: {
  42. provider: () => {
  43. return new HDWalletProvider(
  44. process.env.MNEMONIC,
  45. "https://rpc.ankr.com/eth_goerli"
  46. );
  47. },
  48. network_id: "5",
  49. },
  50. bsc: {
  51. provider: () => {
  52. return new HDWalletProvider(
  53. process.env.MNEMONIC,
  54. "https://bsc-dataseed.binance.org/"
  55. );
  56. },
  57. network_id: "56",
  58. gas: 70000000,
  59. gasPrice: 8000000000,
  60. },
  61. bsc_testnet: {
  62. provider: () =>
  63. new HDWalletProvider(
  64. process.env.MNEMONIC,
  65. "https://data-seed-prebsc-1-s1.binance.org:8545/"
  66. ),
  67. network_id: "97",
  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. polygon_testnet: {
  81. provider: () => {
  82. return new HDWalletProvider(
  83. process.env.MNEMONIC,
  84. "https://rpc.ankr.com/polygon_mumbai",
  85. );
  86. },
  87. network_id: "80001",
  88. },
  89. avalanche: {
  90. provider: () => {
  91. return new HDWalletProvider(
  92. process.env.MNEMONIC,
  93. "https://api.avax.network/ext/bc/C/rpc"
  94. );
  95. },
  96. network_id: "43114",
  97. gas: 8000000,
  98. gasPrice: 26000000000,
  99. },
  100. avalanche_testnet: {
  101. provider: () =>
  102. new HDWalletProvider(
  103. process.env.MNEMONIC,
  104. "https://api.avax-test.network/ext/bc/C/rpc"
  105. ),
  106. network_id: "43113",
  107. },
  108. oasis: {
  109. provider: () => {
  110. return new HDWalletProvider(
  111. process.env.MNEMONIC,
  112. "https://emerald.oasis.dev/"
  113. );
  114. },
  115. network_id: 42262,
  116. },
  117. oasis_testnet: {
  118. provider: () => {
  119. return new HDWalletProvider(
  120. process.env.MNEMONIC,
  121. "https://testnet.emerald.oasis.dev"
  122. );
  123. },
  124. network_id: 42261,
  125. },
  126. aurora: {
  127. provider: () => {
  128. return new HDWalletProvider(
  129. process.env.MNEMONIC,
  130. "https://mainnet.aurora.dev"
  131. );
  132. },
  133. network_id: 0x4e454152,
  134. from: "0xE2e2d9E31d7e1CC1178Fe0d1c5950f6C809816a3",
  135. },
  136. aurora_testnet: {
  137. provider: () => {
  138. return new HDWalletProvider(
  139. process.env.MNEMONIC,
  140. "https://testnet.aurora.dev"
  141. );
  142. },
  143. network_id: 0x4e454153,
  144. gas: 10000000,
  145. from: "0x3bC7f2e458aC4E55F941C458cfD8c6851a591B4F", // public key
  146. },
  147. fantom: {
  148. provider: () => {
  149. return new HDWalletProvider(
  150. process.env.MNEMONIC,
  151. "https://rpc.ftm.tools/"
  152. );
  153. },
  154. network_id: 250,
  155. gas: 8000000,
  156. gasPrice: 3000000000000,
  157. timeoutBlocks: 15000,
  158. },
  159. fantom_testnet: {
  160. provider: () => {
  161. return new HDWalletProvider(
  162. process.env.MNEMONIC,
  163. "https://rpc.testnet.fantom.network/"
  164. );
  165. },
  166. network_id: 0xfa2,
  167. },
  168. karura: {
  169. provider: () => {
  170. return new HDWalletProvider(
  171. process.env.MNEMONIC,
  172. // NOTE: To use this local host, needed to run this: ENDPOINT_URL=wss://karura-rpc-1.aca-api.network npx @acala-network/eth-rpc-adapter@latest
  173. // "http://localhost:8545"
  174. "https://eth-rpc-karura.aca-api.network/"
  175. );
  176. },
  177. network_id: 686,
  178. // NOTE: run ./karura-gas-prices and update the following two values, otherwise the transactions will likely fail
  179. gasPrice: "0x2fad8f03ea",
  180. gasLimit: "0x329b140",
  181. gas: "0x329b140",
  182. },
  183. karura_testnet: {
  184. provider: () => {
  185. return new HDWalletProvider(
  186. process.env.MNEMONIC,
  187. "https://karura-dev.aca-dev.network/eth/http"
  188. );
  189. },
  190. network_id: 596,
  191. gasPrice: "0x2f7e8805de",
  192. gasLimit: "0x329b140",
  193. gas: "0x329b0dc",
  194. },
  195. acala: {
  196. provider: () => {
  197. return new HDWalletProvider(
  198. process.env.MNEMONIC,
  199. // To use this local host, needed to run this: ENDPOINT_URL=wss://acala-rpc-0.aca-api.network npx @acala-network/eth-rpc-adapter@latest
  200. //"http://localhost:8545"
  201. "https://eth-rpc-acala.aca-api.network/"
  202. );
  203. },
  204. network_id: 787,
  205. gasPrice: "0x2f3e3403ea",
  206. gas: "0x6fc3540",
  207. },
  208. acala_testnet: {
  209. provider: () => {
  210. return new HDWalletProvider(
  211. process.env.MNEMONIC,
  212. "https://acala-dev.aca-dev.network/eth/http"
  213. );
  214. },
  215. network_id: 597,
  216. gasPrice: "0x2ed51903ea",
  217. gasLimit: "0x6fc3540",
  218. gas: "0x329b0dc",
  219. },
  220. klaytn: {
  221. // Note that Klaytn works with version 5.3.14 of truffle, but not some of the newer versions.
  222. provider: () => {
  223. return new KLAYHDWalletProvider(process.env.MNEMONIC, "https://public-node-api.klaytnapi.com/v1/cypress");
  224. },
  225. network_id: "8217", //Klaytn mainnet's network id
  226. gas: "8500000",
  227. gasPrice: null,
  228. },
  229. klaytn_testnet: {
  230. // Note that Klaytn works with version 5.3.14 of truffle, but not some of the newer versions.
  231. provider: () => {
  232. return new HDWalletProvider(
  233. process.env.MNEMONIC,
  234. "https://api.baobab.klaytn.net:8651/"
  235. );
  236. },
  237. network_id: "1001",
  238. gas: "8500000",
  239. gasPrice: null,
  240. },
  241. celo: {
  242. provider: () => {
  243. return new HDWalletProvider(
  244. process.env.MNEMONIC,
  245. "https://forno.celo.org"
  246. );
  247. },
  248. network_id: 42220,
  249. gas: 8000000,
  250. gasPrice: null,
  251. },
  252. celo_testnet: {
  253. provider: () => {
  254. return new HDWalletProvider(
  255. process.env.MNEMONIC,
  256. "https://alfajores-forno.celo-testnet.org"
  257. );
  258. },
  259. network_id: 44787,
  260. },
  261. moonbeam: {
  262. provider: () => {
  263. return new HDWalletProvider(
  264. process.env.MNEMONIC,
  265. "https://rpc.api.moonbeam.network"
  266. //"https://moonbeam.api.onfinality.io/public" // When the core was deployed on 7/21/2022, the one above kept timing out but this one worked.
  267. );
  268. },
  269. network_id: 1284,
  270. },
  271. moonbeam_testnet: {
  272. provider: () => {
  273. return new HDWalletProvider(
  274. process.env.MNEMONIC,
  275. "https://rpc.api.moonbase.moonbeam.network"
  276. );
  277. },
  278. network_id: 1287,
  279. gasPrice: 3000000000, // 3.0 gwei
  280. timeoutBlocks: 15000,
  281. },
  282. neon_testnet: {
  283. provider: () => {
  284. return new HDWalletProvider(
  285. process.env.MNEMONIC,
  286. "https://proxy.devnet.neonlabs.org/solana"
  287. );
  288. },
  289. network_id: "*",
  290. gas: 3000000000,
  291. gasPrice: 443065000000,
  292. },
  293. arbitrum: { // Note that arbitrum did not work with our standard version of truffle (5.3.14), but it did work with the latest (5.5.22)
  294. provider: () => {
  295. return new HDWalletProvider(
  296. process.env.MNEMONIC,
  297. "https://arb1.arbitrum.io/rpc"
  298. );
  299. },
  300. network_id: 42161,
  301. },
  302. arbitrum_testnet: { // Note that arbitrum did not work with our standard version of truffle (5.3.14), but it did work with the latest (5.5.22)
  303. provider: () => {
  304. return new HDWalletProvider(
  305. process.env.MNEMONIC,
  306. "https://rinkeby.arbitrum.io/rpc"
  307. );
  308. },
  309. network_id: '*',
  310. },
  311. optimism: {
  312. provider: () => {
  313. return new HDWalletProvider(
  314. process.env.MNEMONIC,
  315. "https://mainnet.optimism.io"
  316. );
  317. },
  318. network_id: 10,
  319. },
  320. optimism_testnet: {
  321. provider: () => {
  322. return new HDWalletProvider(
  323. process.env.MNEMONIC,
  324. "https://goerli.optimism.io"
  325. );
  326. },
  327. network_id: 420,
  328. },
  329. gnosis: {
  330. provider: () => {
  331. return new HDWalletProvider(
  332. process.env.MNEMONIC,
  333. "https://rpc.gnosischain.com/"
  334. );
  335. },
  336. network_id: 100,
  337. },
  338. gnosis_testnet: {
  339. provider: () => {
  340. return new HDWalletProvider(
  341. process.env.MNEMONIC,
  342. "https://sokol.poa.network/"
  343. );
  344. },
  345. network_id: 77,
  346. },
  347. },
  348. compilers: {
  349. solc: {
  350. version: "0.8.4",
  351. settings: {
  352. optimizer: {
  353. enabled: true,
  354. runs: 200,
  355. },
  356. },
  357. },
  358. },
  359. plugins: ["@chainsafe/truffle-plugin-abigen", "truffle-plugin-verify"],
  360. api_keys: {
  361. etherscan: process.env.ETHERSCAN_KEY,
  362. },
  363. };