Releases: ethereum/solidity
Version 0.5.16
This release fixes a bug in the Yul optimizer. You are only affected if you manually enabled the Yul optimizer (not the regular optimizer) and either used Yul stand-alone or via ABIEncoderV2. For more details, please see buglist.json.
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.5.16.tar.gz and not the zip provided by github directly.
Version 0.6.0
This is a major breaking release of the Solidity compiler and language. Changes include explicit virtual and override keywords in inheritance, support for try/catch, splitting the fallback function into a receive Ether function and an actual fallback function and limitations on how the length of an array can be changed, among others. For a detailed explanation, please see the documentation or refer to the list below that shows every single change.
From this release on, ABIEncoderV2 is not considered experimental any more, but you still have to activate it through the pragma.
Furthermore, the Yul optimizer is automatically activated together with the regular optimizer, but you can still disable it through the detailed optimizer settings.
Breaking changes:
- ABI: Remove the deprecated
constant
andpayable
fields. - ABI: The
type
field is now required and no longer specified to default tofunction
. - AST: Inline assembly is exported as structured JSON instead of plain string.
- C API (
libsolc
): Introduce context parameter to bothsolidity_compile
and the callback. - C API (
libsolc
): The provided callback now takes two parameters, kind and data. The callback can then be used for multiple purposes, such has file imports and SMT queries. - C API (
libsolc
):solidity_free
was renamed tosolidity_reset
. Functionssolidity_alloc
andsolidity_free
were added. - C API (
libsolc
):solidity_compile
now returns a string that must be explicitly freed viasolidity_free()
- Commandline Interface: Remove the text-based AST printer (
--ast
). - Commandline Interface: Switch to the new error reporter by default.
--old-reporter
falls back to the deprecated old error reporter. - Commandline Interface: Add option to disable or choose hash method between IPFS and Swarm for the bytecode metadata.
- General: Disallow explicit conversions from external function types to
address
and add a member calledaddress
to them as replacement. - General: Enable Yul optimizer as part of standard optimization.
- General: New reserved keywords:
override
,receive
, andvirtual
. - General:
private
cannot be used together withvirtual
. - General: Split unnamed fallback functions into two cases defined using
fallback()
andreceive()
. - Inheritance: State variable shadowing is now disallowed.
- Inline Assembly: Only strict inline assembly is allowed.
- Inline Assembly: Variable declarations cannot shadow declarations outside the assembly block.
- JSON AST: Replace
superFunction
attribute bybaseFunctions
. - Natspec JSON Interface: Properly support multiple
@return
statements in@dev
documentation and enforce named return parameters to be mentioned in the documentation. - Source mappings: Add "modifier depth" as a fifth field in the source mappings.
- Standard JSON Interface: Add option to disable or choose hash method between IPFS and Swarm for the bytecode metadata.
- Syntax:
push(element)
for dynamic storage arrays do not return the new length anymore. - Syntax: Abstract contracts need to be marked explicitly as abstract by using the
abstract
keyword. - Syntax:
length
member of arrays is now always read-only, even for storage arrays. - Type Checker: Resulting type of exponentiation is equal to the type of the base. Also allow signed types for the base.
Language Features:
- Allow explicit conversions from
address
toaddress payable
viapayable(...)
. - Allow global enums and structs.
- Allow public variables to override external functions.
- Allow underscores as delimiters in hex strings.
- Introduce syntax for array slices and implement them for dynamic calldata arrays.
- Introduce
push()
for dynamic storage arrays. It returns a reference to the newly allocated element, if applicable. - Introduce
virtual
andoverride
keywords. - Introduce
try
/catch
-statement - Modify
push(element)
for dynamic storage arrays such that it does not return the new length anymore. - Yul: Introduce
leave
statement that exits the current function. - JSON AST: Add the function selector of each externally-visible FunctonDefinition to the AST JSON export.
Compiler Features:
- Allow revert strings to be stripped from the binary using the
--revert-strings
option or thesettings.debug.revertStrings
setting. - ABIEncoderV2: Do not warn about enabled ABIEncoderV2 anymore (the pragma is still needed, though).
We especially thank all the contributors that made this release possible:
Alexander Arlt, Alex Beregszaszi, Bhargava Shastry, cd10012, Chris Chinchilla, Christian Parpart, Cory Dickson, Daniel Kirchner, djudjuu, Erik Kundt, Gaith Hallak, krk, Leo Arias, Leonardo Alt, Mathias Baumann, misterfoxy, rodiazet, William Entriken
If you want to perform a source build, please only use solidity_0.6.0.tar.gz and not the zip provided by github directly.
Version 0.5.15
This release fixes a bug that was introduced in 0.5.14 (the previous release). You are only affected if you manually enabled the Yul optimizer (not the regular optimizer) and either used Yul stand-alone or via ABIEncoderV2. For more details, please see buglist.json.
Bugfixes:
- Yul Optimizer: Fix incorrect redundant load optimization crossing user-defined functions that contain for-loops with memory / storage writes.
If you want to perform a source build, please only use solidity_0.5.15.tar.gz and not the zip provided by github directly.
Version 0.5.14
Solidity 0.5.14 sets the default EVM version to "Istanbul" and is targeted as the last release in the 0.5.x series.
The SMT checker supports constructors now and it is possible to directly translate EVM-flavoured Yul to Ewasm from the commandline interface.
Language Features:
- Allow to obtain the selector of public or external library functions via a member
.selector
. - Parser: Allow splitting string and hexadecimal string literals into multiple parts.
- Inline Assembly: Support constants that reference other constants.
Compiler Features:
- Commandline Interface: Allow translation from yul / strict assembly to EWasm using
solc --yul --yul-dialect evm --machine eWasm
- Set the default EVM version to "Istanbul".
- SMTChecker: Add support to constructors including constructor inheritance.
- Yul: When compiling via Yul, string literals from the Solidity code are kept as string literals if every character is safely printable.
- Yul Optimizer: Perform loop-invariant code motion.
Bugfixes:
- SMTChecker: Fix internal error when using
abi.decode
. - SMTChecker: Fix internal error when using arrays or mappings of functions.
- SMTChecker: Fix internal error in array of structs type.
- Version Checker:
^0
should match0.5.0
, but no prerelease. - Yul: Consider infinite loops and recursion to be not removable.
Build System:
- Update to emscripten version 1.39.3.
We especially thank all the contributors that made this release possible:
Alex Beregszaszi, Bhargava Shastry, Chris Chinchilla, Christian Parpart, Daniel Kirchner, Erik Kundt, Gaith Hallak, Henry Lee, Lefteris Karapetsas, Leonardo Alt, Mathias Baumann, mingchuan, Paweł Bylica, William Entriken
If you want to perform a source build, please only use solidity_0.5.14.tar.gz and not the zip provided by github directly.
Version 0.5.13
Solidity 0.5.13 provides Istanbul-EVM compatibility (default is still set to Petersburg), is the first version to generate Ethereum-Webassembly (EWasm) binary output (not fully working yet, though), improves the developer experience by listing potential overloads when resolution fails and can output the layout of the storage variables of a contract. As with all other releases, the coverage of the SMT checker is further improved.
Language Features:
- Allow to obtain the address of a linked library with
address(LibraryName)
.
Compiler Features:
- Code Generator: Use SELFBALANCE opcode for
address(this).balance
if using Istanbul EVM. - EWasm: Experimental EWasm binary output via
--ewasm
and as documented in standard-json. - SMTChecker: Add break/continue support to the CHC engine.
- SMTChecker: Support assignments to multi-dimensional arrays and mappings.
- SMTChecker: Support inheritance and function overriding.
- Standard JSON Interface: Output the storage layout of a contract when artifact
storageLayout
is requested. - TypeChecker: List possible candidates when overload resolution fails.
Bugfixes:
- Code Generator: Fixed a faulty assert that would wrongly trigger for array sizes exceeding unsigned integer.
- SMTChecker: Fix internal error when accessing indices of fixed bytes.
- SMTChecker: Fix internal error when using function pointers as arguments.
- SMTChecker: Fix internal error when implicitly converting string literals to fixed bytes.
- Type Checker: Disallow constructor of the same class to be used as modifier.
- Type Checker: Treat magic variables as unknown identifiers in inline assembly.
We especially thank all the contributors that made this release possible:
Alex Beregszaszi, Alexander Arlt, Bhargava Shastry, Chris Chinchilla, Christian Parpart, Daniel Kirchner, Erik Kundt, Gaith Hallak, hellraiserinchief , Henry Lee, Jochem Brouwer, Leonardo Alt, Mathias Baumann
If you want to perform a source build, please only use solidity_0.5.13.tar.gz and not the zip provided by github directly.
Version 0.5.12
This is a small bugfix release that also includes loop support for the SMT solver and some improvements to the Yul optimizer. The reason for the smaller feature set is that we are mainly working on the upcoming 0.6.0 release.
Language Features:
- Type Checker: Allow assignment to external function arguments except for reference types.
Compiler Features:
- ABI Output: Change sorting order of functions from selector to kind, name.
- Optimizer: Add rule that replaces the BYTE opcode by 0 if the first argument is larger than 31.
- SMTChecker: Add loop support to the CHC engine.
- Yul Optimizer: Take side-effect-freeness of user-defined functions into account.
- Yul Optimizer: Remove redundant mload/sload operations.
Bugfixes:
- Code Generator: Fix internal error when popping a dynamic storage array of mappings.
- Name Resolver: Fix wrong source location when warning on shadowed aliases in import declarations.
- Scanner: Fix multi-line natspec comment parsing with triple slashes when file is encoded with CRLF instead of LF.
- Type System: Fix arrays of recursive structs.
- Yul Optimizer: Fix reordering bug in connection with shifted one and mul/div-instructions in for loop conditions.
We especially thank all the contributors that made this release possible:
Alexander Arlt, Alex Beregszaszi, Ayrat Badykov, Balaji Pachai, Bhargava Shastry, Chris Chinchilla, Christian Parpart, Crawford Leeds, Daniel Kirchner, Dimitry, Erik Kundt, Flash Sheridan, Gois, Lauri Peltonen, Leo Arias, Leonardo Alt, Mathias Baumann, Micah Zoltu, mingchuan, rocky (supported by ConsenSys), Solexplorer,
If you want to perform a source build, please only use solidity_0.5.12.tar.gz and not the zip provided by github directly.
Version 0.5.11
This release fixes a bug related to calldata structs in ABIEncoderV2 and calldata decoding in V1. Several internal bugs of the SMT checker are fixed.
Furthermore, internal types are added to the ABI output which allows you to see which struct type is behind an ABI tuple. Finally, Yul and web assembly support are progressing.
We also improved our testing framework which now allows for semantics tests to run in 4 seconds instead of 1 minute.
Language Features:
- Inline Assembly: Support direct constants of value type in inline assembly.
Compiler Features:
- ABI: Additional internal type info in the field
internalType
. - eWasm: Highly experimental eWasm output using
--ewasm
in the commandline interface or output selection ofewasm.wast
in standard-json. - Metadata: Update the swarm hash to the current specification, changes
bzzr0
tobzzr1
and urls to usebzz-raw://
. - Standard JSON Interface: Compile only selected sources and contracts.
- Standard JSON Interface: Provide secondary error locations (e.g. the source position of other conflicting declarations).
- SMTChecker: Do not erase knowledge about storage pointers if another storage pointer is assigned.
- SMTChecker: Support string literal type.
- Standard JSON Interface: Provide AST even on errors if
--error-recovery
commandline switch or StandardCompilersettings.parserErrorRecovery
is true. - Yul Optimizer: Do not inline function if it would result in expressions being duplicated that are not cheap.
Bugfixes:
- ABI decoder: Ensure that decoded arrays always point to distinct memory locations.
- Code Generator: Treat dynamically encoded but statically sized arrays and structs in calldata properly.
- SMTChecker: Fix internal error when inlining functions that contain tuple expressions.
- SMTChecker: Fix pointer knowledge erasing in loops.
- SMTChecker: Fix internal error when using compound bitwise assignment operators inside branches.
- SMTChecker: Fix internal error when inlining a function that returns a tuple containing an unsupported type inside a branch.
- SMTChecker: Fix internal error when inlining functions that use state variables and belong to a different source.
- SMTChecker: Fix internal error when reporting counterexamples concerning state variables from different source files.
- SMTChecker: Fix SMT sort mismatch when using string literals.
- View/Pure Checker: Properly detect state variable access through base class.
- Yul Analyzer: Check availability of data objects already in analysis phase.
- Yul Optimizer: Fix an issue where memory-accessing code was removed even though
msize
was used in the program.
We especially thank all the contributors that made this release possible:
Alex Beregszaszi, Bhargava Shastry, cgrigis, Chris Chinchilla, Chris Smith, Christian Parpart, Daniel Kirchner, djudjuu, dm4, Erik Kundt, Leonardo Alt, Mathias Baumann, mingchuan, Nimish Bongale, Rocky Bernstein (supported by ConsenSys), William Entriken.
If you want to perform a source build, please only use solidity_0.5.11.tar.gz and not the zip provided by github directly.
Version 0.5.10
Apart from further invisible work on the Yul optimizer, the Solidity to Yul code generation, the eWasm backend and the SMT checker, this release contains two important bug fixes related to storage arrays.
For details see https://blog.ethereum.org/2019/06/25/solidity-storage-array-bugs/
It also contains an experimental mode that allows recovery from parser error (implemented by @rocky, funded by ConsenSys) in the hope that this might be useful for IDE developers.
Important Bugfixes:
- ABIEncoderV2: Fix incorrect abi encoding of storage array of data type that occupy multiple storage slots
- Code Generator: Properly zero out higher order bits in elements of an array of negative numbers when assigning to storage and converting the type at the same time.
Compiler Features:
- Commandline Interface: Experimental parser error recovery via the
--error-recovery
commandline switch. - Optimizer: Add rule to simplify
SUB(~0, X)
toNOT(X)
. - Yul Optimizer: Make the optimizer work for all dialects of Yul including eWasm.
Bugfixes:
- Type Checker: Set state mutability of the function type members
gas
andvalue
to pure (while their return type inherits state mutability from the function type). - Yul / Inline Assembly Parser: Disallow trailing commas in function call arguments.
Build System:
- Attempt to use stock Z3 cmake files to find Z3 and only fall back to manual discovery.
- CMake: use imported targets for boost.
- Emscripten build: upgrade to boost 1.70.
- Generate a cmake error for gcc versions older than 5.0.
We especially thank all the contributors that made this release possible:
Alex Beregszaszi, Anurag Dashputre, Bhargava Shastry, Chris Ward, Christian Parpart, Daniel Kirchner, Fabio Bonfiglio, Leonardo Alt, Mathias Baumann, mingchuan, rocky, Vedant Agarwala, Vignesh Karthikeyan, William Entriken.
If you want to perform a source build, please only use solidity_0.5.10.tar.gz and not the zip provided by github directly.
Version 0.5.9
As in previous releases, we spent most of the time making Solidity future-proof by further working on the Yul optimizer, the Solidity to Yul (and eWasm) translator and the SMT Checker.
Code generated from Solidity now always includes the version number in the CBOR metadata so that it becomes possible to quickly assess whether a contract might be affected by a compiler bug or not.
Language Features:
- Inline Assembly: Revert change introduced in 0.5.7: The
callvalue()
instruction does not requirepayable
anymore. - Static Analyzer: Disallow libraries calling themselves externally.
Compiler Features:
- Assembler: Encode the compiler version in the deployed bytecode.
- Code Generator: Fix handling of structs of dynamic size as constructor parameters.
- Inline Assembly: Disallow the combination of
msize()
and the Yul optimizer. - Metadata: Add IPFS hashes of source files.
- Optimizer: Add rule to simplify SHL/SHR combinations.
- Optimizer: Add rules for multiplication and division by left-shifted one.
- SMTChecker: Support inherited state variables.
- SMTChecker: Support tuples and function calls with multiple return values.
- SMTChecker: Support
delete
. - SMTChecker: Inline external function calls to
this
. - Yul Optimizer: Simplify single-run
for
loops toif
statements. - Yul Optimizer: Optimize representation of numbers.
- Yul Optimizer: Do not inline recursive functions.
- Yul Optimizer: Do not remove instructions that affect
msize()
ifmsize()
is used.
Bugfixes:
- Code Generator: Explicitly turn uninitialized internal function pointers into invalid functions when loaded from storage.
- Code Generator: Fix assertion failure when assigning structs containing array of mapping.
- Compiler Internals: Reset the Yul string repository before each compilation, freeing up memory.
- SMTChecker: Fix bad cast in base constructor modifier.
- SMTChecker: Fix internal error when visiting state variable inherited from base class.
- SMTChecker: Fix internal error in fixed point operations.
- SMTChecker: Fix internal error in assignment to unsupported type.
- SMTChecker: Fix internal error in branching when inlining function calls that modify local variables.
We especially thank all the contributors that made this release possible:
Alex Beregszaszi, Andrey Bronin, asymmetric, Bhargava Shastry, Christian Parpart, Chris Ward, Daniel Kirchner, Erik Kundt, Guy Lando, Isaac Ibiapina, Jorropo, Leonardo Alt, Mathias Baumann, mingchuan, Rocky, Vedant Agarwala.
If you want to perform a source build, please only use solidity_0.5.9.tar.gz and not the zip provided by github directly.
Version 0.5.8
This release fixes important but very unlikely bugs and further completes ABIEncoderV2, SMTChecker and Yul and improves the optimizer.
Notably, if ABIEncoderV2 is activated, the ABI decoder will now revert on input with dirty higher order bits instead of ignoring those bits.
Important Bugfixes:
- Code Generator: Fix initialization routine of uninitialized internal function pointers in constructor context.
- Type System: Use correct type name for contracts in event parameters when used in libraries. This affected code generation.
- Yul Optimizer: Fix SSA transform for multi-assignments.
Language Features:
- ABIEncoderV2: Implement encoding of calldata arrays and structs.
- Code Generation: Implement copying recursive structs from storage to memory.
- Yul: Disallow function definitions inside for-loop init blocks.
Compiler Features:
- ABI Decoder: Raise a runtime error on dirty inputs when using the experimental decoder.
- Optimizer: Add rule for shifts by constants larger than 255 for Constantinople.
- Optimizer: Add rule to simplify certain ANDs and SHL combinations
- SMTChecker: Support arithmetic compound assignment operators.
- SMTChecker: Support unary increment and decrement for array and mapping access.
- SMTChecker: Show unsupported warning for inline assembly blocks.
- SMTChecker: Support mod.
- SMTChecker: Support
contract
type. - SMTChecker: Support
this
as address. - SMTChecker: Support address members.
- Standard JSON Interface: Metadata settings now re-produce the original
"useLiteralContent"
setting from the compilation input. - Yul: Adds break and continue keywords to for-loop syntax.
- Yul: Support
.
as part of identifiers. - Yul Optimizer: Adds steps for detecting and removing of dead code.
Bugfixes:
- SMTChecker: Implement Boolean short-circuiting.
- SMTChecker: SSA control-flow did not take into account state variables that were modified inside inlined functions that were called inside branches.
- Type System: Allow direct call to base class functions that have overloads.
- Yul: Properly register functions and disallow shadowing between function variables and variables in the outside scope.
Build System:
- Soltest: Add commandline option
--test
/-t
to isoltest which takes a string that allows filtering unit tests. - soltest.sh: allow environment variable
SOLIDITY_BUILD_DIR
to specify build folder and add--help
usage.
We especially thank all the contributors that made this release possible:
Alex Beregszaszi, Bhargava Shastry, Christian Parpart, Chris Ward, Constantin Kloecker, Daniel Kirchner, dm4, Erik Kundt, fnatic, Grant Wuerker, hydai, Ilya Ostrovskiy, Leonardo Alt, Mathias Baumann, mingchuan, rocky, William Entriken
If you want to perform a source build, please only use solidity_0.5.8.tar.gz and not the zip provided by github directly.