Releases: ethereum/solidity
Version 0.6.9
This is the first release of Solidity where the solc-js / soljson binary includes the Z3 SMT solver built-in. This means you can use pragma experimental SMTChecker;
even without a local install of z3. Note that this causes an increase in the binary size.
On the language side, the calldata
data location for variables and parameters is now allowed everywhere, even in internal functions.
To enhance developer experience, the option --base-path
allows you to specify a root path of your contract directory structure to help with imports.
Language Features:
- Permit calldata location for all variables.
- NatSpec: Support NatSpec comments on state variables.
- Yul: EVM instruction
pc()
is marked deprecated and will be removed in the next breaking release.
Compiler Features:
- Build system: Update the soljson.js build to emscripten 1.39.15 and boost 1.73.0 and include Z3 for integrated SMTChecker support without the callback mechanism.
- Build system: Switch the emscripten build from the fastcomp backend to the upstream backend.
- Code Generator: Do not introduce new internal source references for small compiler routines.
- Commandline Interface: Adds new option
--base-path PATH
to use the given path as the root of the source tree (defaults to the root of the filesystem). - SMTChecker: Support array
length
. - SMTChecker: Support array
push
andpop
. - SMTChecker: General support to BitVectors and the bitwise
and
operator.
Bugfixes:
- Code Generator: Trigger proper unimplemented errors on certain array copy operations.
- Commandline Interface: Fix internal error when using
--assemble
or--yul
options with--machine ewasm
but without specifying--yul-dialect
. - NatSpec: DocString block is terminated when encountering an empty line.
- Optimizer: Fixed a bug in BlockDeDuplicator.
- Scanner: Fix bug when two empty NatSpec comments lead to scanning past EOL.
- SMTChecker: Fix internal error on try/catch clauses with parameters.
- SMTChecker: Fix internal error when applying arithmetic operators to fixed point variables.
- SMTChecker: Fix internal error when assigning to index access inside branches.
- SMTChecker: Fix internal error when short circuiting Boolean expressions with function calls in state variable initialization.
- Type Checker: Disallow assignments to storage variables of type
mapping
. - Type Checker: Disallow inline arrays of non-nameable types.
- Type Checker: Disallow usage of override with non-public state variables.
- Type Checker: Fix internal compiler error when accessing members of array slices.
- Type Checker: Fix internal compiler error when forward referencing non-literal constants from inline assembly.
- Type Checker: Fix internal compiler error when trying to decode too large static arrays.
- Type Checker: Fix wrong compiler error when referencing an overridden function without calling it.
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, Flash Sheridan, Harikrishnan Mulackal, Jason Cobb, Juan Franco, Kamil Śliwak, Leonardo Alt, Mathias Baumann, ssi91, William Entriken
If you want to perform a source build, please only use solidity_0.6.9.tar.gz and not the zip provided by github directly.
Version 0.6.8
This release of Solidity fixes three important bugs in the code generator:
- a missing callvalue check for constructors
- a bug connected with array slices for arrays containing dynamic types
- literal strings containing backslash characters in connection with ABIEncoderV2
In addition to that:
- we introduced a recommendation to use SPDX license identifiers for all source files which are also stored in the contract metadata
- it is possible to access the min and max values of an integer type directly
- WebAssembly support has been extended
Important Bugfixes:
- Add missing callvalue check to the creation code of a contract that does not define a constructor but has a base that does define a constructor.
- Disallow array slices of arrays with dynamically encoded base types.
- String literals containing backslash characters can no longer cause incorrect code to be generated when passed directly to function calls or encoding functions when ABIEncoderV2 is active.
Language Features:
- Implemented
type(T).min
andtype(T).max
for every integer typeT
that returns the smallest and largest value representable by the type.
Compiler Features:
- Commandline Interface: Don't ignore
--yul-optimizations
in assembly mode. - Allow using abi encoding functions for calldata array slices without explicit casts.
- Wasm binary output: Implement
br
andbr_if
.
Bugfixes:
- ABI: Skip
private
orinternal
constructors. - Fixed an "Assembly Exception in Bytecode" error where requested functions were generated twice.
- Natspec: Fixed a bug that ignored
@return
tag when no other developer-documentation tags were present. - Type Checker: Checks if a literal exponent in the
**
operation is too large or fractional. - Type Checker: Disallow accessing
runtimeCode
for contract types that contain immutable state variables. - Yul Assembler: Fix source location of variable declarations without value.
We especially thank all the contributors that made this release possible:
a3d4, Alex Beregszaszi, Alexander Arlt, Bhargava Shastry, Christian Parpart, Daniel Kirchner, Djordje Mijovic, Harikrishnan Mulackal, Kamil Śliwak, Mathias Baumann
If you want to perform a source build, please only use solidity_0.6.8.tar.gz and not the zip provided by github directly.
Version 0.6.7
Solidity version 0.6.7 introduces support for EIP-165 via type(InterfaceName).interfaceId
.
Language Features:
- Add support for EIP 165 interface identifiers with
type(I).interfaceId
. - Allow virtual modifiers inside abstract contracts to have empty body.
Compiler Features:
- Optimizer: Simplify repeated AND and OR operations.
- Option to specify optimization steps to be performed by Yul optimizer with
--yul-optimizations
in the commandline interface oroptimizer.details.yulDetails.optimizerSteps
in standard-json. - Standard Json Input: Support the prefix
file://
in the fieldurls
.
Bugfixes:
- SMTChecker: Fix internal error when fixed points are used.
- SMTChecker: Fix internal error when using array slices.
- Type Checker: Disallow
virtual
andoverride
for constructors. - Type Checker: Fix several internal errors by performing size and recursiveness checks of types before the full type checking.
- Type Checker: Fix internal error when assigning to empty tuples.
- Type Checker: Fix internal error when applying unary operators to tuples with empty components.
- Type Checker: Perform recursiveness check on structs declared at the file level.
Build System:
- soltest.sh:
SOLIDITY_BUILD_DIR
is no longer relative toREPO_ROOT
to allow for build directories outside of the source tree.
We especially thank all the contributors that made this release possible:
a3d4, Alex Beregszaszi, Alexander Arlt, Bhargava Shastry, Chris Chinchilla, Christian Parpart, Daniel Kirchner, David Cian, Djordje Mijovic, Evan Saulpaugh, hrkrshnn, iamdefinitelyahuman, Jason Cobb, KaiYu Feng, Kamil Śliwak, Leonardo Alt, Mathias Baumann, Noel Maersk, ssi91, yoni206
If you want to perform a source build, please only use solidity_0.6.7.tar.gz and not the zip provided by github directly.
Version 0.6.6
This is a small bugfix release that solves an issue with certain tuple assignments.
Important Bugfixes:
- Fix tuple assignments with components occupying multiple stack slots and different stack size on left- and right-hand-side.
Bugfixes:
- AST export: Export
immutable
property in the fieldmutability
. - SMTChecker: Fix internal error in the CHC engine when calling inherited functions internally.
- Type Checker: Error when trying to encode functions with call options gas and value set.
We especially thank all the contributors that made this release possible:
a3d4, Alexander Arlt, Black3HDF, Djordje Mijovic, hrkrshnn, Jason Cobb, Leonardo Alt
If you want to perform a source build, please only use solidity_0.6.6.tar.gz and not the zip provided by github directly.
Version 0.6.5
Version 0.6.5 of Solidity fixes an important bug and introduces immutable
as a major feature.
The bug concerns the allocation of dynamic memory arrays using e.g. new uint[](...)
. The bug is considered to have a severity level of "low" but is present in all prior versions of Solidity. Therefore, please read more about how check if your contract is vulnerable in this blog post.
The immutable feature supports setting contract-level variables at construction time if they do not change later on. These variables are stored directly in the code instead of storage, which makes them extremely cheap to use. For now, only value types are supported.
Important Bugfixes:
- Code Generator: Restrict the length of dynamic memory arrays to 64 bits during creation at runtime fixing a possible overflow.
Language Features:
- Allow local storage variables to be declared without initialization, as long as they are assigned before they are accessed.
- State variables can be marked
immutable
which causes them to be read-only, but assignable in the constructor. The value will be stored directly in the code.
Compiler Features:
- Commandline Interface: Enable output of storage layout with
--storage-layout
. - Metadata: Added support for IPFS hashes of large files that need to be split in multiple chunks.
Bugfixes:
- Inheritance: Allow public state variables to override functions with dynamic memory types in their return values.
- Inline Assembly: Fix internal error when accessing invalid constant variables.
- Inline Assembly: Fix internal error when accessing functions.
- JSON AST: Always add pointer suffix for memory reference types.
- Reference Resolver: Fix internal error when accessing invalid struct members.
- Type Checker: Fix internal errors when assigning nested tuples.
We especially thank all the contributors that made this release possible:
a3d4, Alexander Arlt, Bhargava Shastry, cameel, Christian Parpart, Daniel Kirchner, Djordje Mijovic, Erik Kundt, gitpusha, hrkrshnn, iamdefinitelyahuman, Jason Cobb, Kamil Śliwak, Leonardo Alt, Martin Lundfall, Mathias Baumann
If you want to perform a source build, please only use solidity_0.6.5.tar.gz and not the zip provided by github directly.
Version 0.5.17
This maintenance release of the 0.5.x series fixes a bug that was always present in the compiler. Some people do not even consider it a bug, though, which might explain why it was undiscovered for so long:
A private function can be overridden in a derived contract by a private function of the same name and types. In other words, the virtual function calling mechanism does not respect visibility.
The same applies to two private functions of the same name and type that are declared in two unrelated base contracts (diamond inheritance).
This bug has been fixed in the 0.6.x series already in version 0.6.0 by making the override mechanism more strict in general.
Bugfixes:
- Type Checker: Disallow overriding of private functions.
Thanks to @k06a for reporting the bug!
If you want to perform a source build, please only use solidity_0.5.17.tar.gz and not the zip provided by github directly.
Version 0.6.4
Version 0.6.4 of Solidity fixes a bug that did not allow calling base contract functions directly, another bug that caused issues with variable scoping in try/catch and it allows for greater flexibility with regards to storage: It is now possible to set storage slots for storage reference variables from inline assembly. We expect this to allow new patterns in connection to delegatecall proxies and upgradable contracts. Please be careful when using this feature!
Language Features:
- General: Deprecated
value(...)
andgas(...)
in favor of{value: ...}
and{gas: ...}
- Inline Assembly: Allow assigning to
_slot
of local storage variable pointers. - Inline Assembly: Perform control flow analysis on inline assembly. Allows storage returns to be set in assembly only.
Compiler Features:
- AssemblyStack: Support for source locations (source mappings) and thus debugging Yul sources.
- Commandline Interface: Enable output of experimental optimized IR via
--ir-optimized
.
Bugfixes:
- Inheritance: Fix incorrect error on calling unimplemented base functions.
- Reference Resolver: Fix scoping issue following try/catch statements.
- Standard-JSON-Interface: Fix a bug related to empty filenames and imports.
- SMTChecker: Fix internal errors when analysing tuples.
- Yul AST Import: correctly import blocks as statements, switch statements and string literals.
We especially thank all the contributors that made this release possible:
a3d4, Bhargava Shastry, Chris Chinchilla, Christian Parpart, Daniel Kirchner, Djordje Mijovic, Erik Kundt, Kamil Śliwak, Leonardo Alt
If you want to perform a source build, please only use solidity_0.6.4.tar.gz and not the zip provided by github directly.
Version 0.6.3
This release adds reason strings for compiler-generated reverts if you specify --revert-strings debug
or use the setting settings.debug.revertStrings = "debug"
. Furthermore, contract types and enums are now allowed as keys for mappings and the doxygen-style comments are better supported by the AST.
Language Features:
- Allow contract types and enums as keys for mappings.
- Allow function selectors to be used as compile-time constants.
Compiler Features:
- AST: Add a new node for doxygen-style, structured documentation that can be received by contract, function, event and modifier definitions.
- Code Generator: Use
calldatacopy
instead ofcodecopy
to zero out memory past input. - Debug: Provide reason strings for compiler-generated internal reverts when using the
--revert-strings
option or thesettings.debug.revertStrings
setting ondebug
mode. - Structured Documentation: Report source locations for structured documentation errors.
- Yul Optimizer: Prune functions that call each other but are otherwise unreferenced.
Bugfixes:
- Assembly Output: Added missing
source
field to legacy assembly json output to complete the source reference. - Parser: Fix an internal error for
abstract
withoutcontract
. - Type Checker: Make invalid calls to uncallable types fatal errors instead of regular.
We especially thank all the contributors that made this release possible:
a3d4, Alexander Arlt, Bhargava Shastry, Brian L. McMichael, cameel, Chris Chinchilla, Christian Parpart, Daniel Kirchner, Djordje Mijovic, Erik Kundt, Gaith Hallak, Jason Cobb, Kamil Śliwak, Leonardo Alt, Mathias Baumann, Nicolas, pinkiebell, rodiazet.
If you want to perform a source build, please only use solidity_0.6.3.tar.gz and not the zip provided by github directly.
Version 0.6.2
After long discussions, we finally enabled a high-level way to use the create2
opcode introduced in Constantinople: When creating a contract, you can specify the salt as a "function call option": new Contract{salt: 0x1234}(arg1, arg2)
. We took this opportunity and also extended the use of these function call options to specifying the gas and value options in external function calls: c.f{value: 10, gas: 20000}(arg1, arg2)
.
Furthermore, interfaces can now inherit from interfaces, making them even more useful for specification purposes.
To allow mutation testing and other uses, you can now export the AST, modify it and re-compile starting from the modified ast using solc --import-ast
. Note that compiling from a modified AST is not meant for production.
And last but not least, we are now building the javascript compiler solc-js / soljson.js using webassembly which should both provide a performance boost as well as reduce compatibility issues with browsers.
Changelog:
Language Features:
- Allow accessing external functions via contract and interface names to obtain their selector.
- Allow interfaces to inherit from other interfaces
- Allow gas and value to be set in external function calls using
c.f{gas: 10000, value: 4 ether}()
. - Allow specifying the
salt
for contract creations and thus thecreate2
opcode usingnew C{salt: 0x1234, value: 1 ether}(arg1, arg2)
. - Inline Assembly: Support literals
true
andfalse
.
Compiler Features:
- LLL: The LLL compiler has been removed.
- General: Raise warning if runtime bytecode exceeds 24576 bytes (a limit introduced in Spurious Dragon).
- General: Support compiling starting from an imported AST. Among others, this can be used for mutation testing.
- Yul Optimizer: Apply penalty when trying to rematerialize into loops.
Bugfixes:
- Commandline interface: Only activate yul optimizer if
--optimize
is given. - Fixes internal compiler error on explicitly calling unimplemented base functions.
Build System:
- Switch to building soljson.js with an embedded base64-encoded wasm binary.
We especially thank all the contributors that made this release possible:
Alex Beregszaszi, Bhargava Shastry, cameel, Chris Chinchilla, Christian Parpart, Daniel Kirchner, djudjuu, Erik Kundt, Gonçalo Sá, Jason Cobb, Leonardo Alt, Mathias Baumann, Nicolás Venturo, Rafael Lorandi, rodiazet, Victor Baranov, William Entriken.
If you want to perform a source build, please only use solidity_0.6.2.tar.gz and not the zip provided by github directly.
Version 0.6.1
This release fixes a bug in the Yul optimizer related to break
and continue
statements in loops. The Yul optimizer is part of the regular optimizer since version 0.6.0. In version 0.5.x, you had to explicitly activate the Yul optimizer in addition to the regular optimizer. The Yul optimizer only operates on the code generated by ABIEncoderV2 or if you use it in a stand-alone way. The code generated by ABIEncoderV2 does not make use of break
and continue
, but these statements can be introduced by other optimizer steps. The Yul optimizer currently is not run on inline-assembly code.
Bugfixes:
- Yul Optimizer: Fix bug in redundant assignment remover in combination with break and continue statements.
If you want to perform a source build, please only use solidity_0.6.1.tar.gz and not the zip provided by github directly.