-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhardhat.config.js
105 lines (102 loc) · 2.56 KB
/
hardhat.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
require('dotenv/config');
require('@nomiclabs/hardhat-ethers');
require('@nomiclabs/hardhat-truffle5');
require('@nomiclabs/hardhat-waffle');
require('solidity-coverage');
require('hardhat-deploy');
require('hardhat-gas-reporter');
require('hardhat-abi-exporter');
require('@ubeswap/hardhat-celo');
require('hardhat-spdx-license-identifier');
require('hardhat-watcher');
const { fornoURLs, ICeloNetwork } = require('@ubeswap/hardhat-celo');
const { removeConsoleLog } = require('hardhat-preprocessor');
const {task} = require('hardhat/config');
const {deploy} = require('./scripts/deploy.js');
task(
"deploy",
"Deploys a contract",
async (...args) => {
return await deploy(...args);
});
const accounts = {
mnemonic:
process.env.MNEMONIC ||
'test test test test test test test test test test test junk',
path: 'm/44\'/52752\'/0\'/0/',
};
module.exports = {
abiExporter: {
path: './ui/src/abis/margin',
// clear: true,
flat: true,
// only: [],
// except: []
},
defaultNetwork: 'hardhat',
gasReporter: {
enable: true,
currency: 'USD',
},
networks: {
mainnet: {
url: fornoURLs[ICeloNetwork.MAINNET],
accounts,
chainId: ICeloNetwork.MAINNET,
live: true,
gasPrice: 0.5 * 10 ** 9,
gas: 8000000,
},
alfajores: {
url: fornoURLs[ICeloNetwork.ALFAJORES],
accounts,
chainId: ICeloNetwork.ALFAJORES,
live: true,
gasPrice: 0.5 * 10 ** 9,
gas: 8000000,
},
hardhat: {
chainId: 31337,
accounts,
},
},
paths: {
cache: './cache',
tests: './test',
sources: './contracts',
artifacts: './artifacts',
},
preprocess: {
eachLine: removeConsoleLog(
(bre) =>
bre.network.name !== 'hardhat' && bre.network.name !== 'localhost',
),
},
solidity: {
compilers: [
{
version: '0.8.4',
settings: {
optimizer: {
enabled: true,
runs: 5000,
},
},
},
],
},
spdxLicenseIdentifier: {
overwrite: false,
runOnCompile: true,
},
watcher: {
compile: {
tasks: ['compile'],
files: ['./contracts'],
verbose: true,
},
},
mocha: {
timeout: 200000,
},
};