1

If the ERC-20 token standard was created today, with all the benefit of hindsight, what would most likely to be changed in the standard? And does such a new standard already exist?

What are the biggest downsides of the standard?

Inspired by https://ethereum.stackexchange.com/a/110159/31933

1 Answer 1

2

There are a couple of standards looking to replace ERC-20, though these are a few years old already and haven't gotten much traction. A few examples are ERC-223 and ERC-777, both created in 2017. Both standards are looking to solve the issues of ERC-20 in different ways.

One of the biggest problems of ERC-20 is contracts not being aware of incoming token transactions. This means that in order to send tokens to a contract you need to approve the contract spending your tokens, and then call the contract, which then calls transferFrom from your address to the contract. This means doing two separate transactions, which is of course more expensive and bad from a UX perspective. It also means that if you (accidentally) send tokens to a contract, the contract has no way to reject the tokens and they will get stuck.

The allowance system in ERC-20 is actively being abused by having people sign a transaction to approve a malicious address from spending tokens. Since it's "just" allowance, users may not realise that this allows someone to spend their tokens.

ERC-223 and ERC-777 solve this by calling a function on the receiving contract when sending the tokens. This means that the contract is aware of the incoming token transaction, and can reject it (default) if the contract does not support tokens, similar to how Solidity contracts reject incoming Ether transactions by default.

ERC-20 also has a potential double spending vulnerability due to a race condition in allowance, but this is not really an issue in most real world situations:

  1. Address A authorized address B to spend 100 tokens.
  2. Address B sends 50 tokens from address A to another address.
  3. Address A decides to lower the maximum limit for Address B to 25.
  4. Address B notices this, and tries to send a transaction to spend 50 tokens (1). If this transaction is completed before the transaction of Address A, Address B can spend another 25 tokens (2) for a total of 125.

Most tokens nowaday still use the ERC-20 token standard. A couple months ago, out of the approximately 175,000 token contracts, only 2,000 use the ERC-223 standard, and only 150 use the ERC-777 standard, so that's only about 1.2% combined.

I wrote a more detailed explanation of some of the different token standards and their up and downsides, which you can find here.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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