Skip to content

processRewardClaim grants credits on uncertain bad_seq outcome #104

Description

@DeFiVC

Problem

In src/modules/rewards/reward.service.ts lines 119-140, when a bad_seq error occurs, txHash is set to "pending_indexer_confirmation" and execution continues to the database transaction which:

  1. Marks rewardClaimed: true
  2. Increments the user's credits

The on-chain transaction may not have actually succeeded. handleBadSeqError explicitly documents "the tx might actually succeed on-chain" — meaning the outcome is uncertain, yet credits are granted unconditionally.

Impact

Users may receive credits when the on-chain reward transfer did not succeed — potential double-spend.

Fix

Do not grant credits until the indexer confirms the on-chain transaction succeeded.

Severity

High

Metadata

Metadata

Assignees

Labels

Stellar WaveIssues in the Stellar wave program

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions