Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Insignificant newline changes output of solc.compile #88

Closed
ghost opened this issue Mar 16, 2017 · 2 comments
Closed

Insignificant newline changes output of solc.compile #88

ghost opened this issue Mar 16, 2017 · 2 comments

Comments

@ghost
Copy link

ghost commented Mar 16, 2017

A newline (\n) at the end of a contract's source code causes the output bytecode to be different to the same contract without the newline. So, for example, if you copy and paste a contract into a string to be compiled, the result may be different to reading the source code into a string from file.

@axic
Copy link
Member

axic commented Mar 16, 2017

This is due to the verification metadata. The bytecode contains a hash of the metadata, which in turn contains hashes of the sources used.

More explanation here: http://solidity.readthedocs.io/en/develop/miscellaneous.html#contract-metadata

@chriseth
Copy link
Contributor

We could strip whitespace at the beginning and end of sources, but I think if we start doing this, we will never find an end to similar problems.

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants