-
Notifications
You must be signed in to change notification settings - Fork 435
/
schema.graphql
762 lines (513 loc) · 17 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
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
type DelegationEvent @entity {
"The txn hash of this event + nounId"
id: ID!
"The Noun being delegated"
noun: Noun!
"Current delegator address"
delegator: Account!
"Previous delegate address"
previousDelegate: Delegate!
"New delegate address"
newDelegate: Delegate!
"Block number of the event"
blockNumber: BigInt!
"The timestamp of the block the event is in"
blockTimestamp: BigInt!
}
type TransferEvent @entity {
"The txn hash of this event"
id: ID!
"The Noun being transfered"
noun: Noun!
"Previous holder address"
previousHolder: Account!
"New holder address"
newHolder: Account!
"Block number of the event"
blockNumber: BigInt!
"The timestamp of the block the event is in"
blockTimestamp: BigInt!
}
type Seed @entity {
"The Noun's ERC721 token id"
id: ID!
"The background index"
background: BigInt!
"The body index"
body: BigInt!
"The accessory index"
accessory: BigInt!
"The head index"
head: BigInt!
"The glasses index"
glasses: BigInt!
}
type Noun @entity {
"The Noun's ERC721 token id"
id: ID!
"The seed used to determine the Noun's traits"
seed: Seed
"The owner of the Noun"
owner: Account!
"Historical votes for the Noun"
votes: [Vote!]! @derivedFrom(field: "nouns")
}
type Bid @entity {
"Noun.id-amount"
id: ID!
"The Noun being bid on"
noun: Noun!
"Bid amount"
amount: BigInt!
"Bidder account"
bidder: Account
"Block number of the bid"
blockNumber: BigInt!
"Transaction hash for the bid"
txHash: Bytes!
"Index of transaction within block"
txIndex: BigInt!
"The auction being bid in"
auction: Auction!
"The timestamp of the block the bid is in"
blockTimestamp: BigInt!
"The ID of the client that facilitated this bid"
clientId: Int
}
type Auction @entity {
"The Noun's ERC721 token id"
id: ID!
"The Noun"
noun: Noun!
"The current highest bid amount"
amount: BigInt!
"The time that the auction started"
startTime: BigInt!
"The time that the auction is scheduled to end"
endTime: BigInt!
"The account with the current highest bid"
bidder: Account
"Whether or not the auction has been settled"
settled: Boolean!
clientId: Int!
"The auction bids"
bids: [Bid!]! @derivedFrom(field: "auction")
}
enum ProposalStatus {
PENDING
ACTIVE
CANCELLED
VETOED
QUEUED
EXECUTED
}
type Account @entity {
"An Account is any address that holds any amount of Nouns, the id used is the blockchain address."
id: ID!
"Delegate address of the token holder which will participate in votings. Delegates don't need to hold any tokens and can even be the token holder itself."
delegate: Delegate
"Noun balance of this address expressed in the smallest unit of the Nouns ERC721 Token"
tokenBalanceRaw: BigInt!
"Noun balance of this address expressed as a BigInt normalized value for the Nouns ERC721 Token"
tokenBalance: BigInt!
"Total amount of Nouns ever held by this address expressed in the smallest unit of the Nouns ERC721 Token"
totalTokensHeldRaw: BigInt!
"Total amount of Nouns ever held by this address expressed as a BigInt normalized value for the Nouns ERC721 Token"
totalTokensHeld: BigInt!
"The Nouns owned by this account"
nouns: [Noun!]!
}
type Delegate @entity {
"A Delegate is any address that has been delegated with voting tokens by a token holder, id is the blockchain address of said delegate"
id: ID!
"Amount of votes delegated to this delegate to be used on proposal votings expressed in the smallest unit of the Nouns ERC721 Token"
delegatedVotesRaw: BigInt!
"Amount of votes delegated to this delegate to be used on proposal votings expressed as a BigInt normalized value for the Nouns ERC721 Token"
delegatedVotes: BigInt!
tokenHoldersRepresentedAmount: Int!
"Token holders that this delegate represents"
tokenHoldersRepresented: [Account!]! @derivedFrom(field: "delegate")
"Nouns that this delegate represents"
nounsRepresented: [Noun!]!
"Votes that a delegate has made in different proposals"
votes: [Vote!]! @derivedFrom(field: "voter")
"Proposals that the delegate has created"
proposals: [Proposal!]! @derivedFrom(field: "proposer")
}
type Proposal @entity {
"Internal proposal ID, in this implementation it seems to be a autoincremental id"
id: ID!
"Delegate that proposed the change"
proposer: Delegate!
"Delegates that signed on this proposal to get it over the proposal threshold"
signers: [Delegate!]
"Targets data for the change"
targets: [Bytes!]
"Values data for the change"
values: [BigInt!]
"Signature data for the change"
signatures: [String!]
"Call data for the change"
calldatas: [Bytes!]
"The proposal creation timestamp"
createdTimestamp: BigInt!
"The proposal creation block"
createdBlock: BigInt!
"The proposal's last update timestamp"
lastUpdatedTimestamp: BigInt!
"The proposal's last update block"
lastUpdatedBlock: BigInt!
"The proposal creation transaction hash"
createdTransactionHash: Bytes!
"The proposal's last update transaction hash"
lastUpdatedTransactionHash: Bytes!
"Block number from where the voting starts"
startBlock: BigInt!
"Block number from where the voting ends"
endBlock: BigInt!
"The proposal threshold at the time of proposal creation"
proposalThreshold: BigInt
"The required number of votes for quorum at the time of proposal creation"
quorumVotes: BigInt
"The number of votes in favor of the proposal"
forVotes: BigInt!
"The number of votes against of the proposal"
againstVotes: BigInt!
"The number of votes to abstain on the proposal"
abstainVotes: BigInt!
"The proposal title, parsed from the description"
title: String!
"The full proposal description, which includes the title"
description: String!
"Status of the proposal"
status: ProposalStatus
"Once the proposal is queued for execution it will have an ETA of the execution"
executionETA: BigInt
"Votes associated to this proposal"
votes: [Vote!]! @derivedFrom(field: "proposal")
"Total supply when this proposal was created"
totalSupply: BigInt!
"Adjusted total supply when this proposal was created"
adjustedTotalSupply: BigInt!
"Dynamic quorum param snapshot: min quorum basis points"
minQuorumVotesBPS: Int!
"Dynamic quorum param snapshot: max quorum basis points"
maxQuorumVotesBPS: Int!
"Dynamic quorum param snapshot: the dynamic quorum coefficient"
quorumCoefficient: BigInt!
"The objection period end block"
objectionPeriodEndBlock: BigInt!
"The update period end block"
updatePeriodEndBlock: BigInt
"Feedback posts associated to this proposal"
feedbackPosts: [ProposalFeedback!]! @derivedFrom(field: "proposal")
"True if the proposal was created via proposeOnTimelockV1"
onTimelockV1: Boolean
"The block at which voting balance snapshots are taken for this proposal"
voteSnapshotBlock: BigInt!
"The block number at which this proposal was canceled"
canceledBlock: BigInt
"The timestamp when this proposal was canceled"
canceledTimestamp: BigInt
"The transaction hash when the proposal was canceled"
canceledTransactionHash: Bytes
"The block number at which this proposal was executed"
executedBlock: BigInt
"The timestamp when this proposal was executed"
executedTimestamp: BigInt
"The transaction hash when the proposal was executed"
executedTransactionHash: Bytes
"The block number at which this proposal was vetoed"
vetoedBlock: BigInt
"The timestamp when this proposal was vetoed"
vetoedTimestamp: BigInt
"The transaction hash when the proposal was vetoed"
vetoedTransactionHash: Bytes
"The block number at which this proposal was queued"
queuedBlock: BigInt
"The timestamp when this proposal was queued"
queuedTimestamp: BigInt
"The transaction hash when the proposal was queued"
queuedTransactionHash: Bytes
"The ID of the client that facilitated this proposal"
clientId: Int!
}
type ProposalVersion @entity(immutable: true) {
id: ID!
"The proposal that was updated"
proposal: Proposal!
"The block number of the update"
createdBlock: BigInt!
"The block timestamp of the update"
createdAt: BigInt!
"The transaction hash of the update"
createdTransactionHash: Bytes!
"Targets data for the change"
targets: [Bytes!]
"Values data for the change"
values: [BigInt!]
"Signature data for the change"
signatures: [String!]
"Call data for the change"
calldatas: [Bytes!]
"The proposal title, parsed from the description"
title: String!
"The full proposal description, which includes the title"
description: String!
"The update message of this proposal version, relevant when it's a proposal update"
updateMessage: String!
}
type Vote @entity {
"Delegate ID + Proposal ID"
id: ID!
"Whether the vote is in favour of the proposal"
support: Boolean!
"The integer support value: against (0), for (1), or abstain (2)"
supportDetailed: Int!
"Amount of votes in favour or against expressed in the smallest unit of the Nouns ERC721 Token"
votesRaw: BigInt!
"Amount of votes in favour or against expressed as a BigInt normalized value for the Nouns ERC721 Token"
votes: BigInt!
"The optional vote reason"
reason: String
"Delegate that emitted the vote"
voter: Delegate!
"The Nouns used to vote"
nouns: [Noun!]
"Proposal that is being voted on"
proposal: Proposal!
"Block number of vote"
blockNumber: BigInt!
"The timestamp of the block the vote is in"
blockTimestamp: BigInt!
"The transaction hash of the vote"
transactionHash: Bytes!
"The ID of the client that facilitated this vote"
clientId: Int!
}
type Governance @entity {
"Unique entity used to keep track of common aggregated data"
id: ID!
"Number of proposals created"
proposals: BigInt!
"Total number of token holders currently"
currentTokenHolders: BigInt!
"Total number of delegates participating on the governance currently"
currentDelegates: BigInt!
"Total number of token holders"
totalTokenHolders: BigInt!
"Total number of delegates that held delegated votes"
totalDelegates: BigInt!
"Total number of votes delegated expressed in the smallest unit of the Nouns ERC721 Token"
delegatedVotesRaw: BigInt!
"Total number of votes delegated expressed as a BigInt normalized value for the Nouns ERC721 Token"
delegatedVotes: BigInt!
"Number of proposals currently queued for execution"
proposalsQueued: BigInt!
"The proposal ID from which vote snapshots are taken at vote start instead of proposal creation"
voteSnapshotBlockSwitchProposalId: BigInt!
"Number of candidates created"
candidates: BigInt!
}
type DynamicQuorumParams @entity {
"Unique entity used to store the latest dymanic quorum params"
id: ID!
"Min quorum basis points"
minQuorumVotesBPS: Int!
"Max quorum basis points"
maxQuorumVotesBPS: Int!
"The dynamic quorum coefficient"
quorumCoefficient: BigInt!
"The block from which proposals are using DQ, based on when we first see configuration being set"
dynamicQuorumStartBlock: BigInt
}
type ProposalCandidate @entity {
"A concatination of proposer and slug"
id: ID!
"The proposer account"
proposer: Bytes!
"The candidate slug, together with the proposer account makes the candidate's unique key"
slug: String!
"The proposal candidate creation transaction hash"
createdTransactionHash: Bytes!
"The proposal candidate creation timestamp"
createdTimestamp: BigInt!
"The proposal candidate creation block"
createdBlock: BigInt!
"The proposal candidate's last update timestamp"
lastUpdatedTimestamp: BigInt!
"The proposal candidate's last update block"
lastUpdatedBlock: BigInt!
"Whether this candidate was canceled or not"
canceled: Boolean!
"The timestamp at which this candidate was canceled"
canceledTimestamp: BigInt
"The block number at which this candidate was canceled"
canceledBlock: BigInt
"The transaction hash at which this candidate was canceled"
canceledTransactionHash: Bytes
"Latest version of the proposal"
latestVersion: ProposalCandidateVersion!
"This candidate's versions"
versions: [ProposalCandidateVersion!]! @derivedFrom(field: "proposal")
"This candidate's number"
number: BigInt!
}
type ProposalCandidateVersion @entity(immutable: true) {
"A concatination of tx hash and log index, just to make sure these entities have a unique ID"
id: ID!
"The proposal candidate this entity is a version of"
proposal: ProposalCandidate!
"This version's creation timestamp"
createdTimestamp: BigInt!
"The version's creation block"
createdBlock: BigInt!
"The update message of this version, relevant when it's an update"
updateMessage: String!
"The proposal content"
content: ProposalCandidateContent!
}
type ProposalCandidateContent @entity {
"The encoded proposal hash"
id: ID!
"The proposer account"
proposer: Bytes!
"Targets data for the change"
targets: [Bytes!]
"Values data for the change"
values: [BigInt!]
"Signature data for the change"
signatures: [String!]
"Call data for the change"
calldatas: [Bytes!]
"The full proposal description, which includes the title"
description: String!
"The proposal id that this content is updating. 0 if it's a new proposal"
proposalIdToUpdate: BigInt!
"The proposal title, parsed from the description"
title: String!
"The encoded proposal hash in bytes"
encodedProposalHash: Bytes!
"IDs of proposals (not candidates) with the same content"
matchingProposalIds: [BigInt!]
"This proposal's content signatures by signers"
contentSignatures: [ProposalCandidateSignature!]! @derivedFrom(field: "content")
}
type ProposalCandidateSignature @entity {
"A concatination of tx hash and log index, just to make sure these entities have a unique ID"
id: ID!
"The candidate content this signature is signing on"
content: ProposalCandidateContent!
"The signing account"
signer: Delegate!
"The signature bytes"
sig: Bytes!
"The signature's expiration timestamp"
expirationTimestamp: BigInt!
"The hash of the abi encoded proposal data"
encodedProposalHash: Bytes!
"The typed signature hash"
sigDigest: Bytes!
"The free text signer reason"
reason: String!
"Whether this signature has been canceled"
canceled: Boolean!
"The signature's creation timestamp"
createdTimestamp: BigInt!
"The signature's creation block"
createdBlock: BigInt!
"The signature's transaction hash"
createdTransactionHash: Bytes!
}
type ProposalFeedback @entity(immutable: true) {
"A concatination of tx hash and log index, just to make sure these entities have a unique ID"
id: ID!
"This feedback's creation timestamp"
createdTimestamp: BigInt!
"The feedback's creation block"
createdBlock: BigInt!
"The proposal this feedback is provided on"
proposal: Proposal!
"The voter account providing the feedback"
voter: Delegate!
"The integer support value: against (0), for (1), or abstain (2)"
supportDetailed: Int!
"Amount of votes voter had when feedback was submitted"
votes: BigInt!
"The optional feedback reason free text"
reason: String
}
type CandidateFeedback @entity(immutable: true) {
"A concatination of tx hash and log index, just to make sure these entities have a unique ID"
id: ID!
"This feedback's creation timestamp"
createdTimestamp: BigInt!
"The feedback's creation block"
createdBlock: BigInt!
"The proposal candidate this feedback is provided on"
candidate: ProposalCandidate!
"The voter account providing the feedback"
voter: Delegate!
"The integer support value: against (0), for (1), or abstain (2)"
supportDetailed: Int!
"Amount of votes voter had when feedback was submitted"
votes: BigInt!
"The optional feedback reason free text"
reason: String
}
type Fork @entity {
"The fork ID given by the escrow contract"
id: ID!
"The fork ID as int, to make it easier to query for the latest fork"
forkID: BigInt!
tokensInEscrowCount: Int!
escrowDeposits: [EscrowDeposit!]! @derivedFrom(field: "fork")
escrowWithdrawals: [EscrowWithdrawal!]! @derivedFrom(field: "fork")
executed: Boolean
executedAt: BigInt
forkingPeriodEndTimestamp: BigInt
forkTreasury: Bytes
forkToken: Bytes
tokensForkingCount: Int!
escrowedNouns: [EscrowedNoun!]! @derivedFrom(field: "fork")
joinedNouns: [ForkJoinedNoun!]! @derivedFrom(field: "fork")
}
type EscrowDeposit @entity(immutable: true) {
id: ID!
fork: Fork!
createdAt: BigInt!
owner: Delegate!
tokenIDs: [BigInt!]!
proposalIDs: [BigInt!]!
reason: String
}
type EscrowWithdrawal @entity(immutable: true) {
id: ID!
fork: Fork!
createdAt: BigInt!
owner: Delegate!
tokenIDs: [BigInt!]!
}
type ForkJoin @entity(immutable: true) {
id: ID!
fork: Fork!
createdAt: BigInt!
owner: Delegate!
tokenIDs: [BigInt!]!
proposalIDs: [BigInt!]!
reason: String
}
type EscrowedNoun @entity {
id: ID!
fork: Fork!
noun: Noun!
owner: Delegate!
escrowDeposit: EscrowDeposit!
}
type ForkJoinedNoun @entity(immutable: true) {
id: ID!
fork: Fork!
noun: Noun!
owner: Delegate!
forkJoin: ForkJoin!
}