This repository has been archived by the owner on Oct 6, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathschema.graphql
117 lines (106 loc) · 2.19 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
type DAO @entity {
id: ID!
agreements: [Agreement!] @derivedFrom(field: "dao")
}
type Agreement @entity {
id: ID!
dao: DAO!
title: String
collateralToken: ERC20
arbitrator: Bytes
currentSetting: Setting
actions: [Action!] @derivedFrom(field: "agreement")
signers: [Signer!] @derivedFrom(field: "agreement")
settings: [Setting!] @derivedFrom(field: "agreement")
tokenBalancePermission: TokenBalancePermission @derivedFrom(field: "agreement")
}
enum ActionState {
Scheduled,
Challenged,
Executed,
Cancelled
}
enum ChallengeState {
Waiting,
Settled,
Disputed,
Rejected,
Accepted,
Voided
}
type Signer @entity {
id: ID!
agreement: Agreement!
address: Bytes!
available: BigInt!
locked: BigInt!
challenged: BigInt!
actions: [Action!] @derivedFrom(field: "submitter")
}
type Action @entity {
id: ID!
agreement: Agreement!
actionId: BigInt!
challengeEndDate: BigInt!
script: Bytes!
context: Bytes!
state: ActionState!
submitter: Signer!
setting: Setting!
challenge: Challenge @derivedFrom(field: "action")
createdAt: BigInt!
}
type Challenge @entity {
id: ID!
action: Action!
context: Bytes!
settlementEndDate: BigInt!
challenger: Bytes!
settlementOffer: BigInt!
arbitratorFeeAmount: BigInt!
arbitratorFeeToken: ERC20!
state: ChallengeState!
dispute: Dispute @derivedFrom(field: "challenge")
createdAt: BigInt!
}
type Dispute @entity {
id: ID!
disputeId: BigInt!
ruling: BigInt!
challenge: Challenge!
submitterFinishedEvidence: Boolean!
challengerFinishedEvidence: Boolean!
evidences: [Evidence!] @derivedFrom(field: "dispute")
createdAt: BigInt!
}
type Evidence @entity {
id: ID!
dispute: Dispute!
data: Bytes!
submitter: Bytes!
createdAt: BigInt!
}
type Setting @entity {
id: ID!
agreement: Agreement!
settingId: BigInt!
content: Bytes!
delayPeriod: BigInt!
settlementPeriod: BigInt!
collateralAmount: BigInt!
challengeCollateral: BigInt!
}
type TokenBalancePermission @entity {
id: ID!
agreement: Agreement!
signToken: ERC20
signBalance: BigInt!
challengeToken: ERC20
challengeBalance: BigInt!
}
type ERC20 @entity {
id: ID!
name: String!
symbol: String!
decimals: Int!
}