Skip to content

feat(contracts): emit contract events from state-changing entrypoints #6

Description

@Mona-i

Description

None of the contracts publish events. State-changing calls — treasury::deposit, governance::create_proposal, voting::cast_vote, dividends::fund/record_share — mutate storage silently. Off-chain consumers (the future @lumio/sdk indexer, the dashboard) have no event stream to follow, which is the idiomatic Soroban way to expose state changes.

Scope

  • Publish a contract event from each state-changing entrypoint using env.events().publish(...) with a small, documented topic/data shape (e.g. topic ("deposit", member), data amount).
  • Keep events minimal and consistent across contracts.
  • Add tests asserting the event is emitted (Soroban testutils env.events().all()).

Out of scope

  • An off-chain indexer (separate repo/phase).
  • Changing existing return values.

Acceptance criteria

  • Each state-changing entrypoint emits a documented event.
  • Tests assert emission for at least treasury::deposit and voting::cast_vote.
  • Event topics/data are documented (in code doc-comments or the README).
  • fmt/build/test green.

Where to start

Estimated effort: ~4–6h. Good Soroban issue.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions