-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtruffle-config.js
More file actions
43 lines (40 loc) · 1.26 KB
/
truffle-config.js
File metadata and controls
43 lines (40 loc) · 1.26 KB
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
// require('babel-register');
// require('babel-polyfill');
const HDWalletProvider = require('truffle-hdwallet-provider')
var infuraProjectId = process.env.INFURA_PROJECT_ID;
var mnemonic = process.env.MNEMONIC;
// naive environment assertions, since these aren't present by default
if (infuraProjectId === undefined || infuraProjectId === '') {
throw new Error('truffle-config.js needs the environment variable "INFURA_PROJECT_ID"');
} else if (mnemonic === undefined) {
throw new Error('truffle-config.js needs the environment variable "MNEMONIC"');
} else if (mnemonic.split(' ').length != 12) {
throw new Error('The environment variable "MNEMONIC" must be 12 words (space delineated)');
}
module.exports = {
networks: {
development: {
host: "127.0.0.1",
port: 7545,
network_id: "*" // Match any network id
},
ropsten: {
provider: () =>
new HDWalletProvider(mnemonic, `https://ropsten.infura.io/v3/${infuraProjectId}`),
network_id: 3, // Ropsten Id
gas: 3000000,
gasPrice: 100000000000
},
},
contracts_directory: './contracts/',
contracts_build_directory: './src/abis/',
compilers: {
solc: {
version: "^0.8.0",
optimizer: {
enabled: true,
runs: 200
}
}
}
}