-
Notifications
You must be signed in to change notification settings - Fork 18
/
Copy pathsubgraph.yaml
112 lines (112 loc) · 3.19 KB
/
subgraph.yaml
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
specVersion: 0.0.2
schema:
file: ./schema.graphql
dataSources:
# This approach uses a particular event emitted once very early to trigger token registry
# initialization. It is not so important what the event is but rather that it was emitted before
# any other event of an ERC20 token. We even don't know what contract it is. Besides that, the ABI
# file for that contract was inferred since no contract information or source code is available
# out there.
- name: TokenRegistry
kind: ethereum/contract
network: mainnet
source:
abi: TokenRegistry
address: '0x7f751820be4b1e44464268c425af6095995e045a'
startBlock: 75563
mapping:
kind: ethereum/events
apiVersion: 0.0.4
language: wasm/assemblyscript
file: ./src/mappings/registry.ts
entities:
- Token
abis:
- name: TokenRegistry
file: ./abis/TokenRegistry.json
- name: ERC20
file: ./abis/ERC20.json
eventHandlers:
- event: 'Unknown(indexed bytes,indexed bytes)'
topic0: '0xa9e319c3b10db96c5cee4bc3ebffa9c5581f222f14a4deb0df7ec2088ccd0974'
handler: initRegistry
templates:
# These data sources templates exist to support the different flags that a token could specify
- name: StandardToken
kind: ethereum/contract
network: mainnet
source:
abi: ERC20
mapping:
kind: ethereum/events
apiVersion: 0.0.4
language: wasm/assemblyscript
file: ./src/mappings/token.ts
entities:
- TransferEvent
abis:
- name: ERC20
file: ./abis/ERC20.json
eventHandlers:
- event: Transfer(indexed address,indexed address,uint256)
handler: handleTransfer
- name: BurnableToken
kind: ethereum/contract
network: mainnet
source:
abi: Burnable
mapping:
kind: ethereum/events
apiVersion: 0.0.4
language: wasm/assemblyscript
file: ./src/mappings/token.ts
entities:
- BurnEvent
abis:
- name: Burnable
file: ./abis/Burnable.json
eventHandlers:
- event: Burn(indexed address,uint256)
handler: handleBurn
- name: MintableToken
kind: ethereum/contract
network: mainnet
source:
abi: Mintable
mapping:
kind: ethereum/events
apiVersion: 0.0.4
language: wasm/assemblyscript
file: ./src/mappings/token.ts
entities:
- MintEvent
abis:
- name: Mintable
file: ./abis/Mintable.json
eventHandlers:
- event: Mint(indexed address,uint256)
handler: handleMint
- name: PausableToken
kind: ethereum/contract
network: mainnet
source:
abi: Pausable
mapping:
kind: ethereum/events
apiVersion: 0.0.4
language: wasm/assemblyscript
file: ./src/mappings/token.ts
entities:
- Token
abis:
- name: Pausable
file: ./abis/Pausable.json
eventHandlers:
- event: Pause()
handler: handlePause
- event: Unpause()
handler: handleUnpause
- event: Paused(address)
handler: handlePaused
- event: Unpaused(address)
handler: handleUnpaused