/ truffle-config.js
truffle-config.js
1 const HDWalletProvider = require("@truffle/hdwallet-provider"); 2 const Web3 = require('web3'); 3 4 require('dotenv').config(); 5 6 module.exports = { 7 8 networks: { 9 10 kovan: { 11 provider: function() { 12 return new HDWalletProvider( 13 process.env.MNENOMIC, 14 "wss://kovan.infura.io/ws/v3/" + process.env.INFURA_API_KEY 15 ) 16 }, 17 network_id: 42, 18 networkCheckTimeout: 1000000, 19 timeoutBlocks: 200, 20 gasPrice: 1e9 // 1 gewi 21 }, 22 23 //for eth 24 /*development: { 25 host: "127.0.0.1", // Localhost (default: none) 26 port: 7545, // Standard Ethereum port (default: none) 27 network_id: "*", // Any network (default: none) 28 gas: 8000000, 29 }*/ 30 31 development: { 32 provider: () => new Web3.providers.HttpProvider('http://127.0.0.1:9545/ext/bc/C/rpc'), 33 network_id: "*", 34 gas: 8000000, 35 gasPrice: 25000000000 // 25 nAVAX for now 36 }, 37 38 matic: { 39 provider: function() { 40 return new HDWalletProvider( 41 process.env.MNENOMIC, 42 "https://polygon-mainnet.infura.io/v3/" + process.env.INFURA_API_KEY 43 ) 44 }, 45 network_id: 137, 46 networkCheckTimeout: 1000000, 47 timeoutBlocks: 200, 48 gasPrice: 50e9 // 50 gewi 49 }, 50 51 mumbai: { 52 provider: function() { 53 return new HDWalletProvider(process.env.TESTNET_PRIVATE_KEY, "https://matic-mumbai.chainstacklabs.com/") 54 }, 55 gas: 8000000, 56 network_id: 80001, 57 networkCheckTimeout: 1000000, 58 timeoutBlocks: 200, 59 from: "0xe977757dA5fd73Ca3D2bA6b7B544bdF42bb2CBf6", 60 gasPrice: 401e8 // 50 gewi 61 } 62 }, 63 64 compilers: { 65 solc: { 66 version: "0.6.0", 67 settings: { 68 optimizer: { 69 enabled: true, 70 runs: 200 71 } 72 } 73 } 74 }, 75 /* 76 plugins: [ 77 'truffle-plugin-verify', 78 'truffle-contract-size' 79 ], 80 81 api_keys: { 82 etherscan: process.env.ETHERSCAN_KEY 83 }*/ 84 };