-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathconfig.js
179 lines (168 loc) · 5.8 KB
/
config.js
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
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
const {
makeRawLogExtractors,
} = require('@makerdao-dux/spock-utils/dist/extractors/rawEventDataExtractor');
const mkrTransformer = require('./transformers/MkrTransformer');
const mkrBalanceTransformer = require('./transformers/MkrBalanceTransformer');
const chiefBalanceTransformer = require('./transformers/ChiefBalanceTransformer');
const pollingTransformerImport = require('./transformers/PollingTransformer');
const pollingTransformer = pollingTransformerImport.default;
const arbitrumPollingTransformer = require('./transformers/ArbitrumPollingTransformer');
const dsChiefTransformer = require('./transformers/DsChiefTransformer');
const voteProxyFactoryTransformer = require('./transformers/VoteProxyFactoryTransformer');
const esmTransformer = require('./transformers/EsmTransformer');
const esmV2Transformer = require('./transformers/EsmV2Transformer');
const voteDelegateFactoryTransformer = require('./transformers/VoteDelegateFactoryTransformer');
const v2VoteDelegateFactoryTransformer = require('./transformers/V2VoteDelegateFactoryTransformer');
//mainnet
const MKR_ADDRESS = '0x9f8f72aa9304c8b593d555f12ef6589cc3a579a2';
const VOTING_CONTRACT_ADDRESS =
pollingTransformerImport.VOTING_CONTRACT_ADDRESS;
const SECOND_VOTING_CONTRACT_ADDRESS =
'0xD3A9FE267852281a1e6307a1C37CDfD76d39b133';
const DSCHIEF_ADDRESS = '0x9eF05f7F6deB616fd37aC3c959a2dDD25A54E4F5';
const VOTE_PROXY_FACTORY_ADDRESS = '0x868ba9aeacA5B73c7C27F3B01588bf4F1339F2bC';
const ESM_ADDRESS = '0x29CfBd381043D00a98fD9904a431015Fef07af2f';
const ESM_V2_ADDRESS = '0x09e05fF6142F2f9de8B6B65855A1d56B6cfE4c58';
const DSCHIEF_12_ADDRESS = '0x0a3f6849f78076aefaDf113F5BED87720274dDC0';
const VOTE_PROXY_FACTORY_12_ADDRESS =
'0x6FCD258af181B3221073A96dD90D1f7AE7eEc408';
const VOTE_DELEGATE_FACTORY_ADDRESS =
'0xD897F108670903D1d6070fcf818f9db3615AF272';
const V2_VOTE_DELEGATE_FACTORY_ADDRESS =
process.env.VL_CONFIG_NAME === 'multi_tenderly'
? '0x093d305366218d6d09ba10448922f10814b031dd'
: '0xC3D809E87A2C9da4F6d98fECea9135d834d6F5A0';
//Arbitrum mainnet
const ARB_POLLING_ADDRESS = '0x4f4e551b4920a5417F8d4e7f8f099660dAdadcEC';
// arbitrum testnet (sepolia)
const ARB_TESTNET_POLLING_ADDRESS =
'0xE63329692fA90B3efd5eB675c601abeDB2DF715a';
const CHAIN_HOST_L1 = process.env.VL_CHAIN_HOST;
const CHAIN_HOST_L2 = process.env.VL_CHAIN_HOST_L2;
const mainnet = {
name: 'mainnet',
processorSchema: 'vulcan2x',
extractedSchema: 'extracted',
startingBlock: 4620855,
chain: {
name: 'mainnet',
host: CHAIN_HOST_L1,
retries: 15,
},
extractors: [
...makeRawLogExtractors([
VOTING_CONTRACT_ADDRESS,
SECOND_VOTING_CONTRACT_ADDRESS,
MKR_ADDRESS,
DSCHIEF_ADDRESS,
VOTE_PROXY_FACTORY_ADDRESS,
DSCHIEF_12_ADDRESS,
VOTE_PROXY_FACTORY_12_ADDRESS,
ESM_ADDRESS,
ESM_V2_ADDRESS,
VOTE_DELEGATE_FACTORY_ADDRESS,
V2_VOTE_DELEGATE_FACTORY_ADDRESS,
]),
],
transformers: [
pollingTransformer(VOTING_CONTRACT_ADDRESS),
pollingTransformer(SECOND_VOTING_CONTRACT_ADDRESS),
mkrTransformer(MKR_ADDRESS),
mkrBalanceTransformer(MKR_ADDRESS),
dsChiefTransformer(DSCHIEF_ADDRESS),
chiefBalanceTransformer(DSCHIEF_ADDRESS),
voteProxyFactoryTransformer(VOTE_PROXY_FACTORY_ADDRESS),
dsChiefTransformer(DSCHIEF_12_ADDRESS, '_v1.2'),
chiefBalanceTransformer(DSCHIEF_12_ADDRESS, '_v1.2'),
voteProxyFactoryTransformer(VOTE_PROXY_FACTORY_12_ADDRESS, '_v1.2'),
esmTransformer(ESM_ADDRESS),
esmV2Transformer(ESM_V2_ADDRESS),
voteDelegateFactoryTransformer(VOTE_DELEGATE_FACTORY_ADDRESS),
v2VoteDelegateFactoryTransformer(V2_VOTE_DELEGATE_FACTORY_ADDRESS),
],
migrations: {
mkr: './migrations',
},
api: {
whitelisting: {
enabled: true,
whitelistedQueriesDir: './queries',
bypassSecret: process.env.BYPASS_SECRET,
},
responseCaching: {
enabled: false,
duration: '15 seconds',
},
},
onStart: (services) =>
console.log(
`Starting Mainnet config with these services: ${Object.keys(services)}`,
),
};
const arbitrum = {
name: 'arbitrum',
processorSchema: 'vulcan2xarbitrum',
extractedSchema: 'extractedarbitrum',
chain: {
name: 'arbitrum',
host: CHAIN_HOST_L2,
retries: 15,
},
startingBlock: 24755800,
extractors: [...makeRawLogExtractors([ARB_POLLING_ADDRESS])],
transformers: [arbitrumPollingTransformer(ARB_POLLING_ADDRESS)],
migrations: {
mkr: './migrations',
},
api: {
whitelisting: {
enabled: true,
whitelistedQueriesDir: './queries',
bypassSecret: process.env.BYPASS_SECRET,
},
responseCaching: {
enabled: false,
duration: '15 seconds',
},
},
onStart: (services) =>
console.log(`Starting with these services: ${Object.keys(services)}`),
};
const arbitrumTestnet = {
name: 'arbitrumTestnet',
processorSchema: 'vulcan2xarbitrum',
extractedSchema: 'extractedarbitrum',
chain: {
name: 'arbitrumTestnet',
host: CHAIN_HOST_L2,
retries: 15,
},
startingBlock: 37261050,
extractors: [...makeRawLogExtractors([ARB_TESTNET_POLLING_ADDRESS])],
transformers: [arbitrumPollingTransformer(ARB_TESTNET_POLLING_ADDRESS)],
migrations: {
mkr: './migrations',
},
api: {
whitelisting: {
enabled: true,
whitelistedQueriesDir: './queries',
bypassSecret: process.env.BYPASS_SECRET,
},
responseCaching: {
enabled: false,
duration: '15 seconds',
},
},
onStart: (services) =>
console.log(`Starting with these services: ${Object.keys(services)}`),
};
let config;
if (process.env.VL_CONFIG_NAME === 'multi') {
console.log('Using Mainnet multi-chain config');
config = [mainnet, arbitrum];
} else if (process.env.VL_CONFIG_NAME === 'multi_tenderly') {
console.log('Using Tenderly multi-chain config');
config = [mainnet, arbitrumTestnet];
}
module.exports.default = config;