-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtruffle-config.js
105 lines (97 loc) · 2.4 KB
/
truffle-config.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
require("dotenv").config()
const HDWalletProvider = require('@truffle/hdwallet-provider')
const fs = require('fs')
let customNetworks = {}
if (fs.existsSync("./custom_networks.js")) {
customNetworks = require("./custom_networks").customNetworks
}
const {
ETH_PKEY,
INFURA_PROJECT_ID,
ETHERSCAN_API,
} = process.env
module.exports = {
networks: {
// ganache-cli
development: {
host: "127.0.0.1", // Localhost (default: none)
port: 8545, // Standard Ethereum port (default: none)
network_id: "*", // Any network (default: none)
},
// truffle develop console
develop: {
host: "127.0.0.1",
port: 8545,
network_id: "*",
},
goerli: {
provider: () =>
new HDWalletProvider({
privateKeys: [ETH_PKEY],
providerOrUrl: `https://goerli.infura.io/v3/${INFURA_PROJECT_ID}`,
}),
network_id: "5",
gasPrice: 50000000000,
skipDryRun: true,
},
sepolia: {
provider: () =>
new HDWalletProvider({
privateKeys: [ETH_PKEY],
providerOrUrl: `https://sepolia.infura.io/v3/${INFURA_PROJECT_ID}`,
}),
network_id: "11155111",
gas: 10000000,
gasPrice: 5000000000,
skipDryRun: true,
},
mainnet: {
provider: () =>
new HDWalletProvider({
privateKeys: [ETH_PKEY],
providerOrUrl: `https://mainnet.infura.io/v3/${INFURA_PROJECT_ID}`
}),
network_id: "1",
gasPrice: 120000000000 // 120e9 = 120 gwei
},
polygon: {
provider: () =>
new HDWalletProvider({
privateKeys: [ETH_PKEY],
providerOrUrl: `https://polygon-mainnet.infura.io/v3/${INFURA_PROJECT_ID}`,
}),
network_id: "137",
gasPrice: 40000000000, // 40 gwei
skipDryRun: true,
},
shibarium: {
provider: () =>
new HDWalletProvider({
privateKeys: [ETH_PKEY],
providerOrUrl: 'https://rpc.shibrpc.com',
}),
network_id: "109",
gasPrice: 10000000000, // 10 gwei
skipDryRun: true,
},
...customNetworks,
},
plugins: [
'truffle-plugin-verify'
],
api_keys: {
etherscan: ETHERSCAN_API
},
// Configure your compilers
compilers: {
solc: {
version: "0.8.3",
settings: {
optimizer: {
enabled: true,
runs: 200
}
}
}
}
};