Skip to content

Commit 63dc875

Browse files
authored
Merge pull request #1948 from kleros/fix/subgraph-event-fix
fix(subgraph): subgraph-event-fix
2 parents cade93c + bd4758a commit 63dc875

File tree

5 files changed

+3301
-18
lines changed

5 files changed

+3301
-18
lines changed

subgraph/core/src/SortitionModule.ts

+6
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import {
22
SortitionModule,
3+
StakeDelayedAlreadyTransferred,
34
StakeDelayedAlreadyTransferredDeposited,
45
StakeDelayedAlreadyTransferredWithdrawn,
56
StakeDelayedNotTransferred,
@@ -11,6 +12,11 @@ import { updateJurorDelayedStake, updateJurorStake } from "./entities/JurorToken
1112
import { ensureUser } from "./entities/User";
1213
import { ZERO } from "./utils";
1314

15+
// FIX: temporarily adding this handler for old event name "StakeDelayedAlreadyTransferred", delete when deploying new fresh-address contract.
16+
export function handleStakeDelayedAlreadyTransferred(event: StakeDelayedAlreadyTransferred): void {
17+
updateJurorDelayedStake(event.params._address.toHexString(), event.params._courtID.toString(), event.params._amount);
18+
}
19+
1420
export function handleStakeDelayedAlreadyTransferredDeposited(event: StakeDelayedAlreadyTransferredDeposited): void {
1521
updateJurorDelayedStake(event.params._address.toHexString(), event.params._courtID.toString(), event.params._amount);
1622
}

subgraph/core/subgraph.yaml

+30-18
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@ dataSources:
88
name: KlerosCore
99
network: arbitrum-sepolia
1010
source:
11-
address: "0xE8442307d36e9bf6aB27F1A009F95CE8E11C3479"
11+
address: "0xA54e7A16d7460e38a8F324eF46782FB520d58CE8"
1212
abi: KlerosCore
13-
startBlock: 95250346
13+
startBlock: 3638878
1414
mapping:
1515
kind: ethereum/events
1616
apiVersion: 0.0.7
@@ -28,11 +28,12 @@ dataSources:
2828
- Counter
2929
abis:
3030
- name: SortitionModule
31-
file: ../../contracts/deployments/arbitrumSepolia/SortitionModule.json
31+
file: ../../contracts/deployments/arbitrumSepoliaDevnet/SortitionModule.json
3232
- name: DisputeKitClassic
33-
file: ../../contracts/deployments/arbitrumSepolia/DisputeKitClassic.json
33+
file: ../../contracts/deployments/arbitrumSepoliaDevnet/DisputeKitClassic.json
3434
- name: KlerosCore
35-
file: ../../contracts/deployments/arbitrumSepolia/KlerosCore.json
35+
# FIX: temporarily point to the abi with event addition.
36+
file: ./temp-abis/KlerosCore.json
3637
eventHandlers:
3738
- event: AppealDecision(indexed uint256,indexed address)
3839
handler: handleAppealDecision
@@ -45,6 +46,9 @@ dataSources:
4546
handler: handleNewPeriod
4647
- event: CourtCreated(indexed uint96,indexed uint96,bool,uint256,uint256,uint256,uint256,uint256[4],uint256[])
4748
handler: handleCourtCreated
49+
# FIX: This is support for old signature
50+
- event: CourtCreated(indexed uint256,indexed uint96,bool,uint256,uint256,uint256,uint256,uint256[4],uint256[])
51+
handler: handleCourtCreated
4852
- event: CourtModified(indexed uint96,bool,uint256,uint256,uint256,uint256,uint256[4])
4953
handler: handleCourtModified
5054
- event: DisputeKitCreated(indexed uint256,indexed address)
@@ -64,9 +68,9 @@ dataSources:
6468
name: PolicyRegistry
6569
network: arbitrum-sepolia
6670
source:
67-
address: "0x2668c46A14af8997417138B064ca1bEB70769585"
71+
address: "0x2AC2EdFD336732bc6963f1AD03ED98B22dB949da"
6872
abi: PolicyRegistry
69-
startBlock: 95247698
73+
startBlock: 3084568
7074
mapping:
7175
kind: ethereum/events
7276
apiVersion: 0.0.7
@@ -75,7 +79,7 @@ dataSources:
7579
- Court
7680
abis:
7781
- name: PolicyRegistry
78-
file: ../../contracts/deployments/arbitrumSepolia/PolicyRegistry.json
82+
file: ../../contracts/deployments/arbitrumSepoliaDevnet/PolicyRegistry.json
7983
eventHandlers:
8084
- event: PolicyUpdate(indexed uint256,string,string)
8185
handler: handlePolicyUpdate
@@ -84,9 +88,9 @@ dataSources:
8488
name: DisputeKitClassic
8589
network: arbitrum-sepolia
8690
source:
87-
address: "0x0c38f115D001d3b5bBec5e8D44f78C7B61A27D94"
91+
address: "0x9426F127116C3652A262AE1eA48391AC8F44D35b"
8892
abi: DisputeKitClassic
89-
startBlock: 95247789
93+
startBlock: 3638835
9094
mapping:
9195
kind: ethereum/events
9296
apiVersion: 0.0.7
@@ -98,9 +102,10 @@ dataSources:
98102
- ClassicContribution
99103
abis:
100104
- name: DisputeKitClassic
101-
file: ../../contracts/deployments/arbitrumSepolia/DisputeKitClassic.json
105+
file: ../../contracts/deployments/arbitrumSepoliaDevnet/DisputeKitClassic.json
102106
- name: KlerosCore
103-
file: ../../contracts/deployments/arbitrumSepolia/KlerosCore.json
107+
# FIX: temporarily point to abi with event addition
108+
file: ./temp-abis/KlerosCore.json
104109
eventHandlers:
105110
- event: DisputeCreation(indexed uint256,uint256,bytes)
106111
handler: handleDisputeCreation
@@ -119,9 +124,9 @@ dataSources:
119124
name: EvidenceModule
120125
network: arbitrum-sepolia
121126
source:
122-
address: "0xA88A9a25cE7f1d8b3941dA3b322Ba91D009E1397"
127+
address: "0x57fd453FB0d16f8ca174E7386102D7170E17Be09"
123128
abi: EvidenceModule
124-
startBlock: 95247733
129+
startBlock: 3638735
125130
mapping:
126131
kind: ethereum/events
127132
apiVersion: 0.0.7
@@ -131,7 +136,7 @@ dataSources:
131136
- ClassicEvidence
132137
abis:
133138
- name: EvidenceModule
134-
file: ../../contracts/deployments/arbitrumSepolia/EvidenceModule.json
139+
file: ../../contracts/deployments/arbitrumSepoliaDevnet/EvidenceModule.json
135140
eventHandlers:
136141
- event: Evidence(indexed uint256,indexed address,string)
137142
handler: handleEvidenceEvent
@@ -140,9 +145,9 @@ dataSources:
140145
name: SortitionModule
141146
network: arbitrum-sepolia
142147
source:
143-
address: "0xbAA5068F0bD1417046250A3eDe2B1F27e31383BD"
148+
address: "0x19cb28BAB40C3585955798f5EEabd71Eec14471C"
144149
abi: SortitionModule
145-
startBlock: 95250316
150+
startBlock: 3638850
146151
mapping:
147152
kind: ethereum/events
148153
apiVersion: 0.0.7
@@ -151,10 +156,14 @@ dataSources:
151156
- JurorTokensPerCourt
152157
abis:
153158
- name: SortitionModule
154-
file: ../../contracts/deployments/arbitrumSepolia/SortitionModule.json
159+
# FIX: temporarily point to abi with event addition
160+
file: ./temp-abis/SortitionModule.json
155161
eventHandlers:
156162
- event: StakeDelayedAlreadyTransferredDeposited(indexed address,uint256,uint256)
157163
handler: handleStakeDelayedAlreadyTransferredDeposited
164+
# FIX: temporarily indexing old event name
165+
- event: StakeDelayedAlreadyTransferred(indexed address,uint256,uint256)
166+
handler: handleStakeDelayedAlreadyTransferred
158167
- event: StakeDelayedAlreadyTransferredWithdrawn(indexed address,indexed uint96,uint256)
159168
handler: handleStakeDelayedAlreadyTransferredWithdrawn
160169
- event: StakeDelayedNotTransferred(indexed address,uint256,uint256)
@@ -163,4 +172,7 @@ dataSources:
163172
handler: handleStakeLocked
164173
- event: StakeSet(indexed address,uint256,uint256,uint256)
165174
handler: handleStakeSet
175+
# FIX: old stake set signature
176+
- event: StakeSet(indexed address,uint256,uint256)
177+
handler: handleStakeSet
166178
file: ./src/SortitionModule.ts

0 commit comments

Comments
 (0)