Skip to content

Add invoice creator whitelist #122

@Kingsman-99

Description

@Kingsman-99

Label: complexity: high
Points: 200

Description

Open invoice creation allows any address to create invoices, which may not be appropriate for private platforms. This issue adds admin-controlled whitelist_creator() and remove_creator() functions — when the whitelist is non-empty, create_invoice() rejects any creator not on the list.

Technical Context

Involves lib.rs. Store whitelist as persistent key "creator_wl" holding Vec<Address>. Add whitelist_creator(env, address) and remove_creator(env, address) requiring admin auth. In create_invoice(), if whitelist is non-empty, assert creator is in the list.

Acceptance Criteria

  • whitelist_creator() requires admin auth
  • create_invoice() with non-whitelisted creator panics with "creator not whitelisted"
  • Empty whitelist allows any creator (open mode)
  • remove_creator() removes address from whitelist
  • Test adds creator to whitelist, verifies non-whitelisted creator rejected
  • All existing cargo tests pass
  • cargo clippy passes with zero warnings

Metadata

Metadata

Assignees

Labels

Stellar WaveIssues in the Stellar wave programcomplexity: highComplex feature requiring deep knowledge - 200 pts

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions