Uniswap / interface

🦄 Open source interfaces for the Uniswap protocol
https://app.uniswap.org
GNU General Public License v3.0
4.92k stars 4.99k forks source link

Add support for ERC20 tokens that do not have public constants [name, decimals, symbol] #159

Closed pascalvanhecke closed 5 years ago

pascalvanhecke commented 5 years ago

The ERC20 standard does not prescribe public constants name/decimals/symbol:

https://github.com/ethereum/eips/issues/20

That's a convention that become popular later, I believe @simondlr popularized it with this template contract: https://github.com/ConsenSys/Token-Factory/blob/master/contracts/HumanStandardToken.sol - see https://media.consensys.net/how-to-create-your-own-tokens-standard-token-factory-for-humans-deployed-e92649a1bb5e

Some older tokens don't support it - it seems possible to add an exchange for those tokens via the createExchange method on the factory contract, but the interface does not seem to support it, as it assumes it can read [name, decimals, symbol] from the contract.

Popular example: the DGD token:

pascalvanhecke commented 5 years ago

I see the default token list now also contains name/decimals/symbol https://github.com/Uniswap/uniswap-frontend/blob/beta/src/contexts/Tokens.js

Does this mean there is no objection anymore against adding legacy tokens such as mentioned DGD @NoahZinsmeister ?