Repository: rotki/rotki

Issue:
Binance: $FTT token wrongly identified as FarmaTrust token
$FTT token is FTX token https://www.coingecko.com/en/coins/ftx-token

But in Rotki, $FTT is identified as FarmaTrust token https://www.farmatrust.com/

There are cases where two tokens have the same name. They should easily be identified properly nonetheless thanks to the different contract addresses.

Thanks guys for correcting this.


Discussion:
What do you mean wrongly identified? We support both:

- Farmatrust: https://github.com/rotki/rotki/blob/1dd5ba9feb8aa81d6b5a5e177a2802aa25e01c3e/rotkehlchen/data/all_assets.json#L5339

- FTX: https://github.com/rotki/rotki/blob/1dd5ba9feb8aa81d6b5a5e177a2802aa25e01c3e/rotkehlchen/data/all_assets.json#L5349
Because it shows a Farmatrust tokens balance when actually I hold FTX
tokens.

Note that it's from Binance. So maybe it's an issue with Binance API.

On Mon, 8 Mar 2021 at 15:30, Lefteris Karapetsas <notifications@github.com>
wrote:

> What do you mean wrongly identified? We support both:
>
>    -
>
>    Farmatrust:
>    https://github.com/rotki/rotki/blob/1dd5ba9feb8aa81d6b5a5e177a2802aa25e01c3e/rotkehlchen/data/all_assets.json#L5339
>    -
>
>    FTX:
>    https://github.com/rotki/rotki/blob/1dd5ba9feb8aa81d6b5a5e177a2802aa25e01c3e/rotkehlchen/data/all_assets.json#L5349
>
> —
> You are receiving this because you authored the thread.
> Reply to this email directly, view it on GitHub
> <https://github.com/rotki/rotki/issues/2517#issuecomment-792757459>, or
> unsubscribe
> <https://github.com/notifications/unsubscribe-auth/AAFUJZO2WQEBOEDE4S4BAHLTCTGQ3ANCNFSM4YZM3TYA>
> .
>

> Note that it's from Binance. So maybe it's an issue with Binance API.

That's the hint I needed. I now understand what your problem is. And this is the common problem of having tokens with the same symbol across different locations. You need mappings. Since addresses are not anywhere in exchanges. We will fix this.
Awesome. Thx!

On Mon, 8 Mar 2021 at 17:39, Lefteris Karapetsas <notifications@github.com>
wrote:

> Note that it's from Binance. So maybe it's an issue with Binance API.
>
> That's the hint I needed. I now understand what your problem is. And this
> is the common problem of having tokens with the same symbol across
> different locations. You need mappings. Since addresses are not anywhere in
> exchanges. We will fix this.
>
> —
> You are receiving this because you authored the thread.
> Reply to this email directly, view it on GitHub
> <https://github.com/rotki/rotki/issues/2517#issuecomment-792838817>, or
> unsubscribe
> <https://github.com/notifications/unsubscribe-auth/AAFUJZOME5XS3VEEOPZDDKTTCTVSDANCNFSM4YZM3TYA>
> .
>


Resolving patch:
diff --git a/rotkehlchen/assets/asset.py b/rotkehlchen/assets/asset.py
--- a/rotkehlchen/assets/asset.py
+++ b/rotkehlchen/assets/asset.py
@@ -162,6 +162,8 @@
     'STX-2': 'STX',
     # ONE is Harmony in Binance
     'ONE-2': 'ONE',
+    # FTT is FTX in Binance
+    'FTT-2': 'FTT',
 }
 
 WORLD_TO_BITFINEX = {
diff --git a/rotkehlchen/constants/resolver.py b/rotkehlchen/constants/resolver.py
--- a/rotkehlchen/constants/resolver.py
+++ b/rotkehlchen/constants/resolver.py
@@ -1,2 +1,2 @@
-ETHEREUM_DIRECTIVE = '_ceth_'
+ETHEREUM_DIRECTIVE = '+ceth+'
 ETHEREUM_DIRECTIVE_LENGTH = len(ETHEREUM_DIRECTIVE)
diff --git a/rotkehlchen/icons.py b/rotkehlchen/icons.py
--- a/rotkehlchen/icons.py
+++ b/rotkehlchen/icons.py
@@ -18,7 +18,7 @@
 
 log = logging.getLogger(__name__)
 
-ALLOWED_ICON_EXTENSIONS = ('.png', '.svg', 'jpeg', 'jpg')
+ALLOWED_ICON_EXTENSIONS = ('.png', '.svg', '.jpeg', '.jpg', '.webp')
 
 
 class IconManager():


Test patch:
diff --git a/rotkehlchen/tests/api/test_icons.py b/rotkehlchen/tests/api/test_icons.py
--- a/rotkehlchen/tests/api/test_icons.py
+++ b/rotkehlchen/tests/api/test_icons.py
@@ -8,6 +8,7 @@
 import pytest
 import requests
 
+from rotkehlchen.icons import ALLOWED_ICON_EXTENSIONS
 from rotkehlchen.tests.utils.api import (
     api_url_for,
     assert_error_response,
@@ -86,6 +87,6 @@ def test_upload_custom_icon_errors(rotkehlchen_api_server, file_upload):
 
     assert_error_response(
         response=response,
-        contained_in_msg='does not end in any of .png,.svg,jpeg,jpg',
+        contained_in_msg=f'does not end in any of {",".join(ALLOWED_ICON_EXTENSIONS)}',
         status_code=HTTPStatus.BAD_REQUEST,
     )