Skip to content

Implement on-chain payer blacklist with appeal period #421

Description

@Kingsman-99

Description

Contract admins have no mechanism to block bad actors (sanctioned addresses, fraudulent payers) from interacting with any invoice. This issue adds an admin-managed payer blacklist with a built-in appeal window during which a blacklisted address can submit an appeal hash and admins can review before the ban is finalised.

Technical Context

Add blacklist_key(payer: Address) -> Symbol storing BlacklistEntry { banned_at: u64, appeal_hash: Option<BytesN<32>>, finalised: bool } in types.rs and lib.rs. Admin calls blacklist_payer(env, admin, payer, reason_hash: BytesN<32>). Payer calls submit_appeal(env, payer, invoice_id, appeal_hash: BytesN<32>) within APPEAL_WINDOW_LEDGERS. Admin calls finalise_blacklist(env, admin, payer, uphold: bool). pay_invoice checks finalised && !uphold → panic PayerBlacklisted.

Acceptance Criteria

  • blacklist_payer records entry with finalised: false; only admin can call it
  • pay_invoice blocks finalised-blacklisted payers with PayerBlacklisted
  • Payer can submit one appeal during the APPEAL_WINDOW_LEDGERS window
  • Admin finalises with uphold: true (ban stands) or false (payer reinstated)
  • PayerBlacklisted, AppealSubmitted, BlacklistFinalised events emitted from events.rs
  • Tests: blacklist blocks, appeal window, appeal accepted reinstates, appeal rejected keeps ban, non-admin blacklist fails
  • All CI checks (cargo test, cargo clippy, cargo fmt) pass and the branch has no merge conflicts

Metadata

Metadata

Labels

Stellar WaveIssues in the Stellar wave programcomplexity: highComplex feature requiring deep knowledge - 200 ptssecuritySecurity hardening and access control

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions