Skip to content

feat: add invoice compliance attestation system (#879) - #908

Merged
Kingsman-99 merged 2 commits into
Stellar-split:mainfrom
jacobjacobb4242:feat/issue-879-invoice-compliance-attestation
Sep 30, 2026
Merged

Kingsman-99 merged 2 commits into
Stellar-split:mainfrom
jacobjacobb4242:feat/issue-879-invoice-compliance-attestation

Conversation

@jacobjacobb4242

Copy link
Copy Markdown

Issue #879 — Add invoice compliance attestation system

Adds a new compliance_attest_ext.rs module that implements a structured,
admin-gated compliance record system for invoices.

Core functionality

Admin management:

  • register_compliance_officer(admin, officer) — adds an officer to the approved set.
  • remove_compliance_officer(admin, officer) — removes an officer.
  • is_compliance_officer(officer) — read-only membership check.

Record submission:

  • submit_compliance_record(officer, invoice_id, framework, passed, notes) — registered officers submit compliance attestations.
    • framework is a short identifier ("KYC", "AML", "GDPR", …) capped at 32 bytes.
    • notes is an optional free-form string capped at 512 bytes.
    • One record per officer per framework per invoice (duplicates rejected).
    • Max 10 records per invoice.
  • get_compliance_records(invoice_id) — returns all records (read-only).

Events

Topic Data
(split, co_add) officer
(split, co_rem) officer
(split, cmp_sub, invoice_id) (officer, framework, passed)

Storage

Local ComplianceAttestKey enum:

  • Records(invoice_id) — Vec<ComplianceRecord> in persistent storage.
  • Officers — Vec<Address> in instance storage.

New type

ComplianceRecord { officer, framework, passed, notes, timestamp }

Tests

7 unit tests:

  • Register and check officer
  • Remove officer
  • Submit and read record
  • Non-officer cannot submit
  • Duplicate framework per officer rejected
  • Non-admin cannot register officer
  • Multiple officers / multiple frameworks on same invoice

Files changed

File Change
contracts/split/src/compliance_attest_ext.rs New
contracts/split/src/lib.rs Added mod compliance_attest_ext;

Closes #879

Add compliance_attest_ext.rs with admin-managed compliance officers
who can submit structured compliance records (framework, passed/fail,
notes) against any invoice.

- register_compliance_officer / remove_compliance_officer (admin only)
- submit_compliance_record (officer only; 1 record per officer+framework)
- get_compliance_records / is_compliance_officer (read-only)
- Records capped at 10 per invoice; framework ≤ 32 bytes; notes ≤ 512
- Events: co_add, co_rem, cmp_sub
- 7 unit tests covering all guard conditions and happy paths

Closes Stellar-split#879
@drips-wave

drips-wave Bot commented Sep 30, 2026

Copy link
Copy Markdown

@jacobjacobb4242 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 e0eda73 into Stellar-split:main Sep 30, 2026
1 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.

Add invoice compliance attestation system

2 participants