1

I am studying to write smart contract and see that there are some token standards such as ERC20. My question is: what is the purpose of those standards ? Why do we need to add those interface to our code rather than just implement "some" functions that we need.

Thanks

3

It's a standard.

ALL those ERC20 based tokens have (at least) the same attribute names, the same method names.

So I do automaticly know that I need to call the method "transfer" when I want to transfer my tokens. No one would name it "transfer_tokens_hello_world". Irrelevant which of the thousands of token I want to transfer: It's always the same method.

The advantage for exchanges and/or user interfaces is that it's really easy to implement. If an exchange list token A and B, then token C has the same structure and it's easy to implement it, too.

  • Thanks. In case exchange tokens, I have 2 points that I don't understand: 1. Who decide transfer rate between 2 different tokens. 2. Why does ERC20 support exchange token ? thanks. – hqt Mar 24 '18 at 20:13

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.