Skip to content

feat(escrow): add escrow top-up support for existing jobs (Closes #533) - #666

Open
bethel4455 wants to merge 4 commits into
anumukul:mainfrom
bethel4455:chore/sc-83-topup-note
Open

feat(escrow): add escrow top-up support for existing jobs (Closes #533)#666
bethel4455 wants to merge 4 commits into
anumukul:mainfrom
bethel4455:chore/sc-83-topup-note

Conversation

@bethel4455

Copy link
Copy Markdown
Contributor

This PR introduces escrow top-up functionality, allowing clients to add additional funds to an existing job without canceling and recreating it. This enables budget increases for scope changes, bonuses, and other post-creation adjustments while preserving the existing client–freelancer relationship.

What was implemented
Added a top_up_escrow(client, job_id, additional_amount) contract function.
Transfers the specified additional_amount from the client into the escrow contract.
Updates the job's escrow amount by adding the new funds to the existing balance.
Restricts top-ups to jobs in eligible states:
Open
InProgress
SubmittedForReview
Enforces authorization so only the original job owner (client) can perform escrow top-ups.
Emits an EscrowToppedUp event containing:
job_id
old_amount
new_amount
Updated get_job to return the latest escrow balance after top-ups.
Frontend Updates
Added an "Add Funds" action to the job details page for eligible clients.
Implemented a confirmation dialog displaying:
Current escrow amount
Additional amount being added
Updated total escrow amount before confirmation
Testing

Added unit tests covering:

Successful escrow top-up flow.
Authorization checks for non-owners.
Invalid job status restrictions.
Escrow balance updates after multiple top-ups.
Event emission and state persistence.
Edge cases and invalid input validation.
Benefits
Eliminates the need to cancel and recreate jobs when increasing project budgets.
Supports bonuses and scope expansion without disrupting ongoing work.
Preserves the existing escrow workflow while maintaining secure authorization and event tracking.
Closes #533

bethel4455 and others added 2 commits July 30, 2026 13:58
Restore a coherent escrow lib and add top_up_escrow with auth/status checks, EscrowToppedUp events, unit tests, and client Add Funds UI so budgets can increase without canceling jobs.

Co-authored-by: Cursor <cursoragent@cursor.com>
@drips-wave

drips-wave Bot commented Aug 3, 2026

Copy link
Copy Markdown

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

Co-authored-by: Cursor <cursoragent@cursor.com>
@anumukul

anumukul commented Aug 5, 2026

Copy link
Copy Markdown
Owner

@bethel4455 please resolve conflicts

Co-authored-by: Cursor <cursoragent@cursor.com>
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.

[SC-83] Add escrow top-up function for existing jobs

2 participants