Post
Share your knowledge.
Caplec104
Feb 05, 2025
Expert Q&A
How to set token icon URL in smart contract?
I'm working with the coin::create_currency function in a smart contract and struggling with setting the URL for the token icon. How should I correctly set the URL for the token icon in this context?
- Move CLI
2
1
Share
Comments
Answers
1andreweth.148
Feb 5 2025, 11:02The icon_url
should be a value of Option<Url>
. You can set this using option::some(url::new_unsafe_from_bytes(b""))
. Make sure to include the necessary use statement: use::sui::url::{Self}
to resolve the 'url' name error.
2
Comments
Do you know the answer?
Please log in and share it.
Move is an executable bytecode language used to implement custom transactions and smart contracts.
148Posts231Answers
Bounty Posts