Skip to content

chore: dispute-kit-gated-subgraph-support #2051

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions subgraph/core/src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ export const ZERO = BigInt.fromI32(0);
export const ONE = BigInt.fromI32(1);

export function extractDisputeKitIDFromExtraData(extraData: Bytes): string {
const start = extraData.length - 32;
const littleEndian = extraData.subarray(start, extraData.length).reverse();
const littleEndian = extraData.subarray(64, 96).reverse();
return BigInt.fromUnsignedBytes(Bytes.fromUint8Array(littleEndian)).toString();
}
76 changes: 76 additions & 0 deletions subgraph/core/subgraph.template.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,82 @@ dataSources:
- event: CommitCast(indexed uint256,indexed address,uint256[],bytes32)
handler: handleCommitCast
file: ./src/DisputeKitClassic.ts
- kind: ethereum
name: DisputeKitGated
network: _PLACEHOLDER_
source:
address: "_PLACEHOLDER_"
abi: DisputeKitGated
startBlock: _PLACEHOLDER_
mapping:
kind: ethereum/events
apiVersion: 0.0.7
language: wasm/assemblyscript
entities:
- ClassicDispute
- ClassicRound
- ClassicVote
- ClassicContribution
abis:
- name: DisputeKitGated
file: ../../contracts/deployments/_PLACEHOLDER_/DisputeKitGated.json
- name: DisputeKitClassic # Required on Alchemy
file: ../../contracts/deployments/_PLACEHOLDER_/DisputeKitClassic.json
- name: KlerosCore
# FIX: temporarily point to abi with event addition
file: ./abi-migrations/KlerosCore.json
eventHandlers:
- event: DisputeCreation(indexed uint256,uint256,bytes)
handler: handleDisputeCreation
- event: Contribution(indexed uint256,indexed uint256,uint256,indexed address,uint256)
handler: handleContributionEvent
- event: Withdrawal(indexed uint256,indexed uint256,uint256,indexed address,uint256)
handler: handleWithdrawal
- event: ChoiceFunded(indexed uint256,indexed uint256,indexed uint256)
handler: handleChoiceFunded
- event: VoteCast(indexed uint256,indexed address,uint256[],indexed uint256,string)
handler: handleVoteCast
- event: CommitCast(indexed uint256,indexed address,uint256[],bytes32)
handler: handleCommitCast
file: ./src/DisputeKitClassic.ts
- kind: ethereum
name: DisputeKitGatedShutter
network: _PLACEHOLDER_
source:
address: "_PLACEHOLDER_"
abi: DisputeKitGatedShutter
startBlock: _PLACEHOLDER_
mapping:
kind: ethereum/events
apiVersion: 0.0.7
language: wasm/assemblyscript
entities:
- ClassicDispute
- ClassicRound
- ClassicVote
- ClassicContribution
abis:
- name: DisputeKitGatedShutter
file: ../../contracts/deployments/_PLACEHOLDER_/DisputeKitGatedShutter.json
- name: DisputeKitClassic # Required on Alchemy
file: ../../contracts/deployments/_PLACEHOLDER_/DisputeKitClassic.json
- name: KlerosCore
# FIX: temporarily point to abi with event addition
file: ./abi-migrations/KlerosCore.json
eventHandlers:
- event: DisputeCreation(indexed uint256,uint256,bytes)
handler: handleDisputeCreation
- event: Contribution(indexed uint256,indexed uint256,uint256,indexed address,uint256)
handler: handleContributionEvent
- event: Withdrawal(indexed uint256,indexed uint256,uint256,indexed address,uint256)
handler: handleWithdrawal
- event: ChoiceFunded(indexed uint256,indexed uint256,indexed uint256)
handler: handleChoiceFunded
- event: VoteCast(indexed uint256,indexed address,uint256[],indexed uint256,string)
handler: handleVoteCast
- event: CommitCast(indexed uint256,indexed address,uint256[],bytes32)
handler: handleCommitCast
file: ./src/DisputeKitClassic.ts
- kind: ethereum
name: EvidenceModule
network: _PLACEHOLDER_
Expand Down
76 changes: 76 additions & 0 deletions subgraph/core/subgraph.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,82 @@ dataSources:
- event: CommitCast(indexed uint256,indexed address,uint256[],bytes32)
handler: handleCommitCast
file: ./src/DisputeKitClassic.ts
- kind: ethereum
name: DisputeKitGated
network: arbitrum-sepolia
source:
address: "0x677dA30B4b27D129354DdA1e219Bcc86802132d1"
abi: DisputeKitGated
startBlock: 175286139
mapping:
kind: ethereum/events
apiVersion: 0.0.7
language: wasm/assemblyscript
entities:
- ClassicDispute
- ClassicRound
- ClassicVote
- ClassicContribution
abis:
- name: DisputeKitGated
file: ../../contracts/deployments/arbitrumSepoliaDevnet/DisputeKitGated.json
- name: DisputeKitClassic # Required on Alchemy
file: ../../contracts/deployments/arbitrumSepoliaDevnet/DisputeKitClassic.json
- name: KlerosCore
# FIX: temporarily point to abi with event addition
file: ./abi-migrations/KlerosCore.json
eventHandlers:
- event: DisputeCreation(indexed uint256,uint256,bytes)
handler: handleDisputeCreation
- event: Contribution(indexed uint256,indexed uint256,uint256,indexed address,uint256)
handler: handleContributionEvent
- event: Withdrawal(indexed uint256,indexed uint256,uint256,indexed address,uint256)
handler: handleWithdrawal
- event: ChoiceFunded(indexed uint256,indexed uint256,indexed uint256)
handler: handleChoiceFunded
- event: VoteCast(indexed uint256,indexed address,uint256[],indexed uint256,string)
handler: handleVoteCast
- event: CommitCast(indexed uint256,indexed address,uint256[],bytes32)
handler: handleCommitCast
file: ./src/DisputeKitClassic.ts
- kind: ethereum
name: DisputeKitGatedShutter
network: arbitrum-sepolia
source:
address: "0xd86b84eb36Cd48f3f384b4490F255b494385F429"
abi: DisputeKitGatedShutter
startBlock: 175286153
mapping:
kind: ethereum/events
apiVersion: 0.0.7
language: wasm/assemblyscript
entities:
- ClassicDispute
- ClassicRound
- ClassicVote
- ClassicContribution
abis:
- name: DisputeKitGatedShutter
file: ../../contracts/deployments/arbitrumSepoliaDevnet/DisputeKitGatedShutter.json
- name: DisputeKitClassic # Required on Alchemy
file: ../../contracts/deployments/arbitrumSepoliaDevnet/DisputeKitClassic.json
- name: KlerosCore
# FIX: temporarily point to abi with event addition
file: ./abi-migrations/KlerosCore.json
eventHandlers:
- event: DisputeCreation(indexed uint256,uint256,bytes)
handler: handleDisputeCreation
- event: Contribution(indexed uint256,indexed uint256,uint256,indexed address,uint256)
handler: handleContributionEvent
- event: Withdrawal(indexed uint256,indexed uint256,uint256,indexed address,uint256)
handler: handleWithdrawal
- event: ChoiceFunded(indexed uint256,indexed uint256,indexed uint256)
handler: handleChoiceFunded
- event: VoteCast(indexed uint256,indexed address,uint256[],indexed uint256,string)
handler: handleVoteCast
- event: CommitCast(indexed uint256,indexed address,uint256[],bytes32)
handler: handleCommitCast
file: ./src/DisputeKitClassic.ts
- kind: ethereum
name: EvidenceModule
network: arbitrum-sepolia
Expand Down
Loading