call => trace, and traces are still dicts here
This commit is contained in:
parent
36c584ed4c
commit
9442078a7a
@ -83,10 +83,14 @@ class UniswapInspector:
|
|||||||
for call in calls:
|
for call in calls:
|
||||||
print("\n", call)
|
print("\n", call)
|
||||||
if (
|
if (
|
||||||
|
call["type"] == "call"
|
||||||
|
and (
|
||||||
call["action"]["to"] == uniswap_router_address.lower()
|
call["action"]["to"] == uniswap_router_address.lower()
|
||||||
or call["action"]["to"] == sushiswap_router_address.lower()
|
or call["action"]["to"] == sushiswap_router_address.lower()
|
||||||
) and utils.check_call_for_signature(
|
)
|
||||||
|
and utils.check_trace_for_signature(
|
||||||
call, self.uniswap_router_trade_signatures
|
call, self.uniswap_router_trade_signatures
|
||||||
|
)
|
||||||
):
|
):
|
||||||
# print("WIP, here is where there is a call that matches what we are looking for")
|
# print("WIP, here is where there is a call that matches what we are looking for")
|
||||||
1 == 1
|
1 == 1
|
||||||
|
@ -2,16 +2,14 @@ from typing import List
|
|||||||
|
|
||||||
from hexbytes.main import HexBytes
|
from hexbytes.main import HexBytes
|
||||||
|
|
||||||
from mev_inspect.schemas import Trace
|
|
||||||
|
|
||||||
|
def check_trace_for_signature(trace: dict, signatures: List[str]):
|
||||||
def check_trace_for_signature(trace: Trace, signatures: List[str]):
|
if trace["action"]["input"] == None:
|
||||||
if trace.action["input"] == None:
|
|
||||||
return False
|
return False
|
||||||
|
|
||||||
## Iterate over all signatures, and if our trace matches any of them set it to True
|
## Iterate over all signatures, and if our trace matches any of them set it to True
|
||||||
for signature in signatures:
|
for signature in signatures:
|
||||||
if HexBytes(trace.action["input"]).startswith(signature):
|
if HexBytes(trace["action"]["input"]).startswith(signature):
|
||||||
## Note that we are turning the input into hex bytes here, which seems to be fine
|
## Note that we are turning the input into hex bytes here, which seems to be fine
|
||||||
## Working with strings was doing weird things
|
## Working with strings was doing weird things
|
||||||
return True
|
return True
|
||||||
|
Loading…
x
Reference in New Issue
Block a user