Skip to content

feat(escrow_contract): implement admin dispute resolution and escrow#42

Merged
Tybravo merged 3 commits into
SwiftChainn:mainfrom
DTriple-p:feat/admin-dispute-resolution
May 1, 2026
Merged

feat(escrow_contract): implement admin dispute resolution and escrow#42
Tybravo merged 3 commits into
SwiftChainn:mainfrom
DTriple-p:feat/admin-dispute-resolution

Conversation

@DTriple-p

Copy link
Copy Markdown
Contributor

Closes: #11

Description

This PR implements the admin-only dispute resolution logic for the escrow_contract to provide a trustless arbitration layer for the SwiftChain protocol. It allows the platform admin to settle paused escrows by either refunding the sender or releasing funds (minus platform fees) to the driver.

Changes

  • New Feature: Added resolve_dispute function with DisputeFavour enum (Sender or Driver).
  • State Transition: Implemented EscrowState::Paused (renamed from Disputed) as the required state for resolution.
  • Fee Logic: Integrated platform fee deduction during driver-favor settlement.
  • Code Refactoring:
    • Renamed EscrowStatus to EscrowState for better semantic clarity.
    • Added missing definitions for EscrowRecord, load_escrow, save_escrow, and require_admin.
    • Fixed broken test logic and added missing test helpers in test.rs.
  • Security: Enforced admin.require_auth() and validated caller against stored admin address.
  • Events: Updated event emission to include the resolution outcome.

Verification

  • Both resolution paths (Sender-favour and Driver-favour) implemented and integrated into the test suite.
  • Correct fund routing and state transitions verified.
  • All core contract logic verified through compilation for the wasm32-unknown-unknown target.

@drips-wave

drips-wave Bot commented Apr 25, 2026

Copy link
Copy Markdown

@Agbasimere 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! 🚀

Learn more about application limits

@Tybravo

Tybravo commented Apr 25, 2026

Copy link
Copy Markdown
Collaborator

@Agbasimere, please resolve the conflict

@DTriple-p

Copy link
Copy Markdown
Contributor Author

@Tybravo Resolved

@Tybravo

Tybravo commented Apr 26, 2026

Copy link
Copy Markdown
Collaborator

@Agbasimere
The Check formatting is still making CI/CD checks to fail.

Please go to this area
Rust CI / Build and Test Contracts (pull_request)Failing after 18s

and navigate to More action to see the errors and fix it

@Tybravo Tybravo merged commit 97b005c into SwiftChainn:main May 1, 2026
1 check failed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Smart Contract: Implement Admin Dispute Resolution and Escrow Settlement

2 participants