Skip to content

Vault: emit metadata_removed event and add remove_metadata for offering cleanup #353

@greatest0fallt1me

Description

@greatest0fallt1me

Description

CalloraVault supports set_metadata/update_metadata/get_metadata for offerings but provides no way to delete a stale offering's metadata, leaving abandoned entries permanently consuming instance storage. Add an owner-only remove_metadata(offering_id) that removes the Metadata(String) key and emits an event.

Requirements and Context

  • Owner-gated remove_metadata(caller, offering_id) removing StorageKey::Metadata(offering_id).
  • Emit metadata_removed with the offering id.
  • get_metadata returns None afterward.
  • 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 feature/vault-remove-metadata
  2. Implement changes
    • contracts/vault/src/lib.rsremove_metadata + event
    • EVENT_SCHEMA.md — document the event
  3. Test and commit
    • cargo test -p callora-vault
    • Test remove then get_metadata returns None; owner-only enforced
    • Include test output and notes in the PR

Example commit message

feat: add remove_metadata to vault offering registry

Acceptance Criteria

  • remove_metadata implemented and owner-gated
  • metadata_removed event emitted
  • get_metadata returns None after removal
  • Tests cover removal and access control

Guidelines

  • .rs under contracts/vault/src/, cargo test, /// docs, minimum 95% line coverage, no unwrap() in prod paths
  • Clear documentation and inline comments
  • Timeframe: 96 hours

Metadata

Metadata

Labels

Stellar WaveIssues in the Stellar wave programenhancementNew feature or improvementgood first issueGood for newcomerssmart-contractSoroban smart-contract worksorobanSoroban SDK / Stellar
No fields configured for Feature.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions