-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathhardhat.config.ts
More file actions
122 lines (114 loc) · 3.23 KB
/
hardhat.config.ts
File metadata and controls
122 lines (114 loc) · 3.23 KB
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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
import { HardhatUserConfig } from 'hardhat/config';
import { eEthereumNetwork } from './helpers/types';
// @ts-ignore
import { accounts } from './test-wallets';
require('dotenv').config();
import 'hardhat-typechain';
import 'solidity-coverage';
import '@nomiclabs/hardhat-waffle';
import '@nomicfoundation/hardhat-verify';
import path from 'path';
import fs from 'fs';
export const BUIDLEREVM_CHAIN_ID = 31337;
const DEFAULT_BLOCK_GAS_LIMIT = 12500000;
const DEFAULT_GAS_PRICE = 100 * 1000 * 1000; // 75 gwei
const PRIVATE_KEY = process.env.PRIVATE_KEY as string;
const ALCHEMY_KEY = process.env.ALCHEMY_KEY || '';
const SKIP_LOAD = process.env.SKIP_LOAD === 'true';
const MAINNET_FORK = process.env.MAINNET_FORK === 'true';
const FORKING_BLOCK = parseInt(process.env.FORKING_BLOCK || '11633164');
const ANKR_API_KEY = process.env.ANKR_API_KEY;
const ROLLUX_TANENBAUM_URL = process.env.ROLLUX_TANENBAUM_URL;
const MNEMONIC = process.env.MNEMONIC;
// Prevent to load scripts before compilation and typechain
if (!SKIP_LOAD) {
['misc', 'migrations', 'deployments'].forEach((folder) => {
const tasksPath = path.join(__dirname, 'tasks', folder);
fs.readdirSync(tasksPath)
.filter((pth) => pth.includes('.ts'))
.forEach((task) => {
require(`${tasksPath}/${task}`);
});
});
}
/*This will default to ROLLUX_TANENBAUM_URL if
you do not specify ANKR_API_KEY in .env */
const rolluxTanenbaumUrl = ANKR_API_KEY
? `https://rpc.ankr.com/rollux_testnet/${ANKR_API_KEY}`
: ROLLUX_TANENBAUM_URL;
require(`${path.join(__dirname, 'tasks/misc')}/set-dre.ts`);
const config: HardhatUserConfig = {
solidity: {
compilers: [
{
version: '0.6.12',
settings: {
optimizer: { enabled: true, runs: 200 },
evmVersion: 'istanbul',
},
},
{
version: '0.7.5',
settings: {
optimizer: { enabled: true, runs: 200 },
evmVersion: 'istanbul',
},
},
{
version: '0.8.0',
settings: {
optimizer: { enabled: true, runs: 200 },
evmVersion: 'istanbul',
},
},
],
},
typechain: {
outDir: 'types',
},
etherscan: {
apiKey: {
main: 'abc', // Set to an empty string or some placeholder
},
customChains: [
{
network: 'main',
chainId: 57000,
urls: {
apiURL: 'https://rollux.tanenbaum.io/api',
browserURL: 'https://rollux.tanenbaum.io/',
},
},
],
},
defaultNetwork: 'hardhat',
mocha: {
timeout: 0,
},
networks: {
main: {
chainId: 57000,
url: 'https://rpc-tanenbaum.rollux.com',
accounts: [PRIVATE_KEY],
},
'rollux-tanenbaum': {
url: rolluxTanenbaumUrl,
chainId: 57000,
accounts: { mnemonic: MNEMONIC },
},
hardhat: {
hardfork: 'istanbul',
blockGasLimit: DEFAULT_BLOCK_GAS_LIMIT,
gas: DEFAULT_BLOCK_GAS_LIMIT,
gasPrice: DEFAULT_GAS_PRICE,
chainId: BUIDLEREVM_CHAIN_ID,
throwOnTransactionFailures: true,
throwOnCallFailures: true,
accounts: accounts.map(({ secretKey, balance }: { secretKey: string; balance: string }) => ({
privateKey: secretKey,
balance,
})),
},
},
};
export default config;