Classifiers: add 1inch Limit Order Protocol
This commit is contained in:
parent
c94b2523c1
commit
3ddfcfdab0
1000
mev_inspect/abis/1inch/1inchLimitOrderProtocol.json
Normal file
1000
mev_inspect/abis/1inch/1inchLimitOrderProtocol.json
Normal file
File diff suppressed because it is too large
Load Diff
@ -11,6 +11,8 @@ from .weth import WETH_CLASSIFIER_SPECS, WETH_ADDRESS
|
|||||||
from .zero_ex import ZEROX_CLASSIFIER_SPECS
|
from .zero_ex import ZEROX_CLASSIFIER_SPECS
|
||||||
from .balancer import BALANCER_CLASSIFIER_SPECS
|
from .balancer import BALANCER_CLASSIFIER_SPECS
|
||||||
from .compound import COMPOUND_CLASSIFIER_SPECS
|
from .compound import COMPOUND_CLASSIFIER_SPECS
|
||||||
|
from .one_inch import ONE_INCH_CLASSIFIER_SPECS
|
||||||
|
|
||||||
|
|
||||||
ALL_CLASSIFIER_SPECS = (
|
ALL_CLASSIFIER_SPECS = (
|
||||||
ERC20_CLASSIFIER_SPECS
|
ERC20_CLASSIFIER_SPECS
|
||||||
|
37
mev_inspect/classifiers/specs/one_inch.py
Normal file
37
mev_inspect/classifiers/specs/one_inch.py
Normal file
@ -0,0 +1,37 @@
|
|||||||
|
from mev_inspect.schemas.classified_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)"
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
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,
|
||||||
|
classifications={
|
||||||
|
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"
|
balancer_v1 = "balancer_v1"
|
||||||
compound_v2 = "compound_v2"
|
compound_v2 = "compound_v2"
|
||||||
cream = "cream"
|
cream = "cream"
|
||||||
|
one_inch = "1inch"
|
||||||
|
|
||||||
|
|
||||||
class ClassifiedTrace(Trace):
|
class ClassifiedTrace(Trace):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user