forked from balancer/balancer-v2-monorepo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
hardhat.config.ts
55 lines (47 loc) · 2.03 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
import '@nomiclabs/hardhat-ethers';
import '@nomiclabs/hardhat-waffle';
import 'hardhat-local-networks-config-plugin';
import '@balancer-labs/v2-common/setupTests';
import { task, types } from 'hardhat/config';
import { TASK_TEST } from 'hardhat/builtin-tasks/task-names';
import { HardhatRuntimeEnvironment } from 'hardhat/types';
import test from './src/test';
import Task from './src/task';
import Verifier from './src/verifier';
import { Logger } from './src/logger';
task('deploy', 'Run deployment task')
.addParam('id', 'Deployment task ID')
.addFlag('force', 'Ignore previous deployments')
.addOptionalParam('key', 'Etherscan API key to verify contracts')
.setAction(
async (args: { id: string; force?: boolean; key?: string; verbose?: boolean }, hre: HardhatRuntimeEnvironment) => {
Logger.setDefaults(false, args.verbose || false);
const verifier = args.key ? new Verifier(hre.network, args.key) : undefined;
await Task.fromHRE(args.id, hre, verifier).run(args);
}
);
task('verify-contract', 'Run verification for a given contract')
.addParam('id', 'Deployment task ID')
.addParam('name', 'Contract name')
.addParam('address', 'Contract address')
.addParam('args', 'ABI-encoded constructor arguments')
.addParam('key', 'Etherscan API key to verify contracts')
.setAction(
async (
args: { id: string; name: string; address: string; key: string; args: string; verbose?: boolean },
hre: HardhatRuntimeEnvironment
) => {
Logger.setDefaults(false, args.verbose || false);
const verifier = args.key ? new Verifier(hre.network, args.key) : undefined;
await Task.fromHRE(args.id, hre, verifier).verify(args.name, args.address, args.args);
}
);
task(TASK_TEST)
.addOptionalParam('fork', 'Optional network name to be forked block number to fork in case of running fork tests.')
.addOptionalParam('blockNumber', 'Optional block number to fork in case of running fork tests.', undefined, types.int)
.setAction(test);
export default {
mocha: {
timeout: 40000,
},
};