-
Notifications
You must be signed in to change notification settings - Fork 524
/
hardhat.config.js
148 lines (138 loc) · 3.49 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
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
require("@nomiclabs/hardhat-waffle")
require("@nomiclabs/hardhat-etherscan")
require("hardhat-contract-sizer")
require('@typechain/hardhat')
const {
BSC_URL,
BSC_DEPLOY_KEY,
BSCSCAN_API_KEY,
POLYGONSCAN_API_KEY,
SNOWTRACE_API_KEY,
ARBISCAN_API_KEY,
ETHERSCAN_API_KEY,
BSC_TESTNET_URL,
BSC_TESTNET_DEPLOY_KEY,
ARBITRUM_TESTNET_DEPLOY_KEY,
ARBITRUM_TESTNET_URL,
ARBITRUM_DEPLOY_KEY,
ARBITRUM_URL,
AVAX_DEPLOY_KEY,
AVAX_URL,
POLYGON_DEPLOY_KEY,
POLYGON_URL,
MAINNET_URL,
MAINNET_DEPLOY_KEY
} = require("./env.json")
const getEnvAccounts = (DEFAULT_DEPLOYER_KEY) => {
return [DEFAULT_DEPLOYER_KEY];
};
// This is a sample Hardhat task. To learn how to create your own go to
// https://hardhat.org/guides/create-task.html
task("accounts", "Prints the list of accounts", async () => {
const accounts = await ethers.getSigners()
for (const account of accounts) {
console.info(account.address)
}
})
task("balance", "Prints an account's balance")
.addParam("account", "The account's address")
.setAction(async (taskArgs) => {
const balance = await ethers.provider.getBalance(taskArgs.account);
console.log(ethers.utils.formatEther(balance), "ETH");
});
task("processFees", "Processes fees")
.addParam("steps", "The steps to run")
.setAction(async (taskArgs) => {
const { processFees } = require("./scripts/core/processFees")
await processFees(taskArgs)
})
task("distributeFees", "Distribute fees")
.addParam("steps", "The steps to run")
.setAction(async (taskArgs) => {
const { distributeFees } = require("./scripts/fees/distributeFees")
await distributeFees(taskArgs)
})
// You need to export an object to set up your config
// Go to https://hardhat.org/config/ to learn more
/**
* @type import('hardhat/config').HardhatUserConfig
*/
module.exports = {
networks: {
localhost: {
timeout: 120000
},
hardhat: {
allowUnlimitedContractSize: true
},
bsc: {
url: BSC_URL,
chainId: 56,
gasPrice: 10000000000,
accounts: getEnvAccounts(BSC_DEPLOY_KEY)
},
testnet: {
url: BSC_TESTNET_URL,
chainId: 97,
gasPrice: 20000000000,
accounts: getEnvAccounts(BSC_TESTNET_DEPLOY_KEY)
},
arbitrumTestnet: {
url: ARBITRUM_TESTNET_URL,
gasPrice: 10000000000,
chainId: 421611,
accounts: getEnvAccounts(ARBITRUM_TESTNET_DEPLOY_KEY)
},
arbitrum: {
url: ARBITRUM_URL,
gasPrice: 30000000000,
chainId: 42161,
accounts: getEnvAccounts(ARBITRUM_DEPLOY_KEY)
},
base: {
url: "https://base.llamarpc.com",
gasPrice: 30000000000,
chainId: 8453,
accounts: getEnvAccounts(ARBITRUM_DEPLOY_KEY)
},
avax: {
url: AVAX_URL,
gasPrice: 100000000000,
chainId: 43114,
accounts: getEnvAccounts(AVAX_DEPLOY_KEY)
},
polygon: {
url: POLYGON_URL,
gasPrice: 100000000000,
chainId: 137,
accounts: getEnvAccounts(POLYGON_DEPLOY_KEY)
},
mainnet: {
url: MAINNET_URL,
gasPrice: 50000000000,
accounts: getEnvAccounts(MAINNET_DEPLOY_KEY)
}
},
etherscan: {
apiKey: {
mainnet: ETHERSCAN_API_KEY,
arbitrumOne: ARBISCAN_API_KEY,
avalanche: SNOWTRACE_API_KEY,
bsc: BSCSCAN_API_KEY,
polygon: POLYGONSCAN_API_KEY,
}
},
solidity: {
version: "0.6.12",
settings: {
optimizer: {
enabled: true,
runs: 10
}
}
},
typechain: {
outDir: "typechain",
target: "ethers-v5",
},
}