0
0
Blockchain / Solidityprogramming~15 mins

Token metadata and URI in Blockchain / Solidity - Mini Project: Build & Apply

Choose your learning style9 modes available
Token metadata and URI
📖 Scenario: You are creating a simple blockchain token system. Each token has metadata like name, description, and an image URI. This metadata helps wallets and apps show useful info about the token.
🎯 Goal: Build a Python dictionary to store token metadata and a URI string. Then create a new dictionary that combines them, and finally print the full token info.
📋 What You'll Learn
Create a dictionary called token_metadata with keys 'name', 'description', and 'image' and exact values.
Create a string variable called token_uri with the exact value.
Create a new dictionary called full_token_info that includes all token_metadata plus the token_uri under key 'uri'.
Print the full_token_info dictionary.
💡 Why This Matters
🌍 Real World
Token metadata and URI are used in blockchain tokens like NFTs to provide details that wallets and marketplaces show to users.
💼 Career
Understanding how to manage token metadata is important for blockchain developers working on smart contracts, NFT platforms, and crypto wallets.
Progress0 / 4 steps
1
Create token metadata dictionary
Create a dictionary called token_metadata with these exact entries: 'name': 'CryptoKitty', 'description': 'A cute blockchain cat', and 'image': 'https://example.com/cat.png'.
Blockchain / Solidity
Need a hint?

Use curly braces {} to create a dictionary. Put keys and values inside with colons.

2
Create token URI string
Create a string variable called token_uri and set it to 'https://example.com/token/123'.
Blockchain / Solidity
Need a hint?

Use an equals sign = to assign the string to the variable token_uri.

3
Combine metadata and URI into full token info
Create a new dictionary called full_token_info that contains all key-value pairs from token_metadata plus a new key 'uri' with the value from token_uri.
Blockchain / Solidity
Need a hint?

Use dictionary unpacking {**token_metadata, 'uri': token_uri} to combine dictionaries.

4
Print the full token info
Write a print statement to display the full_token_info dictionary.
Blockchain / Solidity
Need a hint?

Use print(full_token_info) to show the dictionary on screen.