0

This question have just been published in StackOverflow as well, but you might be able to guide me on a better direction:

I'm looking for the most valid path to download and keep downloading every single smart contract on the ethereum network.

As I've been programming for a few years, I've been thinking about using cURL to make this. But I'm aware this is probably very outdated as it should be possible to be done somehow using the blockchain...

I'm willing to store all the contracts in a traditional MySQL database, in order to run multiple security audits on them. Is there any other database engine compatible with PHP that you would recommend to store them?

How would you approach this?

  • 2
    Did you try quickblocks.io ? – Ismael May 8 '18 at 18:27
  • Thanks, I'm reading about it now. Do you know if it's possible to accomplish, or at least getting near to my goal with it? – Chris Russo May 8 '18 at 19:23
0

So far the best approach I've found is to run a fully synchronised node, and then somehow extract all information into bigQuery or something alike... but it seems a little bit hard to accomplish. Any ideas?

0

If you need a custom solution, firstly know that what is stored on the blockchain is the compiled version of the contracts, i.e., the bytecode. You can decompile it with certain tools, but obviously it won't yield the original result.

However, there are many contracts in Etherscan whose source code is published, like this one. You can get the full list of verified contracts as a CSV file, and using Etherscan's API you can make a simple script to parse that file and download all source codes.

Once you have them, you can store everything in whatever database you want, of course including MySQL.

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.