Skip to content

feat(#679): configurable collection name and symbol - #721

Merged
Eniola3321 merged 2 commits into
ANYTECHS:mainfrom
boseshittu2323-design:feat/679-configurable-collection-name-symbol
Aug 1, 2026
Merged

feat(#679): configurable collection name and symbol#721
Eniola3321 merged 2 commits into
ANYTECHS:mainfrom
boseshittu2323-design:feat/679-configurable-collection-name-symbol

Conversation

@boseshittu2323-design

Copy link
Copy Markdown
Contributor

Summary

Closes #679.

The collection may be renamed without redeploying the contract.

Depends on #719 (fixes pre-existing corruption in lib.rs/nft.controller.ts that this branch needed in order to compile/test — this diff includes those commits until #719 merges; only the last commit here is new).

Changes

Contract (contracts/nft-contract):

  • Added storage-backed collection name/symbol (instance storage, "cname"/"csym" keys).
  • name()/symbol() now check storage first, falling back to the existing hardcoded defaults ("ClipCash NFT" / "CLIP") when never overridden — no behavior change for anyone who hasn't called the new setters.
  • Added set_name() / set_symbol(), admin-only (require_auth + NotInitialized guard, matching the other admin setters), each emitting a name_updated/symbol_updated event.
  • Reused the previously dead CLIP_NAME/CLIP_SYMBOL consts instead of the duplicated string literals that were there before.
  • 6 new unit tests: name/symbol update independently, both require admin auth, both reject before initialize().

Backend (src/nft):

  • AdminContractService.getCollectionInfo() queries the on-chain name()/symbol() view functions (same simulate-transaction pattern as the existing getClipId/getPauseStatus) and returns { name, symbol, contractId }.
  • New GET /nfts/collection endpoint, documented with a response schema (CollectionInfoResponseDto) and example per the issue's Swagger/API task list.
  • Unit tests for the service (including RPC-failure and empty-response error paths) and the controller wiring.

Test plan

  • cargo test in contracts/nft-contract — 83 passed (77 pre-existing + 6 new)
  • npx jest src/nft src/clips/nft-mint — 19 suites / 147 tests passing
  • npx tsc --noEmit — no errors in any file touched by this PR

🤖 Generated with Claude Code

The collection could not be renamed without redeploying the contract
— name()/symbol() returned hardcoded literals.

Contract (contracts/nft-contract):
- Add storage-backed collection name/symbol (instance storage, "cname"
  / "csym" keys) alongside the existing hardcoded defaults.
- name()/symbol() now check storage first, falling back to the
  default "ClipCash NFT" / "CLIP" when never overridden — existing
  callers see no behavior change until an admin opts in.
- Add set_name()/set_symbol(), admin-only (require_auth + NotInitialized
  guard, matching the other admin setters), each emitting a
  name_updated/symbol_updated event.
- Reused the previously-unused CLIP_NAME/CLIP_SYMBOL consts (changed
  from &[u8] to &str) instead of duplicating the literals.
- 6 new unit tests: name/symbol update independently of each other,
  both require admin auth, both reject before initialize().

Backend (src/nft):
- AdminContractService.getCollectionInfo() queries the on-chain
  name()/symbol() view functions (same simulate-transaction pattern as
  getClipId/getPauseStatus) and returns { name, symbol, contractId }.
- New GET /nfts/collection endpoint, documented with a response schema
  and example per the issue's Swagger/API task list.
- Unit tests for the service (including RPC-failure and
  empty-response error paths) and the controller wiring.

Closes ANYTECHS#679
@drips-wave

drips-wave Bot commented Aug 1, 2026

Copy link
Copy Markdown

@boseshittu2323-design Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@Eniola3321
Eniola3321 merged commit e0a5d14 into ANYTECHS:main Aug 1, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Soroban] Configurable Collection Name and Symbol

2 participants