{"id":3221,"date":"2026-11-02T15:15:53","date_gmt":"2026-11-02T15:15:53","guid":{"rendered":"https:\/\/smartcryptosecurity.com\/?p=3221"},"modified":"2026-11-02T15:15:53","modified_gmt":"2026-11-02T15:15:53","slug":"solidity-v0-8-37-released-with-critical-bug-fixes-amsterdam-evm-support-and-experimental-compiler-updates","status":"publish","type":"post","link":"https:\/\/smartcryptosecurity.com\/?p=3221","title":{"rendered":"Solidity v0.8.37 Released with Critical Bug Fixes, Amsterdam EVM Support, and Experimental Compiler Updates"},"content":{"rendered":"<p>The Solidity development team has officially announced the release of Solidity v0.8.37, marking another important milestone for the leading Ethereum smart contract programming language. Primarily focused on maintaining compiler robustness and improving security, the latest release addresses three notable bug fixes, resolves several non-security miscompilations, introduces experimental enhancements to the code generator, and adds support for upcoming Ethereum Virtual Machine (EVM) developments. <\/p>\n<p>The update arrives as part of the core team&#8217;s continuous effort to refine the language toolchain, deprecate legacy features, and streamline the compiler codebase. Developers working across decentralized finance, enterprise protocols, and general Web3 infrastructure are encouraged to review the release notes and update their compilation pipelines accordingly.<\/p>\n<h2>Important Bugfixes<\/h2>\n<p>Solidity v0.8.37 includes three critical bug fixes identified in previous iterations of the compiler. These vulnerabilities were responsibly disclosed through the Ethereum Foundation&#8217;s bug bounty program, highlighting the ongoing collaboration between the core development team and independent security researchers.<\/p>\n<h3>Memory Byte Array Element Delete Clears 32 Bytes<\/h3>\n<p>The most severe security-related fix in the v0.8.37 release addresses a memory corruption vulnerability within the legacy <code>evmasm<\/code> pipeline. Previously, when the <code>delete<\/code> keyword was applied to an individual element of a <code>bytes<\/code> array stored in memory, the compiler incorrectly generated bytecode that wrote thirty-two zero bytes starting at the target element, rather than clearing only that single byte. <\/p>\n<p>As a result of this misbehavior, the extra zero bytes inadvertently overwrote up to thirty-one bytes immediately following the targeted element. Depending on the array&#8217;s layout and length, these overwritten bytes could affect subsequent elements within the same array or corrupt data allocated right after the array in memory. The issue also extended to <code>string<\/code> values that had been explicitly converted into <code>bytes<\/code>. <\/p>\n<p>Crucially, the modern IR (Intermediate Representation) pipeline remains completely unaffected by this bug, and the analogous assignment operation (<code>b[i] = 0<\/code>) correctly clears exactly one byte across both compilation pipelines. All Solidity versions up to and including v0.8.36 are impacted. The underlying issue was discovered and reported by security researcher shaheenfazim. A detailed technical write-up has been published to help developers audit their codebases for potential exposure.<\/p>\n<h3>Spill Slot Collision Across Mutual Recursion<\/h3>\n<p>The second notable security fix involves the IR compilation pipeline&#8217;s stack-to-memory mover, a mechanism designed to circumvent the EVM&#8217;s strict stack depth limitations by relocating local variables to fixed memory offsets known as spill slots. <\/p>\n<p>Under specific, complex call graph configurations involving mutual recursion, the compiler miscalculated the number of required slots, reserving too few for the concurrent execution contexts. Consequently, variables belonging to two entirely different functions were assigned the exact same spill slot, even though both variables could be live simultaneously. This caused one variable to silently overwrite the data of another during runtime execution.<\/p>\n<p>While closely related to a similar issue resolved in version 0.8.36 regarding unsound spills in mutually recursive functions, this specific variant impacts compiler versions 0.7.2 through 0.8.36 when projects are compiled using the <code>--via-ir<\/code> flag. The bug was identified and submitted by Ng Sze Hon via the Ethereum Foundation bug bounty program.<\/p>\n<h3>Misordered Named Parameters in Require with Custom Errors<\/h3>\n<p>The third security-related adjustment corrects an error handling flaw within the IR pipeline. When developers constructed a custom error using named arguments inside a <code>require<\/code> statement\u2014such as <code>require(condition, MyError(b: 2, a: 1))<\/code>\u2014the compiler marshaled the arguments onto the stack in the order they were written at the call site rather than following the parameter order defined in the error&#8217;s structural declaration.<\/p>\n<p>During the subsequent ABI encoding phase, these misordered arguments were matched against incorrect parameter types, leading to structural corruption of the revert payload. While the encoder still produced a valid binary payload matching the error signature, the values reflected inside the data did not correspond to the inputs provided by the developer. <\/p>\n<p>Plain <code>revert MyError(...)<\/code> statements and other language constructs utilizing named parameters remain unaffected. Because this anomaly only alters the revert data of transactions that are already failing and reverting, it has zero impact on valid contract state or successful transaction executions. The bug was caught and reported by Carl of Cantina Security.<\/p>\n<h2>Other Miscompilations<\/h2>\n<p>Beyond the primary bug fixes, Solidity v0.8.37 incorporates corrections for two minor miscompilation scenarios that do not pose direct security vulnerabilities but could lead to unexpected runtime behavior if triggered under precise conditions.<\/p>\n<p>The first minor fix targets the <code>evmasm<\/code> pipeline, specifically addressing how uninitialized internal function pointers behave within packed storage slots. Previously, reading an uninitialized internal function pointer from a packed slot could return an incorrect value if another variable stored sequentially in the same slot held a non-zero value. This could cause equality comparisons between such an uninitialized pointer and a default-initialized local function pointer to evaluate as false, despite neither pointer ever receiving an explicit assignment. <\/p>\n<p>The core team notes that relying on internal function pointer equality is inherently fragile because their underlying values depend directly on exact bytecode layouts and remain unstable across contract updates. The Solidity compiler already emits warnings for such comparisons and intends to disallow them entirely in a future breaking release. Triggering the bug requires a highly specific usage pattern and remains easily detectable through standard unit testing.<\/p>\n<p>The second minor miscompilation fix involves constant expressions evaluated in both checked and unchecked arithmetic contexts within the IR pipeline. Previously, the code required to compute a constant&#8217;s value was generated only once per contract, utilizing either checked or unchecked arithmetic depending entirely on which use site the compiler encountered first. Subsequent use sites reused this initial code block without modification. <\/p>\n<p>For constants whose initializers overflowed their designated types, reading the constant in a checked context could fail to trigger the required overflow panic, or conversely, reading it inside an unchecked block could cause a spurious revert. Because all operands involved in the affected constant evaluations are established at compile time, the resulting behavior is deterministic and entirely insulated from transaction inputs or malicious user manipulation. Exploiting it would require intentionally relying on constants that consistently revert or behave unpredictably across checked boundaries, making standard unit test coverage sufficient to catch any unintended behavior.<\/p>\n<h2>Notable Features and Changes<\/h2>\n<p>Solidity v0.8.37 introduces several forward-looking architectural upgrades, experimental enhancements, and long-awaited cleanups to deprecated tooling.<\/p>\n<h3>SSA CFG Planning Stack Shuffler (Experimental)<\/h3>\n<p>The experimental SSA CFG code generator receives a significant under-the-hood upgrade in this release. The code generator precomputes explicit stack layouts for every point within a program, relying on a stack shuffler to emit the necessary <code>SWAP<\/code>, <code>DUP<\/code>, <code>POP<\/code>, and <code>PUSH<\/code> instructions required to transition the EVM stack from one layout state to another.<\/p>\n<p>In previous versions, this shuffler operated greedily, making incremental local adjustments until the target layout was achieved. Solidity v0.8.37 replaces this greedy approach with a sophisticated planning shuffler. The new mechanism builds an explicit roadmap mapping current stack items to their target positions and executes the plan in a bottom-up fashion. If an item falls out of reach for basic stack manipulation instructions, the algorithm compresses the stack to regain reachability and initiates a fresh plan. <\/p>\n<p>Initial internal benchmarks indicate that this structured approach is significantly more maintainable, computationally more efficient than the legacy greedy algorithm, and produces bytecode of roughly equivalent size. The SSA CFG code generator remains experimental and can be enabled via the <code>--experimental --via-ssa-cfg<\/code> compilation flags.<\/p>\n<h3>Support for the SLOTNUM Opcode<\/h3>\n<p>Aligning with upcoming protocol upgrades, Solidity v0.8.37 adds native support for the <code>SLOTNUM<\/code> opcode introduced by EIP-7843 for the Amsterdam EVM version. This opcode returns the consensus beacon chain slot number associated with the current block execution.<\/p>\n<p>Developers can now access this value directly in Solidity via <code>block.slotnum<\/code> (typed as a <code>uint64<\/code>), while Yul and inline assembly users can utilize the new <code>slotnum()<\/code> built-in function. The SMTChecker formal verification module has also been updated to support the new property. These additions are restricted to compilations specifying <code>--evm-version amsterdam<\/code>. Beginning with the Amsterdam EVM version, <code>slotnum<\/code> also becomes a reserved identifier within Yul.<\/p>\n<h3>Removals and Deprecations<\/h3>\n<p>Continuing the compiler&#8217;s cleanup initiatives, Solidity v0.8.37 permanently removes two features previously restricted to experimental mode in version 0.8.35: Language Server Protocol support (<code>--lsp<\/code>) and the Generic Solidity prototype (<code>pragma experimental solidity<\/code>). <\/p>\n<p>The LSP integration was unmaintained and incomplete. The development team has clarified that while language server tooling remains important, such capabilities should exist as standalone ecosystems rather than being tightly bound to the compiler codebase. Similarly, the Generic Solidity prototype\u2014an early attempt to refactor the compiler in place for Core Solidity\u2014was superseded by <code>solcore<\/code>, an independent modular prototype better suited for advanced language experimentation.<\/p>\n<p>Additionally, the experimental <code>ABIEncoderV2<\/code> pragma now triggers a formal deprecation warning. Since <code>pragma abicoder v2<\/code> became standard in version 0.7.4 and ABI coder v2 became the universal default in version 0.8.0, the old pragma has remained entirely redundant. Because many legacy codebases and older testing framework dependencies still reference it, the team has introduced a warning period to allow developers time to remove it before a future breaking release.<\/p>\n<p>Finally, extending the deprecation cycle initiated in version 0.8.31, this release issues deprecation warnings for older EVM targets\u2014specifically <code>constantinople<\/code>, <code>petersburg<\/code>, <code>istanbul<\/code>, and <code>berlin<\/code>\u2014as well as the SMTChecker&#8217;s legacy BMC verification engine.<\/p>\n<h2>How to Install and Upgrade<\/h2>\n<p>Developers can upgrade to Solidity v0.8.37 by following the standard installation instructions provided in the official documentation. Pre-compiled binaries and release packages are accessible directly through the official GitHub repository. <\/p>\n<p>When building from source, developers are strongly advised to avoid using the automatically generated source archives provided by GitHub, and instead utilize the official <code>solidity_0.8.37.tar.gz<\/code> source tarball or check out the tagged <code>v0.8.37<\/code> release via Git to ensure build integrity.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>The Solidity development team has officially announced the release of Solidity v0.8.37, marking another important&#8230;<\/p>\n","protected":false},"author":1,"featured_media":3220,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[366],"tags":[988,401,1230,201,2183,1568,2001,5,400,402,2131,638],"class_list":["post-3221","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-smart-contract-auditing","tag-amsterdam","tag-auditing","tag-compiler","tag-critical","tag-experimental","tag-fixes","tag-released","tag-security","tag-smart-contracts","tag-solidity","tag-support","tag-updates"],"_links":{"self":[{"href":"https:\/\/smartcryptosecurity.com\/index.php?rest_route=\/wp\/v2\/posts\/3221","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/smartcryptosecurity.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/smartcryptosecurity.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/smartcryptosecurity.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/smartcryptosecurity.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=3221"}],"version-history":[{"count":0,"href":"https:\/\/smartcryptosecurity.com\/index.php?rest_route=\/wp\/v2\/posts\/3221\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/smartcryptosecurity.com\/index.php?rest_route=\/wp\/v2\/media\/3220"}],"wp:attachment":[{"href":"https:\/\/smartcryptosecurity.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=3221"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/smartcryptosecurity.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=3221"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/smartcryptosecurity.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=3221"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}