cowprotocol / token-lists

https://files.cow.fi/tokens/CowSwap.json
Apache License 2.0
3 stars 13 forks source link

Fetch token info inside GH action #343

Open alfetopito opened 6 months ago

alfetopito commented 6 months ago

Summary

When adding a token, the user is required to provide token name, address, symbol, decimals and image. In fact, we only need the address (to know which token to target) and image (not easily available anywhere else).

Additionally, the input info can be different from the contract, which might cause problems down the line.

Proposal

Update the forms to require only: chain, address and image.

Use a REST API to fetch token info based on chain and address during GH action.

One option might be Etherscan although requires a PRO account.

ahhda commented 6 months ago

We can use Ethplorer for this. Here is the documentation on Token info API. Example request: https://api.ethplorer.io/getTokenInfo/0xdef1ca1fb7fbcdc777520aa7f396b4e015f497ab?apiKey=freekey