-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhardhat.config.ts
97 lines (88 loc) · 2.85 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
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
import * as dotenv from 'dotenv';
import '@nomiclabs/hardhat-ethers';
import '@nomiclabs/hardhat-waffle';
import '@nomiclabs/hardhat-etherscan';
import 'hardhat-ignore-warnings';
import 'hardhat-deploy';
import {hardhatBaseConfig} from './common';
import {name} from './package.json';
import {task} from 'hardhat/config';
import {TASK_COMPILE} from 'hardhat/builtin-tasks/task-names';
import overrideQueryFunctions from './helpers/plugins/overrideQueryFunctions';
import SDK from 'tapioca-sdk';
task(TASK_COMPILE).setAction(overrideQueryFunctions);
import {fillLbptest__task} from './tasks/setups/01-setupLbp-test';
dotenv.config();
let supportedChains: {[key: string]: HttpNetworkConfig} = SDK.API.utils
.getSupportedChains()
.reduce(
(sdkChains, chain) => ({
...sdkChains,
[chain.name]: <HttpNetworkConfig>{
accounts:
process.env.PRIVATE_KEY !== undefined
? [process.env.PRIVATE_KEY]
: [],
live: true,
url: chain.rpc.replace('<api_key>', process.env.ALCHEMY_KEY),
gasMultiplier: chain.tags.includes('testnet') ? 2 : 1,
chainId: Number(chain.chainId),
},
}),
{},
);
const compilers = hardhatBaseConfig.compilers;
compilers.push({
version: '0.8.9',
settings: {
optimizer: {
enabled: true,
runs: 200,
},
},
});
export default {
namedAccounts: {
deployer: {
default: 0,
},
},
networks: {
hardhat: {
allowUnlimitedContractSize: false,
},
//testnets
goerli: supportedChains['goerli'],
bnb_testnet: supportedChains['bnb_testnet'],
fuji_avalanche: supportedChains['fuji_avalanche'],
mumbai: supportedChains['mumbai'],
fantom_testnet: supportedChains['fantom_testnet'],
arbitrum_goerli: supportedChains['arbitrum_goerli'],
optimism_goerli: supportedChains['optimism_goerli'],
harmony_testnet: supportedChains['harmony_testnet'],
//mainnets
ethereum: supportedChains['ethereum'],
bnb: supportedChains['bnb'],
avalanche: supportedChains['avalanche'],
matic: supportedChains['polygon'],
arbitrum: supportedChains['arbitrum'],
optimism: supportedChains['optimism'],
fantom: supportedChains['fantom'],
harmony: supportedChains['harmony'],
},
solidity: {
compilers: compilers,
overrides: {...hardhatBaseConfig.overrides(name)},
},
warnings: hardhatBaseConfig.warnings,
mocha: {
timeout: 50000000,
},
etherscan: {
apiKey: process.env.ETHERSCAN_KEY,
},
};
task('fillLbptest', 'setup mock lbp', fillLbptest__task)
.addParam('lbp')
.addParam('vault')
.addParam('owner');