Move.

Post

Share your knowledge.

Caplec.
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

1
andreweth..
Feb 5 2025, 11:02

The 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
Sui.X.Peera.

Earn Your Share of 1000 Sui

Gain Reputation Points & Get Rewards for Helping the Sui Community Grow.

Reward CampaignJuly