-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhardhat.config.cts
116 lines (108 loc) · 2.59 KB
/
hardhat.config.cts
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
// from @nomicfoundation/hardhat-toolbox-viem to avoid module issue
import '@nomicfoundation/hardhat-ignition-viem'
import '@nomicfoundation/hardhat-verify'
import '@nomicfoundation/hardhat-viem'
import 'hardhat-gas-reporter'
import 'solidity-coverage'
import './tasks/hardhat-deploy-viem.cjs'
import dotenv from 'dotenv'
import 'hardhat-abi-exporter'
import 'hardhat-contract-sizer'
import 'hardhat-deploy'
import { HardhatUserConfig } from 'hardhat/config'
// hardhat actions
import './tasks/esm_fix.cjs'
// Load environment variables from .env file. Suppress warnings using silent
// if this file is missing. dotenv will never modify any environment variables
// that have already been set.
// https://github.com/motdotla/dotenv
dotenv.config({ debug: false })
let real_accounts = undefined
if (process.env.DEPLOYER_KEY) {
real_accounts = [
process.env.DEPLOYER_KEY,
process.env.OWNER_KEY || process.env.DEPLOYER_KEY,
]
}
// circular dependency shared with actions
export const archivedDeploymentPath = './deployments/archive'
const config = {
defaultNetwork: "sepolia",
networks: {
hardhat: {
chainId: 1,
forking: {
enabled: true,
url: "https://mainnet.infura.io/v3/8b75f801668e4304bbfad6e8b82aaf0c"
},
accounts: { privateKey: process.env.PRIVATE_KEY, balance: "1000000000000000000000" }
},
sepolia: {
url: "https://sepolia.infura.io/v3/8b75f801668e4304bbfad6e8b82aaf0c",
chainId: 11155111,
accounts: [process.env.PRIVATE_KEY]
},
baseSepolia: {
url: "https://sepolia.base.org",
chainId: 84532,
accounts: [process.env.PRIVATE_KEY]
},
},
mocha: {},
solidity: {
compilers: [
{
version: '0.8.25',
settings: {
optimizer: {
enabled: true,
runs: 1200,
},
},
},
// for DummyOldResolver contract
{
version: '0.4.11',
settings: {
optimizer: {
enabled: true,
runs: 200,
},
},
},
],
},
abiExporter: {
path: './build/contracts',
runOnCompile: true,
clear: true,
flat: true,
except: [
'Controllable$',
'INameWrapper$',
'SHA1$',
'Ownable$',
'NameResolver$',
'TestBytesUtils$',
'legacy/*',
],
spacing: 2,
pretty: true,
},
namedAccounts: {
deployer: {
default: 0,
},
owner: {
default: 0
},
},
external: {
contracts: [
{
artifacts: [archivedDeploymentPath],
},
],
},
} satisfies HardhatUserConfig
export default config