-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathschema.graphql
151 lines (134 loc) · 4.23 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
type Moloch @entity {
id: ID!
summoner: Bytes!
summoningTime: BigInt!
periodDuration: BigInt!
votingPeriodLength: BigInt!
gracePeriodLength: BigInt!
proposalDeposit: BigInt!
dilutionBound: BigInt!
processingReward: BigInt!
depositToken: Token!
approvedTokens:[Token!]!
"NOTE: Resolves to all Token entities that include the DAO's ID."
tokens: [Token!]! @derivedFrom(field: "moloch")
"NOTE: Resolves to all Member entities that include the DAO's id."
members: [Member!] @derivedFrom(field: "moloch")
"NOTE: Resolves to all Token balances that include the DAO's id."
tokenBalances: [TokenBalance!] @derivedFrom(field: "moloch")
"NOTE: Resolves to all Proposals that include the DAO's id."
proposals: [Proposal!] @derivedFrom(field: "moloch")
"NOTE: SC Semantics: guild bank address is 0xDEAD"
guildTokenBalance: [TokenBalance!]
"NOTE: SC Semantics: guild bank address is 0xBEEF"
escrowTokenBalance: [TokenBalance!]
"TODO: update on all event handlers -- currentPeriod = now.sub(summoningTime).div(periodDuration)"
currentPeriod: BigInt!
totalShares: BigInt!
totalLoot: BigInt!
proposalCount: BigInt!
proposalQueueCount: BigInt!
"NOTE: No flag for new member proposal check if applicant address is already a member"
proposedToJoin: [Proposal!]
proposedToWhitelist: [Proposal!]
proposedToKick: [Proposal!]
proposedToFund: [Proposal!]
proposedToTrade: [Proposal!]
}
type TokenBalance @entity {
id: ID!
"NOTE: tracks token balances for multiple Moloch instances (no change required for upgrade)"
moloch: Moloch!
token: Token!
tokenBalance: BigInt!
member: Member
guildBank: Boolean!
ecrowBank: Boolean!
memberBank: Boolean!
}
type Token @entity {
id: ID!
"TODO: moloch DAOs share token refferences"
moloch: Moloch!
tokenAddress: Bytes!
whitelisted: Boolean!
"TODO: pull in from etherscan"
ticker: String
logo: String
details: String
approved: Proposal
}
type Member @entity {
id: ID!
"TODO: members can be a part of multiple molochs"
moloch: Moloch!
memberAddress: Bytes!
delegateKey: Bytes!
shares: BigInt!
loot: BigInt!
exists: Boolean!
highestIndexYesVote: Proposal
tokenTribute: BigInt!
didRagequit: Boolean!
votes: [Vote!] @derivedFrom(field: "member")
submissions: [Proposal!] @derivedFrom(field: "member")
tokenBalances: [TokenBalance!] @derivedFrom(field: "member")
proposedToKick: Boolean!
kicked: Boolean!
jailed: Proposal
}
type Vote @entity {
id: ID!
timestamp:String!
proposal: Proposal!
member: Member!
uintVote: Int!
}
type Proposal @entity {
id: ID!
"NOTE: tracks Proposals for multiple Moloch instances (no change required for upgrade)"
proposalIndex: BigInt
proposalId: BigInt!
moloch: Moloch!
timestamp: String!
member: Member!
memberAddress: Bytes!
delegateKey: Bytes!
applicant: Bytes!
proposer: Bytes!
sponsor: Bytes!
sharesRequested: BigInt!
lootRequested: BigInt!
tributeOffered: BigInt!
tributeToken: Bytes!
paymentRequested: BigInt!
paymentToken: Bytes!
startingPeriod: BigInt!
yesVotes: BigInt!
noVotes: BigInt!
sponsored: Boolean! #flags[0]
processed: Boolean! #flags[1]
didPass: Boolean! #flags[2]
cancelled: Boolean! #flags[3]
whitelist: Boolean! #flags[4]
guildkick: Boolean! #flags[5]
newMember: Boolean! #no flag yet
trade: Boolean! #not flag yet
details: String!
maxTotalSharesAndLootAtYesVote: BigInt!
votes: [Vote!] @derivedFrom(field: "proposal")
yesShares: BigInt!
noShares: BigInt!
# "TODO: might as well sort on back end and make front end lives easier? make block update function that updates proposals on period change"
# "NOTE: Proposals that are not sponsored do not make it into the proposal queue"
# "NOTE: After $sponsorProposal is called $proposal.startingPeriod is set and a voting period of $votingPeriodLength begins"
# "NOTE: After $votingPeriodLength begining after $sponsorProposal a grace period of $gracePeriodLength begins, there is no event to listen to to trigger this change"
# "NOTE: Finally $processProposal can be called after $votingPeriodLength + $gracePeriodLength from $proposal.startingPeriod"
# stage: ProposalStage
}
# enum ProposalStage {
# NOTSPONSORED
# VOTINGPERIOD
# GRACEPERIOD
# PROCESSED
# }