Solidity 0.7.0 is a breaking release of the Solidity compiler and language.
This release does not include many features but rather changes that require a
backwards-incompatible adjustment in syntax or semantics. For a detailed explanation,
please see the documentation.
Most notably, further cleanup of visibility and state mutability has been performed
and several unpopular keywords have been removed. Types with mappings
in memory are disallowed and shift and exponentiation operations use more reasonable types.
Since we usually do not backport bugfixes, it is recommended to upgrade all code to be compatible with Solidity v.0.7.0.
The solidity-upgrade tool can help you to semi-automatically upgrade your contracts to breaking language changes. While
solidity-upgrade carries out a large part of the work, your contracts will most likely need further manual adjustments.
You can find a guide on how to update your code here.
Note that changes listed below are the changes between 0.6.12 and 0.7.0. For changes introduced
during the 0.6.x series, please see the individual changelogs or release announcements on this blog.
- Inline Assembly: Disallow
.in user-defined function and variable names.
- Inline Assembly: Slot and offset of storage pointer variable
xare accessed via
- JSON AST: Mark hex string literals with
- JSON AST: Remove members with
nullvalue from JSON output.
- Parser: Disallow
- Parser: Disallow dot syntax for
- Parser: Disallow non-printable characters in string literals.
- Parser: Introduce Unicode string literals:
- Parser: NatSpec comments on variables are only allowed for public state variables.
- Parser: Remove the
- Parser: Remove the identifier
- Reference Resolver:
using A for Bonly affects the contract it is mentioned in and not all derived contracts
- Type Checker: Disallow
virtualfor library functions.
- Type Checker: Disallow assignments to state variables that contain nested mappings.
- Type checker: Disallow events with same name and parameter types in inheritance hierarchy.
- Type Checker: Disallow shifts by signed types.
- Type Checker: Disallow structs and arrays in memory or calldata if they contain nested mappings.
- Type Checker: Exponentiation and shifts of literals by non-literals will always use
int256as a type.
- Yul: Disallow consecutive and trailing dots in identifiers. Leading dots were already disallowed.
- Yul: Disallow EVM instruction
- Inheritance: Allow overrides to have stricter state mutability:
- Parser: Deprecate visibility for constructors.
- State mutability: Do not issue recommendation for stricter mutability for virtual functions but do issue it for functions that override.
- SMTChecker: Report multi-transaction counterexamples including the function calls that initiate the transactions. This does not include concrete values for reference types and reentrant calls.
- Variable declarations using the
varkeyword are not recognized anymore.
- Inheritance: Disallow public state variables overwriting
- NatSpec: Constructors and functions have consistent userdoc output.
- SMTChecker: Fix internal error when assigning to a 1-tuple.
- SMTChecker: Fix internal error when tuples have extra effectless parenthesis.
- State Mutability: Constant public state variables are considered
- Type Checker: Fixing deduction issues on function types when function call has named arguments.
- Immutables: Fix internal compiler error when immutables are not assigned.
We especially thank all the contributors that made this release possible:
a3d4, Alex Beregszaszi, Alexander Arlt, Bhargava Shastry, Christian Parpart, Daniel Kirchner, Djordje Mijovic, Erik Kundt, franzihei, Harikrishnan Mulackal, Leonardo Alt, Mathias Baumann.
If you want to perform a source build, please only use solidity_0.7.0.tar.gz and not the zip provided by github directly.