-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhardhat.config.ts
71 lines (63 loc) · 1.77 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
import { HardhatUserConfig } from "hardhat/config";
import "@nomicfoundation/hardhat-toolbox";
import { NetworksUserConfig } from "hardhat/types";
import { config as dotenvConfig } from 'dotenv';
import { resolve } from 'path';
dotenvConfig({ path: resolve(__dirname, './.env') });
function getNetworks(): NetworksUserConfig {
if (process.env.ALCHEMY_API_KEY && process.env.PRIVATE_KEY) {
const accounts = [`0x${process.env.PRIVATE_KEY}`]
return {
goerli: {
url: `https://eth-goerli.g.alchemy.com/v2/${process.env.ALCHEMY_API_KEY}`,
chainId: 5,
accounts
},
arbitrum: {
url: "https://arb1.arbitrum.io/rpc",
chainId: 42161,
accounts
},
polygon: {
url: `https://polygon-mumbai.g.alchemy.com/v2/${process.env.ALCHEMY_API_KEY}`,
chainId: 80001,
accounts
},
gnosis: {
url: "https://rpc.gnosischain.com",
accounts: accounts,
},
linea: {
url: "https://rpc.goerli.linea.build",
accounts: accounts,
},
base: {
url: 'https://goerli.base.org',
accounts: accounts,
},
optimism: {
url: `${process.env.OPRIMISM_GOERLI_RPC}`,
accounts: accounts,
},
}
}
return {}
}
const config: HardhatUserConfig = {
solidity: {
compilers: [{
version: '0.8.21',
settings: {
optimizer: { enabled: true, runs: 1000000 },
viaIR: true
}
}],
},
networks: {
hardhat: {
chainId: 1337
},
...getNetworks()
},
};
export default config;