-
Notifications
You must be signed in to change notification settings - Fork 110
/
truffle-config.js
102 lines (96 loc) · 2.64 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
require("dotenv").config();
require("truffle-plugin-verify");
require("ts-node").register({
files: true,
});
const getNetworkProvider = () => {
const HDWalletProvider = require("@truffle/hdwallet-provider");
if (!process.env.WALLET_MNEMONIC)
throw Error("Missing environment variable: WALLET_MNEMONIC");
if (!process.env.ETH_NODE_URL)
throw Error("Missing environment variable: ETH_NODE_URL");
return new HDWalletProvider({
mnemonic: {
phrase: process.env.WALLET_MNEMONIC,
},
providerOrUrl: process.env.ETH_NODE_URL,
});
};
module.exports = {
networks: {
ganache: {
host: "127.0.0.1", // Localhost (default: none)
port: 7545, // Standard Ethereum port (default: none)
network_id: "1337", // Any network (default: none)
},
coverage: {
host: "localhost",
network_id: "*",
port: 8555,
gas: 0xfffffffffff,
gasPrice: 0x01,
},
goerli: {
provider: getNetworkProvider,
network_id: 5,
skipDryRun: true,
},
sepolia: {
provider: getNetworkProvider,
network_id: 11155111,
skipDryRun: true,
},
mainnet: {
provider: getNetworkProvider,
network_id: 1,
skipDryRun: true,
},
gnosis: {
provider: getNetworkProvider,
network_id: 100,
skipDryRun: true,
},
harmony: {
provider: getNetworkProvider,
network_id: 1666600000,
skipDryRun: true,
},
harmonytest: {
provider: getNetworkProvider,
network_id: 1666700000,
skipDryRun: true,
},
polygon: {
provider: getNetworkProvider,
network_id: 137,
skipDryRun: true,
},
polygontest: {
provider: getNetworkProvider,
network_id: 80001,
skipDryRun: true,
gasPrice: 10000000000,
},
},
// Configure your compilers
compilers: {
solc: {
version: "0.8.9", // Fetch exact version from solc-bin (default: truffle's version)
// docker: true, // Use "0.5.1" you've installed locally with docker (default: false)
settings: {
// See the solidity docs for advice about optimization and evmVersion
optimizer: {
enabled: !(process.env.SOLC_OPTIMIZER === "false"),
runs: 200,
},
// evmVersion: "byzantium"
},
},
},
// Supported chains: https://github.com/rkalis/truffle-plugin-verify?tab=readme-ov-file#supported-chains
api_keys: {
etherscan: process.env.ETHERSCAN_API_KEY, // Obtain one at https://etherscan.io/myapikey
polygonscan: process.env.POLYGONSCAN_API_KEY, // Obtain one at https://polygonscan.com/myapikey
},
plugins: ["truffle-plugin-verify"],
};