-
Notifications
You must be signed in to change notification settings - Fork 0
/
hardhat.config.ts
67 lines (63 loc) · 1.67 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
import dotenv from 'dotenv'
import '@openzeppelin/hardhat-upgrades'
import { HardhatUserConfig } from 'hardhat/config'
import '@nomicfoundation/hardhat-verify'
import '@nomiclabs/hardhat-ethers'
import '@typechain/hardhat'
import 'hardhat-abi-exporter'
import 'hardhat-deploy'
import { CHAIN_IDS, CHAIN_NAMES, KNOWN_NETWORK } from './config/constants'
dotenv.config()
const config: HardhatUserConfig = {
solidity: {
version: '0.8.18',
settings: {
viaIR: true,
optimizer: {
enabled: true,
runs: 200,
},
},
},
typechain: {
outDir: './src/typechain',
target: 'ethers-v5',
},
defaultNetwork: KNOWN_NETWORK.POLYGON_MUMBAI,
networks: {
[KNOWN_NETWORK.POLYGON_MUMBAI]: {
url: `https://polygon-mumbai.g.alchemy.com/v2/${process.env.POLYGON_MUMBAI_ALCHEMY_API_KEY}`,
accounts: [`${process.env.DEPLOYER_PRIVATE_KEY}`],
chainId: CHAIN_IDS[CHAIN_NAMES.POLYGON_MUMBAI],
throwOnCallFailures: true,
saveDeployments: true,
},
},
paths: {
cache: 'cache',
sources: 'contracts',
artifacts: 'artifacts',
tests: 'test',
deploy: 'deploy',
deployments: 'deployments',
},
etherscan: {
apiKey: {
polygonMumbai: process.env.POLYGONSCAN_API_KEY ?? '',
},
},
namedAccounts: {
deployer: {
default: 0,
},
},
abiExporter: {
path: './src/abi',
runOnCompile: true,
clear: true,
flat: true,
spacing: 2,
format: 'json',
},
}
export default config