docs: mention the v0.8 restrictions on negative unary

This commit is contained in:
Paul Razvan Berg 2021-04-03 18:03:10 +03:00
parent 5433a640fb
commit f1f236ad3b
No known key found for this signature in database
GPG Key ID: 65B7BBE8447BEDC8

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 max uint and adding 1 (e.g. `type(uint256).max - x + 1`, while ensuring that `x` is not zero)