generated from pcaversaccio/hardhat-project-template-ts
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathhardhat.config.ts
155 lines (151 loc) · 4.12 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
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
import { HardhatUserConfig, vars } from "hardhat/config";
import "@nomicfoundation/hardhat-ethers";
import "@nomiclabs/hardhat-vyper";
import "@nomicfoundation/hardhat-verify";
import "@typechain/hardhat";
import "@matterlabs/hardhat-zksync-solc";
import "@matterlabs/hardhat-zksync-vyper";
import "@matterlabs/hardhat-zksync-deploy";
import "@matterlabs/hardhat-zksync-verify";
import "@matterlabs/hardhat-zksync-verify-vyper";
import "@matterlabs/hardhat-zksync-ethers";
const accounts = [
vars.get(
"PRIVATE_KEY",
// `keccak256("DEFAULT_VALUE")`
"0x0d1706281056b7de64efd2088195fa8224c39103f578c9b84f951721df3fa71c",
),
];
const config: HardhatUserConfig = {
paths: {
sources: "./contracts/vyper",
},
solidity: {
// Only use Solidity default versions `>=0.8.25` for EVM networks that support the new `cancun` opcodes:
// https://github.com/ethereum/execution-specs/blob/master/network-upgrades/mainnet-upgrades/cancun.md
// Only use Solidity default versions `>=0.8.20` for EVM networks that support the opcode `PUSH0`
// Otherwise, use the versions `<=0.8.19`
version: "0.8.28",
settings: {
optimizer: {
enabled: true,
runs: 999_999,
},
evmVersion: "paris", // prevent using the `PUSH0` and `cancun` opcodes
},
},
vyper: {
version: "0.4.0",
settings: {
evmVersion: "paris",
optimize: "gas",
},
},
zksolc: {
version: "1.5.11",
compilerSource: "binary",
settings: {
enableEraVMExtensions: false,
forceEVMLA: false,
optimizer: {
enabled: true,
mode: "3",
fallback_to_optimizing_for_size: false,
},
},
},
zkvyper: {
version: "1.5.9",
settings: {
libraries: {},
optimizer: {
mode: "3",
fallback_to_optimizing_for_size: false,
},
},
},
networks: {
hardhat: {
chainId: 31337,
hardfork: "cancun",
zksync: true,
},
zkSyncLocal: {
chainId: 270,
url: vars.get("ZKSYNC_LOCAL_TESTNET_URL", "http://localhost:3050"),
ethNetwork: "localhost",
zksync: true,
},
sepolia: {
chainId: 11155111,
url: vars.get("ETH_SEPOLIA_TESTNET_URL", "https://rpc.sepolia.org"),
accounts,
},
holesky: {
chainId: 17000,
url: vars.get(
"ETH_HOLESKY_TESTNET_URL",
"https://holesky.rpc.thirdweb.com",
),
accounts,
},
zkSyncTestnet: {
chainId: 300,
url: vars.get("ZKSYNC_TESTNET_URL", "https://sepolia.era.zksync.dev"),
ethNetwork: "sepolia",
zksync: true,
verifyURL:
"https://explorer.sepolia.era.zksync.dev/contract_verification",
browserVerifyURL: "https://sepolia.explorer.zksync.io",
enableVerifyURL: true,
accounts,
},
zkSyncMain: {
chainId: 324,
url: vars.get("ZKSYNC_MAINNET_URL", "https://mainnet.era.zksync.io"),
ethNetwork: "mainnet",
zksync: true,
verifyURL:
"https://zksync2-mainnet-explorer.zksync.io/contract_verification",
browserVerifyURL: "https://explorer.zksync.io",
enableVerifyURL: true,
accounts,
},
},
sourcify: {
// Disable Sourcify verification by default
enabled: false,
apiUrl: "https://sourcify.dev/server",
browserUrl: "https://repo.sourcify.dev",
},
etherscan: {
apiKey: {
// For Ethereum testnets & mainnet
mainnet: vars.get("ETHERSCAN_API_KEY", ""),
sepolia: vars.get("ETHERSCAN_API_KEY", ""),
holesky: vars.get("ETHERSCAN_API_KEY", ""),
// For ZKsync testnet & mainnet
zkSync: vars.get("ZKSYNC_API_KEY", ""),
zkSyncTestnet: vars.get("ZKSYNC_API_KEY", ""),
},
customChains: [
{
network: "zkSync",
chainId: 324,
urls: {
apiURL: "https://api-era.zksync.network/api",
browserURL: "https://era.zksync.network",
},
},
{
network: "zkSyncTestnet",
chainId: 300,
urls: {
apiURL: "https://api-sepolia-era.zksync.network/api",
browserURL: "https://sepolia-era.zksync.network",
},
},
],
},
};
export default config;