Function contract::mint::get_new_token_id
source ·
[−]fn get_new_token_id(
tokenid_by_hash_uref: URef,
metadata_hash: String,
tokens_cnt_uref: URef
) -> u64
Expand description
Gets a new token_id from the contract state and returns is as a u64
It will get tokenid_by_hash_uref
, metadata_hash
, tokens_cnt_uref
, and firstly look into the tokenid_by_hash_uref dict, if it could find the metadatahash in it, it would return the token_id of that nft
Otherwise, it would get the tokens_cnt, and use tokens_cnt+1 as new token_id , and returns it. Also modifies the tokens_cnt to tokens_cnt+1