Skip to content

feat(escrow): implement partial milestone payment release and tracking - #203

Open
kosisochukwu1234 wants to merge 1 commit into
Lumina-eX:mainfrom
kosisochukwu1234:fix-partial-payment-release
Open

feat(escrow): implement partial milestone payment release and tracking#203
kosisochukwu1234 wants to merge 1 commit into
Lumina-eX:mainfrom
kosisochukwu1234:fix-partial-payment-release

Conversation

@kosisochukwu1234

Copy link
Copy Markdown

Closes #190

Implement secure partial payment releases for milestone-based contracts. This PR allows clients to approve and release funds for individual milestones while ensuring escrow balance integrity and preventing double spending.

Changes Made:

  • Balance Tracking: Added EscrowBalance to DataKey to track the remaining escrow balance. The state is incremented correctly upon funding and decremented on release (as well as on refunds and disputes).
  • Client-only Authorization: Modified the release function so that only the client can trigger milestone releases.
  • Idempotency checks: Explicitly verify that the milestone is not already in the Released state before processing the payment, preventing duplicate payouts.
  • Event Emission: Ensure events properly log balance updates (balance event) following fund operations, refunds, and milestone releases.
  • Test Coverage Updated: Updated existing tests (e.g. test_happy_path, test_unauthorized_release_fails) to reflect the new authorization model and verified that the escrow balance logic is successfully checked alongside the release.

@drips-wave

drips-wave Bot commented Aug 26, 2026

Copy link
Copy Markdown

@kosisochukwu1234 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

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.

[Feature]: Partial Milestone Payment Release

1 participant