-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathschema.graphql
731 lines (677 loc) · 22 KB
/
schema.graphql
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
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
interface ChallengeInfoUpdated {
id: ID!
challengeId: String! # bytes32
sourceTxFrom: BigInt # uint256
sourceTxTime: BigInt! # uint64
challenger: String! # address
freezeToken: String! # address
challengeUserRatio: BigInt # uint64
freezeAmount0: BigInt! # uint256
freezeAmount1: BigInt! # uint256
challengeTime: BigInt! # uint64
abortTime: BigInt # uint64
sourceTxBlockNum: BigInt!
sourceTxIndex: BigInt!
challengerVerifyTransactionFee: BigInt!
verifiedTime0: BigInt # uint64
verifiedTime1: BigInt # uint64
verifiedDataHash0: String
latestUpdateHash: String!
latestUpdateTimestamp: BigInt!
latestUpdateBlockNumber: BigInt!
}
enum ChallengeStatuses {
CREATE
VERIFY_SOURCE
VERIFY_DEST
LIQUIDATION
}
enum StringInit {
EMPTY
INVALID
}
type challengeManager @entity {
id: ID! #hash(challengeId, mdcAddress)
challengeId: String! # bytes32
mdcAddr: String! # address of mdc
owner: String! # address of maker
challengeStatuses: ChallengeStatuses!
createChallenge: [createChallenge!]!
# verifyChallengeSource result
sourceTxFrom: String! # address
challengeUserRatio: BigInt! # uint64
verifyChallengeSourceTimestamp: BigInt! # uint64
verifiedDataHash0: String!
verifyPassChallenger: String! # address who create this challenge
# verifyChallengeSource info
# challengerVerifyTransactionFee: BigInt!
challengeSourceVerifier: String! # address who verified this challenge
verifyChallengeSourceHash: String!
verifyChallengeSourceNumber: BigInt!
# verifyChallengeDest result
challengeDestVerifier: String! # address who verified this challenge
verifyChallengeDestTimestamp: BigInt! # uint64
verifyChallengeDestHash: String!
verifyChallengeDestNumber: BigInt!
mdc: MDC! @derivedFrom(field: "challengeManager")
}
type createChallenge @entity {
id: ID! #hash(challengeId, challengerAddress, mdcAddress, createChallengeTimestamp)
# Challenge statement
challengeId: String! # bytes32 hash(sourceChainId, sourceTxHash)
sourceChainId: BigInt!
ruleKey: String! # hash(chain0,chain1,token0,token1)
sourceTxHash: String! # bytes32
sourceTxTime: BigInt! # uint64
challenger: String! # address
freezeToken: String! # address
freezeAmountMaker: BigInt! # uint256
freezeAmountChallenger: BigInt! # uint256
createChallengeTimestamp: BigInt! # uint64 timestamp of createChallenge
sourceTxBlockNum: BigInt! # uint64 challenge tx block number
sourceTxIndex: BigInt! # uint64 challenge tx index
challengeNodeNumberParent: String! # challengeNodeNumber last number
challengeNodeNumber: String! # sorting: encodePacked(sourceTxTime,sourceChainId,blocknumer,TxIndex)
# info
isVerifyPass: Boolean!
totalChallengeVerifyCost: BigInt! # uint: WEI
createChallengeHash: String! # txHash of createChallenge
createChallengeBlockNumber: BigInt! # blockNumber of createChallenge
# liquidation
liquidator: String # address who liquidated this challenge
liquidationTimestamp: BigInt #timestamp of liquidation this challenge of challenger
liquidationHash: String # txHash of liquidation this challenge of challenger
liquidationBlockNumber: BigInt
# Rel
challengeManager: challengeManager! @derivedFrom(field: "createChallenge")
}
type withdrawRequestList @entity(immutable: true) {
id: ID! # log-index
owner: String!
requestAmount: BigInt! # uint256
minWithdrawTimestamp: BigInt! # uint64
requestToken: String! # address
latestUpdateHash: String!
latestUpdateTimestamp: BigInt!
latestUpdateBlockNumber: BigInt!
# Rel
mdc: MDC! @derivedFrom(field: "withdrawRequestList") # MDC
}
enum columnArrayStatuses {
PARAMETER_DUPLICATION
ALL_CLEAR
}
type columnArraySnapshot @entity(immutable: true) {
id: ID! # hash(txHash - logIndex)
columnArrayHash: String! # bytes32
dealers: [String!]! # address[]
dealerMappingSnapshot: [dealerMappingSnapshot!]! # dealer address mapping, defined by maker
ebcs: [String!]! # address[]
ebcMappingSnapshot: [ebcMappingSnapshot!]! # ebc address mapping, defined by maker
chainIds: [BigInt!]! # uint64[]
chainIdMappingSnapshot: [chainIdMappingSnapshot!]! # chainId mapping, defined by maker
columnArrayStatuses: columnArrayStatuses!
# Time
enableTimestamp: BigInt! # uint64
latestUpdateHash: String!
latestUpdateTimestamp: BigInt!
latestUpdateBlockNumber: BigInt!
# Rel
mdc: MDC! @derivedFrom(field: "columnArraySnapshot") # MDC
}
type responseMakersSnapshot @entity {
id: ID! # hash(mdc address - txHash - logIndex)
responseMakerList: [String!]! # responseMaker address array
enableTimestamp: BigInt
owner: String!
mdc: MDC! @derivedFrom(field: "responseMakersSnapshot") # MDC
latestUpdateHash: String
latestUpdateTimestamp: BigInt
latestUpdateBlockNumber: BigInt
}
# customed using entity
type MDC @entity {
# base info
id: ID! # mdc address
owner: String! # maker address
factoryAddr: String! # mdc factory address
manager: String # ob manager address
# Rel
ruleUpdateRel: [ruleUpdateRel!]!
responseMakersSnapshot: [responseMakersSnapshot!]! #snapshot
ruleSnapshot: [ruleRel!]! #snapshot
ruleLatest: [latestRule!]! #latestData
currBoundSpvInfo: [currBoundSpvInfo!]! # currBoundSpvInfo
columnArraySnapshot: [columnArraySnapshot!]! # columnArraySnapshot
challengeManager: [challengeManager!]!
withdrawRequestList: [withdrawRequestList!]!
# derived info
factory: [FactoryManager!]! @derivedFrom(field: "mdcs")
ebc: [ebcRel!]! @derivedFrom(field: "mdcList") # EBC
dealer: [Dealer!]! @derivedFrom(field: "mdcs") # Dealer
# Time related
createblockNumber: BigInt!
createblockTimestamp: BigInt!
createtransactionHash: String!
latestUpdatetransactionHash: String!
}
type ruleUpdateRel @entity {
id: ID! # hash(mdc, ebc, chain0, chain1)
ruleUpdateVersion: [ruleUpdateVersion!]!
latestVersion: BigInt!
# Rel
mdc: MDC! @derivedFrom(field: "ruleUpdateRel")
ebc: ebcRel! @derivedFrom(field: "ruleUpdateRel")
latestRule: latestRule! @derivedFrom(field: "ruleUpdateRel")
latestUpdateHash: String
latestUpdateTimestamp: BigInt
latestUpdateBlockNumber: BigInt
}
type ruleUpdateVersion
@entity(immutable: true) { # every rule update
# As MDC LatestRule: hash(hash(mdc, ebc, chain0, chain1), updateVersion)
id: ID!
makerHash: String! # hash(mdc, ebc, chain0, chain1)
owner: String! # address
updateVersion: BigInt! # version++
mdcAddr: String! # address
ebcAddr: String! # address
type: String # ETH/ERC20
chain0: BigInt # uint64
chain1: BigInt # uint64
chain0Status: Int # uint8
chain1Status: Int # uint8
chain0Token: String # Address
chain1Token: String # Address
chain0minPrice: BigInt # uint128
chain1minPrice: BigInt # uint128
chain0maxPrice: BigInt # uint128
chain1maxPrice: BigInt # uint128
chain0WithholdingFee: BigInt # uint128
chain1WithholdingFee: BigInt # uint128
chain0TradeFee: Int # uint16
chain1TradeFee: Int # uint16
chain0ResponseTime: Int # uint32
chain1ResponseTime: Int # uint32
chain0CompensationRatio: Int # uint32
chain1CompensationRatio: Int # uint32
enableTimestamp: BigInt # uint64
latestUpdateVersion: Int # uint32
latestUpdateTimestamp: BigInt
latestUpdateBlockNumber: BigInt
latestUpdateHash: String
ruleValidation: Boolean!
ruleValidationErrorstatus: String!
# Related
ruleUpdateRel: [ruleUpdateRel!]! @derivedFrom(field: "ruleUpdateVersion")
ruleRel: [ruleRel!]! @derivedFrom(field: "ruleUpdateVersion")
}
interface PairManager {
id: ID!
#Rel
latestRule: [latestRule!]!
latestUpdateHash: String
latestUpdateTimestamp: BigInt
latestUpdateBlockNumber: BigInt
}
type chainPairManager implements PairManager @entity {
id: ID! # chain0Id-chain1Id: 5-420
#Rel
latestRule: [latestRule!]!
latestUpdateHash: String
latestUpdateTimestamp: BigInt
latestUpdateBlockNumber: BigInt
}
type tokenPairManager implements PairManager @entity {
id: ID! # token id: 0x00000000000000000000000076fc39362ef66dad742791bde738b9b050c3cbf5
#Rel
latestRule: [latestRule!]!
latestUpdateHash: String
latestUpdateTimestamp: BigInt
latestUpdateBlockNumber: BigInt
}
# entity to save the latest column of MDC, no need to storage in MDC entity
type mdcLatestColumn @entity {
id: ID! # mdc address
dealerMapping: [DealerMapping!]! # dealer address mapping, defined by maker
ebcMapping: [ebcMapping!]! # ebc address mapping, defined by maker
chainIdMapping: [chainIdMapping!]! # chainId mapping, defined by maker
# mdc: [MDC!]! @derivedFrom(field: "mdcLatestColumn") # MDC
latestUpdateHash: String
latestUpdateTimestamp: BigInt
latestUpdateBlockNumber: BigInt
}
# customed using entity
type Dealer @entity {
id: ID! # dealer address
mdcs: [MDC!]! # binding MDC
rules: [ruleRel!]! # binding ruleSnapshot
feeRatio: BigInt! # uint
extraInfo: String! # string
register: Boolean!
latestUpdateHash: String!
latestUpdateTimestamp: BigInt!
latestUpdateBlockNumber: BigInt!
}
type SubgraphManager @entity {
id: ID! #101
factory: [FactoryManager!]!
totalFactory: Int!
currentFactoryTemplate: Int!
}
# customed using entity
type FactoryManager @entity {
id: ID! # factory address
mdcs: [MDC!]! # MDC[]
owners: [String!]! # ownerAddress
responseMakers: [responseMaker!]! # responseMaker[]
mdcCounts: BigInt!
# latestUpdateHash: String!
# latestUpdateTimestamp: BigInt!
# latestUpdateBlockNumber: BigInt!
#Rel
subgraphManager: SubgraphManager! @derivedFrom(field: "factory")
}
type responseMaker @entity {
id: ID! # responseMaker address
mdcs: [MDC!]! # MDC[]
factory: FactoryManager! @derivedFrom(field: "responseMakers") # FactoryManager
latestUpdateHash: String!
latestUpdateTimestamp: BigInt!
latestUpdateBlockNumber: BigInt!
}
# customed using entity
type ebcMapping @entity {
id: ID! # mdc address - ebc address
owner: String! # address
ebcAddr: String! # ebc address
ebcIndex: BigInt # uint64
enableTimestamp: BigInt
latestUpdateBlockNumber: BigInt
latestUpdateTimestamp: BigInt
latestUpdateHash: String
mdcLatestColumn: mdcLatestColumn! @derivedFrom(field: "ebcMapping") # mdcLatestColumn
}
# customed using entity
type ebcMappingSnapshot @entity {
id: ID! # mdc address - ebc address
owner: String! # address
ebcAddr: String! # ebc address
ebcIndex: BigInt # uint64
# ebcSnapshot: ebcSnapshot! @derivedFrom(field: "ebcMappingSnapshot") # ebcSnapshot
}
# customed using entity
type currBoundSpvInfo @entity {
id: ID! # mdc address - ChainId
chainId: BigInt # uint64 - the index of state varible "_spvs[]" in MDC contract
spv: String # spv address - the value of state varible "_spvs[]" in MDC contract
enableTimestamp: BigInt
mdc: MDC! @derivedFrom(field: "currBoundSpvInfo") # MDC
}
# # customed using entity
# type dealerSnapshot @entity {
# id: ID! # txHash - logIndex
# dealerList: [String!]! # dealer address array
# dealerMappingSnapshot: [dealerMappingSnapshot!]! # dealer address mapping, defined by maker
# columnArrayHash: String
# enableTimestamp: BigInt
# latestUpdateHash: String
# latestUpdateTimestamp: BigInt
# latestUpdateBlockNumber: BigInt
# # Rel
# mdc: MDC! @derivedFrom(field: "dealerSnapshot") # MDC
# }
# # customed using entity
# type ebcSnapshot @entity {
# id: ID! # txHash - logIndex
# ebcList: [String!]! # ebc address array
# ebcMappingSnapshot: [ebcMappingSnapshot!]! # ebc address mapping, defined by maker
# columnArrayHash: String
# enableTimestamp: BigInt
# latestUpdateHash: String
# latestUpdateTimestamp: BigInt
# latestUpdateBlockNumber: BigInt
# # Rel
# mdc: MDC! @derivedFrom(field: "ebcSnapshot") # MDC
# }
# type chainIdSnapshot @entity {
# id: ID! # txHash - logIndex
# chainIdList: [BigInt!]! # chainId array
# chainIdMappingSnapshot: [chainIdMappingSnapshot!]! # chainId mapping, defined by maker
# columnArrayHash: String
# enableTimestamp: BigInt
# latestUpdateHash: String
# latestUpdateTimestamp: BigInt
# latestUpdateBlockNumber: BigInt
# # Rel
# mdc: MDC! @derivedFrom(field: "chainIdSnapshot") # MDC
# }
# customed using entity
type DealerMapping @entity {
id: ID! # mdc address - dealer address
owner: String! # address
dealerAddr: String! # dealer address
dealerIndex: BigInt # uint64
enableTimestamp: BigInt # uint64
latestUpdateBlockNumber: BigInt
latestUpdateTimestamp: BigInt
latestUpdateHash: String
mdcLatestColumn: mdcLatestColumn! @derivedFrom(field: "dealerMapping") # mdcLatestColumn
}
# customed using entity
type dealerMappingSnapshot @entity {
id: ID! # hash(mdc address - dealer address - txHash - logIndex)
owner: String! # address
dealerAddr: String! # dealer address
dealerIndex: BigInt # uint64
# dealerSnapshot: dealerSnapshot! @derivedFrom(field: "dealerMappingSnapshot") # dealerSnapshot
}
# customed using entity
type chainIdMapping @entity {
id: ID! # mdc address - chainId
owner: String! # address
chainId: BigInt! # chainId
chainIdIndex: BigInt # uint64
enableTimestamp: BigInt # uint64
latestUpdateBlockNumber: BigInt
latestUpdateTimestamp: BigInt
latestUpdateHash: String
}
type chainIdMappingSnapshot @entity {
id: ID! # mdc address - chainId
owner: String! # address
chainId: BigInt! # chainId
chainIdIndex: BigInt # uint64
# chainIdSnapshot: chainIdSnapshot!
# @derivedFrom(field: "chainIdMappingSnapshot")
}
# customed using entity
type ruleRel
@entity { #contain all rules snapshot
# As MDC snapshot, id: hash(mdc-ecb-transactionHash-logIndex)
id: ID!
# rules: [rule!]! # rules in input Data
type: String! # ETH/ERC20
ruleLatest: [latestRuleSnapshot!]! # all latest rules
root: String! # String
version: Int! # uint32
sourceChainIds: [BigInt!]! # uint64[]
pledgeAmounts: [BigInt!]! # uint[]
token: String! # address
ruleUpdateVersion: [ruleUpdateVersion!]!
# related to rule
# mappingSnapshot: [mdcLatestColumn!] # ruleMapping
mdc: MDC! @derivedFrom(field: "ruleSnapshot") # MDC
ebc: ebcRel! @derivedFrom(field: "rulesList") # EBCs
# dealer: Dealer! @derivedFrom(field: "rules") # Dealer
latestUpdateHash: String
latestUpdateTimestamp: BigInt
latestUpdateBlockNumber: BigInt
}
# customed using entitys
type latestRule
@entity { # latest rule
# As MDC LatestRule: hash(mdc,ebc,chain0,chain1,token0,token1)
id: ID!
owner: String! # address
mdcAddr: String! # address
ebcAddr: String! # address
ruleKey: String # hash(chain0,chain1,token0,token1)
type: String # ETH/ERC20
chain0: BigInt! # uint64
chain1: BigInt! # uint64
chain0Status: Int # uint8
chain1Status: Int # uint8
chain0Token: String! # Address
chain1Token: String! # Address
chain0minPrice: BigInt # uint128
chain1minPrice: BigInt # uint128
chain0maxPrice: BigInt # uint128
chain1maxPrice: BigInt # uint128
chain0WithholdingFee: BigInt # uint128
chain1WithholdingFee: BigInt # uint128
chain0TradeFee: Int # uint16
chain1TradeFee: Int # uint16
chain0ResponseTime: Int # uint32
chain1ResponseTime: Int # uint32
chain0CompensationRatio: Int # uint32
chain1CompensationRatio: Int # uint32
enableTimestamp: BigInt # uint64
latestUpdateVersion: Int # uint32
latestUpdateTimestamp: BigInt
latestUpdateBlockNumber: BigInt
latestUpdateHash: String
ruleValidation: Boolean!
ruleValidationErrorstatus: String!
root: String!
# Rel
ruleUpdateRel: [ruleUpdateRel!]!
latestSnapShotID: String!
ebc: ebcRel! @derivedFrom(field: "ruleLatest") # EBCs
mdc: MDC! @derivedFrom(field: "ruleLatest") # MDC
chainPairManager: chainPairManager! @derivedFrom(field: "latestRule")
tokenPairManager: tokenPairManager! @derivedFrom(field: "latestRule")
}
# customed using entitys
type latestRuleSnapshot
@entity(immutable: true) { # latest rule
id: ID! # As MDC LatestRuleSnapshot: hash(mdc,ebc,chain0,chain1,token0,token1)
owner: String! # address
mdcAddr: String! # address
ebcAddr: String! # address
ruleKey: String # hash(chain0,chain1,token0,token1)
type: String # ETH/ERC20
chain0: BigInt! # uint64
chain1: BigInt! # uint64
chain0Status: Int # uint8
chain1Status: Int # uint8
chain0Token: String! # Address
chain1Token: String! # Address
chain0minPrice: BigInt # uint128
chain1minPrice: BigInt # uint128
chain0maxPrice: BigInt # uint128
chain1maxPrice: BigInt # uint128
chain0WithholdingFee: BigInt # uint128
chain1WithholdingFee: BigInt # uint128
chain0TradeFee: Int # uint16
chain1TradeFee: Int # uint16
chain0ResponseTime: Int # uint32
chain1ResponseTime: Int # uint32
chain0CompensationRatio: Int # uint32
chain1CompensationRatio: Int # uint32
enableTimestamp: BigInt # uint64
enableBlockNumber: BigInt
latestUpdateVersion: Int # uint32
latestUpdateTimestamp: BigInt
latestUpdateBlockNumber: BigInt
latestUpdateHash: String
ruleValidation: Boolean!
ruleValidationErrorstatus: String!
# ebc: ebcRel! @derivedFrom(field: "ruleLatest") # EBCs
# mdc: MDC! @derivedFrom(field: "ruleLatest") # MDC
ruleRelSnapshot: ruleRel! @derivedFrom(field: "ruleLatest") # ruleRel
}
# using entity, binding in contract Event
type chainRel @entity {
id: ID! # chainId
tokens: [tokenRel!]! # ChainToken
spvs: [String!]! # address[]
nativeToken: String! # address
batchLimit: BigInt # uint192
minVerifyChallengeSourceTxSecond: BigInt # uint64
maxVerifyChallengeSourceTxSecond: BigInt # uint64
minVerifyChallengeDestTxSecond: BigInt # uint64
maxVerifyChallengeDestTxSecond: BigInt # uint64
enableTimestamp: BigInt # uint64
latestUpdateBlockNumber: BigInt!
latestUpdateTimestamp: BigInt!
latestUpdateHash: String!
}
# using entity, binding in contract Event
type tokenRel @entity {
id: ID! # hash(chain - token Address)
tokenAddress: String! # address
chainId: String! # chainId
symbol: String! # string
name: String! # string
mainnetToken: String # address
decimals: Int # uint8
chain: [chainRel!]! @derivedFrom(field: "tokens") # ChainInfo
latestUpdateBlockNumber: BigInt!
latestUpdateTimestamp: BigInt!
latestUpdateHash: String!
}
type chainRelSnapshot @entity {
id: ID! # hash(txhash, logindex, chainId)
chainId: String! # chainId
spvs: [String!]! # address[]
nativeToken: String! # address
batchLimit: BigInt # uint192
minVerifyChallengeSourceTxSecond: BigInt # uint64
maxVerifyChallengeSourceTxSecond: BigInt # uint64
minVerifyChallengeDestTxSecond: BigInt # uint64
maxVerifyChallengeDestTxSecond: BigInt # uint64
enableTimestamp: BigInt # uint64
latestUpdateBlockNumber: BigInt!
latestUpdateTimestamp: BigInt!
latestUpdateHash: String!
}
type challengeUserRatioSnapshot @entity(immutable: true) {
id: ID! # hash(orManagerAddress,txHash,logIndex)
orManagerAddress: String! # address
challengeUserRatio: BigInt! # uint64
enableTimestamp: BigInt! # uint64
enableBlockNumber: BigInt!
latestUpdateBlockNumber: BigInt!
latestUpdateTimestamp: BigInt!
latestUpdateHash: String!
}
# using entity, binding in contract Event
type ebcRel @entity {
id: ID! #ebc address
mdcList: [MDC!]! # list all mdc!! who bind this ebc
rulesList: [ruleRel!]! # list all rules Snapshot!! who bind this ebc
ruleLatest: [latestRule!]! # list all latest rules!! who bind this ebc
ruleUpdateRel: [ruleUpdateRel!]!
statuses: Boolean!
latestUpdateHash: String!
}
type FeeChallengeSecondUpdated @entity(immutable: true) {
id: Bytes!
feeChallengeSecond: BigInt! # uint64
blockNumber: BigInt!
blockTimestamp: BigInt!
transactionHash: Bytes!
}
type FeeTakeOnChallengeSecondUpdated @entity(immutable: true) {
id: Bytes!
feeTakeOnChallengeSecond: BigInt! # uint64
blockNumber: BigInt!
blockTimestamp: BigInt!
transactionHash: Bytes!
}
type MaxMDCLimitUpdated @entity(immutable: true) {
id: Bytes!
maxMDCLimit: BigInt! # uint64
blockNumber: BigInt!
blockTimestamp: BigInt!
transactionHash: Bytes!
}
type MinChallengeRatioUpdated @entity(immutable: true) {
id: Bytes!
minChallengeRatio: BigInt! # uint64
blockNumber: BigInt!
blockTimestamp: BigInt!
transactionHash: Bytes!
}
type OwnershipTransferred @entity(immutable: true) {
id: Bytes!
previousOwner: Bytes # address
newOwner: Bytes # address
blockNumber: BigInt!
blockTimestamp: BigInt!
transactionHash: Bytes!
}
type ProtocolFeeUpdated @entity(immutable: true) {
id: Bytes!
protocolFee: BigInt! # uint64
blockNumber: BigInt!
blockTimestamp: BigInt!
transactionHash: Bytes!
}
type SubmitterFeeUpdated @entity(immutable: true) {
id: Bytes!
submitter: Bytes! # address
blockNumber: BigInt!
blockTimestamp: BigInt!
transactionHash: Bytes!
}
type ETHDeposit @entity(immutable: true) {
id: Bytes!
sender: Bytes! # address
amount: BigInt! # uint256
blockNumber: BigInt!
blockTimestamp: BigInt!
transactionHash: Bytes!
}
type FeeManagerOwnershipTransferred @entity(immutable: true) {
id: Bytes!
previousOwner: Bytes # address
newOwner: Bytes # address
blockNumber: BigInt!
blockTimestamp: BigInt!
transactionHash: Bytes!
}
type SubmissionUpdated @entity(immutable: true) {
id: Bytes!
startBlock: BigInt! # uint64
endBlock: BigInt! # uint64
submitTimestamp: BigInt! # uint64
profitRoot: Bytes! # bytes32
stateTransTreeRoot: Bytes! # bytes32
blockNumber: BigInt!
blockTimestamp: BigInt!
transactionHash: Bytes!
}
type SubmitterRegistered @entity(immutable: true) {
id: ID!
submitter: Bytes! # address
marginAmount: BigInt! # uint256
blockNumber: BigInt!
blockTimestamp: BigInt!
transactionHash: Bytes!
}
type Withdraw @entity(immutable: true) {
# id:hash(transactionHash, logIndex)
id: ID!
user: Bytes! # address
chainId: BigInt! # uint64
token: Bytes! # address
debt: BigInt! # uint256
amount: BigInt! # uint256
blockNumber: BigInt!
blockTimestamp: BigInt!
transactionHash: String!
}
type BlockIntervalUpdated @entity(immutable: true) {
id: ID!
blockInterval: BigInt! # uint64
latestUpdateBlockNumber: BigInt!
latestUpdateTimestamp: BigInt!
latestUpdateHash: String!
}
type HistoryBlocksRootSaved @entity(immutable: true) {
id: ID! # block number
blocksRoot: String! # bytes32
blockInterval: BigInt! # uint256
latestUpdateBlockNumber: BigInt!
latestUpdateTimestamp: BigInt!
latestUpdateHash: String!
}
type InjectOwnerUpdated @entity(immutable: true) {
id: ID!
injectOwner: Bytes! # address
latestUpdateBlockNumber: BigInt!
latestUpdateTimestamp: BigInt!
latestUpdateHash: String!
}