9

In my Python web service, I'd like to confirm if a contract supports specific ABI (certain call methods). I am running get and communicating over JSON RPC.

What are steps to for this? I am guessing it's along the lines to use some RPC method to fetch contract code, decompile it and then check for presence of sha3 signatures of known methods.

1 Answer 1

3

This is an old question that never got answered, but it can be easily done by accessing this web API: https://www.4byte.directory

2
  • 1
    Note that this only works for function signatures that are in that database. It allows self-submission and also scrapes etherscan for solidity sources Jan 16, 2017 at 5:41
  • Agreed. Are there other sources? I can imagine a search algorithm that first tries 4byte, then etherscan, then whatever, but I would imagine that those two would provide nearly all available info. (That last is just a guess.) Jan 17, 2017 at 17:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.