forked from rarible/protocol-contracts
-
Notifications
You must be signed in to change notification settings - Fork 0
/
truffle-config.js
86 lines (75 loc) · 2.14 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
let hdWalletProvider
const setupWallet = (
address, url, key
) => {
var HDWalletProvider = require("@truffle/hdwallet-provider");
return new HDWalletProvider(key, url);
}
const os = require('os');
let apiKey;
try {
console.log(`Loading etherscan key from ${os.homedir() + "/.ethereum/etherscan.json"}`);
apiKey = require(os.homedir() + "/.ethereum/etherscan.json").apiKey;
console.log("loaded etherscan api key");
} catch {
console.log("unable to load etherscan key from config")
apiKey = "UNKNOWN"
}
function createNetwork(name) {
try {
var json = require(os.homedir() + "/.ethereum/" + name + ".json");
var gasPrice = json.gasPrice != null ? json.gasPrice : 2000000000;
return {
provider: () => createProvider(json.address, json.key, json.url),
from: json.address,
gas: 6000000,
gasPrice: gasPrice + "000000000",
network_id: json.network_id,
skipDryRun: true,
networkCheckTimeout: 500000
};
} catch (e) {
return null;
}
}
function createProvider(address, key, url) {
console.log("creating provider for address: " + address);
var HDWalletProvider = require("@truffle/hdwallet-provider");
return new HDWalletProvider(key, url);
}
module.exports = {
api_keys: {
etherscan: apiKey
},
plugins: [
'truffle-plugin-verify'
],
networks: {
e2e: createNetwork("e2e"),
ops: createNetwork("ops"),
ropsten: createNetwork("ropsten"),
mainnet: createNetwork("mainnet"),
rinkeby: createNetwork("rinkeby"),
rinkeby2: createNetwork("rinkeby2"),
polygon_mumbai: createNetwork("polygon_mumbai"),
aurora: {
provider: () => setupWallet('0x109E7E98DE7a6572948009f8733bbbd56f146fB1', 'https://testnet.aurora.dev/AiHEfCXeLBqodUosBPeddiTpJNfUHbRdx2aZEKMnsit1', '9d34444b91bf3bac70d7d89edad0c38295fd452078420255ff1f3631089d6af5'),
network_id: 0x4e454153,
gas: 10000000,
gasPrice: "0",
from: '0x109E7E98DE7a6572948009f8733bbbd56f146fB1'
}
},
compilers: {
solc: {
version: "0.7.6",
settings: {
optimizer: {
enabled : true,
runs: 200
},
evmVersion: "istanbul"
}
}
}
}