-
Notifications
You must be signed in to change notification settings - Fork 4
/
subgraph.mustache
166 lines (166 loc) · 5.7 KB
/
subgraph.mustache
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
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
specVersion: 0.0.4
description: Moonwell is an open lending and borrowing DeFi protocol on Moonbeam and Moonriver
repository: https://github.com/moonwell-fi/moonwell-subgraph
schema:
file: ./schema.graphql
dataSources:
- kind: ethereum/contract
name: Comptroller
network: {{ network }}
source:
address: '{{ comptrollerAddr }}'
abi: Comptroller
startBlock: {{ comptrollerStartBlock }}
mapping:
kind: ethereum/events
apiVersion: 0.0.7
language: wasm/assemblyscript
file: ./src/comptroller.ts
entities:
- Comptroller
- Market
abis:
- name: Comptroller
file: ./abis/comptroller.json
- name: CToken
file: ./abis/ctoken.json
- name: PriceOracle
file: ./abis/priceOracle.json
- name: ERC20
file: ./abis/erc20.json
- name: FeedProxy
file: ./abis/feedProxy.json
eventHandlers:
- event: MarketListed(address)
handler: handleMarketListed
- event: MarketEntered(address,address)
handler: handleMarketEntered
- event: MarketExited(address,address)
handler: handleMarketExited
- event: NewCloseFactor(uint256,uint256)
handler: handleNewCloseFactor
- event: NewCollateralFactor(address,uint256,uint256)
handler: handleNewCollateralFactor
- event: NewLiquidationIncentive(uint256,uint256)
handler: handleNewLiquidationIncentive
- event: NewPriceOracle(address,address)
handler: handleNewPriceOracle
- event: NewBorrowCap(indexed address,uint256)
handler: handleNewBorrowCap
- event: ActionPaused(address,string,bool)
handler: handleMTokenActionPaused
- kind: ethereum/contract
name: Governor
network: {{ network }}
source:
address: '{{ governorAddr }}'
abi: Governor
startBlock: {{ governorStartBlock }}
mapping:
kind: ethereum/events
apiVersion: 0.0.7
language: wasm/assemblyscript
file: ./src/governor.ts
entities: []
abis:
- name: Governor
file: ./abis/governor.json
eventHandlers:
- event: ProposalCanceled(uint256)
handler: handleProposalCanceled
- event: ProposalCreated(uint256,address,address[],uint256[],string[],bytes[],uint256,uint256,string)
handler: handleProposalCreated
- event: ProposalCreated(uint256,address,address[],uint256[],string[],bytes[],uint256,uint256,string,uint256)
handler: handleProposalCreated
- event: ProposalExecuted(uint256)
handler: handleProposalExecuted
- event: ProposalQueued(uint256,uint256)
handler: handleProposalQueued
- event: VoteCast(address,uint256,uint8,uint256)
handler: handleVoteCast
- event: BreakGlassGuardianChanged(address,address)
handler: handleBreakGlassGuardianChanged
- event: ProposalThresholdChanged(uint256,uint256)
handler: handleProposalThresholdChanged
- event: QuroumVotesChanged(uint256,uint256)
handler: handleQuorumVotesChanged
- event: VotingDelayChanged(uint256,uint256)
handler: handleVotingDelayedChanged
- event: VotingPeriodChanged(uint256,uint256)
handler: handleVotingPeriodChanged
templates:
- name: CToken
kind: ethereum/contract
network: {{ network }}
source:
abi: CToken
mapping:
kind: ethereum/events
apiVersion: 0.0.7
language: wasm/assemblyscript
file: ./src/ctoken.ts
entities:
- User
- Market
abis:
- name: CToken
file: ./abis/ctoken.json
- name: Comptroller
file: ./abis/comptroller.json
- name: PriceOracle
file: ./abis/priceOracle.json
- name: ERC20
file: ./abis/erc20.json
- name: SolarbeamLPToken
file: ./abis/solarbeamLPToken.json
eventHandlers:
- event: Mint(address,uint256,uint256)
handler: handleMint
- event: Redeem(address,uint256,uint256)
handler: handleRedeem
- event: Borrow(address,uint256,uint256,uint256)
handler: handleBorrow
- event: RepayBorrow(address,address,uint256,uint256,uint256)
handler: handleRepayBorrow
- event: LiquidateBorrow(address,address,uint256,address,uint256)
handler: handleLiquidateBorrow
- event: AccrueInterest(uint256,uint256,uint256,uint256)
handler: handleAccrueInterest
- event: NewReserveFactor(uint256,uint256)
handler: handleNewReserveFactor
- event: Transfer(indexed address,indexed address,uint256)
handler: handleTransfer
- event: NewMarketInterestRateModel(address,address)
handler: handleNewMarketInterestRateModel
- name: Feed
kind: ethereum/contract
network: {{ network }}
source:
abi: Feed
mapping:
kind: ethereum/events
apiVersion: 0.0.7
language: wasm/assemblyscript
file: ./src/price.ts
entities:
- Market
abis:
- name: CToken
file: ./abis/ctoken.json
- name: Feed
file: ./abis/feed.json
- name: FeedProxy
file: ./abis/feedProxy.json
- name: Comptroller
file: ./abis/comptroller.json
- name: PriceOracle
file: ./abis/priceOracle.json
- name: SafetyModule
file: ./abis/SafetyModule.json
- name: SolarbeamLPToken
file: ./abis/solarbeamLPToken.json
eventHandlers:
- event: AnswerUpdated(indexed int256,indexed uint256,uint256)
handler: handleAnswerUpdated
blockHandlers:
- handler: handleBlock