Skip to content

Closes #188, #189, #193, #195: dispute arbitration, admin rotation, creator volume cap, KYC for recipients#240

Merged
Kingsman-99 merged 2 commits into
Stellar-split:mainfrom
Ebuka321:feat/issues-188-189-193-195
Jun 24, 2026
Merged

Closes #188, #189, #193, #195: dispute arbitration, admin rotation, creator volume cap, KYC for recipients#240
Kingsman-99 merged 2 commits into
Stellar-split:mainfrom
Ebuka321:feat/issues-188-189-193-195

Conversation

@Ebuka321

@Ebuka321 Ebuka321 commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

Closes #188
Closes #189
Closes #193
Closes #195

Summary

Implements 4 issues:

  • Build dispute arbitration with neutral third-party resolver #188 - Dispute Arbitration: Adds arbiter and disputed fields to InvoiceExt2. New functions: set_arbiter (admin sets arbiter per invoice), raise_dispute (arbiter blocks all actions), resolve_dispute (arbiter chooses release or refund). Dispute guards added to all state-mutating functions.

  • Implement admin address rotation with two-step handoff #189 - Admin Rotation: Adds propose_admin (current admin proposes new admin) and accept_admin (pending admin accepts). Uses a pending_admin storage key for two-phase transfer.

  • Add per-creator daily volume cap #193 - Creator Volume Cap: Admin can set per-creator volume caps via set_creator_volume_cap. Enforced at invoice creation time — the total amount across all invoices by a creator cannot exceed the cap. Query with get_creator_volume_cap / get_creator_volume_used.

  • Implement recipient KYC tier enforcement #195 - KYC for Recipients: require_kyc field already existed on InvoiceOptions/InvoiceExt2/Invoice but was hardcoded to false. Now wired through _create_invoice_inner and all callers, with recipient KYC verification against the configured KYC contract at creation time.

Changes

  • contracts/split/src/types.rs: Added arbiter: Option<Address> and disputed: bool to InvoiceExt2 and Invoice, updated split()/assemble()/from_legacy()
  • contracts/split/src/lib.rs: 269 lines added — storage keys, admin rotation, volume cap enforcement, dispute functions + guards, require_kyc wiring

…ar-split#195: dispute arbitration, admin rotation, creator volume cap, KYC for recipients

- Stellar-split#188: Add arbiter/disputed fields, raise_dispute/resolve_dispute functions
- Stellar-split#189: Add propose_admin/accept_admin admin rotation
- Stellar-split#193: Add creator volume cap with set/get functions + creation-time check
- Stellar-split#195: Wire require_kyc through _create_invoice_inner, validate recipients at creation
@drips-wave

drips-wave Bot commented Jun 24, 2026

Copy link
Copy Markdown

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

@Kingsman-99 Kingsman-99 merged commit 49da4bb into Stellar-split:main Jun 24, 2026
1 check failed
Kingsman-99 pushed a commit that referenced this pull request Jun 26, 2026
Implements get_invoice_storage_footprint(env, invoice_id) -> u32 as requested in issue #240.

This pure view function (no auth required) returns the minimum remaining TTL
(in ledgers) across an invoice's persistent storage entries:
- invoice core (inv key)
- invoice_ext (inv_ext key)
- invoice_ext2 (inv_ex2 key)
- audit_log (log key)

Returns 0 for archived invoices (stored in instance storage) or nonexistent invoices,
serving as a sentinel value for ease of use.

Acceptance Criteria Met:
✓ Returns minimum TTL across core/ext/ext2/audit-log storage entries
✓ Pure view function with no mutation or auth requirement
✓ Returns sensible value (0) for archived invoices
✓ Comprehensive test coverage including:
  - TTL decrease as ledger advances
  - TTL increase after extend_ttl operations
  - Archived invoice handling
  - Nonexistent invoice handling
  - Multiple storage key verification
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants