-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathbuidler.config.js
81 lines (73 loc) · 2.26 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
require("dotenv").config();
usePlugin("@nomiclabs/buidler-solhint");
usePlugin("@nomiclabs/buidler-web3")
usePlugin("@nomiclabs/buidler-truffle5");
usePlugin("@nomiclabs/buidler-etherscan");
require('./tasks')
function generateAddressesFromSeed(seed, count, balance) {
let bip39 = require("bip39");
let hdkey = require('ethereumjs-wallet/hdkey');
let hdwallet = hdkey.fromMasterSeed(bip39.mnemonicToSeed(seed));
let wallet_hdpath = "m/44'/60'/0'/0/";
let accounts = [];
for (let i = 0; i < count; i++) {
let wallet = hdwallet.derivePath(wallet_hdpath + i).getWallet();
let address = '0x' + wallet.getAddress().toString("hex");
let privateKey = '0x' + wallet.getPrivateKey().toString("hex");
accounts.push({balance, privateKey});
}
return accounts;
}
const testnetAccounts = generateAddressesFromSeed(process.env.TRUFFLE_MNEMONIC, 10, '100000000000000000000')
// const mainnetAccounts = generateAddressesFromSeed(process.env.MAINNET_MNEMONIC, 10, '100000000000000000000')
// const rinkebyAccounts = generateAddressesFromSeed(process.env.TESTNET_MNEMONIC, 2, '0')
module.exports = {
defaultNetwork: "buidlerevm",
networks: {
ethermint: {
chainId: 8,
url: "http://localhost:8545",
accounts: [process.env.ETHERMINT_KEY]
},
buidlerevm: {
accounts: testnetAccounts
},
develop: {
chainId: 1337,
url: "http://localhost:8545",
// gas: 6000000,
accounts: {mnemonic: process.env.TRUFFLE_MNEMONIC}
},
mainnet: {
url: "https://mainnet.infura.io/v3/" + process.env.INFURA_API_KEY,
chainId: 1,
// gas: 6000000,
accounts: {mnemonic: process.env.MAINNET_MNEMONIC},
gasPrice: 15000000000 // 15 GWEI
},
rinkeby: {
url: "https://rinkeby.infura.io/v3/" + process.env.INFURA_API_KEY,
chainId: 4,
// gas: 6000000,
accounts: {mnemonic: process.env.TESTNET_MNEMONIC},
gasPrice: 15000000000 // 15 GWEI
}
},
solc: {
version: "0.5.9",
optimizer: {
enabled: true,
runs: 10000
}
},
etherscan: {
apiKey: process.env.ETHERSCAN,
url: "https://api-rinkeby.etherscan.io/api"
},
paths: {
sources: "./contracts/v5",
tests: "./test",
cache: "./cache",
artifacts: "./build/contracts"
}
};