generated from yuichiroaoki/typescript-hardhat
-
Notifications
You must be signed in to change notification settings - Fork 175
/
Copy pathhardhat.config.ts
89 lines (84 loc) · 1.64 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
79
80
81
82
83
84
85
86
87
88
89
import { config as dotEnvConfig } from "dotenv";
dotEnvConfig();
import "@nomiclabs/hardhat-etherscan";
import "@nomiclabs/hardhat-waffle";
import "@nomiclabs/hardhat-ethers";
import "@typechain/hardhat";
import "@openzeppelin/hardhat-upgrades";
import "solidity-coverage";
import "./tasks/accounts";
import "./tasks/balance";
import "./tasks/block-number";
/**
* @type import('hardhat/config').HardhatUserConfig
* config for github actions only
*/
const configForTest = {
solidity: {
compilers: [
{
version: "0.8.4",
},
{
version: "0.6.12",
},
],
},
networks: {
hardhat: {
forking: {
url: process.env.JSON_RPC_URL,
},
},
},
mocha: {
timeout: 200000,
},
};
/**
* @type import('hardhat/config').HardhatUserConfig
*/
const configLocal = {
solidity: {
compilers: [
{
version: "0.8.4",
settings: {
optimizer: {
enabled: true,
runs: 200,
details: {
yul: false,
},
},
},
},
{
version: "0.6.12",
},
],
},
networks: {
hardhat: {
forking: {
// polygon
url: process.env.ALCHEMY_POLYGON_RPC_URL,
blockNumber: 28583600,
// bsc
// url: process.env.BSC_RPC_URL,
// blockNumber: 17988430,
},
},
polygon: {
url: process.env.ALCHEMY_POLYGON_RPC_URL,
accounts: [process.env.PRIVATE_KEY],
},
},
etherscan: {
apiKey: process.env.POLYSCAN_APIKEY,
},
mocha: {
timeout: 200000,
},
};
module.exports = process.env.CI ? configForTest : configLocal;