-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathhardhat.config.ts
More file actions
110 lines (101 loc) · 3.5 KB
/
hardhat.config.ts
File metadata and controls
110 lines (101 loc) · 3.5 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
import 'dotenv/config'
import 'hardhat-deploy'
import 'hardhat-contract-sizer'
import '@nomiclabs/hardhat-ethers'
import '@layerzerolabs/toolbox-hardhat'
import '@typechain/hardhat'
import '@openzeppelin/hardhat-upgrades'
import '@nomicfoundation/hardhat-verify'
import '@rumblefishdev/hardhat-kms-signer'
import { HardhatUserConfig, HttpNetworkAccountsUserConfig } from 'hardhat/types'
import { EndpointId } from '@layerzerolabs/lz-definitions'
/** @dev Uncomment below to use standard authentication method */
// // Set your preferred authentication method
// //
// // If you prefer using a mnemonic, set a MNEMONIC environment variable
// // to a valid mnemonic
const MNEMONIC = process.env.MNEMONIC
// If you prefer to be authenticated using a private key, set a PRIVATE_KEY environment variable
const PRIVATE_KEY = process.env.PRIVATE_KEY
const accounts: HttpNetworkAccountsUserConfig | undefined = MNEMONIC
? { mnemonic: MNEMONIC }
: PRIVATE_KEY
? [PRIVATE_KEY]
: undefined
if (accounts == null) {
console.warn(
'Could not find MNEMONIC or PRIVATE_KEY environment variables. It will not be possible to execute transactions in your example.'
)
}
const config: HardhatUserConfig = {
paths: {
cache: 'cache/hardhat',
},
solidity: {
compilers: [
{
version: '0.8.22',
settings: {
optimizer: {
enabled: true,
runs: 200,
},
},
},
],
},
networks: {
/** @dev If using 'KMS_KEY_ID' for safety remove/comment 'PRIVATE_KEY' variable from .env file */
mainnet: {
eid: EndpointId.ETHEREUM_MAINNET,
url: process.env.MAINNET_RPC_URL || '',
kmsKeyId: process.env.KMS_KEY_ID,
},
// 'sepolia-testnet': {
// eid: EndpointId.SEPOLIA_V2_TESTNET,
// url: process.env.SEPOLIA_RPC_URL || 'https://1rpc.io/sepolia',
// kmsKeyId: process.env.KMS_KEY_ID,
// },
// 'base-sepolia-testnet': {
// eid: EndpointId.BASESEP_V2_TESTNET,
// url: process.env.BASE_SEPOLIA_RPC_URL || 'https://sepolia.base.org',
// accounts,
// },
// 'optimism-testnet': {
// eid: EndpointId.OPTSEP_V2_TESTNET,
// url: process.env.RPC_URL_OP_SEPOLIA || 'https://optimism-sepolia.gateway.tenderly.co',
// accounts,
// },
// 'avalanche-testnet': {
// eid: EndpointId.AVALANCHE_V2_TESTNET,
// url: process.env.RPC_URL_FUJI || 'https://avalanche-fuji.drpc.org',
// accounts,
// },
// 'arbitrum-testnet': {
// eid: EndpointId.ARBSEP_V2_TESTNET,
// url: process.env.RPC_URL_ARB_SEPOLIA || 'https://arbitrum-sepolia.gateway.tenderly.co',
// accounts,
// },
hardhat: {
// Need this for testing because TestHelperOz5.sol is exceeding the compiled contract size limit
allowUnlimitedContractSize: true,
},
},
typechain: {
outDir: 'typechain',
target: 'ethers-v5',
},
etherscan: {
apiKey: process.env.ETHERSCAN_API_KEY,
},
sourcify: {
// Disabled by default -> Doesn't need an API key
enabled: true,
},
namedAccounts: {
deployer: {
default: 0, // wallet address of index[0], of the mnemonic in .env
},
},
}
export default config