-
Notifications
You must be signed in to change notification settings - Fork 0
/
hardhat.config.ts
86 lines (82 loc) · 2.43 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
import dotenv from "dotenv";
import { HardhatUserConfig } from "hardhat/config";
import "@nomicfoundation/hardhat-toolbox";
import '@openzeppelin/hardhat-upgrades';
dotenv.config()
const INFURA_API_KEY = process.env.INFURA_API_KEY || 'INFURA_API_KEY'
const ALCHEMY_API_KEY = process.env.ALCHEMY_API_KEY || 'ALCHEMY_API_KEY'
const PRIVATE_KEY = process.env.PRIVATE_KEY
const MNEMONIC = process.env.MNEMONIC
const POLYGONSCAN_KEY = process.env.POLYGONSCAN_API_KEY || ''
const solidityVersions = ["0.6.0", "0.6.2", "0.6.6", "0.8.18", "0.8.20"]
const compilers = solidityVersions.map((version) => ({
version,
settings: {
optimizer: {
enabled: true,
runs: 200
}
}
}))
const config: HardhatUserConfig = {
defaultNetwork: 'hardhat',
networks: {
hardhat: {
chainId: 1337,
allowUnlimitedContractSize: true
},
goerli: {
url: `https://goerli.infura.io/v3/${INFURA_API_KEY}`,
...(PRIVATE_KEY ? { accounts: [`${PRIVATE_KEY}`] } : {})
},
polygon: {
url: `https://polygon-mainnet.g.alchemy.com/v2/${ALCHEMY_API_KEY}`,
...(PRIVATE_KEY ? { accounts: [`${PRIVATE_KEY}`] } : {})
},
polygon_infura: {
url: `https://polygon-mainnet.infura.io/v3/${INFURA_API_KEY}`,
...(PRIVATE_KEY ? { accounts: [`${PRIVATE_KEY}`] } : {})
},
mumbai: {
url: `https://polygon-mumbai.g.alchemy.com/v2/${ALCHEMY_API_KEY}`,
...(PRIVATE_KEY ? { accounts: [`${PRIVATE_KEY}`] } : {})
},
amoy: {
url: `https://polygon-amoy.g.alchemy.com/v2/${ALCHEMY_API_KEY}`,
...(PRIVATE_KEY ? { accounts: [`${PRIVATE_KEY}`] } : {})
},
sepolia: {
url: `https://sepolia.infura.io/v3/${INFURA_API_KEY}`,
...(PRIVATE_KEY ? { accounts: [`${PRIVATE_KEY}`] } : {})
},
bsc_testnet: {
url: "https://data-seed-prebsc-1-s1.bnbchain.org:8545",
chainId: 97,
gasPrice: 20000000000,
accounts: {mnemonic: `${MNEMONIC}`}
},
opbnb_testnet: {
url: "https://opbnb-testnet-rpc.bnbchain.org/",
chainId: 5611,
gasPrice: 20000000000,
...(PRIVATE_KEY ? { accounts: [`${PRIVATE_KEY}`] } : {})
}
},
solidity: {
compilers
},
paths: {
sources: './contracts',
tests: './test',
cache: './cache',
artifacts: './artifacts'
},
etherscan: {
// your API Key from PolygonScan
// Obtain one at https://polygonscan.com/
apiKey: {
polygon: POLYGONSCAN_KEY
}
}
}
export default config