Repository navigation
Conversation
Add optional N-of-M co-signer approval gating invoice release: - CosignerApproval record with signers, threshold, approval/rejection tallies and a derived Pending/Approved/Rejected status - set_cosigners (creator-only, locked once voting starts), approve_release, reject_release and revoke_vote with require_auth signature checks and duplicate-vote protection - release and deposit auto-release now go through check_release_gates - read-only hooks for UIs: get_approval, get_approval_status, has_approved, approvals_remaining - events for configuration, votes and status transitions, plus tests
…t#915) Add optional external price-feed validation before invoice release: - PriceOracle interface (SEP-40 style lastprice) in oracle.rs - OracleCondition with comparator, threshold, staleness window and an optional fallback oracle; set by the creator while Pending - oracle calls go through try_lastprice so panicking/missing oracles map to OracleUnavailable; stale, non-positive and future-dated prices are rejected; fallback oracle consulted when the primary fails - condition evaluated as a release gate (deposit auto-release and release), last reading stored for inspection - admin clear_oracle_condition override for permanently failed oracles - check_oracle_condition / get_oracle_condition / get_last_oracle_reading views, new error states and events, and integration tests with mock oracle contracts
…lit#916) Support delayed release of invoice funds: - ReleaseSchedule with release_at timestamp, unlock_ledger computed from a minimum ledger count, creation metadata and a Scheduled/Executed/Cancelled status - schedule_release / cancel_release_schedule (creator-only, open invoices); release blocked until both time and ledger bounds pass - schedule and invoice TTLs extended through the unlock ledger so the schedule persists until due - schedule marked Executed on release; is_release_due, seconds_until_release and ledgers_until_release views - new error states, events and edge-case tests
Add a configurable grace period after the deadline before refunds can be processed: - admin default (set_default_refund_grace) snapshotted onto each new invoice so later changes never alter existing terms - creator per-invoice override (set_refund_grace) while Pending - admin overrides: extend_refund_grace (bounded by 30 days total) and waive_refund_grace for immediate refunds after the deadline - refund returns RefundGraceActive while the timer runs - NoGrace/NotStarted/Active/Elapsed/Waived status via get_refund_grace_status, plus refund_available_after and refund_grace_remaining countdown views - new error states, events and tests
|
@OZILSOLAR 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! 🚀 |
OZILSOLAR
force-pushed
the
feature/914-915-916-917-escrow-release-controls
branch
from
October 18, 2026 01:54
357a569 to
b1e3f56
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Title:
feat(invoice-escrow): co-signer approvals, oracle guards, scheduled release & refund grace period
Description:
Summary
Adds four release/refund controls to the
invoice-escrowcontract. All of them are opt-in per invoice. They plug into one shared release check,check_release_gates, which bothreleaseand the auto-release indeposituse. If a configured check isn't satisfied, a fully funded invoice staysActiveuntilreleaseis called after it clears. Invoices that don't configure any of these behave exactly as before.#914: Co-signer approval system
CosignerApprovalrecord (signers, threshold, approvals, rejections, statusPending/Approved/Rejected)set_cosigners(creator only; locked once voting starts),approve_release,reject_release,revoke_voterequire_authplus a membership check; duplicate votes are rejected, so concurrent or replayed votes can't inflate the countget_approval,get_approval_status,has_approved,approvals_remaining#915: Oracle condition guards
oracle.rs:PriceOracleinterface (SEP-40-stylelastprice)OracleCondition: comparator (GreaterOrEqual/LessOrEqual), threshold, staleness window, optional fallback oracle; set by the creator while theinvoice is
Pendingtry_lastprice, so a failing oracle reportsOracleUnavailableinstead of aborting; stale, non-positive and future-datedprices are rejected
orc_fbackeventclear_oracle_conditionfor oracles that are permanently downcheck_oracle_condition,get_oracle_condition,get_last_oracle_reading#916: Scheduled release
ReleaseSchedule:release_attimestamp plusunlock_ledger(minimum ledger count), statusScheduled/Executed/Cancelledschedule_release/cancel_release_schedule(creator only); release needs both the time and the ledger bound to have passedget_release_schedule,is_release_due,seconds_until_release,ledgers_until_release#917: Refund grace period
set_default_refund_grace, copied onto each new invoice (later changes never affect existing invoices)set_refund_grace(before any deposits)extend_refund_grace(max 30 days total) andwaive_refund_gracerefundnow returnsRefundGraceActivewhile the grace timer is runningNoGrace/NotStarted/Active/Elapsed/Waivedthroughget_refund_grace_status; countdown viewsrefund_grace_remainingandrefund_available_afterOther
src/test.rs, including mock oracle contracts (configurable and always-failing)Not yet built or run locally. Please run
cargo test -p invoice-escrow; CI checks need to pass before review.Closes #914
Closes #915
Closes #916
Closes #917