Merge b7d688a07a8a0b885e4edd512c4a48cf306f6606 into 8428dd99081bd14e7a5a4b9b8968d15e529eccee
This commit is contained in:
commit
df71addc53
1
mev_inspect/abis/1inch/1inchLimitOrderProtocol.json
Normal file
1
mev_inspect/abis/1inch/1inchLimitOrderProtocol.json
Normal file
File diff suppressed because one or more lines are too long
@ -11,6 +11,8 @@ from .weth import WETH_CLASSIFIER_SPECS, WETH_ADDRESS
|
||||
from .zero_ex import ZEROX_CLASSIFIER_SPECS
|
||||
from .balancer import BALANCER_CLASSIFIER_SPECS
|
||||
from .compound import COMPOUND_CLASSIFIER_SPECS
|
||||
from .one_inch import ONE_INCH_CLASSIFIER_SPECS
|
||||
|
||||
|
||||
ALL_CLASSIFIER_SPECS = (
|
||||
ERC20_CLASSIFIER_SPECS
|
||||
@ -21,6 +23,7 @@ ALL_CLASSIFIER_SPECS = (
|
||||
+ ZEROX_CLASSIFIER_SPECS
|
||||
+ BALANCER_CLASSIFIER_SPECS
|
||||
+ COMPOUND_CLASSIFIER_SPECS
|
||||
+ ONE_INCH_CLASSIFIER_SPECS
|
||||
)
|
||||
|
||||
_SPECS_BY_ABI_NAME_AND_PROTOCOL: Dict[
|
||||
|
31
mev_inspect/classifiers/specs/one_inch.py
Normal file
31
mev_inspect/classifiers/specs/one_inch.py
Normal file
@ -0,0 +1,31 @@
|
||||
from mev_inspect.schemas.traces import (
|
||||
DecodedCallTrace,
|
||||
Protocol,
|
||||
)
|
||||
from mev_inspect.schemas.classifiers import (
|
||||
ClassifierSpec,
|
||||
SwapClassifier,
|
||||
)
|
||||
|
||||
|
||||
class OneInchFillOrderProtocolSwapClassifier(SwapClassifier):
|
||||
@staticmethod
|
||||
def get_swap_recipient(trace: DecodedCallTrace) -> str:
|
||||
return trace.from_address
|
||||
|
||||
|
||||
FILL_ORDER_SIGNATURE = (
|
||||
"fillOrder((uint256,address,address,bytes,bytes,bytes,bytes,bytes,bytes,bytes),"
|
||||
"bytes,uint256,uint256,uint256)"
|
||||
)
|
||||
|
||||
|
||||
ONE_INCH_LIMIT_ORDER_PROTOCOL_SPEC = ClassifierSpec(
|
||||
abi_name="1inchLimitOrderProtocol",
|
||||
protocol=Protocol.one_inch,
|
||||
classifiers={
|
||||
FILL_ORDER_SIGNATURE: OneInchFillOrderProtocolSwapClassifier,
|
||||
},
|
||||
)
|
||||
|
||||
ONE_INCH_CLASSIFIER_SPECS = [ONE_INCH_LIMIT_ORDER_PROTOCOL_SPEC]
|
@ -44,6 +44,7 @@ class Protocol(Enum):
|
||||
balancer_v1 = "balancer_v1"
|
||||
compound_v2 = "compound_v2"
|
||||
cream = "cream"
|
||||
one_inch = "1inch"
|
||||
|
||||
|
||||
class ClassifiedTrace(Trace):
|
||||
|
Loading…
x
Reference in New Issue
Block a user