From cf0926fef09386f90bce73ec12eaedbcf8fe43ed Mon Sep 17 00:00:00 2001 From: Gui Heise Date: Thu, 28 Oct 2021 00:15:57 +0100 Subject: [PATCH] Add ETH_ADDRESS and check against it --- mev_inspect/aave_liquidations.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/mev_inspect/aave_liquidations.py b/mev_inspect/aave_liquidations.py index ce2ccee..f2e1562 100644 --- a/mev_inspect/aave_liquidations.py +++ b/mev_inspect/aave_liquidations.py @@ -33,6 +33,8 @@ AAVE_CONTRACT_ADDRESSES: List[str] = [ "0xbcca60bb61934080951369a648fb03df4f96263c", ] +ETH_TOKEN_ADDRESS = "0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee" + def get_aave_liquidations( traces: List[ClassifiedTrace], @@ -99,6 +101,7 @@ def _get_payback_token_and_amount( if ( child_transfer.to_address == liquidator and child.from_address in AAVE_CONTRACT_ADDRESSES + and child_transfer.token_address != ETH_TOKEN_ADDRESS ): return child_transfer.token_address, child_transfer.amount @@ -106,8 +109,7 @@ def _get_payback_token_and_amount( elif ( child_transfer.to_address == liquidator and child.from_address in AAVE_CONTRACT_ADDRESSES - and child_transfer.token_address - == "0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee" + and child_transfer.token_address == ETH_TOKEN_ADDRESS ): return child_transfer.token_address, child.value