1

Maybe I’m just missing something but all the samples I’ve seen of taking bytecode and trying to reverse engineer it into solidity code looks quite imperfect, yet looking at Etherscan for a particular contract address is showing perfect solidity code, even with comments included. How is this possible? Where is Etherscan getting the code from? https://etherscan.io/address/0x93a796b1e846567fe3577af7b7bb89f71680173a#code

1 Answer 1

2

The developers who wrote the contract have to upload the code themselves. Etherscan then verifies that the code they upload compiles to the on-chain bytecode. https://etherscan.io/verifyContract

Basically all the contracts of the most popular dApps have been verified, which I assume you've been looking at, but not every contract has been verified. If you deploy a contract yourself, you'll see that by default it's not verified and Etherscan only shows bytecode.

1
  • 1
    Thank you. I dont have enough reputation to upvote. Mar 5, 2022 at 13:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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