2

Lets say there's a million utility token created during an ICO. The users access to the utility is based on user owning at least one token. Does each token have it's own unique ID, or do the tokens create just one big pool (balance) from which tokens are transferred to ICO subscribers as quantity, not as individual identifiable tokens? Should the token in this case have decimals set to zero?

2

If you go out there and find a "standard token" smart contract (if there is such a thing), you will most likely find that contract only stores balances. When someone purchases tokens, the only thing that gets recorded is the address that made the purchase and the number of tokens purchased. There is no piece of data stored in any of the ERC20 compliant smart contracts I've seen that attaches a 'serial number' to each individual token (which is what I think you're asking). (I haven't, obviously, seen every token contract).

Having said that, there's nothing conceptually stopping you from writing your ERC20 compliant token from doing that--other than--and this is a big "other than"--the size of your data will explode. For example, if you had 5,000 purchasers and you were only storing balances for the 1,000,000 tokens you sold, you would have 5,000 entries (a balance for each purchaser).

If on the other hand, you had to track all 1,000,000 tokens separately by its own serial number, you would have 1,000,000 entries in your data structure each with its own owner address or a pointer to an owner address or some other more complicated scheme. In other words--way more complicated, and way, way, way more expensive. Storing data on Ethereum is prohibitive.

Update: Check our ERC721 tokens. Does exactly what you’re asking.

|improve this answer|||||
0

By default, as per defined by the ERC20 specification, tokens don't have an unique ID. They are just a number in a balance.

If you wanted to deal with identifiable tokens you would have to modify the data structure and do something that does not necessarily comply with ERC20.

You could comply with ERC20 by setting decimals to 0, but without doing any further changes you wouldn't be able to identify each token by an ID.

|improve this answer|||||

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.