Solidity 0.8.4 fixes a bug in the ABI decoder, adds custom structured errors, bytes.concat(...)
and allows more flexible configuration of the SMT checker. For more details, please see the release announcement.
The release contains an important bugfix. See decoding from memory bug blog post for more details.
The release also implements custom errors. See custom errors blog post for an introduction.
Important Bugfixes:
- ABI Decoder V2: For two-dimensional arrays and specially crafted data in memory, the result of
abi.decode
can depend on data elsewhere in memory. Calldata decoding is not affected.
Language Features:
- Assembly / Yul: Allow hex string literals.
- Possibility to use
bytes.concat
with variable number ofbytes
andbytesNN
arguments which behaves as a restricted version ofabi.encodePacked
with a more descriptive name. - Support custom errors via the
error
keyword and introduce therevert
statement.
Compiler Features:
- Analysis: Properly detect circular references to the bytecode of other contracts across all function calls.
- Commandline Interface: Model checker option
--model-checker-targets
also acceptsoutOfBounds
. - Commandline Interface: New model checker option
--model-checker-contracts
allows users to select which contracts should be analyzed as the most derived. - Low-Level Inliner: Inline ordinary jumps to small blocks and jumps to small blocks that terminate.
- NatSpec: Allow
@notice
tag on non-public state variables and local variable declarations. The documentation will only be part of the AST, under the fielddocumentation
. - SMTChecker: Deprecate
pragma experimental SMTChecker;
and set default model checker engine tonone
. - SMTChecker: Report local variables in CHC counterexamples.
- SMTChecker: Report out of bounds index access for arrays and fixed bytes.
- SMTChecker: Support file level functions and constants.
- Standard JSON: Model checker option
settings.modelChecker.targets
also acceptsoutOfBounds
. - Standard JSON: Model checker option
settings.modelChecker.targets
takes an array of string targets instead of string of comma separated targets. - Standard JSON: New model checker option
settings.modelChecker.contracts
allows users to select which contracts should be analyzed as the most derived. - Yul EVM Code Transform: Stack Optimization: Reuse slots of unused function arguments and defer allocating stack slots for return variables until after expression statements and assignments that do not reference them.
- Yul Optimizer: Added a new step FunctionSpecializer, that specializes a function with its literal arguments.
Bugfixes:
- Antlr Grammar: Fix parsing of import paths involving properly distinguishing between empty and non-empty string literals in general.
- AST Output: Fix
kind
field ofModifierInvocation
for base constructor calls. - Commandline interface: Fix internal error when printing AST and using
--base-path
orfile://
prefix in imports. - Commandline interface: Fix standard input bypassing allowed path checks.
- Natspec: Fix internal error related to the
@returns
documentation for a public state variable overriding a function. - SMTChecker: Fix false positive and false negative on
push
as LHS of a compound assignment. - SMTChecker: Fix false positive in contracts that cannot be deployed.
- SMTChecker: Fix internal error on public getter returning dynamic data on older EVM versions where these are not available.
- SMTChecker: Fix internal error on try-catch with function call in catch block.
- Type Checker: Fix missing error when events are used without an emit statement.
AST Changes:
- New property for
ContractDefinition
nodes:usedErrors
lists AST IDs of all errors used by the contract (even if defined outside).
We especially thank all the contributors that made this release possible:
Alex Beregszaszi, Anurag Dashputre, Behrouz, Bhargava Shastry, Christian Parpart, Daniel Kirchner, Đorđe Mijović, Feiyang Tan, franzihei, Harikrishnan Mulackal, Hongbo Miao, Kamil Śliwak, Leonardo Alt, Martin Blicha, Mathias Baumann, Paul Razvan Berg, Thibaut Schaeffer, zayneio,
If you want to perform a source build, please only use solidity_0.8.4.tar.gz and not the zip provided by github directly.