You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Implement a creator-controlled pause mechanism for invoices that includes: optional time-locked auto-resume, a pause reason string stored on-chain, a full pause/resume audit trail emitted as events, and a global admin override to force-resume any paused invoice.
Acceptance Criteria
Add pause_invoice(creator: Address, invoice_id: u64, reason: String, auto_resume_at: Option<u64>) — sets invoice.frozen = true, stores reason and auto_resume_at in persistent storage, emits a paused event
Description
Implement a creator-controlled pause mechanism for invoices that includes: optional time-locked auto-resume, a pause reason string stored on-chain, a full pause/resume audit trail emitted as events, and a global admin override to force-resume any paused invoice.
Acceptance Criteria
pause_invoice(creator: Address, invoice_id: u64, reason: String, auto_resume_at: Option<u64>)— setsinvoice.frozen = true, stores reason and auto_resume_at in persistent storage, emits apausedeventresume_invoice(creator: Address, invoice_id: u64)— setsinvoice.frozen = false, clears stored reason/auto_resume_at, emits aresumedeventadmin_force_resume(admin: Address, invoice_id: u64)— admin override, emitsforce_resumedevent with admin address_paychecksauto_resume_at: ifledger.timestamp() >= auto_resume_at, automatically setsfrozen = falsebefore proceeding (lazy auto-resume)_paypanics with"invoice is frozen"only when frozen and auto-resume time has not yet passedget_invoice_extreturnspause_reason: Option<String>andauto_resume_at: Option<u64>events::module pattern incontracts/split/src/events.rstest_pause_blocks_payment_with_reasontest_auto_resume_allows_payment_after_timestamptest_admin_force_resume_overrides_creator_pausetest_resume_clears_stored_reasonContext
frozenfield already exists onInvoiceintypes.rscontracts/split/src/events.rs— follow existing patterns for topic/data structurerequire_adminhelper is available inlib.rsStringin Soroban issoroban_sdk::String, not std — useString::from_str(&env, "...")