Skip to content

fix(escrow-vault): reject zero time_lock_duration in create_escrow#706

Merged
gboigwe merged 1 commit into
ThinkLikeAFounder:mainfrom
wheval:fix/issues-688
May 31, 2026
Merged

fix(escrow-vault): reject zero time_lock_duration in create_escrow#706
gboigwe merged 1 commit into
ThinkLikeAFounder:mainfrom
wheval:fix/issues-688

Conversation

@wheval

@wheval wheval commented May 31, 2026

Copy link
Copy Markdown
Contributor

Summary

Reject time_lock_duration = 0 in create_escrow so escrows always have at least one second of time-lock protection before release.

Purpose / Motivation

create_escrow validated expires_in > time_lock_duration but allowed time_lock_duration = 0. That set time_lock_until to the current ledger time, so now >= time_lock_until was true immediately and funds could be released with no time protection (issue #688).

Changes Made

How to Test

  1. From contracts/escrow-vault, run cargo test.
  2. Confirm test_create_escrow_zero_time_lock_duration passes (panics on time_lock_duration = 0).
  3. Confirm release/refund tests still pass with MIN_TIME_LOCK_SECS = 1 and ledger advancement where needed.
  4. (Manual) Attempt create_escrow on a deployed contract with time_lock_duration = 0 and verify the transaction fails.

Screenshots (if applicable)

N/A — contract-only change.

Breaking Changes

  • API: create_escrow no longer accepts time_lock_duration = 0. Callers that relied on “no time lock” must pass at least 1 (one second).

Related Issues

Closes #688

Checklist

  • Code builds successfully
  • Tests added/updated
  • No console errors
  • Documentation updated (if needed)

Prevent immediate escrow release when time_lock_duration is 0 by
requiring at least one second and updating tests/snapshots accordingly.

Closes ThinkLikeAFounder#688
@drips-wave

drips-wave Bot commented May 31, 2026

Copy link
Copy Markdown

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

@gboigwe gboigwe merged commit 599fdd5 into ThinkLikeAFounder:main May 31, 2026
2 of 4 checks 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

Development

Successfully merging this pull request may close these issues.

[bug] escrow-vault: create_escrow accepts time_lock_duration = 0 — escrow is immediately releasable with no time protection

2 participants