Skip to content

Commit 15e2d8a

Browse files
committed
Re-structure list of breaking changes.
1 parent b605ca5 commit 15e2d8a

File tree

1 file changed

+25
-15
lines changed

1 file changed

+25
-15
lines changed

Diff for: docs/080-breaking-changes.rst

+25-15
Original file line numberDiff line numberDiff line change
@@ -3,33 +3,43 @@ Solidity v0.8.0 Breaking Changes
33
********************************
44

55
This section highlights the main breaking changes introduced in Solidity
6-
version 0.8.0, along with the reasoning behind the changes and how to update
7-
affected code.
6+
version 0.8.0.
87
For the full list check
98
`the release changelog <https://github.com/ethereum/solidity/releases/tag/v0.8.0>`_.
109

11-
Semantic and Syntactic Changes
12-
==============================
10+
Silent Changes of the Semantics
11+
===============================
1312

14-
This section lists changes where you have to modify your code
15-
and it does something else afterwards.
13+
This section lists changes where existing code changes its behaviour without
14+
the compiler notifying you about it.
15+
16+
* Arithmetic operations revert on underflow and overflow. You can use ``unchecked { ... }`` to use
17+
the previous wrapping behaviour.
18+
19+
Checks for overflow are very common, so we made them the default to increase readability of code,
20+
even if it comes at a slight increase of gas costs.
1621

17-
* Explicit conversions from negative literals and literals larger than ``type(uint160).max`` to ``address`` are now disallowed.
1822
* Exponentiation is right associative, i.e., the expression ``a**b**c`` is parsed as ``a**(b**c)``.
1923
Before 0.8.0, it was parsed as ``(a**b)**c``.
2024

21-
Semantic only Changes
22-
=====================
25+
This is the common way to parse the exponentiation operator.
26+
27+
* Failing assertions and other internal checks like division by zero or arithmetic overflow do
28+
not use the invalid opcode but instead the revert opcode.
29+
More specifically, they will use error data equal to a function call to ``Panic(uint256)`` with an error code specific
30+
to the circumstances.
2331

24-
* Failing assertions (and other internal checks like division by zero) do not use the invalid opcode anymore but instead revert
25-
with error data equal to a function call to ``Panic(uint256)`` with an error code specific to the circumstances.
32+
This will save gas on errors while it still allows static analysis tools to distinguish
33+
these situations from a revert on invalid input, like a failing ``require``.
2634

27-
This will save gas on errors while it still allows static analysis tools to detect these situations.
35+
New Restrictions
36+
================
2837

38+
* Explicit conversions from negative literals and literals larger
39+
than ``type(uint160).max`` to ``address`` are disallowed.
2940

30-
Syntactic Only Changes
31-
======================
41+
The previous behaviour was likely ambiguous.
3242

3343
* The global functions ``log0``, ``log1``, ``log2``, ``log3`` and ``log4`` have been removed.
3444

35-
These are low-level functions that were largely unused. Their behaviour can be accessed from inline assembly.
45+
These are low-level functions that were largely unused. Their behaviour can be accessed from inline assembly.

0 commit comments

Comments
 (0)