-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathhardhat.config.ts
More file actions
111 lines (105 loc) · 3.12 KB
/
Copy pathhardhat.config.ts
File metadata and controls
111 lines (105 loc) · 3.12 KB
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
import { HardhatUserConfig } from "hardhat/config";
import "@nomicfoundation/hardhat-toolbox";
import "@nomicfoundation/hardhat-verify";
import dotenv from "dotenv"
dotenv.config()
/** Bump estimated gas price / EIP-1559 fees by 30% on COTI networks (see hardhat/gasPriceBump.ts). */
import "./hardhat/gasPriceBump"
/** Prefer native solc on linux-arm64 (wasm viaIR often OOMs in this environment). */
import "./hardhat/preferNativeSolc"
const accounts = process.env.PRIVATE_KEY
? [process.env.PRIVATE_KEY]
: process.env.SIGNING_KEYS
? process.env.SIGNING_KEYS.split(",").map((k) => k.trim()).filter(Boolean)
: [];
const coverageRun = process.argv.includes("coverage");
const config: HardhatUserConfig = {
defaultNetwork: "coti-testnet",
// Pinned compiler versions for reproducible bytecode; bump only alongside contract pragma / CI review.
solidity: {
compilers: [
{
version: "0.8.28",
settings: {
// COTI rejects Shanghai PUSH0; keep Paris for deployability.
evmVersion: "paris",
viaIR: true,
optimizer: {
enabled: true,
// Prefer create-size headroom under the 24_576-byte Spurious Dragon limit (higher runs → larger code).
runs: 1,
},
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',
},
}
},
{
// Exact-pragma legacy contracts (e.g. disperse).
version: "0.8.20",
settings: {
evmVersion: "paris",
viaIR: true,
optimizer: {
enabled: true,
runs: 1,
},
metadata: {
bytecodeHash: 'none',
},
}
},
]
},
networks: {
hardhat: {
// Coverage instrumentation inflates PrivacyPortal / PodERC20 past EIP-170
// (24_576) and EIP-3860 initcode (49_152). Production size is gated by
// `npm run check:bytecode-size`, not Hardhat deploy.
allowUnlimitedContractSize: coverageRun,
// Coverage instrumentation inflates gas estimates for portal / pERC20.
blockGasLimit: 60_000_000,
},
"coti-testnet": {
url: "https://testnet.coti.io/rpc",
chainId: 7082400,
accounts,
},
"coti-mainnet": {
url: "https://mainnet.coti.io/rpc",
chainId: 2632500,
accounts,
},
},
etherscan: {
apiKey: {
"coti-testnet": "placeholder",
"coti-mainnet": "placeholder",
},
customChains: [
{
network: "coti-testnet",
chainId: 7082400,
urls: {
apiURL: "https://testnet.cotiscan.io/api",
browserURL: "https://testnet.cotiscan.io/",
},
},
{
network: "coti-mainnet",
chainId: 2632500,
urls: {
apiURL: "https://mainnet.cotiscan.io/api",
browserURL: "https://mainnet.cotiscan.io/",
},
},
],
},
mocha: {
timeout: 100000000
},
}
export default config;