Skip to content

Add admin entry to update DonorBadge Display templates post-setup #28

Description

@alireza-sharifpour

Right now badge_rewards::setup_badge_display is the only way to register Display metadata for DonorBadge, and it only runs once per package publish. After the display is shared we can’t change name/description/image/link templates without upgrading the whole package and calling setup again.

We need an admin entry (guarded by Publisher or AdminCap) that lets ops update the existing Display object in-place. Requirements:

  • Accepts either &Publisher or an equivalent badge admin capability.
  • Allows updating the display fields (name, description, image URI template, deep link) and bumps the version via display::update_version.
  • Emits an event so wallets/indexers know badge display metadata changed.
  • Document the new endpoint in TESTNET_DEPLOYMENT_GUIDE.md + PUBLISHER_DISPLAY_SETUP.md, including when to call it (e.g., after changing badge artwork URLs).

Deliverables: Move entry, tests verifying display templates change, and docs/runbook update.

Please also update the placeholder deep link used in the display template:

  • Current line in sources/badge_rewards.move:
    // TODO: Replace placeholder badge deep link with final production URL.
    "https://crowdwalrus.app/badges/{owner}/{level}"
  • When implementing the new update entry, include a parameter (or constant) for the deep-link base so ops can switch it (e.g., to production or staging) and then call display::update_version to emit VersionUpdated.
  • Acceptance: after calling the new entry, a Display VersionUpdated event is emitted and wallets show the new link/template.

Implementation hint

  • Add entry fun update_badge_display(pub: &Publisher, display: &mut display::Display, keys: vector, values: vector) that:

  • Calls display::add_multiple or display::edit per key.

  • Calls display::update_version(display).

  • Emits a small custom event (optional) noting which keys changed.

  • In the deployment guide, document the display object ID (created in tx CZWgWxEb318Z728Jt5CSPZSzXEBf9yeRkN6hWFXKeNub: 0x3e040f2d1efe17209a8acbdca994a46765654df45b4d59fc52b2f415d6933160) and the admin call format to update fields (including the deep link).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions