-
Notifications
You must be signed in to change notification settings - Fork 2
/
hardhat.config.ts
64 lines (58 loc) · 1.59 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
import "hardhat-gas-reporter"
import "solidity-coverage";
import "@nomicfoundation/hardhat-toolbox"
import { config as dotenvConfig } from "dotenv"
import { HardhatUserConfig } from "hardhat/config"
import { NetworksUserConfig } from "hardhat/types"
import { resolve } from "path"
import { config } from "./package.json"
dotenvConfig({ path: resolve(__dirname, "./.env") })
function getNetworks(): NetworksUserConfig {
if (!process.env.ALCHEMEY_KEY)
throw new Error(
`ALCHEMEY_KEY env var not set. Copy .env.template to .env and set the env var`
)
const alchemyApiKey = process.env.ALCHEMEY_KEY;
const accounts = process.env.MNEMONIC ? { mnemonic: process.env.MNEMONIC } : [];
return {
hardhat: {
accounts: accounts,
forking: {
url: `https://arb-mainnet.g.alchemy.com/v2/${alchemyApiKey}`,
// blockNumber: 82350734, // <-- edit here
},
},
mainnet: {
url: `https://arb-mainnet.g.alchemy.com/v2/${alchemyApiKey}`,
accounts: accounts,
},
}
}
const hardhatConfig: HardhatUserConfig = {
solidity: config.solidity,
paths: {
sources: config.paths.contracts,
tests: config.paths.tests,
cache: config.paths.cache,
artifacts: config.paths.build.contracts,
},
networks: {
...getNetworks(),
},
typechain: {
outDir: config.paths.build.typechain,
target: "ethers-v5",
},
etherscan: {
apiKey: {
arbitrumOne: `${process.env.ARBISCAN_API_KEY}`
},
},
gasReporter: {
enabled: (process.env.REPORT_GAS) ? true : false
},
mocha: {
timeout: 1200 * 1e3,
},
}
export default hardhatConfig