-
Notifications
You must be signed in to change notification settings - Fork 83
/
Copy pathconstructor-args.ts
58 lines (56 loc) · 2.01 KB
/
constructor-args.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
import * as artifacts from '../src/lib';
const getAdminWalletAddress = (contract: string): string => {
if (!process.env.ADMIN_WALLET_ADDRESS) {
throw new Error(`ADMIN_WALLET_ADDRESS missing to get constructor args for: ${contract}`);
}
return process.env.ADMIN_WALLET_ADDRESS;
};
export const getConstructorArgs = (contract: string, network?: string): string[] => {
switch (contract) {
case 'Erc20ConversionProxy': {
return [
'0x0000000000000000000000000000000000000000',
'0x0000000000000000000000000000000000000000',
getAdminWalletAddress(contract),
];
}
case 'ETHConversionProxy': {
return [
'0x0000000000000000000000000000000000000000',
'0x0000000000000000000000000000000000000000',
'0x39e19aa5b69466dfdc313c7cda37cb2a599015cd',
];
// TODO setupETHConversionProxy
}
case 'ERC20SwapToConversion': {
return [getAdminWalletAddress(contract)];
}
case 'ERC20EscrowToPay': {
if (!network) {
throw new Error(
'Escrow contract requires network parameter to get correct address of erc20FeeProxy',
);
}
const erc20FeeProxy = artifacts.erc20FeeProxyArtifact;
const erc20FeeProxyAddress = erc20FeeProxy.getAddress(network);
return [erc20FeeProxyAddress, getAdminWalletAddress(contract)];
}
case 'BatchConversionPayments': {
if (!network) {
throw new Error(
'Batch conversion contract requires network parameter to get correct address of erc20FeeProxy, erc20ConversionFeeProxy, ethereumFeeProxy, ethereumConversionFeeProxy, and chainlinkConversionPath',
);
}
return [
'0x0000000000000000000000000000000000000000',
'0x0000000000000000000000000000000000000000',
'0x0000000000000000000000000000000000000000',
'0x0000000000000000000000000000000000000000',
'0x0000000000000000000000000000000000000000',
getAdminWalletAddress(contract),
];
}
default:
return [];
}
};