Merge pull request #11208 from paulrberg/develop

docs: mention the v0.8 restrictions on negative unary
This commit is contained in:
chriseth 2021-04-06 13:21:33 +02:00 committed by GitHub
commit 722c878ccc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -146,6 +146,8 @@ This section lists changes that might cause existing contracts to not compile an
* The ``chainid`` builtin in inline assembly is now considered ``view`` instead of ``pure``.
* Unary negation cannot be used on unsigned integers anymore, only on signed integers.
Interface Changes
=================
@ -170,4 +172,5 @@ How to update your code
- Combine ``c.f{gas: 10000}{value: 1}()`` to ``c.f{gas: 10000, value: 1}()``.
- Change ``msg.sender.transfer(x)`` to ``payable(msg.sender).transfer(x)`` or use a stored variable of ``address payable`` type.
- Change ``x**y**z`` to ``(x**y)**z``.
- Use inline assembly as a replacement for ``log0``, ..., ``log4``.
- Use inline assembly as a replacement for ``log0``, ..., ``log4``.
- Negate unsigned integers by subtracting them from the maximum value of the type and adding 1 (e.g. ``type(uint256).max - x + 1``, while ensuring that `x` is not zero)