Skip to content

Emit structured indexed events with topics for all vault lifecycle transitionsΒ #224

Description

@1nonlypiece

πŸ“Œ Description

src/lib.rs publishes vault_created, milestone_validated, funds_released,
funds_redirected, and vault_cancelled, but the topic/data layout is
inconsistent β€” some carry the full ProductivityVault, some carry only the
amount, some carry (). Indexers consuming these (see the event-monitoring
section of src/doc.md) need a stable, predictable schema.

This issue standardizes event topics and data into a documented, indexable shape.

Goal: give every lifecycle event a consistent topic tuple and a typed data
payload, then document the schema for off-chain consumers.

🎯 Requirements and Context

  • Must be tested and documented.
  • Each event topic should be (event_name, vault_id, creator) so indexers can
    filter by creator without decoding data.
  • Data payloads should be typed structs/tuples (amount, destination, status).
  • Keep event names backward-compatible where possible; document any change.
  • Verify emission via env.events() assertions, not just snapshots.

πŸ› οΈ Suggested Execution

1. Fork the repo and create a branch

git checkout -b feature/structured-events

2. Implement changes

  • Contract: update every env.events().publish(...) call in src/lib.rs to the
    standardized topic/data shape.
  • Tests: add tests/events.rs asserting topics and decoded data for each
    transition using env.events().all().
  • Docs: rewrite the event-monitoring section of src/doc.md and add
    docs/EVENTS.md with the full schema table.
  • Add NatSpec-style /// comments documenting each emitted event.

3. Test and commit

  • Run cargo test.
  • Cover edge cases: events for create, validate, release (validated + deadline),
    redirect, cancel; assert vault_id and creator topics on each.

Example commit message

feat: standardized indexed lifecycle events with schema docs and tests

βœ… Guidelines

  • Minimum 95% test coverage on new/changed event paths.
  • Clear documentation of the event schema for indexers.
  • No regressions on existing event names where preserved.
  • Timeframe: 96 hours.

🏷️ Labels

type-enhancement Β· area-contracts Β· type-documentation Β·
MAYBE REWARDED Β· GRANTFOX OSS Β· OFFICIAL CAMPAIGN

πŸ’¬ Community & Support

  • Join the Disciplr contributor Discord to coordinate, ask questions, and get
    unblocked fast: https://discord.gg/xvNAvMJf
  • Please introduce yourself before you start so we can avoid duplicate work,
    pair you with a reviewer, and merge your PR quickly.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Fields

    No fields configured for Feature.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions