Skip to content
d7f0394
Compare
Choose a tag to compare

Solidity v0.8.11 adds a first implementation of a Language Server, allows a safer way to perform ABI-encoding and fixes several bugs.

For more details, see the release announcement.

Language Features:

  • General: New builtin function abi.encodeCall(functionPointer, (arg1, arg2, ...)) that type-checks the arguments and returns the ABI-encoded function call data.

Compiler Features:

  • Commandline Interface: Add --lsp option to get solc to act as a Language Server (LSP) communicating over stdio.

Bugfixes:

  • Code Generator: Fix a crash when using @use-src and compiling from Yul to ewasm.
  • SMTChecker: Fix internal error when an unsafe target is solved more than once and the counterexample messages are different.
  • SMTChecker: Fix soundness of assigned storage/memory local pointers that were not erasing enough knowledge.
  • Fix internal error when a function has a calldata struct argument with an internal type inside.
  • IR Generator: Fix IR syntax error when copying storage arrays of functions.

We especially thank all the contributors that made this release possible:

Kamil Śliwak, Leo Alt, nishant-sachdeva, Daniel Kirchner, Marenz, minami, Alessandro Coglio, Alex Beregszaszi, Bhargava Shastry, Dallon Asnes, Dallon Asnes, neel iyer, Christian Parpart, GitHubPang, Mathias Baumann, Omkar Nikhal, Saska Karsi, Tynan Richards, dinah.

If you want to perform a source build, please only use solidity_0.8.11.tar.gz and not the zip provided by github directly.

fc41083
Compare
Choose a tag to compare

Solidity v0.8.10 can now report contract invariants and reentrancy properties through the SMTChecker. It also contains some new optimizations with regards to external function calls and enabled the new EVM code generator for pure Yul mode.

For more details, see the release announcement.

Language Features:

  • Inline Assembly: Support .address and .selector on external function pointers to access their address and function selector.

Compiler Features:

  • Code Generator: Skip existence check for external contract if return data is expected. In this case, the ABI decoder will revert if the contract does not exist.
  • Commandline Interface: Accept nested brackets in step sequences passed to --yul-optimizations.
  • Commandline Interface: Add --debug-info option for selecting how much extra debug information should be included in the produced EVM assembly and Yul code.
  • Commandline Interface: Support --asm, --bin, --ir-optimized, --ewasm and --ewasm-ir output selection options in assembler mode.
  • Commandline Interface: Use different colors when printing errors, warnings and infos.
  • JSON AST: Set absolute paths of imports earlier, in the parsing stage.
  • SMTChecker: Output values for block.*, msg.* and tx.* variables that are present in the called functions.
  • SMTChecker: Report contract invariants and reentrancy properties. This can be enabled via the CLI option --model-checker-invariants or the Standard JSON option settings.modelChecker.invariants.
  • Standard JSON: Accept nested brackets in step sequences passed to settings.optimizer.details.yulDetails.optimizerSteps.
  • Standard JSON: Add settings.debug.debugInfo option for selecting how much extra debug information should be included in the produced EVM assembly and Yul code.
  • Yul EVM Code Transform: Switch to new optimized code transform when compiling via Yul with enabled optimizer.
  • Yul Optimizer: Take control-flow side-effects of user-defined functions into account in various optimizer steps.

Bugfixes:

  • Code Generator: Fix constructor source mappings for immutables.
  • Commandline Interface: Disallow --error-recovery option outside of the compiler mode.
  • Commandline Interface: Don't return zero exit code when writing linked files to disk fails.
  • Commandline Interface: Fix extra newline character being appended to sources passed through standard input, affecting their hashes.
  • Commandline Interface: Report output selection options unsupported by the selected input mode instead of ignoring them.
  • Commandline Interface: When linking only accept exact matches for library names passed to the --libraries option. Library names not prefixed with a file name used to match any library with that name.
  • SMTChecker: Fix internal error in magic type access (block, msg, tx).
  • SMTChecker: Fix internal error in the CHC engine when passing gas in the function options.
  • TypeChecker: Fix internal error when using arrays and structs with user defined value types before declaration.
  • TypeChecker: Fix internal error when using user defined value types in public library functions.
  • TypeChecker: Improved error message for constant variables with (nested) mapping types.
  • Yul Assembler: Fix internal error when function names are not unique.
  • Yul IR Generator: Do not output empty switches/if-bodies for empty contracts.

Important Bugfixes in Experimental Features:

  • Yul IR Generator: Changes to function return variables referenced in modifier invocation arguments were not properly forwarded if there was more than one return variable.

Build System:

  • Pass linker-only emscripten options only when linking.
  • Remove obsolete compatibility workaround for emscripten builds.
  • Update emscripten to version 2.0.33.

We especially thank all the contributors that made this release possible:

4molybdenum2, Adam Bliss, Alex Beregszaszi, Christian Parpart, Daniel Kirchner, David Dzhalaev, Derek Brans, Gyeonghun Park, Harikrishnan Mulackal, José López, Kamil Śliwak, Leo Arias, Leonardo Alt, Mariela Mantle, Mathias Baumann, Midhun07, Mikko Ohtamaa, MrBrain295, Saurabh Sharma, sgmoore, shikharvashistha, Shivam Rajput, soroosh-sdi, Sreekesh V, tcoyvwac, TerranCivilian, vowchick, William Entriken, Zachinquarantine

If you want to perform a source build, please only use solidity_0.8.10.tar.gz and not the zip provided by github directly.

e5eed63
Compare
Choose a tag to compare

Solidity v0.8.9 is a pure bugfix release and fixes two important, but low severity, bugs.
For more details, see the release announcement.

Important Bugfixes:

  • Immutables: Properly perform sign extension on signed immutables.
  • User Defined Value Type: Fix storage layout of user defined value types for underlying types shorter than 32 bytes.

Bugfixes:

  • AST: Export canonicalName for UserDefinedValueTypeDefinition and ContractDefinition.

If you want to perform a source build, please only use solidity_0.8.9.tar.gz and not the zip provided by github directly.

dddeac2
Compare
Choose a tag to compare

Solidity v0.8.8 introduces user defined value types as a major feature, improves overriding interface functions and reading from immutables. Apart from bugfixes, we also cleaned up the command-line interface and improved the way the
import mechanism resolves files.

For more details, see the release announcement.

Language Features:

  • Inheritance: A function that overrides only a single interface function does not require the override specifier.
  • Type System: Support type(E).min and type(E).max for enums.
  • User Defined Value Type: allows creating a zero cost abstraction over a value type with stricter type requirements.

Compiler Features:

  • Commandline Interface: Add --include-path option for specifying extra directories that may contain importable code (e.g. packaged third-party libraries).
  • Commandline Interface: Do not implicitly run evm bytecode generation unless needed for the requested output.
  • Commandline Interface: Normalize paths specified on the command line and make them relative for files located inside base path and/or include paths.
  • Immutable variables can be read at construction time once they are initialized.
  • SMTChecker: Add constraints to better correlate address(this).balance and msg.value.
  • SMTChecker: Support constants via modules.
  • SMTChecker: Support low level call as external calls to unknown code.
  • SMTChecker: Support the value option for external function calls.
  • SMTChecker: Support user defined value types.

Bugfixes:

  • Code Generator: Fix ICE on assigning to calldata structs and statically-sized calldata arrays in inline assembly.
  • Code Generator: Use stable source order for ABI functions.
  • Commandline Interface: Disallow the --experimental-via-ir option in Standard JSON, Assembler and Linker modes.
  • Commandline Interface: Fix resolution of paths whitelisted with --allowed-paths or implicitly due to base path, remappings and files being compiled. Correctly handle paths that do not match imports exactly due to being relative, non-normalized or empty.
  • Commandline Interface: Report optimizer options as invalid in Standard JSON and linker modes instead of ignoring them.
  • Name Resolver: Fix that when importing an aliased symbol using import {AliasedName} from "a.sol" it would use the original name of the symbol and not the aliased one.
  • Opcode Optimizer: Prevent the optimizer from running multiple times to avoid potential bytecode differences for referenced code.
  • Parser: Properly check for multiple SPDX license identifiers next to each other and validate them.
  • SMTChecker: Fix BMC's constraints regarding internal functions.
  • SMTChecker: Fix false negative caused by push on storage array references returned by internal functions.
  • SMTChecker: Fix false positive in external calls from constructors.
  • SMTChecker: Fix internal error on some multi-source uses of abi.*, cryptographic functions and constants.
  • Standard JSON: Fix non-fatal errors in Yul mode being discarded if followed by a fatal error.
  • Type Checker: Correct wrong error message in inline assembly complaining about .slot or .offset` not valid when actually .length`` was used.
  • Type Checker: Disallow modifier declarations and definitions in interfaces.
  • Yul Optimizer: Fix a crash in LoadResolver, when keccak256 has particular non-identifier arguments.

We especially thank all the contributors that made this release possible:

Ahmed Ali, Alessandro Coglio, Alex Beregszaszi, Alexander Arlt, Andrew Lyndem, Basit Raza, benldrmn, Bhargava Shastry, CrimsonGlory, Daniel Kirchner, Harikrishnan Mulackal, hawkess, istareatscreens, John Adler, Kamil Śliwak, Leonardo Alt, Marenz, Midhun07, Nikita Stupin, Paul Razvan Berg, priyansh786, Sean Hawkes, soroosh-sdi, Sreekesh V, yatharthagoenka

If you want to perform a source build, please only use solidity_0.8.8.tar.gz and not the zip provided by github directly.

e28d00a
Compare
Choose a tag to compare

Solidity v0.8.7 introduces support for the London upgrade, includes
various improvements to Yul to EVM code transformation, the SMTChecker and some bugfixes.

For more details, see the release announcement.

Language Features:

  • Introduce global block.basefee for retrieving the base fee of the current block.
  • Yul: Introduce builtin basefee() for retrieving the base fee of the current block.

Compiler Features:

  • AssemblyStack: Also run opcode-based optimizer when compiling Yul code.
  • Commandline Interface: option --pretty-json works also with --standard--json.
  • EVM: Set the default EVM version to "London".
  • SMTChecker: Do not check underflow and overflow by default.
  • SMTChecker: Unproved targets are hidden by default, and the SMTChecker only states how many unproved targets there are. They can be listed using the command line option --model-checker-show-unproved or the JSON option settings.modelChecker.showUnproved.
  • SMTChecker: new setting to enable/disable encoding of division and modulo with slack variables. The command line option is --model-checker-div-mod-slacks and the JSON option is settings.modelChecker.divModWithSlacks.
  • Yul EVM Code Transform: Also pop unused argument slots for functions without return variables (under the same restrictions as for functions with return variables).
  • Yul EVM Code Transform: Do not reuse stack slots that immediately become unreachable.
  • Yul Optimizer: Move function arguments and return variables to memory with the experimental Stack Limit Evader (which is not enabled by default).

Bugfixes:

  • Code Generator: Fix crash when passing an empty string literal to bytes.concat().
  • Code Generator: Fix internal compiler error when calling functions bound to calldata structs and arrays.
  • Code Generator: Fix internal compiler error when passing a 32-byte hex literal or a zero literal to bytes.concat() by disallowing such literals.
  • Commandline Interface: Apply --optimizer-runs option in assembly / yul mode.
  • Commandline Interface: Fix crash when a directory path is passed to --standard-json.
  • Commandline Interface: Read JSON from standard input when --standard-json gets - as a file name.
  • Standard JSON: Include source location for errors in files with empty name.
  • Type Checker: Fix internal error and prevent static calls to unimplemented modifiers.
  • Yul Code Generator: Fix internal compiler error when using a long literal with bitwise negation.
  • Yul Code Generator: Fix source location references for calls to builtin functions.
  • Yul Parser: Fix source location references for if statements.

We especially thank all the contributors that made this release possible:

Alex Beregszaszi, Alexander Arlt, Amid Moeinzadeh, Bhargava Shastry, Christian Parpart, CrimsonGlory, Daniel Kirchner, GuLiPing-Hz, Harikrishnan Mulackal, Josué, Kamil Śliwak, Ladislav Sladecek, Leo Alt, Mathias Baumann, Simon Tian, Tony, chriseth, franzihei, iskanderandrews, jaa2, qedk and t11s.

If you want to perform a source build, please only use solidity_0.8.7.tar.gz and not the zip provided by github directly.

11564f7
Compare
Choose a tag to compare

Solidity 0.8.6 fixes some non-critical but annoying bugs, especially a warning about unreachable code that
is in fact reachable.

For more details, please see the release announcement.

Language Features:

  • Yul: Special meaning of ".metadata" data object in Yul object.

Bugfixes:

  • Control Flow Graph: Fix incorrectly reported unreachable code.
  • Solc-Js: When running solcjs without the --optimize flag, use settings.optimizer.enabled=false in Standard JSON instead of omitting the key.
  • Standard JSON: Omitting settings.optimizer.enabled was not equivalent to setting it to false. It meant disabling also the peephole optimizer and jumpdest remover which by default still run with enabled=false.

We especially thank all the contributors that made this release possible:
Alex Beregszaszi, Allegheny Crypto, axeldelamarre, Djordje Mijovic, hrkrshnn, jgoodall628, Kamil Śliwak, Leonardo, Mathias Baumann, patekuru, QQ喵, TaldenV

If you want to perform a source build, please only use solidity_0.8.6.tar.gz and not the zip provided by github directly.

a4f2e59
Compare
Choose a tag to compare

Solidity 0.8.5 allows conversions from bytes to bytesNN values, adds the verbatim builtin function to inject
arbitrary bytecode in Yul and fixes several smaller bugs.

For more details, please see the release announcement.

Language Features:

  • Allowing conversion from bytes and bytes slices to bytes1/.../bytes32.
  • Yul: Add verbatim builtin function to inject arbitrary bytecode.

Compiler Features:

  • Code Generator: Insert helper functions for panic codes instead of inlining unconditionally. This can reduce costs if many panics (checks) are inserted, but can increase costs where few panics are used.
  • EVM: Set the default EVM version to "Berlin".
  • SMTChecker: Function definitions can be annotated with the custom Natspec tag custom:smtchecker abstract-function-nondet to be abstracted by a nondeterministic value when called.
  • Standard JSON / combined JSON: New artifact "functionDebugData" that contains bytecode offsets of entry points of functions and potentially more information in the future.
  • Yul Optimizer: Evaluate keccak256(a, c), when the value at memory location a is known at compile time and c is a constant <= 32.

Bugfixes:

  • AST: Do not output value of Yul literal if it is not a valid UTF-8 string.
  • Code Generator: Fix internal error when function arrays are assigned to storage variables and the function types can be implicitly converted but are not identical.
  • Code Generator: Fix internal error when super would have to skip an unimplemented function in the virtual resolution order.
  • Control Flow Graph: Assume unimplemented modifiers use a placeholder.
  • Control Flow Graph: Take internal calls to functions that always revert into account for reporting unused or unassigned variables.
  • Function Call Graph: Fix internal error connected with circular constant references.
  • Name Resolver: Do not issue shadowing warning if the shadowing name is not directly accessible.
  • Natspec: Allow multiple @return tags on public state variable documentation.
  • SMTChecker: Fix internal error on conversion from bytes to fixed bytes.
  • SMTChecker: Fix internal error on external calls from the constructor.
  • SMTChecker: Fix internal error on struct constructor with fixed bytes member initialized with string literal.
  • Source Locations: Properly set source location of scoped blocks.
  • Standard JSON: Properly allow the inliner setting under settings.optimizer.details.
  • Type Checker: Fix internal compiler error related to having mapping types in constructor parameter for abstract contracts.
  • Type Checker: Fix internal compiler error when attempting to use an invalid external function type on pre-byzantium EVMs.
  • Type Checker: Fix internal compiler error when overriding receive ether function with one having different parameters during inheritance.
  • Type Checker: Make errors about (nested) mapping type in event or error parameter into fatal type errors.
  • Type Checker: Fix internal compiler error when overriding an implemented modifier with an unimplemented one.

AST Changes:

  • Add member hexValue for Yul string and hex literals.

We especially thank all the contributors that made this release possible:
a3d4, Alex Beregszaszi, Alexander Arlt, Anurag Dashputre, Bhargava Shastry, Christian Parpart, cxxboy, Daniel Kirchner, Đorđe Mijović, Franziska Heintel, Harikrishnan Mulackal, Kamil Śliwak, Keqi Huang, Leonardo Alt, Martin Blicha, Mathias Baumann, Maurelian, newbateni, Raphael Roullet, TerranCivilian, Wade Dorrell, William Entriken.

If you want to perform a source build, please only use solidity_0.8.5.tar.gz and not the zip provided by github directly.

c7e474f
Compare
Choose a tag to compare

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 of bytes and bytesNN arguments which behaves as a restricted version of abi.encodePacked with a more descriptive name.
  • Support custom errors via the error keyword and introduce the revert 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 accepts outOfBounds.
  • 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 field documentation.
  • SMTChecker: Deprecate pragma experimental SMTChecker; and set default model checker engine to none.
  • 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 accepts outOfBounds.
  • 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 of ModifierInvocation for base constructor calls.
  • Commandline interface: Fix internal error when printing AST and using --base-path or file:// 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.

8d00100
Compare
Choose a tag to compare

Solidity 0.8.3 is a bugfix release that fixes an important bug about how the optimizer handles the Keccak256 opcode.
For details on the bug, please see the bug blog post.

For a detailed explanation of the new features and changes, please see the release blog post.

Important Bugfixes:

  • Optimizer: Fix bug on incorrect caching of Keccak-256 hashes.

Compiler Features:

  • Command Line Interface: Drop experimental support for --machine evm15.
  • Optimizer: Try to move and with constant inside or to improve storage writes of small types.
  • Optimizer: Replace multiplications and divisions with powers of two by shifts.

Bugfixes:

  • AST Import: For constructors, a public visibility is ignored during importing.
  • Error Reporter: Fix handling of carriage return.
  • SMTChecker: Fix internal error in BMC on resolving virtual functions inside branches.
  • SMTChecker: Fix internal error on array.pop nested inside 1-tuple.
  • SMTChecker: Fix internal error on FixedBytes constant initialized with string literal.
  • SMTChecker: Fix internal error on array slices.
  • SMTChecker: Fix internal error on calling public getter on a state variable of type array (possibly nested) of structs.
  • SMTChecker: Fix internal error on pushing to string casted to bytes.
  • SMTChecker: Fix bug in virtual functions called by constructors.

AST Changes:

  • ModifierInvocation: Add kind field which can be modifierInvocation or baseConstructorSpecifier.

We especially thank all the contributors that made this release possible:
Alex Beregszaszi, Alexander Arlt, Bhargava Shastry, Daniel Kirchner, Djordje Mijovic, ghidello, Harikrishnan Mulackal, Kamil Śliwak, Leonardo Alt, Martin Blicha, Mathias Baumann.

If you want to perform a source build, please only use solidity_0.8.3.tar.gz and not the zip provided by github directly.

661d110
Compare
Choose a tag to compare

Solidity 0.8.2 adds an optimizer stage that can inline small amounts of code to save gas and
provides more means to work with code documentation by exporting inline comments
and allowing custom natspec tags.

For a detailed explanation of the new features and changes, please see the blog post.

Compiler Features:

  • AST: Export NatSpec comments above each statement as their documentation.
  • Inline Assembly: Do not warn anymore about variables or functions being shadowed by EVM opcodes.
  • NatSpec: Allow and export all tags that start with @custom:.
  • NatSpec: Provide source locations for parsing errors.
  • Optimizer: Simple inlining when jumping to small blocks that jump again after a few side-effect free opcodes.

Bugfixes:

  • AST: Added referencedDeclaration for enum members.
  • Code Generator: Fix internal error when functions are passed as parameters of other callables, when the function types can be implicitly converted, but not identical.
  • Parser: Properly parse .address in some situations.
  • SMTChecker: Fix missing type constraints on block and transaction variables in the deployment phase.
  • Type Checker: Fix internal error when override specifier is not a contract.
  • Type Checker: Make function-hash collision errors into fatal type errors.

AST Changes:

  • Adds nameLocation to declarations to represent the exact location of the symbolic name.
  • Removed the redundant function type "bytearraypush" - replaced by "arraypush".
  • Support field documentation to hold NatSpec comments above each statement.

We especially thank all the contributors that made this release possible:
Alex Beregszaszi, Alexander Arlt, Bhargava Shastry, Christian Parpart, Daniel Kirchner, dms-yondy, Đorđe Mijović, DragonDev1906, Franziska Heintel, Harikrishnan Mulackal, Kamil Śliwak, Leonardo Alt, Martin Blicha, Mathias Baumann, Mikko Ohtamaa, nora, Rostyslav,
Sanad, ssi91