Skip to content

[Feature]: Time-Locked Escrow & Milestone Deadlines #221

Description

@SudiptaPaul-31

🔍 Problem Statement

Description

Enhance the Soroban escrow contract with deadline-based protections. This ensures milestones are completed within agreed timelines, prevents misuse of escrow funds, and enforces refund/extension rules directly on-chain.


Requirements

  • Store milestone deadline — each milestone must include a deadline timestamp at creation.
  • Prevent invalid deadline modifications — deadlines cannot be shortened/extended by unauthorized users.
  • Detect expired milestones — contract checks if the current block time exceeds the milestone deadline.
  • Define behavior after deadline — specify whether funds are refunded, extended, or locked pending dispute.
  • Support refund/extension rules — allow client-initiated refunds or arbitrator-approved extensions.

Acceptance Criteria

  • ✅ Deadline logic enforced on-chain — contract rejects milestone approval/release if deadline has expired.
  • ✅ Unauthorized users cannot modify deadlines — only client or arbitrator can request extensions.
  • ✅ Expired milestones handled gracefully — funds refunded or locked until resolution.
  • ✅ Edge cases tested — multiple milestones expiring simultaneously, disputes raised after expiry, and escrow funded but no submission.
  • ✅ Event emission — log DeadlineSet, DeadlineExpired, DeadlineExtended, RefundIssued.

Additional Notes

  • State machine integration:

    • Add Expired state to milestone lifecycle.
    • Ensure transitions from Expired → Refunded or Expired → Extended.
  • Security considerations:

    • Prevent replay attacks by binding deadlines to milestone IDs.
    • Ensure extensions require cryptographic authorization from client/arbitrator.
  • Testing:

    • Unit tests for valid/invalid deadline modifications.
    • Edge cases: expired milestones with pending disputes, overlapping deadlines, and refund race conditions.

Future Enhancements

  • 🔹 Automatic refund after expiry without manual trigger.
  • 🔹 DAO-based voting for deadline extensions.
  • 🔹 Off-chain notifications/reminders before deadlines.

📈 Expected Impact

High — Would significantly improve user experience

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions