-
Notifications
You must be signed in to change notification settings - Fork 5
/
hardhat.config.ts
71 lines (62 loc) · 1.72 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
require('dotenv').config();
import '@nomiclabs/hardhat-waffle';
import '@typechain/hardhat';
import '@nomicfoundation/hardhat-foundry';
import 'hardhat-deploy';
import { HardhatUserConfig, task } from 'hardhat/config';
import { NetworkUserConfig } from 'hardhat/types';
import example from './scripts/tasks/example';
task('example', 'Example task').setAction(example);
const DEFAULT_MNEMONIC = 'title spike pink garlic hamster sorry few damage silver mushroom clever window';
const { TESTNET_PK, TESTNET_URL, MAINNET_PK, MAINNET_URL } = process.env;
if (!TESTNET_PK) {
console.warn('TESTNET_PK is unset. Using DEFAULT_MNEMONIC');
}
if (!MAINNET_PK) {
console.warn('MAINNET_PK is unset. Using DEFAULT_MNEMONIC');
}
const testnet: NetworkUserConfig = {
chainId: 2021,
url: TESTNET_URL || 'https://saigon-testnet.roninchain.com/rpc',
accounts: TESTNET_PK ? [TESTNET_PK] : { mnemonic: DEFAULT_MNEMONIC },
blockGasLimit: 100000000,
};
const mainnet: NetworkUserConfig = {
chainId: 2020,
url: MAINNET_URL || 'https://api.roninchain.com/rpc',
accounts: MAINNET_PK ? [MAINNET_PK] : { mnemonic: DEFAULT_MNEMONIC },
blockGasLimit: 100000000,
};
const config: HardhatUserConfig = {
solidity: {
version: '0.8.19',
settings: {
optimizer: {
enabled: true,
runs: 200,
},
},
},
typechain: {
outDir: './scripts/typechain-types',
},
paths: {
sources: './src',
cache: './cache/hardhat',
deploy: ['./scripts/deploy'],
},
namedAccounts: {
deployer: 0,
},
networks: {
hardhat: {
hardfork: 'istanbul',
accounts: {
mnemonic: DEFAULT_MNEMONIC,
},
},
'ronin-testnet': testnet,
'ronin-mainnet': mainnet,
},
};
export default config;