Skip to content

Implement invoice cross-contract composability #145

@Kingsman-99

Description

@Kingsman-99

Label: complexity: high
Points: 200

Description

Other Soroban contracts cannot programmatically create StellarSplit invoices without knowing internal storage details. This issue adds a standardised IInvoiceFactory trait interface with create_invoice_for() — allowing any authorised external contract to create invoices on behalf of users.

Technical Context

Involves lib.rs — new create_invoice_for(env, caller: Address, creator: Address, recipients, amounts, token, deadline) -> u64. Requires caller.require_auth(). Store authorised_factories: Vec<Address> in persistent storage. Assert caller is in the list. Then execute standard create_invoice() logic with creator.

Acceptance Criteria

  • authorise_factory(env, address) requires admin auth
  • create_invoice_for() requires caller auth and caller must be authorised factory
  • Unauthorised caller panics with "not authorised factory"
  • Invoice created with correct creator (not the factory address)
  • Test authorises factory contract, creates invoice via factory, verifies creator field
  • All existing cargo tests pass
  • cargo clippy passes with zero warnings

Metadata

Metadata

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