-
Notifications
You must be signed in to change notification settings - Fork 0
/
hardhat.config.ts
132 lines (124 loc) · 3.08 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
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
import { HardhatUserConfig } from "hardhat/config";
import "@nomicfoundation/hardhat-toolbox";
import "dotenv/config";
import "hardhat-deploy";
import "hardhat-deploy-ethers";
const PRIVATE_KEY =
process.env.PRIVATE_KEY ||
"";
// Polygon
const MUMBAI_RPC_URL =
process.env.MUMBAI_RPC_URL ||
"https://polygon-mumbai.g.alchemy.com/v2/your-api-key";
const POLYGONSCAN_API_KEY =
process.env.POLYGONSCAN_API_KEY ||
"";
// Ethereum
const SEPOLIA_RPC_URL =
process.env.SEPOLIA_RPC_URL ||
"https://eth-sepolia.g.alchemy.com/v2/your-api-key";
const ETHERSCAN_API_KEY =
process.env.ETHERSCAN_API_KEY ||
"";
// Etherlink testnet
const ETHERLINK_TESTNET_RPC_URL =
process.env.ETHERLINK_TESTNET_RPC_URL ||
"https://node.ghostnet.etherlink.com";
const ETHERLINK_API_KEY =
process.env.ETHERLINK_API_KEY ||
"";
// Arbitrum
const ARBITRUM_SEPOLIA_RPC_URL =
process.env.ARBITRUM_SEPOLIA_RPC_URL ||
"https://sepolia-rollup.arbitrum.io/rpc";
const ARBITRUM_SEPOLIA_API_KEY =
process.env.ARBITRUM_SEPOLIA_API_KEY ||
"";
// Binance Smart Chain
const BSC_TESTNET_URL =
process.env.BSC_TESTNET_URL ||
"https://bsc-testnet.publicnode.com";
const BSCSCAN_API_KEY =
process.env.BSCSCAN_API_KEY ||
"";
const config: HardhatUserConfig = {
solidity: {
version: '0.7.6',
settings: {
optimizer: {
enabled: true,
runs: 800,
},
metadata: {
// do not include the metadata hash, since this is machine dependent
// and we want all generated code to be deterministic
// https://docs.soliditylang.org/en/v0.7.6/metadata.html
bytecodeHash: 'none',
},
},
},
defaultNetwork: "hardhat",
networks: {
hardhat: {
chainId: 31337,
},
localhost: {
url: "http://127.0.0.1:8545/",
chainId: 31337
},
mumbai: {
chainId: 80001,
url: MUMBAI_RPC_URL,
accounts: [PRIVATE_KEY],
},
sepolia: {
chainId: 11155111,
url: SEPOLIA_RPC_URL,
accounts: [PRIVATE_KEY]
},
etherlinkTestnet: {
chainId: 128123,
url: ETHERLINK_TESTNET_RPC_URL,
accounts: [PRIVATE_KEY],
},
arbitrumSepolia: {
chainId: 421614,
url: ARBITRUM_SEPOLIA_RPC_URL,
accounts: [PRIVATE_KEY],
},
bscTestnet: {
chainId: 97,
url: BSC_TESTNET_URL,
accounts: [PRIVATE_KEY],
}
},
// hardhat-deploy named account system
namedAccounts: {
deployer: {
default: 0, // Deployer will be the first private key above
},
assistant: {
default: 1, // Assistant will be the second private key above
}
},
etherscan: {
apiKey: {
polygonMumbai: POLYGONSCAN_API_KEY,
sepolia: ETHERSCAN_API_KEY,
etherlinkTestnet: ETHERLINK_API_KEY,
arbitrumSepolia: ARBITRUM_SEPOLIA_API_KEY,
bscTestnet: BSCSCAN_API_KEY,
},
customChains: [
{
network: "etherlinkTestnet",
chainId: 128123,
urls: {
apiURL: "https://testnet-explorer.etherlink.com/api",
browserURL: "https://testnet-explorer.etherlink.com"
}
}
]
}
};
export default config;