25 lines
706 B
Python
25 lines
706 B
Python
import json
|
|
|
|
from eth_abi.codec import ABIDecoder, ABIEncoder
|
|
from eth_abi.registry import registry as default_registry
|
|
|
|
from .. import current_w3
|
|
|
|
abi_decoder = ABIDecoder(default_registry)
|
|
abi_encoder = ABIEncoder(default_registry)
|
|
|
|
from .abi import abis
|
|
from .contract_proxy import ContractProxy, Transaction
|
|
from .pool_contract import UniswapV3Pool
|
|
from .uniswap_contracts import uniswapV3
|
|
|
|
|
|
def get_contract_data(name):
|
|
with open(f'../contract/out/{name}.sol/{name}.json', 'rt') as file:
|
|
return json.load(file)
|
|
|
|
|
|
def get_contract_event(contract_name:str, event_name:str):
|
|
return getattr(current_w3.get().eth.contract(abi=get_contract_data(contract_name)['abi']).events, event_name)()
|
|
|