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:
- Marks
rewardClaimed: true
- 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
Problem
In
src/modules/rewards/reward.service.tslines 119-140, when abad_seqerror occurs,txHashis set to"pending_indexer_confirmation"and execution continues to the database transaction which:rewardClaimed: trueThe on-chain transaction may not have actually succeeded.
handleBadSeqErrorexplicitly 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