This repository has been archived by the owner on Dec 21, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
truffle-config.js
executable file
·75 lines (63 loc) · 1.89 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
require('ts-node/register')
require('dotenv').config()
const process = require('process')
const HDWalletProvider = require('@truffle/hdwallet-provider')
const networks = require('./truffle-networks')
const { PRIVATE_KEY, INFURA, ETHERSCAN } = process.env
const canMigrate = typeof PRIVATE_KEY !== 'undefined' && typeof INFURA !== 'undefined'
// const canVerify = typeof ETHERSCAN !== 'undefined'
module.exports = {
networks: {
// default network
development: {
...networks.development,
},
// used when testing
test: {
...networks.test,
},
// used for generating code coverage
soliditycoverage: {
...networks.soliditycoverage,
},
rinkeby: canMigrate && {
...networks.rinkeby,
provider: () => new HDWalletProvider(PRIVATE_KEY, `https://rinkeby.infura.io/v3/${INFURA}`),
},
kovan: canMigrate && {
...networks.kovan,
provider: () => new HDWalletProvider(PRIVATE_KEY, `https://kovan.infura.io/v3/${INFURA}`),
},
// block explorer: https://blockscout.com/poa/sokol
solkol: canMigrate && {
...networks.solkol,
provider: () => new HDWalletProvider(PRIVATE_KEY, 'https://sokol.poa.network'),
},
// block explorer: https://blockscout.com/poa/core
xdai: canMigrate && {
...networks.xdai,
provider: () => new HDWalletProvider(PRIVATE_KEY, 'https://xdai.poanetwork.dev'),
},
},
// default mocha options
mocha: {
timeout: 200e3,
},
// configure your compilers
compilers: {
solc: {
version: '0.6.6', // Fetch exact version from solc-bin (default: truffle's version)
settings: {
// See the solidity docs for advice about optimization and evmVersion
optimizer: {
enabled: true,
runs: 200,
},
},
},
},
api_keys: {
etherscan: ETHERSCAN,
},
plugins: ['solidity-coverage', 'truffle-plugin-verify'],
}