Skip to content

[Contracts] Emit an event when update_fee_config changes treasury or fee rate #458

@ogazboiz

Description

@ogazboiz

Join the discussion on Telegram

Why this matters

update_fee_config (contracts/stream_contract/src/lib.rs) changes protocol-critical state — the treasury address and the fee rate that is applied to every create_stream and top_up_stream. Unlike every other mutating function in the contract, it emits no event. The off-chain indexer therefore has no way to observe or audit a fee/treasury change, and an admin dashboard cannot show fee-config history. For a protocol that collects fees from user funds, silent, unauditable fee changes are a transparency and trust problem.

Acceptance criteria

  • Add a FeeConfigUpdatedEvent to contracts/stream_contract/src/events.rs carrying at least { admin, old_treasury, new_treasury, old_fee_rate_bps, new_fee_rate_bps }.
  • Emit it from update_fee_config in contracts/stream_contract/src/lib.rs (and consider emitting an Initialized event from initialize for symmetry).
  • Add a unit test in contracts/stream_contract/src/test.rs asserting the event is published with correct fields.
  • Document the new event topic in any contract event documentation.

Files to touch

  • contracts/stream_contract/src/events.rs
  • contracts/stream_contract/src/lib.rs
  • contracts/stream_contract/src/test.rs

Out of scope

  • Indexing the new event in the backend worker (follow-up).

Metadata

Metadata

Assignees

Labels

Stellar WaveIssues in the Stellar wave programcontractsSmart contract related taskssmart-contractSoroban smart contract

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