-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathhardhat.config.ts
78 lines (75 loc) · 2.26 KB
/
hardhat.config.ts
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
import { HardhatUserConfig } from "hardhat/types";
import "@typechain/hardhat";
import "hardhat-gas-reporter";
import "hardhat-tracer";
import "@nomiclabs/hardhat-web3";
import "@nomiclabs/hardhat-etherscan";
import { task } from "hardhat/config";
import { bn18, networks } from "@defi.org/web3-candies";
task("deploy").setAction(async () => {
// initNetworkContracts();
// const owner = await askAddress("owner address 0x");
// const gasLimit = 2_000_000;
// console.log(await deploy("AaveLoop", [owner, asset.address, lendingPool.options.address, incentives.options.address], gasLimit, 0, true, 1));
});
const configFile = () => require("./.config.json");
export default {
solidity: {
version: "0.8.6",
settings: {
optimizer: {
enabled: true,
runs: 200,
},
},
},
defaultNetwork: "hardhat",
networks: {
hardhat: {
forking: {
blockNumber: process.env.BLOCK_NUMBER ? parseInt(process.env.BLOCK_NUMBER!) : undefined,
url: configFile()[`NODE_URL_${process.env.NETWORK?.toUpperCase() || "ETH"}`] as string,
},
blockGasLimit: 10e6,
accounts: {
accountsBalance: bn18("1,000,000").toString(),
},
},
eth: {
chainId: networks.eth.id,
url: configFile().NODE_URL_ETH,
},
poly: {
chainId: networks.poly.id,
url: configFile().NODE_URL_POLY,
},
avax: {
chainId: networks.avax.id,
url: configFile().NODE_URL_AVAX,
},
},
typechain: {
outDir: "typechain-hardhat",
target: "web3-v1",
},
mocha: {
timeout: 240_000,
retries: 0,
bail: true,
},
gasReporter: {
currency: "USD",
coinmarketcap: configFile().coinmarketcapKey,
token: process.env.NETWORK?.toLowerCase() == "avax" ? "AVAX" : process.env.NETWORK?.toLowerCase() == "poly" ? "MATIC" : undefined,
gasPriceApi:
process.env.NETWORK?.toLowerCase() == "avax"
? "https://api.snowtrace.io/api?module=proxy&action=eth_gasPrice"
: process.env.NETWORK?.toLowerCase() == "poly"
? "https://api.polygonscan.com/api?module=proxy&action=eth_gasPrice"
: undefined,
showTimeSpent: true,
},
etherscan: {
apiKey: configFile()[`ETHERSCAN_${process.env.NETWORK?.toUpperCase() || "ETH"}`],
},
} as HardhatUserConfig;