-
Notifications
You must be signed in to change notification settings - Fork 1
/
hardhat.config.ts
53 lines (46 loc) · 1.46 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
import '@nomiclabs/hardhat-waffle';
import '@typechain/hardhat';
import {env} from 'process';
import {HardhatUserConfig, NetworkUserConfig} from 'hardhat/types';
import {customConfig as AppCustomConfig} from './src/config';
import {config as AppConfig, log} from '@jovijovi/pedrojs-common';
import {network} from '@jovijovi/ether-network';
// Default app config file
const defaultAppConfig = './conf/app.config.yaml'
function getDeveloperPK(): string {
return env.DEVELOPER_PK ? env.DEVELOPER_PK : `1234567890123456789012345678901234567890123456789012345678901234`;
}
function getNetworkConfig(): NetworkUserConfig {
AppConfig.LoadConfig(defaultAppConfig);
AppCustomConfig.LoadCustomConfig();
network.LoadConfig(AppCustomConfig.Get());
log.RequestId().info("ChainId=", network.GetChainId());
log.RequestId().info("Provider URL=", network.GetProvider())
return {
chainId: network.GetChainId(),
url: network.GetProvider(),
accounts: [`0x${getDeveloperPK()}`]
}
}
const config: HardhatUserConfig = {
// defaultNetwork: 'custom',
networks: {
custom: getNetworkConfig()
},
solidity: {
compilers: [
{
version: '0.8.9',
settings: {
// You should disable the optimizer when debugging
// https://hardhat.org/guides/compile-contracts#configuring-the-compiler
// optimizer: {
// enabled: true,
// runs: 200
// },
}
}
],
},
};
export default config;