Skip to content

Migrate the subgraph to support the latest instant-staking contract changes #1368

Closed
@jaybuidl

Description

@jaybuidl

This is a follow-up on PR #1228 which is not deployed yet but will be on Arbitrum Sepolia soon.

The SortitionModule must be added to the contracts to index in subgraph.yml (it's not currently).

The main change is that these 2 events and handles should now point to the SortitionModule instead of KlerosCore.

- event: StakeSet(indexed address,uint256,uint256)
  handler: handleStakeSet
- event: StakeDelayedNotTransferred(indexed address,uint256,uint256)
  handler: handleStakeDelayedNotTransferred

As a bonus, there's now an extra event StakeLocked in the SortitionModule to index the stake locking (with _unlock == false) and unlocking (with _unlock == true).

event StakeLocked(address indexed _address, uint256 _relativeAmount, bool _unlock);

Question: perhaps this trick is not necessary anymore with the new events?
https://github.com/unknownunknown1/kleros-v2/blob/5970449533103144b6d65c0c939c34f1992ff71c/subgraph/src/KlerosCore.ts#L195C1-L198

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions