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

Does solc calculate a keccak256(...) constant at compile time? #1740

Closed
frangio opened this issue May 8, 2019 · 4 comments · Fixed by #1741
Closed

Does solc calculate a keccak256(...) constant at compile time? #1740

frangio opened this issue May 8, 2019 · 4 comments · Fixed by #1741
Milestone

Comments

@frangio
Copy link
Contributor

frangio commented May 8, 2019

https://github.com/OpenZeppelin/openzeppelin-solidity/blob/86f214b7a3cb6b938463a3509ccd273ad7a04d44/contracts/drafts/ERC777/ERC777.sol#L28-L29

Last time I checked (several months ago), this resulted in the keccak256 calculation being inlined in the code, instead of the resulting hash.

@frangio frangio added this to the v2.3 milestone May 8, 2019
@nventuro
Copy link
Contributor

nventuro commented May 8, 2019

I did a quick test on remix, and, it doesn't. Looks like this is the issue tracking this feature: ethereum/solidity#4024

@frangio
Copy link
Contributor Author

frangio commented May 8, 2019

We should replace it for the value in the source code then IMO. LIke we did for interface hashes.

https://github.com/OpenZeppelin/openzeppelin-solidity/blob/86f214b7a3cb6b938463a3509ccd273ad7a04d44/contracts/token/ERC721/ERC721.sol#L19-L21

@axic
Copy link
Contributor

axic commented Jul 8, 2020

This feature has been added and will be released probably in 0.6.12. Looking forward to have it used in zeppelin 😉

@frangio
Copy link
Contributor Author

frangio commented Jul 8, 2020

@axic That's great news! Thanks for letting us know.

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

Successfully merging a pull request may close this issue.

3 participants