3

Suppose that you have a contract, someone audited it, and you would like to use that specific version for compilation and deployment to Ethereum.

Now, you want to verify the source code on Etherscan, but say that you want to modify one or more comments before you verify the source code for the first time. Would Etherscan still be able to pass the verification or not?

I know that changing just one character in a contract changes the metadata hash, but I'm not sure whether Etherscan checks for that.

1

Etherscan only compares the bytecode of the submitted contract to the bytecode of the deployed contract (excluding the metadata hash). So you can change any comments and the source code will still be verified by Etherscan.

Source of this information is my own findings while developing truffle-plugin-verify. I have verified many contracts where the comments in the submitted contract did not match the comments in the deployed contracts.

0

If the bytecode is identical, and it matches a previous implementation, you won't be able to check it again. You have to ensure that the bytecode is different, or compile via another version.

5
  • Sure, but what I meant is before I verify the source code for the 1st time. – Paul Razvan Berg Nov 20 '20 at 11:14
  • Sorry, I'm not sure to understand, but you can put whatever you want in the comment, in fact comments are not included in the bytecode – Adam Boudjemaa Nov 20 '20 at 15:27
  • I know. The question was not "are comments included in the bytecode of an Ethereum contarct". – Paul Razvan Berg Nov 20 '20 at 16:19
  • your question is not clear – Adam Boudjemaa Nov 20 '20 at 22:15
  • I updated the question to make it more clear. Thanks for your feedback! – Paul Razvan Berg Nov 21 '20 at 0:10

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.