Skip to content

[CT-05] Implement on-chain Dispute Window Checker for bookings in Rust #1022

@devwums

Description

@devwums

Problem

There is no on-chain enforcement of a dispute window. Members can dispute a booking at any time — even months after checkout — with no time constraint.

Proposed Solution

Create contracts/cntr/dispute_window.rs implementing: pub fn is_within_dispute_window(checkout_timestamp: u64, current_timestamp: u64, window_seconds: u64) -> bool and pub fn dispute_window_expires_at(checkout_timestamp: u64, window_seconds: u64) -> u64. Default dispute window is 48 hours (172,800 seconds). All implementation must live inside contracts/cntr/.

Acceptance Criteria

  • File at contracts/cntr/dispute_window.rs
  • Returns true when current_timestamp - checkout_timestamp < window_seconds
  • Returns false when the window has passed
  • dispute_window_expires_at returns checkout_timestamp + window_seconds
  • At least 5 unit tests covering: inside window, outside window, exactly at boundary
  • Compiles with cargo test

Metadata

Metadata

Assignees

Labels

Stellar WaveIssues in the Stellar wave program

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