26 Oct 2026, Mon

Solidity v0.8.37 Released with Critical Bug Fixes, Amsterdam EVM Support, and Experimental Compiler Improvements

The Solidity development team has officially announced the release of Solidity v0.8.37, a comprehensive update that primarily focuses on addressing critical security bugfixes, miscompilation issues, and introducing experimental optimizations alongside early support for upcoming Ethereum Virtual Machine (EVM) upgrades.

This latest release delivers three major bugfixes—two rated with low-to-medium severity and one very low—alongside critical corrections for two smaller non-security miscompilations. Beyond patching security vulnerabilities, Solidity v0.8.37 brings a new planning-based stack shuffler to the experimental SSA CFG code generator, incorporates support for the new SLOTNUM opcode introduced in the Amsterdam EVM specification, removes several outdated experimental features, and introduces deprecation warnings for functionalities slated for complete removal in future versions.

Important Bugfixes and Security Vulnerabilities Addressed

Solidity v0.8.37 introduces crucial patches for vulnerabilities discovered through the Ethereum Foundation’s bug bounty program, highlighting the ongoing collaborative effort between core developers and independent security researchers to harden the smart contract ecosystem.

Memory Byte Array Element Delete Clears 32 Bytes

One of the most critical vulnerabilities addressed in this release affects the legacy evmasm compilation pipeline when utilizing the delete operator on elements of a bytes array stored in memory. Historically, when developers applied delete to an individual element of a memory bytes array, the compiler inadvertently wrote 32 zero bytes starting directly at that element instead of appropriately clearing only the single byte in question.

This unintended behavior resulted in extra zero bytes overwriting up to 31 subsequent bytes following the targeted element. Depending on memory allocation patterns, these overwritten bytes could belong to later elements within the exact same array or, if the deleted element happened to reside near the termination of the array, to whatever arbitrary data happened to be allocated immediately after it. This issue similarly impacted string values that had been explicitly converted into bytes.

Crucially, the IR (Intermediate Representation) pipeline remains entirely unaffected by this bug. Furthermore, the analogous assignment operation b[i] = 0 was verified to clear precisely one single byte across both compilation pipelines. Versions of Solidity up to and including v0.8.36 are impacted by this issue.

The vulnerability was responsibly identified and reported by developer shaheenfazim through the Ethereum Foundation bug bounty program. Comprehensive technical documentation regarding the mechanics of this vulnerability has been published in a dedicated security write-up by the Solidity team.

Spill Slot Collision Across Mutual Recursion

The second notable security fix targets the IR pipeline’s stack-to-memory mover, a mechanism designed to circumvent the EVM’s strict stack depth limit by relocating localized variables to fixed memory offsets known as spill slots.

Under specific, complex call graph configurations involving mutual recursion, the compiler previously reserved an insufficient number of spill slots. Consequently, variables belonging to two completely distinct functions could be assigned to the exact same memory slot even when both variables remained simultaneously live during execution. This overlap meant that one variable could be silently overwritten by another, introducing unpredictable runtime corruption.

While closely related, this bug is distinct from the unsound spill issue in mutual recursion that was previously patched in version v0.8.36. Solidity versions 0.7.2 through 0.8.36 are susceptible to this flaw when compiled using the --via-ir command-line flag.

The issue was discovered and reported by Ng Sze Hon via the Ethereum Foundation’s bug bounty program, accompanied by an in-depth technical analysis detailing the conditions under which mutual recursion can trigger stack spill collisions.

Misordered Named Parameters in require with Custom Errors

The third security-related fix resolves an ordering bug within the IR pipeline concerning custom errors constructed with named arguments and subsequently passed directly into a require statement—for example, constructs resembling require(condition, MyError(b: 2, a: 1)).

Under affected versions, the arguments supplied to the custom error were incorrectly placed onto the stack in the exact call-site order rather than adhering to their proper declaration order within the error definition. During subsequent ABI encoding, these parameters could be incorrectly matched against unexpected fields, causing them to be misinterpreted as values of completely different types. Although the encoder successfully generated a structurally valid payload matching the target error signature, the payload failed to accurately reflect the actual values utilized to instantiate the error.

Plain revert MyError(...) statements and other language features supporting named parameters remain entirely unaffected. Because this anomaly only impacts the revert data of transactions that are already actively reverting, it has zero impact on valid contract state transitions or successful execution paths.

The bug was brought to light by security researcher Carl from Cantina Security through the Ethereum Foundation bug bounty program, complete with an official advisory write-up.

Other Miscompilations

In addition to the primary security fixes, Solidity v0.8.37 resolves two minor miscompilation issues that do not directly constitute security vulnerabilities but nonetheless required correction.

The first fix addresses an issue within the evmasm pipeline where reading an uninitialized internal function pointer from a packed storage slot produced erroneous values whenever a separate variable stored subsequently within the exact same slot held a non-zero value. Consequently, an equality comparison evaluating such an uninitialized pointer against a default-initialized local function pointer could evaluate to false, despite neither pointer ever having been assigned a valid target. This behavior exclusively impacts the evmasm pipeline and has no bearing on actual function execution calls made through valid pointers. Furthermore, comparing internal function pointers remains inherently fragile because their underlying numerical values depend strictly on exact bytecode layouts and are explicitly unstable across contract upgrades. The compiler already emits warnings for such comparisons and intends to prohibit them entirely in future breaking releases.

The second fix resolves an issue in the IR pipeline involving constants read in both checked and unchecked arithmetic contexts. Previously, the code responsible for computing a constant’s value was generated exactly once per contract utilizing either checked or unchecked arithmetic, depending entirely on which usage site happened to be generated first by the compiler. Every subsequent usage site reused this initial implementation. For constants whose initializers overflowed their designated types, reading the constant inside a checked context could improperly bypass the required overflow panic, whereas reading it inside an unchecked block could trigger a spurious revert. Because all operands involved in these constant evaluations are established at compile-time, the resulting behavior is completely deterministic and independent of transaction inputs or external manipulation.

Notable Features and Changes

Solidity v0.8.37 introduces several forward-looking compiler modifications, experimental optimizations, and cleanup initiatives aimed at reducing technical debt.

SSA CFG Planning Stack Shuffler (Experimental)

The experimental SSA CFG code generator, which precomputes explicit stack layouts for every instruction point in a program, has received a major architectural upgrade. Previously, the underlying stack shuffler operated via a greedy algorithm, executing individual local steps iteratively until the desired target layout was achieved.

The v0.8.37 release replaces this greedy approach with an advanced planning shuffler. The new mechanism first calculates an explicit plan mapping current stack items to their respective target positions before realizing the plan in a bottom-up fashion. If the shuffler encounters a scenario where an item remains unreachable via standard SWAP or DUP instructions, it compresses the stack to guarantee reachability and recalculates a fresh plan. Preliminary benchmarking indicates that this structured approach is computationally more efficient than its predecessor while maintaining comparable bytecode output sizes. The SSA CFG code generator remains experimental and requires explicit activation via --experimental --via-ssa-cfg.

Support for the SLOTNUM Opcode

Aligning with upcoming Ethereum network upgrades, this release adds comprehensive support for the SLOTNUM opcode introduced via EIP-7843 for the Amsterdam EVM version. Solidity now exposes this functionality natively via block.slotnum as a uint64 data type, while Yul and inline assembly environments gain access through the built-in slotnum() function. The built-in SMTChecker has likewise been updated to support this new block property. Developers can utilize block.slotnum and slotnum() exclusively when compiling with the --evm-version amsterdam flag. This integration represents another incremental step toward full Amsterdam EVM compatibility, and from this version onward, slotnum is treated as a reserved identifier within Yul.

Removals and Deprecations

As part of ongoing codebase maintenance, several legacy features have been permanently removed. The Language Server Protocol mode (--lsp) and the Generic Solidity prototype (pragma experimental solidity), both of which were restricted to experimental status in version v0.8.35, have been completely purged from the codebase. The LSP integration was unfinished and unmaintained, reinforcing the core team’s philosophy that language tooling should remain modular and standalone rather than tightly coupled directly inside the compiler binary. Similarly, Generic Solidity has been entirely deprecated in favor of solcore, a standalone experimental codebase better suited for researching future language iterations.

Additionally, the experimental ABIEncoderV2 pragma now emits a formal deprecation warning. This pragma has been completely redundant since pragma abicoder v2 debuted in version v0.7.4 and became the permanent default in v0.8.0. Although many older projects and legacy dependencies still incorporate it, the deprecation warning provides developers adequate opportunity to clean up their codebases ahead of future removal.

Continuing the deprecation timeline initiated in version v0.8.31, Solidity v0.8.37 introduces formal deprecation warnings for several aging EVM versions—namely constantinople, petersburg, istanbul, and berlin—as well as for the SMTChecker’s legacy BMC engine.

How to Install and Upgrade

Developers seeking to update their workflows to Solidity v0.8.37 can access comprehensive instructions through the official Solidity documentation portal. Binary releases and release notes are publicly available via the project’s official GitHub repository under release tag v0.8.37.

Developers building the compiler directly from source are strongly advised to avoid utilizing the generic source archives automatically generated by GitHub. Instead, builds should rely exclusively on the officially provided solidity_0.8.37.tar.gz source tarball or by checking out the explicit v0.8.37 git tag to ensure build integrity.