Skip to content

Issue 4: Escrow Contract - Mutual Fund Release Logic #15

@soomtochukwu

Description

@soomtochukwu

Description:
When a freelancer completes a milestone and the client is fully satisfied with the delivered work, the platform must seamlessly allow the mutual, undisputed release of funds. This issue is focused on creating the release_funds function, which acts as the happy-path resolution for the escrow contract. It mandates dual authorization or specific client-side authorization depending on the platform's exact trust model. Ideally, if the client calls this function, they are cryptographically attesting that the work meets their standards, triggering an immediate internal transfer from the contract balance to the freelancer’s address. This step is critical because it represents the primary value exchange mechanism on the Lance platform. Robust checks are necessary to prove the escrow is in a 'Funded' state and hasn't already been depleted.
Requirements:

  • Implement release_funds specifying the Job ID and the explicit Milestone Index to unlock.
  • Enforce that only the specified client/payer assigned to this escrow can authorize this happy-path release.
  • Execute the asset transfer to the payee utilizing the token::Client.
  • Update the persistent storage to mark the specified milestone as Completed and prevent double-spending.
    Acceptance Criteria:
  • The client can successfully trigger the payout to the freelancer.
  • The freelancer receives the exact funds scoped out for that specific milestone.
  • An attempt to call release_funds twice on the same milestone returns an error.

Metadata

Metadata

Assignees

Labels

Stellar WaveIssues in the Stellar wave program

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions