From 60aa73dbc452711262346c44028e823c9754f425 Mon Sep 17 00:00:00 2001 From: Alexander Date: Fri, 19 Jul 2024 17:17:25 -0400 Subject: [PATCH] added more accurate log search for minted lp tokens --- main.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/main.py b/main.py index 9f540dc..c22664f 100644 --- a/main.py +++ b/main.py @@ -157,7 +157,9 @@ def main(): for log in tx_receipt['logs']: if log['topics'][0].hex() != '0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef': continue - if web3.to_checksum_address('0x' + log['topics'][2].hex()[-40:]) != wallet_address: + log_from = web3.to_checksum_address('0x' + log['topics'][1].hex()[-40:]) + log_to = web3.to_checksum_address('0x' + log['topics'][2].hex()[-40:]) + if log_from != "0x0000000000000000000000000000000000000000" and log_to != wallet_address: continue # extract lp tokens just created lp_balance = int(log['data'].hex(), 16)