I'm doing a hobby project of blockchain exploration project. One thing I'd like to do is to see what contracts are deployed, maybe do some exploration analysis.

One thing I'd like to see is the source code of contracts.

There were quite a bit of questions on this matter, but I'd like take look at it from different angle: I'd like to be able to download source code somewhat automatically. Is there any standardish way to do it?

Things I have considered:

  • Download code from swarm, however it looks like that it is not widely used (is that true?);
  • Use service like: https://etherscan.io --- however API doesn't provide source code and their Terms And Conditions forbid scraping;

Possible duplicate How to get Source code of an already deployed contract? : How to get Source code of an already deployed contract?

  • I'm aware of that question. However there are some extra angle of trying to do this more or less automatically. – Joe Dec 2 '17 at 16:04

I basically see two options

  • download source-code from the various blockchain explorers if it was published (etherscan.io, ...) (here's my sample code to automate dumping of smart contract sources from etherchain.org)
  • decompile to a source-code equivalent from byte-code with porosity

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.