Skip to content

Add invoice contract monitoring hooks #180

Description

@Kingsman-99

Label: complexity: high
Points: 200

Description

Production contracts need structured observability for real-time monitoring dashboards. This issue adds a comprehensive monitoring event emitted on every state change — monitor_event with fields for function name, invoice ID, actor, gas used estimate, and timestamp — enabling real-time contract health observability.

Technical Context

Involves events.rs — add monitor_event(env, function: Symbol, invoice_id: u64, actor: &Address, timestamp: u64). Call from every public entry point in lib.rs (create_invoice, pay, release, refund) as the first operation. Use topic (symbol_short!("monitor"), function) for easy filtering.

Acceptance Criteria

  • monitor_event emitted at the start of every public entry point
  • Event topic is (symbol_short!("monitor"), function_name)
  • Event data includes invoice ID, actor address, and ledger timestamp
  • All 4 public functions emit monitoring events
  • Test verifies monitoring event emitted with correct function name on each call
  • 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