CoinAlpha / gateway-api

Apache License 2.0
47 stars 25 forks source link

Simplify token lists for testnet vs mainnet #43

Closed fengtality closed 3 years ago

fengtality commented 3 years ago

Why

In the refactored Gateway PR, we use a function called getERC20TokenListin eth.route.js to fetch the right token list given mainnet, kovan, network etc.

This is unnecessary because token lists have different chain IDs for kovan and other testnets. For instance, the default Uniswap list (https://gateway.ipfs.io/ipns/tokens.uniswap.org) has different addresses for mainnet (chainID=1), ropsten (chainID=3), kovan (chainID=42)

What

  1. Change ETHEREUM_CHAIN in .env to ETHEREUM_CHAIN_ID so that the user inputs the ID directly
  2. Change functions that depend on the chain name kovan
  3. Modify getERC20TokenAddresses function in eth.js so that it uses the chainID to get the correct address for a given symbol
  4. Remove the getERC20TokenList function in eth.js since it should no longer be needed
dennisocana commented 3 years ago

Removing from version 0.39 sprint and moving to backlog.