Skip to main content
added 150 characters in body
Source Link
Peteris
  • 1k
  • 7
  • 25

Since the ethereum Python library has been deprecated in May 2019, the ContractTranslator.encode_abi function is probably not the best way to turn Python argument lists into calldata strings. In particular, it doesn't support functions with the same name but different argument lists.

What is a better way to do this? I've been digging into web3.py _utils but they don't have a single reusable function for this. Any alternatives to use in Python?

I'm looking for a function with an equivalent signature to this:

def encode_abi(abi, function_name: str, args: List[Any]) -> bytes:

Since the ethereum Python library has been deprecated in May 2019, the ContractTranslator.encode_abi function is probably not the best way to turn Python argument lists into calldata strings. In particular, it doesn't support functions with the same name but different argument lists.

What is a better way to do this? I've been digging into web3.py _utils but they don't have a single reusable function for this. Any alternatives to use in Python?

Since the ethereum Python library has been deprecated in May 2019, the ContractTranslator.encode_abi function is probably not the best way to turn Python argument lists into calldata strings. In particular, it doesn't support functions with the same name but different argument lists.

What is a better way to do this? I've been digging into web3.py _utils but they don't have a single reusable function for this. Any alternatives to use in Python?

I'm looking for a function with an equivalent signature to this:

def encode_abi(abi, function_name: str, args: List[Any]) -> bytes:
Source Link
Peteris
  • 1k
  • 7
  • 25

What is a good alternative to `ContractTranslator.encode_abi`

Since the ethereum Python library has been deprecated in May 2019, the ContractTranslator.encode_abi function is probably not the best way to turn Python argument lists into calldata strings. In particular, it doesn't support functions with the same name but different argument lists.

What is a better way to do this? I've been digging into web3.py _utils but they don't have a single reusable function for this. Any alternatives to use in Python?