-
Notifications
You must be signed in to change notification settings - Fork 0
/
truffle-config.ovm.js
100 lines (89 loc) · 2.82 KB
/
truffle-config.ovm.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
// create a file at the root of your project and name it .env -- there you can set process variables
// like the mnemomic below. Note: .env is ignored by git in this project to keep your private information safe
require('dotenv').config();
const ganacheMnemonic = process.env.GANACHE_MNEMONIC;
const mnemonic = 'test test test test test test test test test test test junk'; // process.env["MNEMONIC"];
// Hard-coded secrets
const kovanMnemonic = process.env.KOVAN_MNEMONIC;
const infuraKey = process.env.INFURA_KEY;
// uncomment to use mainnetMnemonic, be sure to set it in the .env file
const mainnetMnemonic = process.env.MAINNET_MNEMONIC;
const { ganache } = require('@eth-optimism/plugins/ganache');
const HDWalletProvider = require('@truffle/hdwallet-provider');
module.exports = {
/**
* contracts_build_directory tells Truffle where to store compiled contracts
*/
contracts_build_directory: './build/optimism-contracts',
/**
* contracts_directory tells Truffle where to find your contracts
*/
contracts_directory: './contracts',
test_directory: './test',
networks: {
development: {
url: 'http://127.0.0.1:7545',
network_id: '*'
},
ganache: {
network_id: 108,
networkCheckTimeout: 100000,
provider: () => (
ganache.provider({
mnemonic: ganacheMnemonic,
network_id: 108,
default_balance_ether: 100
})
)
},
// for use with local environment -- see README and list of available
// scripts in package.json for steps to get this running on your local machine
optimistic_ethereum: {
network_id: 420,
gas: 15000000,
provider: () => (
new HDWalletProvider({
mnemonic: {
phrase: mnemonic
},
providerOrUrl: 'http://127.0.0.1:8545/',
addressIndex: 0,
numberOfAddresses: 1,
chainId: 420
})
)
},
optimistic_kovan: {
network_id: 69,
chain_id: 69,
gas: 0,
gasPrice: 15000000,
provider: () => (new HDWalletProvider(kovanMnemonic, `https://optimism-kovan.infura.io/v3/${infuraKey}`, 1, 5))
// Error: while migrating SimpleStorage: fee too low: 15000000000000, use at least tx.gasLimit = 3300000 and tx.gasPrice = 15000000
},
// requires a mainnet mnemonic; you can save this in .env or in whatever secure location
// you wish to use
optimistic_mainnet: {
network_id: 10,
chain_id: 10,
provider: () => (new HDWalletProvider(mainnetMnemonic, `https://optimism-mainnet.infura.io/v3/${infuraKey}`, 1, 1))
}
},
mocha: {
timeout: 100000
},
compilers: {
solc: {
version: 'node_modules/@eth-optimism/solc',
settings: {
optimizer: {
enabled: true,
runs: 800
}
}
}
},
db: {
enabled: false
}
};