-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
schema.graphql
138 lines (120 loc) · 2.79 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
type Metadata @entity(immutable: true){
id: ID! # Singleton
arbitrator: ArbitratorEntity!
arbitrable: ArbitrableEntity!
}
type Article @entity {
id: ID! # Storage address + blocknumber
articleID: String! # Actual IPFS content id of the article.
owner: Bytes! # The owner of the article
category: Int!
bounty: BigInt! # uint256
status: Status
challenger: Bytes
withdrawalPermittedAt: BigInt
lastCalculatedScore: BigInt!
createdAtBlock: BigInt!
createdAtTimestamp: BigInt!
lastBalanceUpdate: BigInt!
disputes: [DisputeEntity!] @derivedFrom(field: "article")
events: [EventEntity!] @derivedFrom(field: "article")
arbitrator: ArbitratorEntity!
arbitratorExtraData: Bytes
}
type ArticleStorage @entity {
id: ID! # article storage address
articleEntityID: String! # primary key of Article entity
}
type ContributionEntity @entity {
id: ID! # DisputeID-round-contributor-ruling
amount: BigInt!
contributor: User!
}
type User @entity {
id: ID!
contributions: [ContributionEntity!]! @derivedFrom(field: "contributor")
rewards: [RewardEntity!] @derivedFrom(field: "beneficiary")
}
type RewardEntity @entity {
id: ID! # DisputeID-userID
totalWithdrawableAmount: BigInt!
withdrew: Boolean!
beneficiary: User!
}
type DisputeEntity @entity {
id: ID! # DisputeID
ruled: Boolean
ruling: BigInt
article: Article!
period: Period
lastPeriodChange: BigInt
court: CourtEntity!
rounds: [RoundEntity!]! @derivedFrom(field: "dispute")
contributors: [User!]!
}
type RoundEntity @entity {
id: ID! # DisputeID-RoundID
dispute: DisputeEntity!
jurySize: BigInt!
votesPerChoice: [BigInt!]!
raisedSoFar: [BigInt!]! # indexed By Ruling
appealDeadline: [BigInt!]! # indexed by ruling
totalToBeRaised: [BigInt!]! # indexed by ruling
hasPaid: [Boolean!]!
}
type CourtEntity @entity {
id: ID! # CourtID
policyURI: String
hiddenVotes: Boolean!
timesPerPeriod: [BigInt!]!
}
type ArbitratorEntity @entity {
id: ID! # Arbitrator address
network: Bytes!
phase: Phase!
lastPhaseChange: BigInt!
lastDelayedSetStake: BigInt!
nextDelayedSetStake: BigInt!
minStakingTime: BigInt!
}
type ArbitrableEntity @entity {
id: ID! # Contract address
network: Bytes!
}
type EventEntity @entity {
id: ID! # transactionHash-logIndex
name: String!
details: String # Any extra detail about an event
timestamp: BigInt!
from: Bytes!
article: Article!
}
type MetaEvidenceEntity @entity {
id: ID! # 0
uri: String!
}
type CrowdfundingStatus @entity {
id: ID! # disputeID-round-ruling
fullyFunded: Boolean!
}
enum Status {
"I don't know how to use this inside the mapping"
Absent
Debunked
Withdrawn
TimelockStarted
Challenged
Live
}
enum Period {
evidence
commit
vote
appeal
execution
}
enum Phase {
staking
generating
drawing
}