Repository: rotki/rotki

Issue:
Support saddle finance airdrop
## Abstract

Seems saddle.finance is doing an airdrop. @banteg sent us this link: https://github.com/saddle-finance/saddle-retroactive-merkle-tree/blob/master/output/results.json

## Specification

Add it to the supported airdrops along with all the other ones.



Discussion:
@LefterisJP Is there an existing script to parse the json linked in the description before adding it to the data repo? 
Hey @Aragar199, no you would have to write one for it. It should be trivial. As you saw from the PSP airdrop, the only thing we need is the amount in token, and the address. The tricky thing is the address needs to be checksummed. I think from looking at the json, it already is.

But just to be sure you can also pass it from the `to_checksum_address()`function.

```python
from eth_utils.address import to_checksum_address
```

So each entry seems to be like this:

```json
"0x0000000000f4DEf5F3572C846B1483daf4588d8f":{"amount":"1674480910917615539182","proof":["0x0e2f17b299da681130459beb5020571f562f6785c8c07f8a0bf159ab65a59dbb","0x26e76aaa0fc01fb47050f2dd1ed3862d51425993e2aa5bc8c54449a044e9053d","0x80dcbffd741b74f4cb6aa73ea54ed8355477f7f46472be05591f387e0d685392","0x03b2a640acbb84ed255b0edf16128949cdfbbf566255662b1e9ac37d0f0d36b6","0x3a8f1fbb8a981c650ece04091023beb9ba3610f159f5ddacf88a34c911313595","0xb62b1c76a1866c470035fbed6e7be4695b9fe0f4e5342cab423ccac3abfac37b","0xb4df7f4be825bde29e6d4674f7d4fa165704eec2249d339c7a93579fee206e8c","0xa2e179b3b0575ca73f2786cbd7de836a0b29f3d83cc89cd66b99160280e25672","0xa9d7a44d7201b484370abad86f65a249690a5fc61100e24fb77dbaedd818c607","0xf3576d6185a89f02ccff65c6a882539cfb634ec1e8529659128b54fa9ad57a32","0xfade3f6f01ed85645f19f74e931af60eefbb34e583b43f0b5e1496525fc43bbd","0xa6edc56917a706666fe22c37836f137a0db80ac1312c221f5711b91706a1346b","0xdc957bd15b1887a279e37386da2b1eb65e69b89a150576b55e54bf0503c4cd16","0xdf87902300fe8c1ee84079d7ad2c2aca2010ef895bd5853a25f0bfef7c83423a"]}
```

With the key being the address, then the amount being inside the `amount` key. And all else being the merkle proof which for our purposes is useless as we only care about allocation and not the actual act of claiming.
Yes, it should be trivial. Thanks for clarifying.

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
@@ -19,6 +19,7 @@
     A_GRAIN,
     A_LDO,
     A_PSP,
+    A_SDL,
     A_TORN,
     A_UNI,
 )
@@ -101,6 +102,11 @@
         A_PSP,
         'https://paraswap.io/',
     ),
+    'sdl': (
+        'https://raw.githubusercontent.com/rotki/data/main/airdrops/saddle_finance.csv',
+        A_SDL,
+        'https://saddle.exchange/#/',
+    ),
 }
 
 POAP_AIRDROPS = {
@@ -278,7 +284,7 @@ def check_airdrops(
             addr, amount, *_ = row
             # not doing to_checksum_address() here since the file addresses are checksummed
             # and doing to_checksum_address() so many times hits performance
-            if protocol_name in ('cornichon', 'tornado', 'grain', 'lido'):
+            if protocol_name in ('cornichon', 'tornado', 'grain', 'lido', 'sdl'):
                 amount = token_normalized_value_decimals(int(amount), 18)
             if addr in addresses:
                 found_data[addr][protocol_name] = {
diff --git a/rotkehlchen/constants/assets.py b/rotkehlchen/constants/assets.py
--- a/rotkehlchen/constants/assets.py
+++ b/rotkehlchen/constants/assets.py
@@ -1,5 +1,5 @@
 # This python file was generated automatically by
-# tools/scripts/generate_constant_assets.py at 23/11/2021 09:31:11.
+# tools/scripts/generate_constant_assets.py at 01/12/2021 21:00:50.
 # Do not edit manually!
 
 from typing import List
@@ -2233,3 +2233,15 @@
     protocol=None,
 )
 CONSTANT_ASSETS.append(A_PSP)
+A_SDL = EthereumToken.initialize(
+    address=string_to_ethereum_address('0xf1Dc500FdE233A4055e25e5BbF516372BC4F6871'),
+    decimals=18,
+    name="Saddle DAO",
+    symbol='SDL',
+    started=Timestamp(1637043563),
+    swapped_for=None,
+    coingecko='saddle-finance',
+    cryptocompare=None,
+    protocol=None,
+)
+CONSTANT_ASSETS.append(A_SDL)


Test patch: