Add automatic TFT refund for transfers with no/invalid memo #4

Closed
opened 2026-02-25 22:24:50 +00:00 by mahmoud · 1 comment
Owner

Description

When users send TFT to the treasury with no memo or an invalid memo, the bridge
cannot mint SPORE. Currently these transfers are marked FAILED and the TFT is
stuck in the treasury, requiring manual intervention.

Implement an automatic refund system that:

  • Returns TFT (minus a small fee) to the sender when a transfer cannot be processed
  • Supports two refund paths: catch-all RefundHandler for no-memo transfers, and
    inline refund on is_refundable() handler errors
  • Tracks refund state with REFUNDED/REFUND_FAILED statuses and refund_tx in the DB
  • Is opt-in via REFUND_ENABLED config flag with treasury mnemonic validation
### Description When users send TFT to the treasury with no memo or an invalid memo, the bridge cannot mint SPORE. Currently these transfers are marked FAILED and the TFT is stuck in the treasury, requiring manual intervention. Implement an automatic refund system that: - Returns TFT (minus a small fee) to the sender when a transfer cannot be processed - Supports two refund paths: catch-all RefundHandler for no-memo transfers, and inline refund on is_refundable() handler errors - Tracks refund state with REFUNDED/REFUND_FAILED statuses and refund_tx in the DB - Is opt-in via REFUND_ENABLED config flag with treasury mnemonic validation
mahmoud self-assigned this 2026-02-25 22:24:54 +00:00
Author
Owner

The code is merged to the development branch

The code is merged to the development branch
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
lhumina_code/hero_tfspores#4
No description provided.