feat(#679): configurable collection name and symbol - #721
Merged
Eniola3321 merged 2 commits intoAug 1, 2026
Merged
Conversation
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
|
@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! 🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Closes #679.
Depends on #719 (fixes pre-existing corruption in
lib.rs/nft.controller.tsthat 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):"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.set_name()/set_symbol(), admin-only (require_auth+NotInitializedguard, matching the other admin setters), each emitting aname_updated/symbol_updatedevent.CLIP_NAME/CLIP_SYMBOLconsts instead of the duplicated string literals that were there before.initialize().Backend (
src/nft):AdminContractService.getCollectionInfo()queries the on-chainname()/symbol()view functions (same simulate-transaction pattern as the existinggetClipId/getPauseStatus) and returns{ name, symbol, contractId }.GET /nfts/collectionendpoint, documented with a response schema (CollectionInfoResponseDto) and example per the issue's Swagger/API task list.Test plan
cargo testincontracts/nft-contract— 83 passed (77 pre-existing + 6 new)npx jest src/nft src/clips/nft-mint— 19 suites / 147 tests passingnpx tsc --noEmit— no errors in any file touched by this PR🤖 Generated with Claude Code