Skip to content

Commit 434e608

Browse files
authored
Merge pull request #2051 from kleros/chore/token-gated-dispute-kit-subgraph
chore: dispute-kit-gated-subgraph-support
2 parents fe7419c + 7912160 commit 434e608

File tree

3 files changed

+153
-2
lines changed

3 files changed

+153
-2
lines changed

subgraph/core/src/utils.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ export const ZERO = BigInt.fromI32(0);
44
export const ONE = BigInt.fromI32(1);
55

66
export function extractDisputeKitIDFromExtraData(extraData: Bytes): string {
7-
const start = extraData.length - 32;
8-
const littleEndian = extraData.subarray(start, extraData.length).reverse();
7+
const littleEndian = extraData.subarray(64, 96).reverse();
98
return BigInt.fromUnsignedBytes(Bytes.fromUint8Array(littleEndian)).toString();
109
}

subgraph/core/subgraph.template.yaml

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,82 @@ dataSources:
160160
- event: CommitCast(indexed uint256,indexed address,uint256[],bytes32)
161161
handler: handleCommitCast
162162
file: ./src/DisputeKitClassic.ts
163+
- kind: ethereum
164+
name: DisputeKitGated
165+
network: _PLACEHOLDER_
166+
source:
167+
address: "_PLACEHOLDER_"
168+
abi: DisputeKitGated
169+
startBlock: _PLACEHOLDER_
170+
mapping:
171+
kind: ethereum/events
172+
apiVersion: 0.0.7
173+
language: wasm/assemblyscript
174+
entities:
175+
- ClassicDispute
176+
- ClassicRound
177+
- ClassicVote
178+
- ClassicContribution
179+
abis:
180+
- name: DisputeKitGated
181+
file: ../../contracts/deployments/_PLACEHOLDER_/DisputeKitGated.json
182+
- name: DisputeKitClassic # Required on Alchemy
183+
file: ../../contracts/deployments/_PLACEHOLDER_/DisputeKitClassic.json
184+
- name: KlerosCore
185+
# FIX: temporarily point to abi with event addition
186+
file: ./abi-migrations/KlerosCore.json
187+
eventHandlers:
188+
- event: DisputeCreation(indexed uint256,uint256,bytes)
189+
handler: handleDisputeCreation
190+
- event: Contribution(indexed uint256,indexed uint256,uint256,indexed address,uint256)
191+
handler: handleContributionEvent
192+
- event: Withdrawal(indexed uint256,indexed uint256,uint256,indexed address,uint256)
193+
handler: handleWithdrawal
194+
- event: ChoiceFunded(indexed uint256,indexed uint256,indexed uint256)
195+
handler: handleChoiceFunded
196+
- event: VoteCast(indexed uint256,indexed address,uint256[],indexed uint256,string)
197+
handler: handleVoteCast
198+
- event: CommitCast(indexed uint256,indexed address,uint256[],bytes32)
199+
handler: handleCommitCast
200+
file: ./src/DisputeKitClassic.ts
201+
- kind: ethereum
202+
name: DisputeKitGatedShutter
203+
network: _PLACEHOLDER_
204+
source:
205+
address: "_PLACEHOLDER_"
206+
abi: DisputeKitGatedShutter
207+
startBlock: _PLACEHOLDER_
208+
mapping:
209+
kind: ethereum/events
210+
apiVersion: 0.0.7
211+
language: wasm/assemblyscript
212+
entities:
213+
- ClassicDispute
214+
- ClassicRound
215+
- ClassicVote
216+
- ClassicContribution
217+
abis:
218+
- name: DisputeKitGatedShutter
219+
file: ../../contracts/deployments/_PLACEHOLDER_/DisputeKitGatedShutter.json
220+
- name: DisputeKitClassic # Required on Alchemy
221+
file: ../../contracts/deployments/_PLACEHOLDER_/DisputeKitClassic.json
222+
- name: KlerosCore
223+
# FIX: temporarily point to abi with event addition
224+
file: ./abi-migrations/KlerosCore.json
225+
eventHandlers:
226+
- event: DisputeCreation(indexed uint256,uint256,bytes)
227+
handler: handleDisputeCreation
228+
- event: Contribution(indexed uint256,indexed uint256,uint256,indexed address,uint256)
229+
handler: handleContributionEvent
230+
- event: Withdrawal(indexed uint256,indexed uint256,uint256,indexed address,uint256)
231+
handler: handleWithdrawal
232+
- event: ChoiceFunded(indexed uint256,indexed uint256,indexed uint256)
233+
handler: handleChoiceFunded
234+
- event: VoteCast(indexed uint256,indexed address,uint256[],indexed uint256,string)
235+
handler: handleVoteCast
236+
- event: CommitCast(indexed uint256,indexed address,uint256[],bytes32)
237+
handler: handleCommitCast
238+
file: ./src/DisputeKitClassic.ts
163239
- kind: ethereum
164240
name: EvidenceModule
165241
network: _PLACEHOLDER_

subgraph/core/subgraph.yaml

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,82 @@ dataSources:
161161
- event: CommitCast(indexed uint256,indexed address,uint256[],bytes32)
162162
handler: handleCommitCast
163163
file: ./src/DisputeKitClassic.ts
164+
- kind: ethereum
165+
name: DisputeKitGated
166+
network: arbitrum-sepolia
167+
source:
168+
address: "0x677dA30B4b27D129354DdA1e219Bcc86802132d1"
169+
abi: DisputeKitGated
170+
startBlock: 175286139
171+
mapping:
172+
kind: ethereum/events
173+
apiVersion: 0.0.7
174+
language: wasm/assemblyscript
175+
entities:
176+
- ClassicDispute
177+
- ClassicRound
178+
- ClassicVote
179+
- ClassicContribution
180+
abis:
181+
- name: DisputeKitGated
182+
file: ../../contracts/deployments/arbitrumSepoliaDevnet/DisputeKitGated.json
183+
- name: DisputeKitClassic # Required on Alchemy
184+
file: ../../contracts/deployments/arbitrumSepoliaDevnet/DisputeKitClassic.json
185+
- name: KlerosCore
186+
# FIX: temporarily point to abi with event addition
187+
file: ./abi-migrations/KlerosCore.json
188+
eventHandlers:
189+
- event: DisputeCreation(indexed uint256,uint256,bytes)
190+
handler: handleDisputeCreation
191+
- event: Contribution(indexed uint256,indexed uint256,uint256,indexed address,uint256)
192+
handler: handleContributionEvent
193+
- event: Withdrawal(indexed uint256,indexed uint256,uint256,indexed address,uint256)
194+
handler: handleWithdrawal
195+
- event: ChoiceFunded(indexed uint256,indexed uint256,indexed uint256)
196+
handler: handleChoiceFunded
197+
- event: VoteCast(indexed uint256,indexed address,uint256[],indexed uint256,string)
198+
handler: handleVoteCast
199+
- event: CommitCast(indexed uint256,indexed address,uint256[],bytes32)
200+
handler: handleCommitCast
201+
file: ./src/DisputeKitClassic.ts
202+
- kind: ethereum
203+
name: DisputeKitGatedShutter
204+
network: arbitrum-sepolia
205+
source:
206+
address: "0xd86b84eb36Cd48f3f384b4490F255b494385F429"
207+
abi: DisputeKitGatedShutter
208+
startBlock: 175286153
209+
mapping:
210+
kind: ethereum/events
211+
apiVersion: 0.0.7
212+
language: wasm/assemblyscript
213+
entities:
214+
- ClassicDispute
215+
- ClassicRound
216+
- ClassicVote
217+
- ClassicContribution
218+
abis:
219+
- name: DisputeKitGatedShutter
220+
file: ../../contracts/deployments/arbitrumSepoliaDevnet/DisputeKitGatedShutter.json
221+
- name: DisputeKitClassic # Required on Alchemy
222+
file: ../../contracts/deployments/arbitrumSepoliaDevnet/DisputeKitClassic.json
223+
- name: KlerosCore
224+
# FIX: temporarily point to abi with event addition
225+
file: ./abi-migrations/KlerosCore.json
226+
eventHandlers:
227+
- event: DisputeCreation(indexed uint256,uint256,bytes)
228+
handler: handleDisputeCreation
229+
- event: Contribution(indexed uint256,indexed uint256,uint256,indexed address,uint256)
230+
handler: handleContributionEvent
231+
- event: Withdrawal(indexed uint256,indexed uint256,uint256,indexed address,uint256)
232+
handler: handleWithdrawal
233+
- event: ChoiceFunded(indexed uint256,indexed uint256,indexed uint256)
234+
handler: handleChoiceFunded
235+
- event: VoteCast(indexed uint256,indexed address,uint256[],indexed uint256,string)
236+
handler: handleVoteCast
237+
- event: CommitCast(indexed uint256,indexed address,uint256[],bytes32)
238+
handler: handleCommitCast
239+
file: ./src/DisputeKitClassic.ts
164240
- kind: ethereum
165241
name: EvidenceModule
166242
network: arbitrum-sepolia

0 commit comments

Comments
 (0)