If I have the address of the solidity contract, can I from that address determine the source code and the ABI?

I mean by this, is there a function to call in etherscan or something like that?


1 Answer 1


Yes, both are documented here: https://etherscan.io/apis#contracts.

In short, to get the ABI:


and to get the source code:

  • Does this to be be verified? I guessed that would be possible. But I am dynamically deploying code so the contracts will not be verified. Aug 30, 2018 at 15:58
  • 1
    I'm a bit confused about your scenario. You're the one deploying the code, but you don't have the source code and ABI? Certainly Etherscan can't tell you the source code if no one has given Etherscan the source code. :-)
    – user19510
    Aug 30, 2018 at 16:10
  • No, my UI, but the users write their own code from generated options. They do not write the solidity but generate it. But I do not see the code itself directly. I can store it off chain, but I wondered if ethereum had a option for this. I guess not. Aug 30, 2018 at 16:58
  • @TrevorOakley if you see the code, then just run it trough solc and get the abi methods array
    – Nulik
    Aug 30, 2018 at 17:07
  • Yes of course, I understand that can be done. Thanks. Aug 30, 2018 at 18:03

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