-
Notifications
You must be signed in to change notification settings - Fork 0
/
schema.graphql
81 lines (75 loc) · 2.24 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
type Project @entity {
id: ID! #<projectId>
benefactor: User!
projectDataIdentifier: String!
projectState: String!
projectVoteResults: [VoteStatus!]
iterationsWon: [Iteration!]
}
# Future idea
# interface DepositManipulation {
# id: ID!
# type: 4
# time: BigInt!
# iteration: BigInt!
# amount: BigInt!
# depositBefore:
# depositAfter:
# }
# type Single implements Status @entity {
# id: ID!,
# last_partner: Person
# }
type User @entity {
id: ID! #<usersAddress>
amount: BigInt!
# fix the logic for the below.
timeJoinedLeft: [BigInt!]! # so we can see a history of when they joined and left and if they joined again
iterationJoinedLeft: [Iteration!]! # if user joins and leaves in the same iteration, won't be appended again it seems
votes: [Vote!]
projects: [Project!] # If empty this user has no project. They can have multiple projects, but only one active.
proxyAddress: Bytes
nextIterationEligibleToVote: BigInt! # 0 if proposal or currently never eligible to vote
lastIterationVoted: BigInt
}
# VoteTallies
type VoteStatus @entity {
id: ID! # <iteration>-<projectId>
projectVote: BigInt!
iterationOfVoteTally: Iteration!
}
type Vote @entity {
id: ID! # <iteration>-<projectId>-<address>
voteAmount: BigInt!
voter: User!
proxyVoteAddress: Bytes
timestamp: BigInt!
iterationOfVote: Iteration!
}
type Iteration @entity {
id: ID! # <iteration>
iterationNumber: BigInt!
projectVoteTallies: [VoteStatus!]
individualVotes: [Vote!]
totalVotes: BigInt!
winningProposal: Project # there might not be a winning proposal (iteration 0)
payoutAmountForWinnerOfPreviousIteration: BigInt # this is amount is only known at end of iteration
fundsDistributed: BigInt!
winningVotes: BigInt!
interestDistribution: [BigInt!]
iterationStartTimestamp: BigInt!
iterationEndTimestamp: BigInt
minerAddress: Bytes
}
# add total deposited and other stats
# add total number of users etc...
type VoteManager @entity {
id: ID! # this should be a singleton. Give it a constant id of "VOTE_MANAGER"
currentIteration: Iteration!
latestCompleteIteration: Iteration
totalDeposited: BigInt!
totalDepositedUsers: BigInt!
totalDepositedProjects: BigInt!
numberOfUsers: BigInt!
numberOfProjects: BigInt!
}