Skip to content

NFT tweaks#409

Merged
wilfreddenton merged 3 commits into
mainfrom
nft
May 11, 2026
Merged

NFT tweaks#409
wilfreddenton merged 3 commits into
mainfrom
nft

Conversation

@ouziel-slama
Copy link
Copy Markdown

@ouziel-slama ouziel-slama commented May 11, 2026

Replace description with attribute map and add creator/listing views

  • mint: replace description: string with attributes: list<attribute> (≤32 entries, unique non-empty keys ≤64B, values ≤2048B), set once at mint
  • nft-info: add immutable creator (= mint signer), drop description
  • views: add list-nfts, list-nfts-by-creator, count-nfts-by-creator (offset/limit, internal cap), plus get-attributes / get-attribute
  • backed by a creator→nft-ids index populated at mint

Note

Medium Risk
Medium risk because it changes the NFT contract storage and WIT interface (breaking mint/nft-info shape) and introduces new indexing/pagination logic that could affect on-chain data compatibility and query correctness.

Overview
NFT contract API/storage refactor: replaces description with an immutable attributes map set at mint, adds a permanent creator field (mint signer), and updates validation to enforce attribute count/size/uniqueness constraints.

New read APIs: adds paginated list-nfts, list-nfts-by-creator, and count-nfts-by-creator (with internal limit clamp and lenient handling of invalid creators), plus get-attributes/get-attribute views.

Indexing + tests: introduces a per-creator secondary index populated at mint (not affected by transfers) and significantly expands the native NFT contract integration test coverage for attributes, creator invariance, pagination, and edge cases; Cargo.lock is updated for WIT/wasm tooling version resolution.

Reviewed by Cursor Bugbot for commit 2bb67d8. Bugbot is set up for automated code reviews on this repo. Configure here.

…iews

- mint: replace `description: string` with `attributes: list<attribute>`
  (≤32 entries, unique non-empty keys ≤64B, values ≤2048B), set once at mint
- nft-info: add immutable `creator` (= mint signer), drop `description`
- views: add `list-nfts`, `list-nfts-by-creator`, `count-nfts-by-creator`
  (offset/limit, internal cap), plus `get-attributes` / `get-attribute`
- backed by a creator→nft-ids index populated at mint
Copy link
Copy Markdown

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 2 potential issues.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 9337705. Configure here.

Comment thread native-contracts/nft/src/lib.rs Outdated
Comment thread native-contracts/nft/src/lib.rs
@wilfreddenton wilfreddenton merged commit bc662bc into main May 11, 2026
7 checks passed
@wilfreddenton wilfreddenton deleted the nft branch May 11, 2026 13:47
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.

4 participants