-
Notifications
You must be signed in to change notification settings - Fork 2
/
schema.graphql
59 lines (52 loc) · 1.6 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
"A Crowdfund created by the CrowdfundFactory"
type Crowdfund @entity {
id: ID! # crowdfundproxy address
operator: Bytes!
crowdfundProxy: Bytes!
editionsContract: EditionsContract! # Editions source contract
name: String!
symbol: String!
fundingCap: BigInt!
operatorPercent: BigInt!
contributors: [Contribution!] @derivedFrom(field: "crowdfund")
closed: Boolean!
amountRaised: BigInt! # Sum of the contributions with direct funds and with purchased editions
editions:[Edition!] @derivedFrom(field: "crowdfund")
}
"The user that contributes to crowdfunds on Mirror"
type Contributor @entity {
id: ID! # address
contributions: [Contribution!] @derivedFrom(field: "contributor")
editionContributions: [EditionContribution!] @derivedFrom(field: "contributor")
}
"Contribution to a crowdfund by purchasing an Edition"
type EditionContribution @entity {
id: ID! # tx hash
contributor: Contributor!
funds: BigInt!
edition: Edition!
}
"Contribution of an user to a crowdfound"
type Contribution @entity {
id: ID! # tx hash
contributor: Contributor!
funds: BigInt!
crowdfund: Crowdfund!
}
"The contract that creates editions for one or multiple crowdfunds "
type EditionsContract @entity {
id: ID! # contract address
editions:[Edition!] @derivedFrom(field: "address")
crowdfunds: [Crowdfund!]! @derivedFrom(field: "editionsContract")
}
"A crowdfund edition"
type Edition @entity {
id: ID! # contract address + '-' + editionId(hex)
contributors: [Contributor!]
quantity: BigInt!
price: BigInt!
sold: BigInt!
crowdfund: Crowdfund!
address: EditionsContract!
editionId: BigInt!
}