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.
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_fundsfunction, 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:
release_fundsspecifying the Job ID and the explicit Milestone Index to unlock.token::Client.Completedand prevent double-spending.Acceptance Criteria:
release_fundstwice on the same milestone returns an error.