-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhardhat.config.ts
47 lines (41 loc) · 1.04 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
import { HardhatUserConfig } from 'hardhat/config';
import '@nomicfoundation/hardhat-toolbox';
import { config } from 'dotenv';
config({ path: __dirname + '/.env' });
const { ALCHEMY_API_KEY, GOERLI_PRIVATE_KEY, MUMBAI_PRIVATE_KEY, SKALE_PRIVATE_KEY } = process.env;
let networks = {};
if (SKALE_PRIVATE_KEY) {
networks = {
...networks,
skale: {
url: 'https://eth-sf.skalenodes.com/v1/hackathon-complex-easy-naos',
accounts: [SKALE_PRIVATE_KEY],
},
};
}
if (ALCHEMY_API_KEY) {
if (GOERLI_PRIVATE_KEY) {
networks = {
...networks,
goerli: {
url: `https://eth-goerli.alchemyapi.io/v2/${ALCHEMY_API_KEY}`,
accounts: [GOERLI_PRIVATE_KEY],
},
};
}
if (MUMBAI_PRIVATE_KEY) {
networks = {
...networks,
mumbai: {
url: `https://polygon-mumbai.g.alchemy.com/v2/${ALCHEMY_API_KEY}`,
accounts: [MUMBAI_PRIVATE_KEY],
chainId: 80001,
},
};
}
}
const result: HardhatUserConfig = {
solidity: '0.8.9',
networks,
};
module.exports = result;