Skip to content

Implement LP whitelist for private invoice markets #122

@Nursca

Description

@Nursca

Description
Some businesses may want to offer invoices exclusively to trusted LPs (e.g. their own treasury, a specific VC). An optional LP whitelist on invoices enables private invoice markets within the public protocol.

Requirements and context

  • submit_invoice() accepts optional allowed_lps: Option<Vec<Address>>
  • If set, fund_invoice() rejects callers not in the whitelist with Error::LPNotWhitelisted
  • Store whitelist on invoice struct (cap at 10 addresses to limit storage)
  • Emit whitelist in InvoiceSubmitted event
  • Write tests: public invoice (no whitelist), private invoice (whitelist), non-whitelisted LP rejected

Suggested execution

git checkout -b feat/lp-whitelist
  • Add optional whitelist to invoice struct
  • Add check in fund_invoice()
  • Write tests

Example commit message
feat: add optional LP whitelist for private invoice markets

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    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