Skip to content

feat(escrow_contract): implement escrow lifecycle for issues 7-10 - #44

Merged
Tybravo merged 1 commit into
SwiftChainn:mainfrom
ALIPHATICHYD:feat/escrow-lifecycle-issues-7-8-9-10
Apr 28, 2026
Merged

feat(escrow_contract): implement escrow lifecycle for issues 7-10#44
Tybravo merged 1 commit into
SwiftChainn:mainfrom
ALIPHATICHYD:feat/escrow-lifecycle-issues-7-8-9-10

Conversation

@ALIPHATICHYD

Copy link
Copy Markdown
Contributor

This PR implements the full escrow lifecycle in the escrow contract, including payment locking on creation, fee-aware release, full refunds, and dispute-triggered escrow pausing with dispute metadata.

What changed
Added robust escrow creation flow with sender auth, token transfer to contract, duplicate delivery rejection, Locked state, and created_at timestamp.
Added recipient/admin controlled escrow release with Locked-state checks, platform fee basis-points calculation, fee transfer to admin, net transfer to driver, and Released transition.
Added sender/admin controlled refund path from Locked or Paused states, full refund with no fee deduction, and Refunded transition.
Added dispute flow where sender or recipient can pause a Locked escrow, recording disputed_by and disputed_at metadata.
Updated shared escrow types and contract tests to validate the full lifecycle and access-control/state-machine constraints.
Validation
Ran formatting and full workspace tests successfully:
cargo fmt --all
cargo test

Closes #7
Closes #8
Closes #9
Closes #10

@drips-wave

drips-wave Bot commented Apr 27, 2026

Copy link
Copy Markdown

@ALIPHATICHYD 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 merged commit 0f467bf into SwiftChainn:main Apr 28, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants