The development team behind Solidity, the leading smart contract programming language for the Ethereum ecosystem, has officially announced the release of Solidity v0.8.37. Primarily structured as a maintenance and bug-fixing release, version 0.8.37 addresses several crucial security vulnerabilities and compiler miscompilations discovered in earlier iterations. Alongside these essential patches, the new release introduces experimental optimizations to the SSA CFG code generator, integrates support for the upcoming Amsterdam EVM upgrade, and deprecates legacy features to streamline the compiler codebase.
As
smart contracts continue to secure billions of dollars in decentralized finance (DeFi) protocols, continuous improvements to compiler safety and predictability remain paramount. Solidity v0.8.37 delivers targeted fixes across both the legacy evmasm pipeline and the modern Intermediate Representation (IR) pipeline, reinforcing the language’s security posture.
Important Bug Fixes
Among the security updates included in v0.8.37, three critical bug fixes stand out, addressing issues across different compilation pipelines and language constructs.
The most prominent security patch addresses a memory byte array element deletion bug. When the delete operator was previously applied to an element within a bytes array allocated in memory, the evmasm pipeline incorrectly wrote 32 zero bytes starting at that element, rather than clearing only the targeted single byte. This behavior resulted in extra zero bytes overwriting up to 31 subsequent bytes. Depending on the array layout, these overwritten bytes could belong to later elements within the same array or, if the element resided near the end of the allocation, to whatever data happened to reside immediately afterward in memory. This issue similarly affected string values that had been converted into bytes.
Crucially, the IR compilation pipeline was unaffected by this behavior, and direct assignments such as b[i] = 0 correctly cleared only a single byte across both compilation pipelines. However, versions up to and including v0.8.36 remained vulnerable under the legacy pipeline. This vulnerability was responsibly disclosed by community researcher shaheenfazim via the Ethereum Foundation’s bug bounty program.
A second critical fix addresses a spill slot collision occurring across mutual recursion patterns. The stack-to-memory mover within the IR pipeline utilizes spill slots—fixed memory offsets—to relocate local variables and work around the Ethereum Virtual Machine’s strict stack depth limitations. In specific call graph configurations involving mutual recursion, the compiler reserved too few spill slots. As a result, variables belonging to two separate functions could be assigned identical memory slots even when both functions were simultaneously live. This led to one variable being silently overwritten by another.
This bug shares similarities with an earlier unsound spill issue in mutual recursion fixed in version 0.8.36, but represents a distinct mechanism. Versions 0.7.2 through 0.8.36 are affected when compiling with the --via-ir flag enabled. This flaw was reported by Ng Sze Hon through the Ethereum Foundation bug bounty program.
The third security-related bug fix concerns misordered named parameters in require statements utilizing custom errors. When developers constructed custom errors using named arguments inside a require condition—such as require(condition, MyError(b: 2, a: 1))—the IR pipeline incorrectly placed the arguments onto the execution stack in the order they were written at the call site rather than following the parameter declaration order defined in the error signature. During ABI encoding, these misordered arguments were matched with incorrect parameter types, causing them to be misinterpreted as entirely different data types.
While the encoder generated a structurally valid payload matching the target error signature, the resulting data failed to reflect the actual values instantiated by the developer. Because this flaw only affected the revert data of transactions that were already failing, contract state was left unharmed, and plain revert MyError(...) statements were completely unaffected. This issue was brought to light by security researcher Carl from Cantina Security through the Ethereum Foundation bug bounty program.
Other Miscompilations
Solidity v0.8.37 also resolves two minor miscompilation issues that do not fall under traditional security vulnerabilities but nonetheless impact compilation correctness under narrow conditions.
The first involves uninitialized function pointers residing in packed storage. In the legacy evmasm pipeline, reading an uninitialized internal function pointer from a packed storage slot produced an incorrect value whenever a subsequently stored variable within the same slot held a non-zero value. Consequently, comparing such an uninitialized pointer against a default-initialized local function pointer could evaluate to false, even though neither pointer had ever been assigned a value.
This bug was restricted exclusively to the evmasm pipeline and did not affect actual function calls executed through those pointers. It manifested only when packed pointers were compared prior to any assignment—a programming practice that is already discouraged and flagged by existing compiler warnings due to the inherent instability of internal function pointer values across contract updates.
The second miscompilation involves constants evaluated within both checked and unchecked contexts. In the IR pipeline, the computational logic for a constant was previously generated once per contract, utilizing either checked or unchecked arithmetic based entirely on whichever use site the compiler encountered first. All subsequent use sites reused this initial evaluation code. For constants whose initializers overflowed their designated types, reads occurring within a checked context could fail to trigger the required overflow panic, while reads inside an unchecked block could incorrectly revert due to a spurious panic.
Because all operands involved in evaluating these constants are determined at compile time, the resulting behavior was entirely deterministic and isolated from external transaction inputs. Exploiting this issue would require relying intentionally on constants that either always revert or behave unexpectedly outside of unchecked scopes. Realistically, the bug typically surfaces as an oversight in projects with insufficient test coverage, easily discoverable during standard unit testing.
Notable Features and Changes
Beyond bug fixes, the new release introduces significant enhancements to experimental tooling, blockchain integration, and codebase cleanup.
The experimental SSA CFG code generator receives a major upgrade with the introduction of a planning stack shuffler. Previously, the code generator relied on a greedy algorithm to manipulate the stack via SWAP, DUP, POP, and PUSH instructions, making local adjustments one step at a time until the desired layout was reached. Version 0.8.37 replaces this greedy approach with a planning shuffler. The new mechanism constructs an explicit plan mapping current stack items to their target positions, executing the transformation bottom-up. When items fall out of reach for basic stack operations, the shuffler compresses the stack and recalculates a fresh plan. Benchmarks indicate that this structured methodology is computationally more efficient while maintaining comparable bytecode sizes. The SSA CFG generator remains experimental and can be enabled using the --experimental --via-ssa-cfg compilation flags.
In preparation for upcoming protocol upgrades, Solidity v0.8.37 adds native support for the SLOTNUM opcode introduced in the Amsterdam EVM version, as detailed in EIP-7843. Developers can now access the beacon chain slot number of the current block via block.slotnum (typed as uint64) within Solidity code, or through the slotnum() builtin in Yul and inline assembly. The SMTChecker has also been updated to support this new property. These features require compiling with --evm-version amsterdam. Additionally, slotnum becomes a reserved identifier within Yul starting with the Amsterdam specification.
Removals and Deprecations
As part of ongoing efforts to maintain a lean and sustainable codebase, version 0.8.37 removes two experimental features previously restricted in version 0.8.35: the Language Server Protocol mode (--lsp) and the Generic Solidity prototype (pragma experimental solidity). The LSP integration was incomplete and unmaintained; future language server tooling will be developed as a standalone architecture rather than being tightly bound to the compiler core. Similarly, Generic Solidity—an early prototype aimed at refactoring the compiler in place—has been permanently retired in favor of solcore, an external experimental framework better suited for future language iterations.
Furthermore, the experimental ABIEncoderV2 pragma now triggers a formal deprecation warning. Since the introduction of pragma abicoder v2 in version 0.7.4 and its adoption as the default standard in version 0.8.0, the old pragma has remained redundant. Giving projects advance warning before its eventual removal allows developers and dependency managers sufficient time to clean up legacy references.
Finally, continuing deprecation trajectories initiated in version 0.8.31, this release issues deprecation warnings for older EVM versions including constantinople, petersburg, istanbul, and berlin, alongside the SMTChecker’s Bounded Model Checking (BMC) engine.
Upgrades to Solidity v0.8.37 can be performed by following the standard installation pathways detailed in the official documentation, with official binary packages available directly via the project’s GitHub repository.

