How is possible for Etherscan to know the Solidity source code of contracts such as this one https://etherscan.io/address/0xab7c74abc0c4d48d1bdad5dcb26153fc8780f83e#code? They wouldn't be able to reconstruct it from the compiled code that's in the blockchain?


The source code is uploaded to Etherscan by the contract developer or someone else who has access to it. They also provide Git hooks to do this automatically.

Since Ethercan can recompile the source code people send them and confirm that it matches the compiled code on the blockchain, they don't need to trust the people sending them source code.

  • 1
    Got it, thanks. A more general question. Is this mechanism of compiling and comparing compiled code the way trust is established for smart contracts (so that someone who interacts with contract knows what it actually exactly does)?
    – migu
    Mar 4 '17 at 2:53
  • 2
    Yes, this is the normal process, whether you get the source code from Etherscan, directly from the developers or from somewhere else. Mar 4 '17 at 2:57

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.