aave, erc20, weth moved into separated specs

This commit is contained in:
Patrick Daly 2021-08-16 23:49:03 -07:00
parent cdf8265de9
commit 6ceedbf9af
5 changed files with 59 additions and 33 deletions

View File

@ -1,4 +1,13 @@
from .uniswap import UNISWAP_CLASSIFIER_SPECS
from .aave import AAVE_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
)

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

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

View File

@ -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_V3_CONTRACT_SPECS,
*UNISWAPPY_V2_CONTRACT_SPECS,
WETH_SPEC,
AAVE_SPEC,
ERC20_SPEC,
UNISWAP_V3_POOL_SPEC,
UNISWAPPY_V2_PAIR_SPEC,
]

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