Repository: rotki/rotki

Issue:
Add shapeshift airdrop
https://fox.shapeshift.com/airdrop


Discussion:

Resolving patch:
diff --git a/rotkehlchen/chain/ethereum/airdrops.py b/rotkehlchen/chain/ethereum/airdrops.py
--- a/rotkehlchen/chain/ethereum/airdrops.py
+++ b/rotkehlchen/chain/ethereum/airdrops.py
@@ -17,6 +17,7 @@
     A_LDO,
     A_TORN,
     A_UNI,
+    A_FOX,
 )
 from rotkehlchen.errors import RemoteError
 from rotkehlchen.typing import ChecksumEthAddress
@@ -76,6 +77,11 @@
         A_CVX,
         'https://www.convexfinance.com/',
     ),
+    'fox': (
+        'https://raw.githubusercontent.com/rotki/data/main/airdrops/shapeshift.csv',
+        A_FOX,
+        'https://shapeshift.com/shapeshift-decentralize-airdrop',
+    ),
 }
 
 POAP_AIRDROPS = {
diff --git a/rotkehlchen/constants/assets.py b/rotkehlchen/constants/assets.py
--- a/rotkehlchen/constants/assets.py
+++ b/rotkehlchen/constants/assets.py
@@ -1,13 +1,13 @@
 # This python file was generated automatically by
-# tools/scripts/generate_constant_assets.py at 08/07/2021 21:43:30.
+# tools/scripts/generate_constant_assets.py at 31/07/2021 09:17:15.
 # Do not edit manually!
 
 from typing import List
 
 from rotkehlchen.assets.asset import Asset, EthereumToken
 from rotkehlchen.assets.typing import AssetType
-from rotkehlchen.chain.ethereum.typing import string_to_ethereum_address
 from rotkehlchen.typing import Timestamp
+from rotkehlchen.chain.ethereum.typing import string_to_ethereum_address
 
 CONSTANT_ASSETS: List[Asset] = []
 
@@ -131,6 +131,7 @@
     cryptocompare=None,
 )
 CONSTANT_ASSETS.append(A_AVAX)
+
 A_BAL = EthereumToken.initialize(
     address=string_to_ethereum_address('0xba100000625a3754423978a60c9317c58a424e3D'),
     decimals=18,
@@ -369,7 +370,7 @@
     swapped_for=None,
     coingecko='compound-governance-token',
     cryptocompare=None,
-    protocol=None,
+    protocol='compound',
 )
 CONSTANT_ASSETS.append(A_COMP)
 A_LRC = EthereumToken.initialize(
@@ -663,7 +664,7 @@
     swapped_for=None,
     coingecko='aave-link',
     cryptocompare='LINK',
-    protocol=None,
+    protocol='aave',
 )
 CONSTANT_ASSETS.append(A_ALINK_V1)
 A_AETH_V1 = EthereumToken.initialize(
@@ -675,7 +676,7 @@
     swapped_for=None,
     coingecko='aave-eth-v1',
     cryptocompare='ETH',
-    protocol=None,
+    protocol='aave',
 )
 CONSTANT_ASSETS.append(A_AETH_V1)
 A_AENJ_V1 = EthereumToken.initialize(
@@ -687,7 +688,7 @@
     swapped_for=None,
     coingecko='aave-enj',
     cryptocompare='ENJ',
-    protocol=None,
+    protocol='aave',
 )
 CONSTANT_ASSETS.append(A_AENJ_V1)
 A_ADAI_V1 = EthereumToken.initialize(
@@ -699,7 +700,7 @@
     swapped_for=None,
     coingecko='aave-dai',
     cryptocompare='DAI',
-    protocol=None,
+    protocol='aave',
 )
 CONSTANT_ASSETS.append(A_ADAI_V1)
 A_AUSDC_V1 = EthereumToken.initialize(
@@ -711,7 +712,7 @@
     swapped_for=None,
     coingecko='aave-usdc',
     cryptocompare='USDC',
-    protocol=None,
+    protocol='aave',
 )
 CONSTANT_ASSETS.append(A_AUSDC_V1)
 A_ASUSD_V1 = EthereumToken.initialize(
@@ -723,7 +724,7 @@
     swapped_for=None,
     coingecko='aave-susd',
     cryptocompare='sUSD',
-    protocol=None,
+    protocol='aave',
 )
 CONSTANT_ASSETS.append(A_ASUSD_V1)
 A_ATUSD_V1 = EthereumToken.initialize(
@@ -735,7 +736,7 @@
     swapped_for=None,
     coingecko='aave-tusd',
     cryptocompare='TUSD',
-    protocol=None,
+    protocol='aave',
 )
 CONSTANT_ASSETS.append(A_ATUSD_V1)
 A_AUSDT_V1 = EthereumToken.initialize(
@@ -747,7 +748,7 @@
     swapped_for=None,
     coingecko='aave-usdt',
     cryptocompare='USDT',
-    protocol=None,
+    protocol='aave',
 )
 CONSTANT_ASSETS.append(A_AUSDT_V1)
 A_ABUSD_V1 = EthereumToken.initialize(
@@ -759,7 +760,7 @@
     swapped_for=None,
     coingecko='aave-busd',
     cryptocompare='BUSD',
-    protocol=None,
+    protocol='aave',
 )
 CONSTANT_ASSETS.append(A_ABUSD_V1)
 A_ABAT_V1 = EthereumToken.initialize(
@@ -771,7 +772,7 @@
     swapped_for=None,
     coingecko='aave-bat',
     cryptocompare='BAT',
-    protocol=None,
+    protocol='aave',
 )
 CONSTANT_ASSETS.append(A_ABAT_V1)
 A_AKNC_V1 = EthereumToken.initialize(
@@ -783,7 +784,7 @@
     swapped_for=None,
     coingecko='aave-knc',
     cryptocompare='KNC',
-    protocol=None,
+    protocol='aave',
 )
 CONSTANT_ASSETS.append(A_AKNC_V1)
 A_ALEND_V1 = EthereumToken.initialize(
@@ -795,7 +796,7 @@
     swapped_for=None,
     coingecko='aave-lend',
     cryptocompare='LEND',
-    protocol=None,
+    protocol='aave',
 )
 CONSTANT_ASSETS.append(A_ALEND_V1)
 A_AMANA_V1 = EthereumToken.initialize(
@@ -807,7 +808,7 @@
     swapped_for=None,
     coingecko='aave-mana',
     cryptocompare='MANA',
-    protocol=None,
+    protocol='aave',
 )
 CONSTANT_ASSETS.append(A_AMANA_V1)
 A_AMKR_V1 = EthereumToken.initialize(
@@ -819,7 +820,7 @@
     swapped_for=None,
     coingecko='aave-mkr',
     cryptocompare='MKR',
-    protocol=None,
+    protocol='aave',
 )
 CONSTANT_ASSETS.append(A_AMKR_V1)
 A_AREP_V1 = EthereumToken.initialize(
@@ -831,7 +832,7 @@
     swapped_for=None,
     coingecko='aave-rep',
     cryptocompare='REP',
-    protocol=None,
+    protocol='aave',
 )
 CONSTANT_ASSETS.append(A_AREP_V1)
 A_AREN_V1 = EthereumToken.initialize(
@@ -843,7 +844,7 @@
     swapped_for=None,
     coingecko='aave-ren',
     cryptocompare='REN',
-    protocol=None,
+    protocol='aave',
 )
 CONSTANT_ASSETS.append(A_AREN_V1)
 A_ASNX_V1 = EthereumToken.initialize(
@@ -855,7 +856,7 @@
     swapped_for=None,
     coingecko='aave-snx',
     cryptocompare='SNX',
-    protocol=None,
+    protocol='aave',
 )
 CONSTANT_ASSETS.append(A_ASNX_V1)
 A_AWBTC_V1 = EthereumToken.initialize(
@@ -867,7 +868,7 @@
     swapped_for=None,
     coingecko='aave-wbtc',
     cryptocompare='WBTC',
-    protocol=None,
+    protocol='aave',
 )
 CONSTANT_ASSETS.append(A_AWBTC_V1)
 A_AYFI_V1 = EthereumToken.initialize(
@@ -879,7 +880,7 @@
     swapped_for=None,
     coingecko='ayfi',
     cryptocompare='YFI',
-    protocol=None,
+    protocol='aave',
 )
 CONSTANT_ASSETS.append(A_AYFI_V1)
 A_AZRX_V1 = EthereumToken.initialize(
@@ -891,7 +892,7 @@
     swapped_for=None,
     coingecko='aave-zrx',
     cryptocompare='ZRX',
-    protocol=None,
+    protocol='aave',
 )
 CONSTANT_ASSETS.append(A_AZRX_V1)
 A_AAAVE_V1 = EthereumToken.initialize(
@@ -903,7 +904,7 @@
     swapped_for=None,
     coingecko='aave',
     cryptocompare='AAVE',
-    protocol=None,
+    protocol='aave',
 )
 CONSTANT_ASSETS.append(A_AAAVE_V1)
 A_AUNI_V1 = EthereumToken.initialize(
@@ -915,7 +916,7 @@
     swapped_for=None,
     coingecko='uniswap',
     cryptocompare='UNI',
-    protocol=None,
+    protocol='aave',
 )
 CONSTANT_ASSETS.append(A_AUNI_V1)
 
@@ -929,7 +930,7 @@
     swapped_for=None,
     coingecko='cdai',
     cryptocompare=None,
-    protocol=None,
+    protocol='compound',
 )
 CONSTANT_ASSETS.append(A_CDAI)
 A_CUSDC = EthereumToken.initialize(
@@ -941,7 +942,7 @@
     swapped_for=None,
     coingecko='compound-usd-coin',
     cryptocompare=None,
-    protocol=None,
+    protocol='compound',
 )
 CONSTANT_ASSETS.append(A_CUSDC)
 A_CUSDT = EthereumToken.initialize(
@@ -953,7 +954,7 @@
     swapped_for=None,
     coingecko='compound-usdt',
     cryptocompare=None,
-    protocol=None,
+    protocol='compound',
 )
 CONSTANT_ASSETS.append(A_CUSDT)
 A_CBAT = EthereumToken.initialize(
@@ -965,7 +966,7 @@
     swapped_for=None,
     coingecko='compound-basic-attention-token',
     cryptocompare=None,
-    protocol=None,
+    protocol='compound',
 )
 CONSTANT_ASSETS.append(A_CBAT)
 A_CETH = EthereumToken.initialize(
@@ -977,7 +978,7 @@
     swapped_for=None,
     coingecko='compound-ether',
     cryptocompare=None,
-    protocol=None,
+    protocol='compound',
 )
 CONSTANT_ASSETS.append(A_CETH)
 A_CREP = EthereumToken.initialize(
@@ -989,7 +990,7 @@
     swapped_for=None,
     coingecko='compound-augur',
     cryptocompare=None,
-    protocol=None,
+    protocol='compound',
 )
 CONSTANT_ASSETS.append(A_CREP)
 A_CWBTC = EthereumToken.initialize(
@@ -1001,7 +1002,7 @@
     swapped_for=None,
     coingecko='compound-wrapped-btc',
     cryptocompare=None,
-    protocol=None,
+    protocol='compound',
 )
 CONSTANT_ASSETS.append(A_CWBTC)
 A_CZRX = EthereumToken.initialize(
@@ -1013,7 +1014,7 @@
     swapped_for=None,
     coingecko='compound-0x',
     cryptocompare=None,
-    protocol=None,
+    protocol='compound',
 )
 CONSTANT_ASSETS.append(A_CZRX)
 
@@ -1042,7 +1043,7 @@
     swapped_for=None,
     coingecko='lp-bcurve',
     cryptocompare=None,
-    protocol=None,
+    protocol='yearn-v1',
 )
 CONSTANT_ASSETS.append(A_YV1_DAIUSDCTBUSD)
 A_CRVP_DAIUSDCTBUSD = EthereumToken.initialize(
@@ -1066,7 +1067,7 @@
     swapped_for=None,
     coingecko='yvault-lp-ycurve',
     cryptocompare=None,
-    protocol=None,
+    protocol='yearn-v1',
 )
 CONSTANT_ASSETS.append(A_YV1_DAIUSDCTTUSD)
 A_CRVP_DAIUSDCTTUSD = EthereumToken.initialize(
@@ -1102,7 +1103,7 @@
     swapped_for=None,
     coingecko='lp-renbtc-curve',
     cryptocompare=None,
-    protocol=None,
+    protocol='yearn-v1',
 )
 CONSTANT_ASSETS.append(A_YV1_RENWSBTC)
 A_CRV_RENWBTC = EthereumToken.initialize(
@@ -1162,7 +1163,7 @@
     swapped_for=None,
     coingecko='curve-dao-token',
     cryptocompare=None,
-    protocol=None,
+    protocol='yearn-v1',
 )
 CONSTANT_ASSETS.append(A_YV1_3CRV)
 A_CRV_3CRVSUSD = EthereumToken.initialize(
@@ -1186,7 +1187,7 @@
     swapped_for=None,
     coingecko='aave-link',
     cryptocompare=None,
-    protocol=None,
+    protocol='yearn-v1',
 )
 CONSTANT_ASSETS.append(A_YV1_ALINK)
 A_YV1_DAI = EthereumToken.initialize(
@@ -1198,7 +1199,7 @@
     swapped_for=None,
     coingecko='dai',
     cryptocompare=None,
-    protocol=None,
+    protocol='yearn-v1',
 )
 CONSTANT_ASSETS.append(A_YV1_DAI)
 A_YV1_WETH = EthereumToken.initialize(
@@ -1210,7 +1211,7 @@
     swapped_for=None,
     coingecko='weth',
     cryptocompare=None,
-    protocol=None,
+    protocol='yearn-v1',
 )
 CONSTANT_ASSETS.append(A_YV1_WETH)
 A_YV1_YFI = EthereumToken.initialize(
@@ -1222,7 +1223,7 @@
     swapped_for=None,
     coingecko='yearn-finance',
     cryptocompare=None,
-    protocol=None,
+    protocol='yearn-v1',
 )
 CONSTANT_ASSETS.append(A_YV1_YFI)
 A_YV1_USDT = EthereumToken.initialize(
@@ -1234,7 +1235,7 @@
     swapped_for=None,
     coingecko='tether',
     cryptocompare=None,
-    protocol=None,
+    protocol='yearn-v1',
 )
 CONSTANT_ASSETS.append(A_YV1_USDT)
 A_YV1_USDC = EthereumToken.initialize(
@@ -1246,7 +1247,7 @@
     swapped_for=None,
     coingecko='usd-coin',
     cryptocompare=None,
-    protocol=None,
+    protocol='yearn-v1',
 )
 CONSTANT_ASSETS.append(A_YV1_USDC)
 A_YV1_TUSD = EthereumToken.initialize(
@@ -1258,7 +1259,7 @@
     swapped_for=None,
     coingecko='true-usd',
     cryptocompare=None,
-    protocol=None,
+    protocol='yearn-v1',
 )
 CONSTANT_ASSETS.append(A_YV1_TUSD)
 A_YV1_GUSD = EthereumToken.initialize(
@@ -1270,7 +1271,7 @@
     swapped_for=None,
     coingecko='gemini-dollar',
     cryptocompare=None,
-    protocol=None,
+    protocol='yearn-v1',
 )
 CONSTANT_ASSETS.append(A_YV1_GUSD)
 A_FARM_USDC = EthereumToken.initialize(
@@ -2327,3 +2328,15 @@
     protocol=None,
 )
 CONSTANT_ASSETS.append(A_RSPT)
+A_FOX = EthereumToken.initialize(
+    address=string_to_ethereum_address('0xc770EEfAd204B5180dF6a14Ee197D99d808ee52d'),
+    decimals=18,
+    name="FOX Token",
+    symbol='FOX',
+    started=Timestamp(1553639047),
+    swapped_for=None,
+    coingecko='fox-token',
+    cryptocompare=None,
+    protocol=None,
+)
+CONSTANT_ASSETS.append(A_FOX)


Test patch:
diff --git a/rotkehlchen/tests/unit/test_ethereum_airdrops.py b/rotkehlchen/tests/unit/test_ethereum_airdrops.py
--- a/rotkehlchen/tests/unit/test_ethereum_airdrops.py
+++ b/rotkehlchen/tests/unit/test_ethereum_airdrops.py
@@ -16,7 +16,7 @@ def test_check_airdrops(ethereum_accounts, data_dir):
 
     # Test data is returned for the address correctly
     assert len(data) == 2
-    assert len(data[TEST_ADDR1]) == 2
+    assert len(data[TEST_ADDR1]) == 3
     assert data[TEST_ADDR1]['uniswap'] == {
         'amount': '400',
         'asset': A_UNI,