aave, erc20, weth moved into separated specs
This commit is contained in:
parent
cdf8265de9
commit
6ceedbf9af
@ -1,4 +1,13 @@
|
|||||||
from .uniswap import UNISWAP_CLASSIFIER_SPECS
|
from .aave import AAVE_CLASSIFIER_SPECS
|
||||||
from .curve import CURVE_CLASSIFIER_SPECS
|
from .curve import CURVE_CLASSIFIER_SPECS
|
||||||
|
from .erc20 import ERC20_CLASSIFIER_SPECS
|
||||||
|
from .uniswap import UNISWAP_CLASSIFIER_SPECS
|
||||||
|
from .weth import WETH_CLASSIFIER_SPECS
|
||||||
|
|
||||||
ALL_CLASSIFIER_SPECS = CURVE_CLASSIFIER_SPECS + UNISWAP_CLASSIFIER_SPECS
|
ALL_CLASSIFIER_SPECS = (
|
||||||
|
ERC20_CLASSIFIER_SPECS
|
||||||
|
+ CURVE_CLASSIFIER_SPECS
|
||||||
|
+ UNISWAP_CLASSIFIER_SPECS
|
||||||
|
+ WETH_CLASSIFIER_SPECS
|
||||||
|
+ AAVE_CLASSIFIER_SPECS
|
||||||
|
)
|
||||||
|
15
mev_inspect/classifiers/specs/aave.py
Normal file
15
mev_inspect/classifiers/specs/aave.py
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
from mev_inspect.schemas.classified_traces import (
|
||||||
|
Classification,
|
||||||
|
ClassifierSpec,
|
||||||
|
Protocol,
|
||||||
|
)
|
||||||
|
|
||||||
|
AAVE_SPEC = ClassifierSpec(
|
||||||
|
abi_name="AaveLendingPool",
|
||||||
|
protocol=Protocol.aave,
|
||||||
|
classifications={
|
||||||
|
"liquidationCall(address,address,address,uint256,bool)": Classification.liquidate,
|
||||||
|
},
|
||||||
|
)
|
||||||
|
|
||||||
|
AAVE_CLASSIFIER_SPECS = [AAVE_SPEC]
|
16
mev_inspect/classifiers/specs/erc20.py
Normal file
16
mev_inspect/classifiers/specs/erc20.py
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
from mev_inspect.schemas.classified_traces import (
|
||||||
|
Classification,
|
||||||
|
ClassifierSpec,
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
ERC20_SPEC = ClassifierSpec(
|
||||||
|
abi_name="ERC20",
|
||||||
|
classifications={
|
||||||
|
"transferFrom(address,address,uint256)": Classification.transfer,
|
||||||
|
"transfer(address,uint256)": Classification.transfer,
|
||||||
|
"burn(address)": Classification.burn,
|
||||||
|
},
|
||||||
|
)
|
||||||
|
|
||||||
|
ERC20_CLASSIFIER_SPECS = [ERC20_SPEC]
|
@ -90,40 +90,9 @@ UNISWAPPY_V2_PAIR_SPEC = ClassifierSpec(
|
|||||||
},
|
},
|
||||||
)
|
)
|
||||||
|
|
||||||
ERC20_SPEC = ClassifierSpec(
|
|
||||||
abi_name="ERC20",
|
|
||||||
classifications={
|
|
||||||
"transferFrom(address,address,uint256)": Classification.transfer,
|
|
||||||
"transfer(address,uint256)": Classification.transfer,
|
|
||||||
"burn(address)": Classification.burn,
|
|
||||||
},
|
|
||||||
)
|
|
||||||
|
|
||||||
AAVE_SPEC = ClassifierSpec(
|
|
||||||
abi_name="AaveLendingPool",
|
|
||||||
protocol=Protocol.aave,
|
|
||||||
classifications={
|
|
||||||
"liquidationCall(address,address,address,uint256,bool)": Classification.liquidate,
|
|
||||||
},
|
|
||||||
)
|
|
||||||
|
|
||||||
WETH_SPEC = ClassifierSpec(
|
|
||||||
abi_name="WETH9",
|
|
||||||
protocol=Protocol.weth,
|
|
||||||
valid_contract_addresses=["0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2"],
|
|
||||||
classifications={
|
|
||||||
"transferFrom(address,address,uint256)": Classification.transfer,
|
|
||||||
"transfer(address,uint256)": Classification.transfer,
|
|
||||||
},
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
UNISWAP_CLASSIFIER_SPECS = [
|
UNISWAP_CLASSIFIER_SPECS = [
|
||||||
*UNISWAP_V3_CONTRACT_SPECS,
|
*UNISWAP_V3_CONTRACT_SPECS,
|
||||||
*UNISWAPPY_V2_CONTRACT_SPECS,
|
*UNISWAPPY_V2_CONTRACT_SPECS,
|
||||||
WETH_SPEC,
|
|
||||||
AAVE_SPEC,
|
|
||||||
ERC20_SPEC,
|
|
||||||
UNISWAP_V3_POOL_SPEC,
|
UNISWAP_V3_POOL_SPEC,
|
||||||
UNISWAPPY_V2_PAIR_SPEC,
|
UNISWAPPY_V2_PAIR_SPEC,
|
||||||
]
|
]
|
||||||
|
17
mev_inspect/classifiers/specs/weth.py
Normal file
17
mev_inspect/classifiers/specs/weth.py
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
from mev_inspect.schemas.classified_traces import (
|
||||||
|
Classification,
|
||||||
|
ClassifierSpec,
|
||||||
|
Protocol,
|
||||||
|
)
|
||||||
|
|
||||||
|
WETH_SPEC = ClassifierSpec(
|
||||||
|
abi_name="WETH9",
|
||||||
|
protocol=Protocol.weth,
|
||||||
|
valid_contract_addresses=["0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2"],
|
||||||
|
classifications={
|
||||||
|
"transferFrom(address,address,uint256)": Classification.transfer,
|
||||||
|
"transfer(address,uint256)": Classification.transfer,
|
||||||
|
},
|
||||||
|
)
|
||||||
|
|
||||||
|
WETH_CLASSIFIER_SPECS = [WETH_SPEC]
|
Loading…
x
Reference in New Issue
Block a user