-
Notifications
You must be signed in to change notification settings - Fork 5
/
buidler.config.js
106 lines (101 loc) · 2.94 KB
/
buidler.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
106
const path = require('path');
const url = require('url');
require('dotenv').config();
require('@nomiclabs/buidler/config');
const { InfuraProvider } = require('@ethersproject/providers');
const { fromPrivateKey } = require('ethereumjs-wallet');
const { randomBytes } = require('crypto');
const { usePlugin } = require('@nomiclabs/buidler/config');
usePlugin('@nomiclabs/buidler-waffle');
usePlugin('@nomiclabs/buidler-etherscan');
usePlugin('buidler-ethers-v5');
usePlugin('buidler-deploy');
usePlugin('solidity-coverage');
const keys = {
mainnet: fromPrivateKey(
process.env.MAINNET_PVT_KEY
? Buffer.from(process.env.MAINNET_PVT_KEY.slice(2), 'hex')
: randomBytes(32)).getPrivateKeyString(),
rinkeby: fromPrivateKey(
process.env.RINKEBY_PVT_KEY
? Buffer.from(process.env.RINKEBY_PVT_KEY.slice(2), 'hex')
: randomBytes(32)).getPrivateKeyString()
};
module.exports = {
etherscan: {
url: "https://api.etherscan.io/api",
apiKey: process.env.ETHERSCAN_API_KEY,
},
namedAccounts: {
deployer: {
default: 0
},
},
external: {
artifacts: [
'node_modules/@uniswap/v2-core/build',
'node_modules/@uniswap/v2-periphery/build',
'node_modules/@uniswap/lib/build',
'node_modules/@indexed-finance/indexed-core/artifacts',
"node_modules/@indexed-finance/proxies/artifacts",
"node_modules/@indexed-finance/uniswap-v2-oracle/artifacts"
],
deployments: {
rinkeby: [
"node_modules/@indexed-finance/indexed-core/deployments/rinkeby",
"node_modules/@indexed-finance/proxies/deployments/rinkeby",
"node_modules/@indexed-finance/uniswap-deployments/rinkeby"
],
mainnet: [
"node_modules/@indexed-finance/indexed-core/deployments/mainnet",
"node_modules/@indexed-finance/proxies/deployments/mainnet",
"node_modules/@indexed-finance/uniswap-deployments/mainnet"
]
}
},
networks: {
buidlerevm: {
live: false,
saveDeployment: false
},
local: {
url: url.format({
protocol: 'http:',
port: 8545,
hostname: 'localhost',
}),
},
mainnet: {
url: new InfuraProvider('mainnet', process.env.INFURA_PROJECT_ID).connection.url,
accounts: [keys.rinkeby],
chainId: 1
},
rinkeby: {
url: new InfuraProvider('rinkeby', process.env.INFURA_PROJECT_ID).connection.url,
accounts: [keys.rinkeby],
chainId: 4
},
coverage: {
url: url.format({
protocol: 'http:',
port: 8555,
hostname: 'localhost',
}),
}
},
paths: {
sources: path.join(__dirname, 'contracts'),
tests: path.join(__dirname, 'test'),
cache: path.join(__dirname, 'cache'),
artifacts: path.join(__dirname, 'artifacts'),
deploy: path.join(__dirname, 'deploy'),
deployments: path.join(__dirname, 'deployments')
},
solc: {
version: '0.6.12',
optimizer: {
enabled: true,
runs: 200
}
},
};