Feat/invoice escrow dispute resolution - #418
Open
Stephan-Thomas wants to merge 3 commits into
Open
Conversation
… with timeout and default fallback
|
@Stephan-Thomas Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Implemented a complete on-chain dispute resolution lifecycle for the
invoice-escrowcontract.The new dispute flow introduces a
Disputedescrow state and supports raising, resolving, and timing out disputes:raise_disputeallows the buyer or seller to raise a dispute while the escrow is in theFundedstate.resolve_disputeallows an authorized admin to resolve the dispute in favor of either the seller or buyer.This change also adds dispute metadata tracking, dispute-related errors, the default 7-day dispute timeout,
DisputeRaisedevent emission, and tests covering the complete dispute lifecycle and timeout behavior.Closes #378
Type of Change
Checklist
Testing
The
invoice-escrowtest suite was updated to verify the complete dispute lifecycle, authorization requirements, resolution outcomes, and timeout fallback behavior.How to Test
cargo test -p invoice-escrowFundedtoDisputedand that the dispute metadata andDisputeRaisedevent are recorded.Test Coverage
Screenshots (if applicable)
Not applicable — this change affects the Soroban contract logic and test suite rather than a user interface.
Additional Notes
The dispute lifecycle introduces the following state transitions:
Funded -> Disputed -> Settledor
Funded -> Disputed -> RefundedIf a dispute remains unresolved after the configured timeout period, the contract defaults to a buyer refund to prevent disputed escrow funds from remaining indefinitely locked.
The default dispute timeout is 7 days (604800 seconds).
Dispute metadata records the address that raised the dispute, the reason, the timestamp at which it was raised, and whether the dispute has been resolved.
For Reviewers
Please focus on:
In particular, review the dispute state transitions, authorization checks for dispute resolution, seller/buyer settlement paths, timeout handling, dispute metadata lifecycle, and the default refund behavior.