Hop
Search…
Contract State
Get contract state

Contract state command

Prints the state of bridge and AMM contracts
Docker
Node
1
docker run -it -v ~/.hop-node:/root hopprotocol/hop-node contract-state --config /root/config.json --token USDC --l1bridge --l2bridge --l2amm --l2ammwrapper
Copied!
1
hop-node contract-state --config ~/.hop-node/config.json --token USDC --l1bridge --l2bridge --l2amm --l2ammwrapper
Copied!
Note: except for the token flag, all flags are optional.

Output example

1
{
2
"l1Bridge": {
3
"challengeAmountDivisor": "10",
4
"timeSlotSize": "14400",
5
"challengePeriod": "86400",
6
"challengeResolutionPeriod": "1209600",
7
"chainId": "1",
8
"governance": "0x22e3F828b3f47dAcFACd875D20bd5cc0879C96e7",
9
"minTransferRootBondDelay": "900",
10
"chainStates": {
11
"10": {
12
"chainBalance": "6112490700021",
13
"crossDomainMessengerWrapper": "0x1ba1f1368ecEB7bFcbdE20e1F803771b7B401F7d",
14
"isChainIdPaused": false,
15
"timeSlot": "0"
16
},
17
"100": {
18
"chainBalance": "406180962091",
19
"crossDomainMessengerWrapper": "0x12e59C59D282D2C00f3166915BED6DC2F5e2B5C7",
20
"isChainIdPaused": false,
21
"timeSlot": "0"
22
},
23
"137": {
24
"chainBalance": "4616887310670",
25
"crossDomainMessengerWrapper": "0x10541b07d8Ad2647Dc6cD67abd4c03575dade261",
26
"isChainIdPaused": false,
27
"timeSlot": "0"
28
},
29
"42161": {
30
"chainBalance": "6673887957462",
31
"crossDomainMessengerWrapper": "0xaC9BABf20eF2338D7F4a152Af43bedDC80C6ae2a",
32
"isChainIdPaused": false,
33
"timeSlot": "2"
34
}
35
},
36
"bonderStates": {
37
"0xa6a688F107851131F0E1dce493EbBebFAf99203e": {
38
"credit": "22589161487578",
39
"debitAndAdditionalDebit": "22401021943583",
40
"isBonder": "true"
41
}
42
}
43
},
44
"l2Bridges": {
45
"xdai": {
46
"ammWrapper": "0x76b22b8C1079A44F1211D867D68b1eda76a635A7",
47
"chainId": "100",
48
"nextTransferNonce": "0x6ec3b5ad589fa51d75b8f24153d72114c94b826abef7755bfcba9416907632c5",
49
"hToken": "0x9ec9551d4A1a1593b0ee8124D98590CC71b3B09D",
50
"l1BridgeAddress": "0x3666f603Cc164936C1b87e207F36BEBa4AC5f18a",
51
"l1BridgeCaller": "0x12e59C59D282D2C00f3166915BED6DC2F5e2B5C7",
52
"l1Governance": "0x22e3F828b3f47dAcFACd875D20bd5cc0879C96e7",
53
"maxPendingTransfers": "128",
54
"minBonderBps": "2",
55
"minBonderFeeAbsolute": "0",
56
"chainStates": {
57
"1": {
58
"activeChainId": true,
59
"lastCommitTimeForChainId": "1631851515",
60
"pendingAmountForChainId": "15479670558"
61
},
62
"10": {
63
"activeChainId": true,
64
"lastCommitTimeForChainId": "1632007530",
65
"pendingAmountForChainId": "76305479475"
66
},
67
"100": {
68
"activeChainId": false,
69
"lastCommitTimeForChainId": "0",
70
"pendingAmountForChainId": "0"
71
},
72
"137": {
73
"activeChainId": true,
74
"lastCommitTimeForChainId": "1632264635",
75
"pendingAmountForChainId": "12712040065"
76
},
77
"42161": {
78
"activeChainId": true,
79
"lastCommitTimeForChainId": "1632155810",
80
"pendingAmountForChainId": "21996160771"
81
}
82
},
83
"bonderStates": {
84
"0xa6a688F107851131F0E1dce493EbBebFAf99203e": {
85
"credit": "1670035438477",
86
"debitAndAdditionalDebit": "1575783321453",
87
"isBonder": "true"
88
}
89
}
90
},
91
"polygon": {
92
"ammWrapper": "0x76b22b8C1079A44F1211D867D68b1eda76a635A7",
93
"chainId": "137",
94
"nextTransferNonce": "0x2d2f1042c518fa12e4b77fc1e5c73b995fdd0ae131075f11091c4aa617696c3a",
95
"hToken": "0x9ec9551d4A1a1593b0ee8124D98590CC71b3B09D",
96
"l1BridgeAddress": "0x3666f603Cc164936C1b87e207F36BEBa4AC5f18a",
97
"l1BridgeCaller": "0x3666f603Cc164936C1b87e207F36BEBa4AC5f18a",
98
"l1Governance": "0x22e3F828b3f47dAcFACd875D20bd5cc0879C96e7",
99
"maxPendingTransfers": "128",
100
"minBonderBps": "2",
101
"minBonderFeeAbsolute": "0",
102
"chainStates": {
103
"1": {
104
"activeChainId": true,
105
"lastCommitTimeForChainId": "1632587370",
106
"pendingAmountForChainId": "4258981407"
107
},
108
"10": {
109
"activeChainId": true,
110
"lastCommitTimeForChainId": "1632453762",
111
"pendingAmountForChainId": "19406133313"
112
},
113
"100": {
114
"activeChainId": true,
115
"lastCommitTimeForChainId": "1631951255",
116
"pendingAmountForChainId": "5932620396"
117
},
118
"137": {
119
"activeChainId": false,
120
"lastCommitTimeForChainId": "0",
121
"pendingAmountForChainId": "0"
122
},
123
"42161": {
124
"activeChainId": true,
125
"lastCommitTimeForChainId": "1632587500",
126
"pendingAmountForChainId": "26876359528"
127
}
128
},
129
"bonderStates": {
130
"0xa6a688F107851131F0E1dce493EbBebFAf99203e": {
131
"credit": "4099763736258",
132
"debitAndAdditionalDebit": "4022821095435",
133
"isBonder": "true"
134
}
135
}
136
},
137
"optimism": {
138
"ammWrapper": "0x2ad09850b0CA4c7c1B33f5AcD6cBAbCaB5d6e796",
139
"chainId": "10",
140
"nextTransferNonce": "0xa3b20d425f59899c5f0e09f8e36dcb41380bdcaf42703c093f117853231e3610",
141
"hToken": "0x25D8039bB044dC227f741a9e381CA4cEAE2E6aE8",
142
"l1BridgeAddress": "0x3666f603Cc164936C1b87e207F36BEBa4AC5f18a",
143
"l1BridgeCaller": "0x1ba1f1368ecEB7bFcbdE20e1F803771b7B401F7d",
144
"l1Governance": "0x22e3F828b3f47dAcFACd875D20bd5cc0879C96e7",
145
"maxPendingTransfers": "128",
146
"minBonderBps": "2",
147
"minBonderFeeAbsolute": "0",
148
"chainStates": {
149
"1": {
150
"activeChainId": true,
151
"lastCommitTimeForChainId": "1632480055",
152
"pendingAmountForChainId": "99282640062"
153
},
154
"10": {
155
"activeChainId": false,
156
"lastCommitTimeForChainId": "0",
157
"pendingAmountForChainId": "0"
158
},
159
"100": {
160
"activeChainId": true,
161
"lastCommitTimeForChainId": "1632626825",
162
"pendingAmountForChainId": "3816453963"
163
},
164
"137": {
165
"activeChainId": true,
166
"lastCommitTimeForChainId": "1632403654",
167
"pendingAmountForChainId": "42293513551"
168
},
169
"42161": {
170
"activeChainId": true,
171
"lastCommitTimeForChainId": "1632603735",
172
"pendingAmountForChainId": "6996809242"
173
}
174
},
175
"bonderStates": {
176
"0xa6a688F107851131F0E1dce493EbBebFAf99203e": {
177
"credit": "3253669893410",
178
"debitAndAdditionalDebit": "3197685446435",
179
"isBonder": "true"
180
}
181
}
182
},
183
"arbitrum": {
184
"ammWrapper": "0xe22D2beDb3Eca35E6397e0C6D62857094aA26F52",
185
"chainId": "42161",
186
"nextTransferNonce": "0xaa50a5b0f4e9e598d33bfca85fcf4d2593c276993d7991aab0f41b67daeda018",
187
"hToken": "0x0ce6c85cF43553DE10FC56cecA0aef6Ff0DD444d",
188
"l1BridgeAddress": "0x3666f603Cc164936C1b87e207F36BEBa4AC5f18a",
189
"l1BridgeCaller": "0xBDaCAbf20ef2338D7F4A152aF43bedDC80c6BF3b",
190
"l1Governance": "0x33F4F828b3F47dACfACd875d20bD5Cc0879CA7f8",
191
"maxPendingTransfers": "128",
192
"minBonderBps": "2",
193
"minBonderFeeAbsolute": "0",
194
"chainStates": {
195
"1": {
196
"activeChainId": true,
197
"lastCommitTimeForChainId": "1632604068",
198
"pendingAmountForChainId": "10290010801"
199
},
200
"10": {
201
"activeChainId": true,
202
"lastCommitTimeForChainId": "0",
203
"pendingAmountForChainId": "42593547254"
204
},
205
"100": {
206
"activeChainId": true,
207
"lastCommitTimeForChainId": "1632133224",
208
"pendingAmountForChainId": "2928841269"
209
},
210
"137": {
211
"activeChainId": true,
212
"lastCommitTimeForChainId": "1632575038",
213
"pendingAmountForChainId": "53434635349"
214
},
215
"42161": {
216
"activeChainId": false,
217
"lastCommitTimeForChainId": "0",
218
"pendingAmountForChainId": "0"
219
}
220
},
221
"bonderStates": {
222
"0xa6a688F107851131F0E1dce493EbBebFAf99203e": {
223
"credit": "2146919103909",
224
"debitAndAdditionalDebit": "2012151631190",
225
"isBonder": "true"
226
}
227
}
228
}
229
},
230
"l2Amms": {
231
"xdai": {
232
"A": "200",
233
"APrecise": "20000",
234
"token0": "0xDDAfbb505ad214D7b80b1f830fcCc89B60fb7A83",
235
"token1": "0x9ec9551d4A1a1593b0ee8124D98590CC71b3B09D",
236
"token0Balance": "163104028207",
237
"token1Balance": "176357831197",
238
"virtualPrice": "1017070218286347997",
239
"swapStorage": {
240
"initialA": "20000",
241
"futureA": "20000",
242
"initialATime": "0",
243
"futureATime": "0",
244
"swapFee": "4000000",
245
"adminFee": "0",
246
"defaultWithdrawFee": "0",
247
"lpToken": "0x9D373d22FD091d7f9A6649EB067557cc12Fb1A0A"
248
}
249
},
250
"polygon": {
251
"A": "200",
252
"APrecise": "20000",
253
"token0": "0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174",
254
"token1": "0x9ec9551d4A1a1593b0ee8124D98590CC71b3B09D",
255
"token0Balance": "3591466737479",
256
"token1Balance": "4354141459435",
257
"virtualPrice": "1022227118817319093",
258
"swapStorage": {
259
"initialA": "20000",
260
"futureA": "20000",
261
"initialATime": "0",
262
"futureATime": "0",
263
"swapFee": "4000000",
264
"adminFee": "0",
265
"defaultWithdrawFee": "0",
266
"lpToken": "0x9D373d22FD091d7f9A6649EB067557cc12Fb1A0A"
267
}
268
},
269
"optimism": {
270
"A": "200",
271
"APrecise": "20000",
272
"token0": "0x7F5c764cBc14f9669B88837ca1490cCa17c31607",
273
"token1": "0x25D8039bB044dC227f741a9e381CA4cEAE2E6aE8",
274
"token0Balance": "3589736061063",
275
"token1Balance": "3276578935297",
276
"virtualPrice": "1002972199941239661",
277
"swapStorage": {
278
"initialA": "20000",
279
"futureA": "20000",
280
"initialATime": "0",
281
"futureATime": "0",
282
"swapFee": "4000000",
283
"adminFee": "0",
284
"defaultWithdrawFee": "0",
285
"lpToken": "0x2e17b8193566345a2Dd467183526dEdc42d2d5A8"
286
}
287
},
288
"arbitrum": {
289
"A": "200",
290
"APrecise": "20000",
291
"token0": "0xFF970A61A04b1cA14834A43f5dE4533eBDDB5CC8",
292
"token1": "0x0ce6c85cF43553DE10FC56cecA0aef6Ff0DD444d",
293
"token0Balance": "3507823521764",
294
"token1Balance": "3691945785094",
295
"virtualPrice": "1001742860866211679",
296
"swapStorage": {
297
"initialA": "20000",
298
"futureA": "20000",
299
"initialATime": "0",
300
"futureATime": "0",
301
"swapFee": "4000000",
302
"adminFee": "0",
303
"defaultWithdrawFee": "0",
304
"lpToken": "0xB67c014FA700E69681a673876eb8BAFAA36BFf71"
305
}
306
}
307
},
308
"l2AmmWrappers": {
309
"xdai": {
310
"bridge": "0x25D8039bB044dC227f741a9e381CA4cEAE2E6aE8",
311
"exchangeAddress": "0x5C32143C8B198F392d01f8446b754c181224ac26",
312
"l2CanonicalToken": "0xDDAfbb505ad214D7b80b1f830fcCc89B60fb7A83",
313
"l2CanonicalTokenIsEth": false
314
},
315
"polygon": {
316
"bridge": "0x25D8039bB044dC227f741a9e381CA4cEAE2E6aE8",
317
"exchangeAddress": "0x5C32143C8B198F392d01f8446b754c181224ac26",
318
"l2CanonicalToken": "0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174",
319
"l2CanonicalTokenIsEth": false
320
},
321
"optimism": {
322
"bridge": "0xa81D244A1814468C734E5b4101F7b9c0c577a8fC",
323
"exchangeAddress": "0x3c0FFAca566fCcfD9Cc95139FEF6CBA143795963",
324
"l2CanonicalToken": "0x7F5c764cBc14f9669B88837ca1490cCa17c31607",
325
"l2CanonicalTokenIsEth": false
326
},
327
"arbitrum": {
328
"bridge": "0x0e0E3d2C5c292161999474247956EF542caBF8dd",
329
"exchangeAddress": "0x10541b07d8Ad2647Dc6cD67abd4c03575dade261",
330
"l2CanonicalToken": "0xFF970A61A04b1cA14834A43f5dE4533eBDDB5CC8",
331
"l2CanonicalTokenIsEth": false
332
}
333
}
334
}
Copied!