Skip to content

Implement Swap Rollback with Partial Refund #411

@fejilaup-cloud

Description

@fejilaup-cloud

Description

If a swap completes but the decryption key is invalid, the buyer has no recourse. A rollback mechanism with partial refund would allow recovery from key validation failures.

Tasks

  • Implement validate_and_rollback_swap(env, swap_id, is_key_valid) -> bool — buyer-only, within 24 hours of completion
  • If key is invalid, refund 90% of payment to buyer, 10% to treasury as penalty
  • Update swap status to RolledBack
  • Emit event with refund amounts
  • Add tests for rollback validation and refund calculation

Priority: Medium | Estimated Time: 2 hours

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions