Skip to content

Add grace period functionality for penalty-free early exits#530

Merged
1nonlypiece merged 3 commits into
Commitlabs-Org:masterfrom
BigJohn-dev:feature/grace-period-penalty-free-exit
May 28, 2026
Merged

Add grace period functionality for penalty-free early exits#530
1nonlypiece merged 3 commits into
Commitlabs-Org:masterfrom
BigJohn-dev:feature/grace-period-penalty-free-exit

Conversation

@BigJohn-dev
Copy link
Copy Markdown
Contributor

Closes #481

Summary

Adds a configurable penalty-free grace period for near-maturity early exits in the escrow contract. When a funded commitment is refunded within the configured window before maturity, the contract now waives the early-exit penalty and returns the full principal.

Changes

  • lib.rs

    • Added DataKey::GracePeriodSeconds storage key.
    • Added admin setter set_grace_period(admin, grace_period_seconds).
    • Added getter get_grace_period().
    • Implemented grace-period check in execute_refund() and dispute-resolution refunds.
    • Added missing storage keys for Paused, YieldPool, and Attestations(u64) to match contract state usage.
    • Added AttestationRecord type for attestation history storage.
  • test.rs

    • Added tests covering:
      • penalty-free refund at the exact grace-window boundary
      • penalty application just outside the grace window
      • admin can set/get grace period configuration

@vercel
Copy link
Copy Markdown

vercel Bot commented May 27, 2026

@BigJohn-dev is attempting to deploy a commit to the 1nonly's projects Team on Vercel.

A member of the Team first needs to authorize it.

@drips-wave
Copy link
Copy Markdown

drips-wave Bot commented May 27, 2026

@BigJohn-dev 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

@1nonlypiece 1nonlypiece merged commit f45fbf4 into Commitlabs-Org:master May 28, 2026
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.

Contracts - Add grace-period window allowing penalty-free early exit near maturity

2 participants