-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathsubgraph.yaml
65 lines (64 loc) · 2.05 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
specVersion: 0.0.4
schema:
file: ./schema.graphql
#graft:
# base: QmPYS7pSoWHDmPh9nza3kzZ9KfswmfQE65Emm5CwjSoEK6
# block: 14800000
#features:
# - grafting
dataSources:
- kind: ethereum/contract
name: ERC4626Vault
network: mainnet
source:
startBlock: 14427000
abi: ERC4626
mapping:
kind: ethereum/events
apiVersion: 0.0.6
language: wasm/assemblyscript
entities:
- ERC4626Vault
abis:
- name: ERC20
file: ./abis/ERC20.json
- name: DSToken
file: ./abis/DSToken.json
- name: ERC4626
file: ./abis/ERC4626.json
- name: UniswapV2Router
file: ./abis/UniswapV2Router.json
- name: UniswapV3Router
file: ./abis/UniswapV3Router.json
eventHandlers:
- event: Deposit(indexed address,indexed address,uint256,uint256)
handler: handleDepositEvent
file: ./src/ERC4626Mappings.ts
# We keep the Transfer/Withdraw event handlers separate in this template.
# When a 4626 vault is detected, the template can be instantiated with the vault's address to start the listener.
# If we don't do this, the subgraph will trigger on every single ERC20 transfer event on the network, which is bad.
# We can keep the withdraw handler in this template because we assume the first time we ever see a valid 4626 vault, it will
# be during the vault's initial deposit.
templates:
- name: ERC4626Template
kind: ethereum/contract
network: mainnet
source:
abi: ERC4626
mapping:
kind: ethereum/events
abis:
- name: ERC20
file: ./abis/ERC20.json
- name: ERC4626
file: ./abis/ERC4626.json
entities:
- ERC4626Vault
apiVersion: 0.0.6
language: wasm/assemblyscript
eventHandlers:
- event: Transfer(indexed address,indexed address,uint256)
handler: handleTransferEvent
- event: Withdraw(indexed address,indexed address,indexed address,uint256,uint256)
handler: handleWithdrawEvent
file: ./src/ERC4626Mappings.ts