Merge b7d688a07a8a0b885e4edd512c4a48cf306f6606 into 8428dd99081bd14e7a5a4b9b8968d15e529eccee

This commit is contained in:
Leo Arias 2021-11-22 21:25:58 -06:00 committed by GitHub
commit df71addc53
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 36 additions and 0 deletions

File diff suppressed because one or more lines are too long

View File

@ -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
@ -21,6 +23,7 @@ ALL_CLASSIFIER_SPECS = (
+ ZEROX_CLASSIFIER_SPECS + ZEROX_CLASSIFIER_SPECS
+ BALANCER_CLASSIFIER_SPECS + BALANCER_CLASSIFIER_SPECS
+ COMPOUND_CLASSIFIER_SPECS + COMPOUND_CLASSIFIER_SPECS
+ ONE_INCH_CLASSIFIER_SPECS
) )
_SPECS_BY_ABI_NAME_AND_PROTOCOL: Dict[ _SPECS_BY_ABI_NAME_AND_PROTOCOL: Dict[

View 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]

View File

@ -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):