**# 🎨 Sui NFT Display Standard Challenge #2
A demonstration of Sui's Display Standard for NFTs, showcasing how metadata can be modified without changing the actual NFT data.
This project implements an NFT using Sui's Display Standard, demonstrating the decoupling of hardcoded NFT metadata from flexible display metadata. The challenge culminates in "feeding the NFT to a rabbit" 🐰 which modifies the display metadata without touching the NFT itself.
- NFT with Display Standard: Complete implementation of Sui's Display Standard
- Flexible Metadata: Display templates can be modified independently from NFT data
- Required Fields: Implements
name,image_url, anddescriptionin both NFT object and Display - Rabbit-Compatible: Ready to be fed to the challenge's
feed_rabbitfunction
.
├── sources/
│ └── display_nft.move # Main NFT module with Display Standard
├── Move.toml # Package configuration
└── README.md # This file
- Sui CLI installed and configured
- Active Sui wallet with testnet SUI tokens
sui move buildsui client publish --gas-budget 100000000Save these IDs from the output:
- Package ID
- Display Object ID (type:
Display<MyNFT>) - Publisher ID
sui client call \
--package <YOUR_PACKAGE_ID> \
--module display_nft \
--function mint_nft \
--args "My Cool NFT" "https://example.com/nft.png" "An amazing NFT for the challenge" \
--gas-budget 10000000sui client call \
--package 0xaa3e79b37f336fa23ce354ddaa82391a7903690e78e46f61a197537be0b318b3 \
--module display \
--function feed_rabbit \
--type-args <YOUR_PACKAGE_ID>::display_nft::MyNFT \
--args <YOUR_DISPLAY_OBJECT_ID> \
--gas-budget 10000000Here's a working example deployment:
- Package ID:
0xf34d2ae5187bff8336a98cd62fd8a19a1cbb59217b319d1a53c5fbf472769192 - Display Object ID:
0xe27c39b7f02ee88f4c1a570ac97b732890652e04b089d7407888595e87ff3a0f - Sample NFT ID:
0x8e1d760cc01a24ea82a5a6a1ef168743c682cf2adb566fb9f83af8474212887a - NFT Metadata:
- Name: "WAT"
- Image: WAT meme
- Description: "Just WAT"
The Display Standard allows developers to create templates for how NFTs are displayed:
let keys = vector[
string::utf8(b"name"),
string::utf8(b"image_url"),
string::utf8(b"description"),
];
let values = vector[
string::utf8(b"{name}"), // Template references NFT field
string::utf8(b"{image_url}"), // Can be modified later
string::utf8(b"{description}"),
];public struct MyNFT has key, store {
id: UID,
name: String, // Original data (immutable)
image_url: String, // Original data (immutable)
description: String, // Original data (immutable)
}- NFT data stays on-chain and unchanged
- Display object can be modified to change how the NFT appears
- Rabbit function modifies the Display, demonstrating flexibility
Mints a new NFT with custom metadata.
Parameters:
name: The NFT nameimage_url: URL to the NFT imagedescription: Description of the NFT
Updates the Display object templates (optional).
Parameters:
display: Mutable reference to Display objectname_template: New template for name fieldimage_template: New template for image_url fielddescription_template: New template for description field
name(nft: &MyNFT): Returns NFT nameimage_url(nft: &MyNFT): Returns NFT image URLdescription(nft: &MyNFT): Returns NFT description
- NFT has
name,image_url, anddescriptionfields - Display object created with matching fields
- Display object can be transferred and used
- Compatible with
feed_rabbitfunction signature - Successfully fed to rabbit 🐰
The feed_rabbit function is provided by the challenge organizers:
public fun feed_rabbit<T: key>(display: &mut Display<T>)This function takes your Display object and modifies it, demonstrating how display metadata can change without altering the underlying NFT data.
- Save your Display Object ID - You'll need it for the feed_rabbit function
- Type arguments are required - Don't forget
--type-argswhen calling feed_rabbit - Gas budget - Make sure you have enough SUI for transactions
- Verify on explorer - Check your transactions on Sui Explorer
Deadline: November 24th, 15:00 CET
Make sure to submit:
- Your package ID
- Display object ID
- Transaction hash of feeding to rabbit
- Any additional documentation
This project is created for the Sui NFT Display Challenge.
Thanks to the Sui Foundation and challenge organizers for providing this learning opportunity!
Happy Building on Sui! 🚀✨**