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

Support for Solidity 0.6.0 #2028

Closed
abcoathup opened this issue Dec 18, 2019 · 11 comments · Fixed by #2080
Closed

Support for Solidity 0.6.0 #2028

abcoathup opened this issue Dec 18, 2019 · 11 comments · Fixed by #2080
Labels
breaking change Changes that break backwards compatibility of the public API. contracts Smart contract code.

Comments

@abcoathup
Copy link
Contributor

🧐 Motivation

OpenZeppelin Contracts support for Solidity 0.6 has been requested in the forum: https://forum.openzeppelin.com/t/when-solidity-0-6-0-support-for-oz-contracts-library/1948

📝 Details

Create a version of OpenZeppelin Contracts with support for Solidity 0.6.

@frangio
Copy link
Contributor

frangio commented Dec 19, 2019

0.6 includes many things that will probably result in a new major release of the OpenZeppelin Contracts.

Some snippets from the release notes that I think will be relevant for us:

Language features

  • Allow explicit conversions from address to address payable via payable(...).

We'll want to remove Address.toPayable.

  • Allow global enums and structs.

We should review the structs that we have and see if they should be made global.

  • Introduce virtual and override keywords.

This is probably the biggest one, as we will have to decide what functions should be overrideable. The sentiment in the team is that we should be tolerant of extension, because users already expect this, and so a lot of things will have to be overrideable.

  • Introduce try/catch-statement

We have some instances where we use .call only because we need to catch any potential reverts. This feature will be very useful, and likely remove all manual .calls or .staticalls.

Compiler Features:

  • Allow revert strings to be stripped from the binary using the --revert-strings option or the settings.debug.revertStrings setting.

We might want to use this flag when compiling the artifacts that are included in the package.

@frangio
Copy link
Contributor

frangio commented Dec 20, 2019

There's a very useful "how to update your code" guide in the Solidity docs. We should also include this in our release notes when we update to 0.6.

https://solidity.readthedocs.io/en/v0.6.0/060-breaking-changes.html#how-to-update-your-code

@thecircleoflifefree
Copy link

Is there an estimate ETA for the official support? Will it set before or after Q2?

@abcoathup
Copy link
Contributor Author

Hi @thecircleoflifefree,

There isn't an estimate yet. I will update here when I know an ETA for supporting Solidity 0.6.

@frangio
Copy link
Contributor

frangio commented Dec 23, 2019

@thecircleoflifefree This will definitely happen before Q2, and most likely during January. We are analyzing this and will post as soon as we have any estimates.

@gitpusha
Copy link

gitpusha commented Jan 6, 2020

@frangio

With regards to try catch and the @openzeppelin/contracts library I noticed the following for the SafeERC20 library:
image

Ergo 0.5 internal methods are not compatible with the 0.6 try/catch syntax.

One more thing that might also be relevant to you ( I found it to be relevant for buidler) is the solidity-parser-antlr package current incompatibility with solc 0.6
I opened an issue regarding the solc 0.6 array slicing syntax in their repo: federicobond/solidity-parser-antlr#96

@frangio
Copy link
Contributor

frangio commented Jan 6, 2020

Very interesting @gitpusha, thanks for sharing! The bit about SafeERC20 is particularly interesting.

@abcoathup
Copy link
Contributor Author

@gitpusha @thecircleoflifefree and everyone following this issue, I suggest joining the discussion in the forum on adoption of virtual functions:
https://forum.openzeppelin.com/t/how-we-plan-to-adopt-solidity-0-6-virtual-functions/2063

@GNSPS
Copy link

GNSPS commented Jan 10, 2020

Hey guys!

Just dropping here a message about the parser. We at ConsenSys Diligence have just taken up its maintenance. Find an updated 0.6.0 version here: https://github.com/consensys/solidity-parser-antlr

@abcoathup abcoathup added breaking change Changes that break backwards compatibility of the public API. contracts Smart contract code. labels Jan 31, 2020
@abcoathup
Copy link
Contributor Author

abcoathup commented Jan 31, 2020

@abcoathup
Copy link
Contributor Author

Hi @gitpusha, @thecircleoflifefree and anyone following this Issue:

OpenZeppelin Contracts were migrated to Solidity 0.6 in OpenZeppelin Contracts v3.0 Beta

Would appreciate if you can give the Beta a try and let us know what you think in the Community Forum!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking change Changes that break backwards compatibility of the public API. contracts Smart contract code.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants