-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathhardhat.config.js
More file actions
109 lines (106 loc) · 2.43 KB
/
Copy pathhardhat.config.js
File metadata and controls
109 lines (106 loc) · 2.43 KB
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
const fs = require('fs');
require("@nomicfoundation/hardhat-toolbox");
require("@onmychain/hardhat-uniswap-v2-deploy-plugin");
// Any file that has require('dotenv').config() statement
// will automatically load any variables in the root's .env file.
require('dotenv').config();
const PRIVATE_KEY = process.env.PRIVATE_KEY
const etherscanKey = process.env.BSSCAN_KEY
const infraKey = process.env.INFRA_KEY
function getRemappings() {
return fs
.readFileSync('remappings.txt', 'utf8')
.split('\n')
.filter(Boolean)
.map((line) => line.trim().split('='));
}
module.exports = {
defaultNetwork: "hardhat",
networks: {
mainnet: {
url: `https://mainnet.infura.io/v3/${infraKey}`,
accounts: [PRIVATE_KEY],
//gasPrice: 120 * 1000000000,
chainId: 1,
},
bsc: {
url: "https://bsc-dataseed.binance.org/",
accounts: [PRIVATE_KEY],
// gasPrice: 20000000000,
gas: 6000000,
},
hardhat: {
allowUnlimitedContractSize: true,
chainId: 31337,
gasPrice: 20000000000,
gas: 6000000,
},
goerli: {
url: `https://goerli.infura.io/v3/${infraKey}`,
accounts: [PRIVATE_KEY],
// gas: 2100000,
// gasPrice: 8000000000
},
localhost: {
live: false,
saveDeployments: true,
tags: ["local"],
},
},
solidity: {
compilers: [
{
version: "0.8.17",
settings: {
optimizer: {
enabled: true,
runs: 2000000,
},
viaIR: true
},
},
{
version: "0.8.0",
settings: {
optimizer: {
enabled: true,
runs: 2000000,
details: {
yul: true,
yulDetails: {
stackAllocation: true,
optimizerSteps: "dhfoDgvulfnTUtnIf"
}
}
},
viaIR: true
},
},]
},
paths: {
sources: "./contracts",
tests: "./test",
cache: "./cache",
artifacts: "./artifacts"
},
mocha: {
timeout: 400000000
},
etherscan: {
apiKey: etherscanKey,
},
preprocess: {
eachLine: (hre) => ({
transform: (line) => {
if (line.match(/^\s*import /i)) {
getRemappings().forEach(([find, replace]) => {
if (line.match(find)) {
line = line.replace(find, replace);
}
});
}
return line;
},
}),
},
}