8

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.

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

  • 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 – Tjaden Hess Jan 16 '17 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.) – Thomas Jay Rush Jan 17 '17 at 17:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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