Get Name from TokenId

given a tokenId, how do I get the name?

Using the mapping:

mapping(uint256 => string) public tokenToName;

Example:

To find the name for tokenId 12345

One can call tokenToName(12345) and if the given tokenId has been registered, the contract will return the registered name as a string.

Last updated