forked from safe-global/safe-modules
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathhardhat.config.ts
82 lines (76 loc) · 1.75 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
import '@nomicfoundation/hardhat-toolbox'
import '@nomicfoundation/hardhat-ethers'
import dotenv from 'dotenv'
import type { HardhatUserConfig } from 'hardhat/config'
import 'hardhat-deploy'
import { HttpNetworkUserConfig } from 'hardhat/types'
import './src/tasks/codesize'
import './src/tasks/deployContracts'
import './src/tasks/localVerify'
dotenv.config()
const { CUSTOM_NODE_URL, MNEMONIC, ETHERSCAN_API_KEY, PK } = process.env
const DEFAULT_MNEMONIC = 'candy maple cake sugar pudding cream honey rich smooth crumble sweet treat'
const sharedNetworkConfig: HttpNetworkUserConfig = {}
if (PK) {
sharedNetworkConfig.accounts = [PK]
} else {
sharedNetworkConfig.accounts = {
mnemonic: MNEMONIC || DEFAULT_MNEMONIC,
}
}
const customNetwork = CUSTOM_NODE_URL
? {
custom: {
...sharedNetworkConfig,
url: CUSTOM_NODE_URL,
},
}
: {}
const config: HardhatUserConfig = {
paths: {
artifacts: 'build/artifacts',
cache: 'build/cache',
deploy: 'src/deploy',
sources: 'contracts',
},
networks: {
localhost: {
url: 'http://localhost:8545',
tags: ['dev', 'entrypoint', 'safe'],
},
hardhat: {
tags: ['test', 'entrypoint', 'safe'],
},
sepolia: {
...sharedNetworkConfig,
url: 'https://rpc.ankr.com/eth_sepolia',
tags: ['dev'],
},
...customNetwork,
},
solidity: {
compilers: [
{
version: '0.8.24',
settings: {
optimizer: {
enabled: true,
runs: 10_000_000,
},
viaIR: false,
evmVersion: 'paris',
},
},
],
},
namedAccounts: {
deployer: 0,
},
etherscan: {
apiKey: ETHERSCAN_API_KEY,
},
sourcify: {
enabled: true,
},
}
export default config