Skip to content

Contracts: Add on-chain campaign metadata (name, description, image URI) to campaign contract #320

@CelestinaBeing

Description

@CelestinaBeing

Summary

The campaign contract stores only operational config (active flag, time window, cap, Merkle root). Campaign name, description, and an optional image_uri are stored only in the off-chain backend DB — meaning on-chain verification of campaign identity is impossible.

Problem

  • Users cannot verify a campaign's metadata from the contract alone
  • Forks of the backend can display arbitrary metadata for any contract ID
  • No trustless way to confirm what a campaign is about before registering

Acceptance Criteria

  • Add set_metadata(env, admin, nonce, name: Symbol, description: String, image_uri: String) admin function
  • Add get_metadata(env) -> (Symbol, String, String) view function
  • Store in instance storage; emit a metadata event on update
  • Keep name as Symbol (max 32 chars), description and image_uri as String (max 256 chars each) — reject with InvalidMetadata error if too long
  • Add unit tests: set and get, unauthorized set, string length boundary
  • Update backend/src/jobs/eventIndexer.js (issue Backend: Implement Soroban event indexer worker #283) to index the metadata event and sync with DB
  • Update docs/ARCHITECTURE_OVERVIEW.md

References

  • contracts/campaign/src/lib.rs
  • contracts/rewards/src/lib.rs:81metadata() view pattern to follow

Metadata

Metadata

Assignees

Labels

Stellar WaveIssues in the Stellar wave program

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