graphprotocol / graphprotocol/indexer

DIPs: Monitor escrow thaw events to protect against payer withdrawal

Open
#1,170 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

DIPS
Dominant language
TypeScript
Stars
262
Forks
148
PR merge metrics
No merged PRs in 30d

Description

Context

When a payer wants to withdraw funds from escrow, they must first call thaw() which starts a waiting period. After the thawing period ends, they can call withdraw() to retrieve their funds.

If the indexer has outstanding fees to collect from an indexing agreement, and the payer starts thawing, the indexer must collect before the thaw completes or risk losing payment.

Proposed Solution

The indexer agent should monitor Thaw events from the PaymentsEscrow contract. When a thaw is detected for a payer with active agreements:

  1. Calculate outstanding fees owed
  2. Prioritize collection before thawEndTimestamp
  3. Alert if collection fails and thaw is imminent

Event to Monitor

From IPaymentsEscrow.sol:

event Thaw(
    address indexed payer,
    address indexed collector,
    address indexed receiver,
    uint256 tokens,
    uint256 thawEndTimestamp
);

Related

  • Escrow contract: packages/horizon/contracts/payments/PaymentsEscrow.sol
  • DIPS indexer-rs validation: graphprotocol/indexer-rs#942

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Read packages/horizon/contracts/payments/PaymentsEscrow.sol and the related DIPS indexer-rs validation issue (#942) first. Find the indexer agent entry point for PaymentsEscrow Thaw events, then verify it calculates outstanding fees, prioritizes collection before thawEndTimestamp, and alerts when collection fails.

Written by the indexing model from the issue text.

Assessment

Tech stack
solidity, typescript
Domain
backend, blockchain
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.