-
Notifications
You must be signed in to change notification settings - Fork 2
/
truffle-config.js
120 lines (117 loc) · 3.18 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
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
require('dotenv').config();
const HDWalletProvider = require('@truffle/hdwallet-provider');
const ContractKit = require('@celo/contractkit')
const Web3 = require('web3');
const web3_alfajores = new Web3(process.env.ALFAJORES_REST_URL);
const web3_celo = new Web3(process.env.CELO_REST_URL);
const web3 = new Web3();
const mnemonicPhrase = process.env.MNEMONIC;
const privateKey = process.env.PRIVATEKEY;
const kit = ContractKit.newKitFromWeb3(web3_alfajores) // Change to Celo web3 for main net deployment
const account = web3_alfajores.eth.accounts.privateKeyToAccount(privateKey)
kit.connection.addAccount(account.privateKey);
module.exports = {
networks: {
development: {
host: '0.0.0.0', // Localhost (default: none)
port: 8545, // Standard Ethereum port (default: none)
network_id: '*', // Any network (default: none)
gas: 10000000,
},
coverage: {
host: '0.0.0.0',
network_id: '*',
port: 8545,
gas: 0xfffffffffff,
gasPrice: 0x01,
},
homestead: {
provider: () =>
new HDWalletProvider({
mnemonic: {
phrase: mnemonicPhrase
},
providerOrUrl: web3,
// numberOfAddresses: 1,
// shareNonce: true,
// derivationPath: "m/44'/1'/0'/0/"
derivationPath: "m/44'/60'/0'/0/"
}),
gas: 10000000,
gasPrice: web3.utils.toWei('46', 'gwei'),
network_id: 1,
},
kovan: {
provider: () =>
new HDWalletProvider({
mnemonic: {
phrase: mnemonicPhrase
},
providerOrUrl: ``,
}),
gas: 10000000,
gasPrice: web3.utils.toWei('46', 'gwei'),
network_id: 42,
},
sokol: {
provider: () =>
new HDWalletProvider({
mnemonic: {
phrase: mnemonicPhrase
},
providerOrUrl: ``,
}),
gas: 10000000,
gasPrice: 5000000000,
network_id: 77,
},
xdai: {
provider: () =>
new HDWalletProvider({
mnemonic: {
phrase: mnemonicPhrase
},
providerOrUrl: "https://dai.poa.network",
}),
gas: 5000000,
gasPrice: 10000000000,
network_id: 100,
networkCheckTimeout: 1000000000,
confirmations: 5,
timeoutBlocks: 900
},
catalyst: {
provider: () =>
new HDWalletProvider({
mnemonic: {
phrase: mnemonicPhrase
},
providerOrUrl: web3,
}),
gas: 12087782,
gasPrice: 1000000000,
network_id: 10000,
},
alfajores: {
provider: kit.connection.web3.currentProvider, // CeloProvider
network_id: 44787 // Alfajores Celo test netowrk network id
},
celo: {
provider: kit.connection.web3.currentProvider, // CeloProvider
network_id: 42220 // Alfajores Celo test netowrk network id
}
},
// Configure your compilers
compilers: {
solc: {
version: '^0.5.0',
settings: { // See the solidity docs for advice about optimization and evmVersion
optimizer: {
enabled: true,
runs: 100,
},
evmVersion: 'istanbul',
},
},
},
};