Solidity, the Smart Contract Programming Language
Introducing the newest version of the Solidity Compiler!
We are excited to announce the release of the Solidity Compiler Solidity v0.8.25. This release is a small one, and is mainly centered around the Dencun hard-fork that occurred yesterday. On that note, the default EVM version in the compiler is now cancun
, and we've also introduced some gas savings via better exploitation of the MCOPY
opcode, as well fixing an issue that could result in larger than necessary bytecode.
MCOPY
instead of MLOAD
/MSTORE
loop when copying byte arrays.cancun
.tstore
.--via-ir
is used but no output that depends on the IR is requested.--model-checker-solvers eld
, even when it is present on the system.We especially thank all the contributors that made this release possible: Aditya Kode, Alexander Arlt, Bhargava Shastry, ByeongSu Go, Chomtana, Cyrus, Daniel Kirchner, Dimitris Apostolou, Jeason, Kamil Śliwak, Martin Blicha, Matheus Aguiar, Nikola Matić, Saw-mon & Natalie, Simon Perriard, Twice, Vishwa Mehta, Vojtch, minaminao, omahs, pgebal, r0qs, racerol
UPDATE 2024-03-14: The MacOS universal binary originally included here has been rebuilt and replaced due to a missing signature which made it unusable.
The SHA-256 hash of the old binary was ce09577e654628c2b4d00e66bcab7c8a4dc18c1d9812dcbab7bd8572a6d4d27e
. The new one is cc3f94a70ac681b0304084acc1980aabe2a1bb3240d44ce76a8df0e1e77a2110
.
Introducing the newest version of the Solidity Compiler!
We are excited to announce the release of the Solidity Compiler Solidity v0.8.24. This newest version of the compiler brings readiness for the "Cancun" network upgrade, including support for transient storage (EIP-1153), shard blob transactions (EIP-4844), & more. The release binaries for macOS are now also compatible with Apple Silicon chips.
block.blobbasefee
for retrieving the blob base fee of the current block.blobhash(uint)
for retrieving versioned hashes of blobs, akin to the homonymous Yul builtin.blobbasefee()
for retrieving the blob base fee of the current block.blobhash()
for retrieving versioned hashes of blobs associated with the transaction.mcopy()
for cheaply copying data between memory areas.tload()
and tstore()
for transient storage access.bytes.concat
except when string literals are passed as arguments.--asm-json
.let
variable declaration.We especially thank all the contributors that made this release possible: Alexander Arlt, Bhargava Shastry, Daniel Kirchner, GoodDaisy, Jitendra Kumar, Kamil Śliwak, Matheus Aguiar, Nikola Matić, Qi He, Sukey, Vishwa Mehta, pgebal, r0qs, xiaolou86.
Introducing the newest version of the Solidity Compiler! We are excited to announce the latest release of the Solidity Compiler, Solidity v0.8.23.
Important Bugfixes:
verbatim
instructions to be treated as equivalent and thus collapsed into a single one.Compiler Features:
--yul-optimizations
sequence can now be always provided.optimizerSteps
sequence can now always be provided.We especially thank all the contributors that made this release possible: Daniel Kirchner, Kamil Śliwak, Markus Osterlund / robriks, Matheus Aguiar, Nikola Matić, Nuzair
Introducing the newest version of the Solidity Compiler! We are excited to announce the latest release of the Solidity Compiler, Solidity v0.8.22.
IMPORTANT NOTE: This release deprecates support for EVM versions older than Constantinople for the reason of ruling out the need to maintain multiple complex code paths or workarounds for ancient EVM versions. In case you rely on the support for such EVM versions, please reach out to us.
Notable Features:
Language Features:
Compiler Features:
for
loops when the counter variable cannot overflow.--no-import-callback
option that prevents the compiler from loading source files not given explicitly on the CLI or in Standard JSON input.--import-asm-json
option that can import EVM assembly in the format used by --asm-json
.--error-recovery
/ settings.parserErrorRecovery
).PUSH0
is supported, favor zero literals over storing zero values in variables.Rematerializer
and UnusedPruner
steps at the end of the default clean-up sequence.Bugfixes:
userdoc
or devdoc
for a contract that emits an event defined in a foreign contract or interface.while
or for
loops are unrolled before the condition check.AST Changes:
We especially thank all the contributors that made this release possible: Alejandro Criado-Pérez, Alexander Arlt, Bhargava Shastry, Daniel, Jun Zhang, Kamil Śliwak, Leo, Martin Blicha, Matheus Aguiar, Nikola Matić, Paul Wackerow, Pawel Gebal, Saw-mon & Natalie, Zach Obront, franzihei, omahs, pgebal, r0qs, shalaamum
Introducing the newest version of the Solidity Compiler! We are excited to announce the latest release of the Solidity Compiler, Solidity v0.8.21.
Important Bugfixes:
<expression>.selector
in the legacy code generation pipeline.FullInliner
step (i
) not preserving the evaluation order of arguments passed into inlined functions in code that is not in expression-split form (i.e. when using a custom optimizer sequence in which the step not preceded by ExpressionSplitter
(x
)).Language Features:
Compiler Features:
--ast-compact-json
output in assembler mode.--ir-ast-json
and --ir-optimized-ast-json
outputs for Solidity input, providing AST in compact JSON format for IR and optimized IR.--optimize-yul
and --no-optimize-yul
in compiler mode and accept them in assembler mode as well. --optimize --no-optimize-yul
combination now allows enabling EVM assembly optimizer without enabling Yul optimizer.pragma experimental solidity
, which will enable an experimental language mode that, in particular, has no stability guarantees between non-breaking releases and is not suited for production use.--model-checker-print-query
CLI option and settings.modelChecker.printQuery
JSON option to output the SMTChecker queries in the SMTLIB2 format. This requires using smtlib2
solver only.ast
file-level output for Yul input.irAst
and irOptimizedAst
contract-level outputs for Solidity input, providing AST in compact JSON format for IR and optimized IR.ReasoningBasedSimplifier
optimization step.Bugfixes:
--stop-after parsing
and requesting some of the outputs that require full analysis or compilation.--optimize-yul
and --no-optimize-yul
at the same time.if
and ternary conditional
statements in the BMC engine.FullInliner
step not ignoring code that is not in expression-split form.AST Changes:
experimentalSolidity
field to the SourceUnit
nodes, which indicates whether the experimental parsing mode has been enabled via pragma experimental solidity
.We especially thank all the contributors that made this release possible:
Alejandro Criado-Pérez, Alexander Arlt, Alexandre Ferreira, Bhargava Shastry, Cliff Syner, Daniel Kirchner, David Bar-On, GiokaMarkella, Jun Zhang, Kaan Uzdoğan, Kamil Śliwak, Leo Alt, Martin Blicha, Matheus Aguiar, Nikola Matić, Nuno Santos, Paul Wackerow, Pawel Gebal, johnnygee19, minaminao, r0qs
Introducing the newest version of the Solidity Compiler! We are excited to announce the latest release of the Solidity Compiler, Solidity v0.8.20. This latest version includes a range of improvements and, most importantly, support for Shanghai! It also contains performance improvements in the via-IR pipeline and improves the list of events exposed in the contract ABI.
IMPORTANT NOTE: This compiler switches the default target EVM version to Shanghai, which means that the generated bytecode will include PUSH0
opcodes. Be sure to select the appropriate EVM version in case you intend to deploy on a chain other than mainnet like L2 chains that may not yet support PUSH0
, otherwise deployment of your contracts will fail.
Compiler Features:
push0
for placing 0
on the stack for EVM versions starting from "Shanghai". This decreases the deployment and runtime costs.enum
definitions.struct
definitions.UnusedAssignEliminator
and UnusedStoreEliminator
. It can correctly remove some unused assignments in deeply nested loops that were ignored by the old version.--model-checker-show-unsupported
and the JSON option settings.modelChecker.showUnsupported
can be enabled to show the full list.--model-checker-show-proved-safe
and the JSON option settings.modelChecker.showProvedSafe
can be enabled to show the full list of safe properties.push0
instead of codesize
to produce an arbitrary value on stack in order to create equal stack heights between branches.Bugfixes:
AST Changes:
internalFunctionIDs
field to the AST nodes of contracts containing IDs of functions that may be called via the internal dispatch. The field is a map from function AST IDs to internal dispatch function IDs. These IDs are always generated, but they are only used in via-IR code generation.usedEvents
field to ContractDefinition
which contains the AST IDs of all events emitted by the contract as well as all events defined and inherited by the contract.We especially thank all the contributors that made this release possible:
Alexander Arlt, Alex Beregszaszi, Bhargava Shastry, chriseth, Christian Parpart, Daniel Kirchner, Francois-Rene Rideau, hrkrshnn, Kaan Uzdoğan, Kamil Śliwak, Leo Alt, Matheus Aguiar, Michael de Hoog, minaminao, mmqxyz, Nikola Matic, Nuno Santos, Ojas Aklecha, Peter Lemenkov, Rodrigo Q. Saramago, uji, Vaibhaw
If you want to perform a source build, please only use solidity_0.8.20.tar.gz
and not the source archives generated automatically by GitHub.
Introducing the newest version of the Solidity Compiler! We are excited to announce the latest release of the Solidity Compiler, Solidity v0.8.19. This latest version includes a range of improvements and, most importantly, custom operators for user-defined value types language feature! It also contains a fix for a long-standing bug that can result in code that is only used in creation code to also be included in runtime bytecode.
Language Features:
using {f as +} for T global
syntax.Compiler Features:
--model-checker-ext-calls trusted
or the JSON field settings.modelChecker.extCalls: "trusted"
.Bugfixes:
z3
expressions that come from the solver when bitwise operators are used.using for
.AST Changes:
function
field to UnaryOperation
and BinaryOperation
AST nodes. functionList
in UsingForDirective
AST nodes will now contain operator
and definition
members instead of function
when the list entry defines an operator.We especially thank all the contributors that made this release possible:
Bhargava Shastry, Daniel Kirchner, Evan Saulpaugh, Jacob Heider, Kamil Śliwak, Leo Alt, Matheus Aguiar, Michał Janiszewski, Nicolás Acosta, Nikola Matić, Nuno Santos, Pawel Gebal, Peter Lemenkov, Rodrigo Q. Saramago, William Entriken, Zachinquarantine, chriseth, drblessing, minaminao, wechman
If you want to perform a source build, please only use solidity_0.8.19.tar.gz
and not the source archives generated automatically by GitHub.
Introducing the newest version of the Solidity Compiler! We are excited to announce the latest release of the Solidity Compiler, Solidity v0.8.18. This latest version includes a range of improvements and it also introduces support for the Paris upgrade!
Language Features:
Compiler Features:
--no-cbor-metadata
that skips CBOR metadata from getting appended at the end of the bytecode.2
on uncaught exceptions.block.difficulty
and disallow difficulty()
in inline assembly for EVM versions >= paris. The change is due to the renaming introduced by EIP-4399.block.prevrandao
in Solidity and prevrandao()
in inline assembly for EVM versions >= paris.and(shl(X, Y), shl(X, Z)) => shl(X, and(Y, Z))
.z3
the default solver for the BMC and CHC engines instead of all solvers.--model-checker-solvers eld
. The binary eld
must be available in the system.solidity-upgrade
tool.settings.metadata.appendCBOR
that skips CBOR metadata from getting appended at the end of the bytecode.selfdestruct
.:
) in the sequence string.keccak256
calls if the value was already calculated by a previous call and can be reused.Bugfixes:
indexed
attributes for the same event parameter.indexed
attribute for modifier parameters.using for
outside of their declaration scope.We especially thank all the contributors that made this release possible:
Alexander Arlt, Alex Beregszaszi, andy53, Anton Paymyshev, Bhargava Shastry, Big-Aaron, Bojidar00, Bulgantamir Gankhuyag, chriseth, Christian Parpart, ChrisXXXXXXX, Damian Wechman, Daniel Kirchner, Doggo, Duc Thanh Nguyen, Franco Victorio, Franziska Heintel, George Plotnikov, hrkrshnn, Ikko Ashimine, Ishtiaque Zahid, John Kane, Kaan Uzdoğan, Kamil Śliwak, Leo Alt, ligi, Lokesh Kumar, Matheus Aguiar, Mathias L. Baumann, Mike Leach, Miles Liu, Minebuu, Mio, Nathaniel Jensen, Nikola Matić, Nishant Sachdeva, Nuno Santos, omahs, Paweł Bylica, Phill, Pierre Grimaud, Prusakova Katya, Rafal Stozek, Rajkumar gaur, Rhythm Bansal, Riley, Rodrigo Q. Saramago, Sabnock, Saw-mon-and-Natalie, Sebastian Supreme, Soham Zemse, Vinay, vlad, William Entriken, Yusuf Benli
If you want to perform a source build, please only use solidity_0.8.18.tar.gz
and not the source archives generated automatically by GitHub.
UPDATE 2023-02-02: The Linux binary originally included here has been rebuilt and replaced due to incompatibility with older Ubuntu releases (Bionic, Focal and earlier). We have recently migrated our CI builds to Ubuntu 22.04, which includes a backwards-incompatible glibc version. Since the Linux binary is not completely static (it dynamically loads Z3 and consequently glibc), it would not run with older glibc when built against newer one. You can find more details in the release blog post and issue #13921.
To be clear: both binaries will produce identical outputs under all circumstances, including the commit hash in the metadata. Only the hash of the compiler binary itself will change due to the replacement, but the new binary will always produce byte-identical output.
The SHA-256 hash of the old binary was a1c0f33eb4482c26f56719ecf62b0ee05d7d7a4f8264ffbddf9ebcd9095c32bd
. The new one is
95e6ed4949a63ad89afb443ecba1fb8302dd2860ee5e9baace3e674a0f48aa77
.
This release primarily fixes an important bug, but also involves some improvements in code generation, optimizer and in the language server.
For details, please see the release announcement.
Important Bugfixes:
Compiler Features:
'file-load-strategy'
to 'directly-opened-and-on-import'
in LSP settings object).Bugfixes:
.slot
member of a mapping through a storage reference in inline assembly.Build System:
-DPEDANTIC=OFF
flag is passed to CMake.We especially thank all the contributors that made this release possible:
Alexander Arlt, Bhargava Shastry, Christian Parpart, Damian Wechman, Daniel Kirchner, Duc Thanh Nguyen, Emmanuel Oaikhenan, Francisco Giordano, Kamil Śliwak, krakxn, Leonardo Alt, Leonid Pospelov, Luke Hutchison, Luoh Ren-Shan, Matheus Aguiar, Mathias L. Baumann, MeetRajput00, Nikola Matić, NoFaceDev, Pranay, Roman Figurin, Taylor Ferran, Thanh Tran, Yuvraj Singh, aathan, emmaodia, khue, kuzdogan, minaminao, Nishant Sachdeva, tcoyvwac, xternet
If you want to perform a source build, please only use solidity_0.8.17.tar.gz
and not the zip provided by github directly.
This release fixes one important bug and contains further minor bug fixes and features.
For details, please see the release announcement.
Important Bugfixes:
Compiler Features:
mod(add(X, Y), A)
into addmod(X, Y, A)
, if A
is a power of two.mod(mul(X, Y), A)
into mulmod(X, Y, A)
, if A
is a power of two.Bugfixes:
--via-ir
,--metadata-literal
, --metadata-hash
, --model-checker-show-unproved
, --model-checker-div-mod-no-slacks
, --model-checker-engine
, --model-checker-invariants
, --model-checker-solvers
, --model-checker-timeout
, --model-checker-contracts
, --model-checker-targets
.abi.encodeCall
received a tuple expression instead of an inline tuple.abi.encodeCall
type checking of free function.We especially thank all the contributors that made this release possible:
a3d4, Aiman Baharna, Alex Beregszaszi, Bhargava Shastry, Christian Parpart, Christian Reitwiessner, CJ42, Damian Wechman, Daniel Kirchner, Daniel Lupu, Derek Gottfrid, Duc Thanh Nguyen, Femi Bolaji, Harikrishnan Mulackal, Ishtiaque Zahid, Kamil Śliwak, krakxn, Matheus Aguiar, Mathias L. Baumann, Maximiliano Schultheis, Midhun07, minami, Nikola Matić, Nishant Sachdeva, Quentin Garchery, Richie, Rodrigo Baraglia, Rohit Kumar Suman, Ryan, vdusart, victorknox, William Entriken, ywon0925
If you want to perform a source build, please only use solidity_0.8.16.tar.gz
and not the zip provided by github directly.