Using random UUID for cis2multi tokenID

Hi, I am trying to use a random Id for a CIS2 mult contract.

pub struct MintParams {
    /// Owner of the newly minted tokens.
    pub owner:        Address,
    /// The metadata_url of the token.
    pub metadata_url: MetadataUrl,
    /// The token_id to mint/create additional tokens.
    pub token_id:     ContractTokenId,
    pub amount: ContractTokenAmount
}

I am currently using pub type ContractTokenId = TokenIdU32; but numbers above 100 doesn’t work with the contract.

Is there a way to achieve this random id?

You can use TokenIdVec to have up to 256 bytes of space for our ID.

1 Like