Skip to content

Releases: ethereum/solidity

Version 0.6.6

09 Apr 12:42
6c089d0
Compare
Choose a tag to compare

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 field mutability.
  • 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

06 Apr 14:04
f956cc8
Compare
Choose a tag to compare

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

17 Mar 16:46
Compare
Choose a tag to compare

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

10 Mar 15:26
1dca32f
Compare
Choose a tag to compare

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(...) and gas(...) 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

18 Feb 15:38
8dda952
Compare
Choose a tag to compare

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 of codecopy to zero out memory past input.
  • Debug: Provide reason strings for compiler-generated internal reverts when using the --revert-strings option or the settings.debug.revertStrings setting on debug 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 without contract.
  • 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

27 Jan 14:27
bacdbe5
Compare
Choose a tag to compare

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 the create2 opcode using new C{salt: 0x1234, value: 1 ether}(arg1, arg2).
  • Inline Assembly: Support literals true and false.

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

02 Jan 23:36
e6f7d5a
Compare
Choose a tag to compare

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.

Version 0.5.16

02 Jan 18:54
Compare
Choose a tag to compare

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

17 Dec 22:12
26b7007
Compare
Choose a tag to compare

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 and payable fields.
  • ABI: The type field is now required and no longer specified to default to function.
  • AST: Inline assembly is exported as structured JSON instead of plain string.
  • C API (libsolc): Introduce context parameter to both solidity_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 to solidity_reset. Functions solidity_alloc and solidity_free were added.
  • C API (libsolc): solidity_compile now returns a string that must be explicitly freed via solidity_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 called address to them as replacement.
  • General: Enable Yul optimizer as part of standard optimization.
  • General: New reserved keywords: override, receive, and virtual.
  • General: private cannot be used together with virtual.
  • General: Split unnamed fallback functions into two cases defined using fallback() and receive().
  • 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 by baseFunctions.
  • 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 to address payable via payable(...).
  • 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 and override 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 the settings.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

17 Dec 17:23
6a57276
Compare
Choose a tag to compare

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.