-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathpolygon.config.ts
35 lines (28 loc) · 999 Bytes
/
polygon.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
import { ChainId, NetworkName } from '@constants/network';
import defaultConfig from './hardhat.config';
import { log } from './helpers/logger';
const { PRIVATE_KEY, POLYGONSCAN_API_KEY, POLYGON_ALCHEMY_PROVIDER, POLYGON_PROVIDER_URL } = process.env;
if (!PRIVATE_KEY) {
throw new Error('MantleConfig: The private key is required');
}
log(`Using Polygon config`);
defaultConfig.networks = {
...defaultConfig.networks,
[NetworkName.Polygon]: {
url: POLYGON_ALCHEMY_PROVIDER || POLYGON_PROVIDER_URL || 'https://polygon.llamarpc.com',
accounts: [PRIVATE_KEY],
chainId: ChainId.Polygon,
},
[NetworkName.PolygonMumbai]: {
url: POLYGON_ALCHEMY_PROVIDER || POLYGON_PROVIDER_URL || 'https://rpc.ankr.com/polygon_mumbai',
accounts: [PRIVATE_KEY],
chainId: ChainId.PolygonMumbai,
},
};
defaultConfig.etherscan = {
apiKey: POLYGONSCAN_API_KEY,
};
defaultConfig.sourcify = {
enabled: false,
};
export default defaultConfig;