If there is only one distinct attribute in a token, then the number of unique values of this attribute determines how many token instances are there.
Note: Each Token is identified by a attribute-value pair where the attribute has to be a distinct attribute. See more in Token Identifier.
If there is no distinct attribute defined in a Token, TokenScript Engine takes a default value ownerAddress=${ownerAddress} as its Token Identifier.
A Car Ownership Token
In this example, which is part of a TokenScript that defines a Car Ownership Toke. Vehicle Identification Number ("vin") is an attribute that identifies a car:
Since VIN is a distinct token, each distinct values of this attribute is used to create a distinct token. So, let's say that the function getCars() in this example returns an array of two values:
Then, the TokenScript engine should interpret that there are 2Car Tokens, identified the following two Token Identifiers:
Both are instances of the Car Token. If the TokenScript engine is running in a user's wallet, it would render two distinct cars.
CryptoKitty
The following code defines a distinct attribute called tokenId.
If the smart contract returns 2 values for it:
0x59a7a9fd49fabd07c0f8566ae4be96fcf20be5e1
0xd915c8AD3241F459a45AdcBBF8af42caA561A154
then the TokenScript engine identifies 2 tokens, each identified with:
In fact, this attribute can be found in all ERC721 tokens, as ERC721 requires an attribute tokenID to identify a token. However, such a design may not suit other tokens who doesn't benefit from being shoe-horned into ERC721.