-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathhardhat.config.ts
59 lines (53 loc) · 1.63 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
import '@nomicfoundation/hardhat-foundry'
import '@nomicfoundation/hardhat-toolbox'
import * as tdly from '@tenderly/hardhat-tenderly'
import { config as dotenvConfig } from 'dotenv'
import { statSync } from 'fs'
import { type HardhatUserConfig, type NetworkUserConfig } from 'hardhat/types'
import { accountsPrivates } from './scripts/address-list'
dotenvConfig({ path: '.env.hardhat' })
if (!statSync('.env.hardhat').isFile()) {
console.warn('No .env.hardhat file found, required to use tenderly')
console.warn('Please check .env.hardhat.example for an example')
}
const { TENDERLY_URL, TENDERLY_CHAINID, TENDERLY_USER, TENDERLY_PROJECT, TENDERLY_ACCESS_KEY } = process.env
const tenderlyNetwork = {} as NetworkUserConfig & { url?: string }
if (TENDERLY_URL != null && TENDERLY_CHAINID != null && TENDERLY_URL.length > 10) {
tenderlyNetwork.url = TENDERLY_URL
tenderlyNetwork.accounts = accountsPrivates
tenderlyNetwork.chainId = parseFloat(TENDERLY_CHAINID)
}
tdly.setup({ automaticVerifications: true })
const config: HardhatUserConfig = {
solidity: {
version: '0.8.18',
settings: {
optimizer: {
enabled: true,
runs: 200,
},
outputSelection: {
'*': {
'*': ['abi'],
},
},
},
},
defaultNetwork: 'tenderly',
networks: {
// hardhat: {
// chainId: 1337,
// forking: {
// url: 'https://arb1.arbitrum.io/rpc',
// },
// },
tenderly: tenderlyNetwork,
},
tenderly: {
username: TENDERLY_USER!,
accessKey: TENDERLY_ACCESS_KEY!,
project: TENDERLY_PROJECT!,
privateVerification: false,
},
}
export default config