ABIs

Examples

abis

Reference

ctc.binary.get_event_hash(event_abi)

compute event hash from event’s abi

Parameters

event_abi (<class 'EventABI'>) –

Return type

<class ‘str’>

ctc.binary.get_event_indexed_names(event_abi)

get list of indexed names in signature of event

ctc.binary.get_event_indexed_types(event_abi)

get list of indexed types in signature of event

ctc.binary.get_event_signature(event_abi)
Parameters

event_abi (<class 'EventABI'>) –

Return type

<class ‘str’>

ctc.binary.get_event_unindexed_names(event_abi)

get list of data names in signature of event

ctc.binary.get_event_unindexed_types(event_abi)

get list of data types in signature of event

ctc.binary.get_function_output_names(function_abi, human_readable=False)
ctc.binary.get_function_output_types(function_abi)
ctc.binary.get_function_parameter_types(function_abi=None, function_signature=None)
Parameters
  • function_abi (FunctionABI | None) –

  • function_signature (Optional[str]) –

Return type

list[ABIDatumType]

ctc.binary.get_function_selector(function_abi=None, function_signature=None)
Parameters
  • function_abi (Union[FunctionABI, NoneType]) –

  • function_signature (Union[str, NoneType]) –

Return type

<class ‘str’>

ctc.binary.get_function_signature(function_abi=None, parameter_types=None, function_name=None, include_names=False)
Parameters
  • function_abi (FunctionABI | None) –

  • parameter_types (Optional[list[str]]) –

  • function_name (Optional[str]) –

  • include_names (bool) –

Return type

str

async ctc.evm.async_decompile_function_abis(bytecode, sort=None)
Parameters
  • bytecode (str) –

  • sort (str | None) –

Return type

Sequence[Mapping]

async ctc.evm.async_get_contract_abi(**query)
Parameters

query (Any) –

Return type

List[Union[FunctionABI, EventABI, ErrorABI]]

async ctc.evm.async_get_event_abi(contract_abi=None, contract_address=None, event_name=None, event_hash=None, event_abi=None, network=None)
Parameters
  • contract_abi (Union[List[Union[FunctionABI, EventABI, ErrorABI]], NoneType]) –

  • contract_address (Union[str, NoneType]) –

  • event_name (Union[str, NoneType]) –

  • event_hash (Union[str, NoneType]) –

  • event_abi (Union[EventABI, NoneType]) –

  • network (Union[int, str, NoneType]) –

Return type

<class ‘EventABI’>

async ctc.evm.async_get_function_abi(function_name=None, contract_abi=None, contract_address=None, n_parameters=None, parameter_types=None, function_selector=None, network=None)