Can we send tokens with data input? I did a bit of research on erc20 but maybe this is quite complicated. Will erc 721 do this?

  • 1
    Can you give an example of data input? Oct 8, 2019 at 6:28
  • Voting down because you didn't show us what you tried. Nov 29, 2019 at 15:26
  • Why it is closed. The question is about erc20 and 721 but the original question is only about erc20. I wouldl ike to answer it regarding 721 Dec 21, 2021 at 15:13

1 Answer 1


ERC20 and ERC721 are, by definition, interfaces.

You cannot attach extra data to the prescribed functions, e.g. transfer() because that will break compatibility with the standard interface.

You didn't say what you want to achieve so it's not possible to be specific about the solution. Two common approaches spring to mind.

ERC20 is for fungible assets - every instance is materially equal to the others. You can use this to represent a medium of exchange (e.g. currency), fractional ownership, general-admission seating, etc. You can separate the "extra data" into a separate function or separate contract that deals with both the extra data and the exchange of tokens.

ERC721 is for non-fungible assets - every instance is unique and materially different from the others, e.g. collectables, cryptokitties, reserved seating, etc. ERC721 deals with common functions, again transfer() and it is silent on the matter of metadata associated with each token.

A housekey would be an example. Such a thing can use a common set of rudimentary functions (e.g. transfer() from Alice to Bob) and custom metadata suitable to the application. The shape of the teeth is unique in each instance. ERC721 allows the introduction of additional functions (e.g. cutKey()) that can write to the arbitrary metadata of each instance.

Hope it helps.


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