Skip to content

Commit e25ab73

Browse files
authored
add EnergyWeb, Moonriver & Celo Alfajores (#239)
* add EnergyWeb, Moonriver & Celo Alfajores * fix ocean address * add ERC20 abis
1 parent 6bd7995 commit e25ab73

5 files changed

+651
-0
lines changed

package.json

+6
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@
1616
"create:local-catenaxtestnet": "graph create oceanprotocol/ocean-subgraph --node http://127.0.0.1:8020",
1717
"create:local-mumbai": "graph create oceanprotocol/ocean-subgraph --node http://127.0.0.1:8020",
1818
"create:local-bsc": "graph create oceanprotocol/ocean-subgraph --node http://127.0.0.1:8020",
19+
"create:local-celoalfajores": "graph create oceanprotocol/ocean-subgraph --node http://127.0.0.1:8020",
20+
"create:local-energyweb": "graph create oceanprotocol/ocean-subgraph --node http://127.0.0.1:8020",
21+
"create:local-moonriver": "graph create oceanprotocol/ocean-subgraph --node http://127.0.0.1:8020",
1922
"codegen": "graph codegen --output-dir src/@types",
2023
"build": "graph build",
2124
"deploy": "graph deploy oceanprotocol/ocean-subgraph --ipfs https://api.thegraph.com/ipfs/ --node https://api.thegraph.com/deploy/",
@@ -30,6 +33,9 @@
3033
"deploy:local-catenaxtestnet": "graph deploy oceanprotocol/ocean-subgraph subgraph.catenaxtestnet.yaml --debug --ipfs http://127.0.0.1:5001 --node http://127.0.0.1:8020",
3134
"deploy:local-mumbai": "graph deploy oceanprotocol/ocean-subgraph subgraph.mumbai.yaml --debug --ipfs http://127.0.0.1:5001 --node http://127.0.0.1:8020",
3235
"deploy:local-bsc": "graph deploy oceanprotocol/ocean-subgraph subgraph.bsc.yaml --debug --ipfs http://127.0.0.1:5001 --node http://127.0.0.1:8020",
36+
"deploy:local-celoalfajores": "graph deploy oceanprotocol/ocean-subgraph subgraph.celoalfajores.yaml --debug --ipfs http://127.0.0.1:5001 --node http://127.0.0.1:8020",
37+
"deploy:local-energyweb": "graph deploy oceanprotocol/ocean-subgraph subgraph.energyweb.yaml --debug --ipfs http://127.0.0.1:5001 --node http://127.0.0.1:8020",
38+
"deploy:local-moonriver": "graph deploy oceanprotocol/ocean-subgraph subgraph.moonriver.yaml --debug --ipfs http://127.0.0.1:5001 --node http://127.0.0.1:8020",
3339
"test": "npm run codegen && npm run lint && npm run type-check",
3440
"test-integration": "TS_NODE_PROJECT='test/integration/tsconfig.json' mocha --config=test/integration/.mocharc.json --node-env=test --exit 'test/integration/**/*.test.ts'",
3541
"lint": "eslint --ignore-path .gitignore --ext .js --ext .ts --ext .tsx .",

src/helpers.ts

+6
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,12 @@ export function getOceanAddress(): string {
5151
return '0x80e63f73cac60c1662f27d2dfd2ea834acddbaa8'
5252
if (network == 'mumbai') return '0xd8992ed72c445c35cb4a2be468568ed1079357c8'
5353
if (network == 'bsc') return '0xdce07662ca8ebc241316a15b611c89711414dd1a'
54+
if (network == 'celoalfajores')
55+
return '0xd8992ed72c445c35cb4a2be468568ed1079357c8'
56+
if (network == 'energyweb')
57+
return '0x593122aae80a6fc3183b2ac0c4ab3336debee528'
58+
if (network == 'moonriver')
59+
return '0x99c409e5f62e4bd2ac142f17cafb6810b8f0baae'
5460
return '0x967da4048cd07ab37855c090aaf366e4ce1b9f48'
5561
}
5662

subgraph.celoalfajores.yaml

+213
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,213 @@
1+
specVersion: 0.0.2
2+
description: Ocean provides data sharing through IDOs
3+
repository: https://github.com/oceanprotocol/ocean-subgraph
4+
schema:
5+
file: ./schema.graphql
6+
dataSources:
7+
- kind: ethereum/contract
8+
name: Factory
9+
network: celoalfajores
10+
source:
11+
address: '0x80E63f73cAc60c1662f27D2DFd2EA834acddBaa8'
12+
abi: Factory
13+
startBlock: 7542884
14+
mapping:
15+
kind: ethereum/events
16+
apiVersion: 0.0.4
17+
language: wasm/assemblyscript
18+
file: ./src/mappings/factory.ts
19+
entities:
20+
- PoolFactory
21+
abis:
22+
- name: Factory
23+
file: ./abis/BFactory.json
24+
eventHandlers:
25+
- event: BPoolRegistered(address,indexed address)
26+
handler: handleNewPool
27+
- kind: ethereum/contract
28+
name: DTFactory
29+
network: celoalfajores
30+
source:
31+
address: '0x69B6E54Ad2b3c2801d11d8Ad56ea1d892555b776'
32+
abi: DTFactory
33+
startBlock: 7542879
34+
mapping:
35+
kind: ethereum/events
36+
apiVersion: 0.0.4
37+
language: wasm/assemblyscript
38+
file: ./src/mappings/dtfactory.ts
39+
entities:
40+
- DatatokenFactory
41+
abis:
42+
- name: DTFactory
43+
file: ./abis/DTFactory.json
44+
eventHandlers:
45+
- event: TokenRegistered(indexed address,string,string,uint256,indexed address,indexed string)
46+
handler: handleNewToken
47+
- kind: ethereum/contract
48+
name: Metadata
49+
network: celoalfajores
50+
source:
51+
address: '0x30E4CC2C7A9c6aA2b2Ce93586E3Df24a3A00bcDD'
52+
abi: Metadata
53+
startBlock: 7542888
54+
mapping:
55+
kind: ethereum/events
56+
apiVersion: 0.0.4
57+
language: wasm/assemblyscript
58+
file: ./src/mappings/metadata.ts
59+
entities:
60+
- Metadata
61+
abis:
62+
- name: Metadata
63+
file: ./abis/Metadata.json
64+
eventHandlers:
65+
- event: MetadataCreated(indexed address,indexed address,bytes,bytes)
66+
handler: handleMetadataCreated
67+
- event: MetadataUpdated(indexed address,indexed address,bytes,bytes)
68+
handler: handleMetadataUpdated
69+
- kind: ethereum/contract
70+
name: FixedRateExchange
71+
network: celoalfajores
72+
source:
73+
address: '0x3C5605202eD47C162450AE975415473e73F93072'
74+
abi: FixedRateExchange
75+
startBlock: 7542886
76+
mapping:
77+
kind: ethereum/events
78+
apiVersion: 0.0.4
79+
language: wasm/assemblyscript
80+
file: ./src/mappings/fixedrateexchange.ts
81+
entities:
82+
- FixedRateExchange
83+
abis:
84+
- name: FixedRateExchange
85+
file: ./abis/FixedRateExchange.json
86+
- name: ERC20
87+
file: ./abis/ERC20.json
88+
- name: ERC20SymbolBytes
89+
file: ./abis/ERC20SymbolBytes.json
90+
- name: ERC20NameBytes
91+
file: ./abis/ERC20NameBytes.json
92+
eventHandlers:
93+
- event: ExchangeCreated(indexed bytes32,indexed address,indexed address,address,uint256)
94+
handler: handleExchangeCreated
95+
- event: ExchangeActivated(indexed bytes32,indexed address)
96+
handler: handleExchangeActivated
97+
- event: ExchangeDeactivated(indexed bytes32,indexed address)
98+
handler: handleExchangeDeactivated
99+
- event: ExchangeRateChanged(indexed bytes32,indexed address,uint256)
100+
handler: handleExchangeRateChanged
101+
- event: Swapped(indexed bytes32,indexed address,uint256,uint256)
102+
handler: handleSwapped
103+
- kind: ethereum/contract
104+
name: Dispenser
105+
network: celoalfajores
106+
source:
107+
address: '0xDEfD0018969cd2d4E648209F876ADe184815f038'
108+
abi: Dispenser
109+
startBlock: 7542890
110+
mapping:
111+
kind: ethereum/events
112+
apiVersion: 0.0.4
113+
language: wasm/assemblyscript
114+
file: ./src/mappings/dispenser.ts
115+
entities:
116+
- Dispenser
117+
abis:
118+
- name: Dispenser
119+
file: ./abis/Dispenser.json
120+
eventHandlers:
121+
- event: Activated(indexed address)
122+
handler: handleDispenserActivated
123+
- event: Deactivated(indexed address)
124+
handler: handleDispenserDeactivated
125+
- event: AcceptedMinter(indexed address)
126+
handler: handleDispenserAcceptedMinter
127+
- event: RemovedMinter(indexed address)
128+
handler: handleDispenserRemovedMinter
129+
- event: TokensDispensed(indexed address,indexed address,uint256)
130+
handler: handleDispenserTokensDispensed
131+
- event: OwnerWithdrawed(indexed address,indexed address,uint256)
132+
handler: handleDispenserOwnerWithdrawed
133+
templates:
134+
- kind: ethereum/contract
135+
name: Pool
136+
network: celoalfajores
137+
source:
138+
abi: Pool
139+
mapping:
140+
kind: ethereum/events
141+
apiVersion: 0.0.4
142+
language: wasm/assemblyscript
143+
file: ./src/mappings/pool.ts
144+
entities:
145+
- Pool
146+
- PoolFactory
147+
- Swap
148+
abis:
149+
- name: Pool
150+
file: ./abis/BPool.json
151+
- name: BToken
152+
file: ./abis/BToken.json
153+
- name: ERC20
154+
file: ./abis/ERC20.json
155+
- name: ERC20SymbolBytes
156+
file: ./abis/ERC20SymbolBytes.json
157+
- name: ERC20NameBytes
158+
file: ./abis/ERC20NameBytes.json
159+
eventHandlers:
160+
- event: LOG_CALL(indexed bytes4,indexed address,bytes)
161+
topic0: '0x34e1990700000000000000000000000000000000000000000000000000000000'
162+
handler: handleSetSwapFee
163+
- event: LOG_CALL(indexed bytes4,indexed address,bytes)
164+
topic0: '0x92eefe9b00000000000000000000000000000000000000000000000000000000'
165+
handler: handleSetController
166+
- event: LOG_CALL(indexed bytes4,indexed address,bytes)
167+
topic0: '0x49b5955200000000000000000000000000000000000000000000000000000000'
168+
handler: handleSetPublicSwap
169+
- event: LOG_CALL(indexed bytes4,indexed address,bytes)
170+
topic0: '0x4bb278f300000000000000000000000000000000000000000000000000000000'
171+
handler: handleFinalize
172+
- event: LOG_CALL(indexed bytes4,indexed address,bytes)
173+
topic0: '0xd1d7bc9100000000000000000000000000000000000000000000000000000000'
174+
handler: handleSetup
175+
- event: LOG_CALL(indexed bytes4,indexed address,bytes)
176+
topic0: '0x3fdddaa200000000000000000000000000000000000000000000000000000000'
177+
handler: handleRebind
178+
- event: LOG_CALL(indexed bytes4,indexed address,bytes)
179+
topic0: '0xe4e1e53800000000000000000000000000000000000000000000000000000000'
180+
handler: handleRebind
181+
- event: LOG_CALL(indexed bytes4,indexed address,bytes)
182+
topic0: '0x8c28cbe800000000000000000000000000000000000000000000000000000000'
183+
handler: handleGulp
184+
- event: LOG_JOIN(indexed address,indexed address,uint256)
185+
handler: handleJoinPool
186+
- event: LOG_EXIT(indexed address,indexed address,uint256)
187+
handler: handleExitPool
188+
- event: LOG_SWAP(indexed address,indexed address,indexed address,uint256,uint256)
189+
handler: handleSwap
190+
- event: Transfer(indexed address,indexed address,uint256)
191+
handler: handleTransfer
192+
193+
- kind: ethereum/contract
194+
name: DataToken
195+
network: celoalfajores
196+
source:
197+
abi: DataToken
198+
mapping:
199+
kind: ethereum/events
200+
apiVersion: 0.0.4
201+
language: wasm/assemblyscript
202+
file: ./src/mappings/datatoken.ts
203+
entities:
204+
- DataToken
205+
- DatatokenFactory
206+
abis:
207+
- name: DataToken
208+
file: ./abis/DataTokenTemplate.json
209+
eventHandlers:
210+
- event: Transfer(indexed address,indexed address,uint256)
211+
handler: handleTransfer
212+
- event: OrderStarted(indexed address,indexed address,uint256,uint256,uint256,indexed address,uint256)
213+
handler: handleOrderStarted

0 commit comments

Comments
 (0)