Skip to content

Cross-crate symbol catalog — single source of truth for event topic names #440

Description

@greatest0fallt1me

Description

Event topic strings ("init", "pause_set", "distribute", "admin_changed") are repeated as ad-hoc Symbol::new(&env, "...") calls across the three crates. Extract a shared events module per crate that exports pub const Symbol topic constants so renames are mechanical and the catalog is grep-able.

Requirements and Context

  • New contracts/<crate>/src/events.rs with pub fn event_init(env: &Env) -> Symbol (or similar) per topic
  • Replace inline literals at emit sites
  • Must be secure, tested, and documented
  • Should be efficient and easy to review

Suggested Execution

  1. Fork the repo and create a branch
    git checkout -b task/event-symbol-catalog
  2. Implement changes
    • contracts/vault/src/events.rs, contracts/settlement/src/events.rs, contracts/revenue_pool/src/events.rs
    • Replace Symbol::new(&env, "init") etc. throughout
  3. Test and commit
    • cargo test --workspace
    • Cover edge cases: every topic still produces identical bytes (snapshot test)
    • Include test output and notes in the PR

Example commit message

task: centralize event topic symbols per crate

Acceptance Criteria

  • No remaining inline Symbol::new(env, "...") for event topics
  • Topic-byte snapshot test prevents accidental renames
  • EVENT_SCHEMA.md cross-links each topic constant

Guidelines

  • .rs only under contracts/.../src/, NatSpec-style /// doc comments
  • Use real Soroban SDK idioms
  • Clear documentation and inline comments
  • Timeframe: 96 hours

Metadata

Metadata

Assignees

Labels

GRANTFOX OSSGrantFox open-source campaign taskOFFICIAL CAMPAIGNOfficial GrantFox campaign issueStellar WaveStellar Wave Program issuedocumentationDocumentationenhancementNew feature or improvementrustRust implementationsmart-contractSoroban smart-contract worksorobanSoroban SDK / Stellar

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions