On February 11, 2026, the Solidity development team disclosed a high-severity bug within the Solidity code generator, originally discovered and reported by blockchain security firm Hexens. The vulnerability affects compiler versions 0.8.28 through 0.8.33 when developers utilize the intermediate representation (IR) compilation pipeline via the --via-ir flag.
The bug manifests when a smart contract clears both a persistent storage variable and a transient storage variable of the same type. Under these specific conditions, the compiler emits an incorrect EVM opcode—mistaking an sstore instruction for a tstore, or vice versa—for one of the clearing operations. This unexpected opcode generation stems from a naming collision in the generated Yul helper functions, where persistent and transient operations share identical identifiers, causing one function to overwrite the other during the compilation process.
Despite the high internal severity rating assigned by the Solidity team, the real-world impact appears remarkably limited. A coordinated emergency scan across all Ethereum Virtual Machine (EVM)-compatible chains identified only three deployed contracts matching the vulnerable pattern. The development teams behind these affected contracts were swiftly notified, and mitigating measures were promptly implemented. However, the discovery serves as a vital reminder for projects utilizing modern Solidity features to review any codebase compiled with the --via-ir flag that executes delete operations on transient storage variables.
The vulnerability is exclusively tied to the IR pipeline; projects relying on the legacy evmasm pipeline remain entirely unaffected. Furthermore, because the --via-ir flag is not enabled by default in the Solidity compiler, projects that have not explicitly opted into the IR pipeline face no risk. The issue has been officially resolved in Solidity version 0.8.34, rendering versions 0.8.28 through 0.8.33 vulnerable if specific structural criteria are met.
Which Contracts Are Affected?
For a smart contract to be vulnerable to this code generation bug, it must meet a strict set of intersecting conditions. Codebases that do not invoke the delete keyword on a transient state variable are completely safe. Additionally, explicitly assigning a zero value to a variable—such as writing _lock = 0—bypasses the clearing helper function entirely and will not trigger the bug.
The core collision mechanism occurs when two distinct clearing operations—one targeting transient storage and the other targeting persistent storage—resolve to the same internal helper function. This happens when both operations clear matching Solidity value types. Crucially, the persistent variable does not need to be declared with the exact same primitive type as the transient variable; it is sufficient for a matching value type to be nested within it, such as acting as a struct member or an array element.
On the transient side of the equation, there is precisely one code path that invokes the vulnerable tstore variant: executing a delete statement on a transient state variable. Because transient arrays, mappings, and structs are not currently supported in Solidity, this operation invariably targets a simple value type.
Conversely, multiple operations can trigger the sstore variant on the persistent side, provided they clear persistent storage of a matching value type. These include standard deletion statements on persistent variables, clearing mapping values, or clearing arrays and struct members.
Cross-Type Collisions via Array Clearing
A particularly subtle vector for this bug involves array clearing operations. Solidity generally performs clearing operations on arrays at slot granularity, treating every storage slot as a uint256 rather than iterating through and clearing each individual element. Consequently, operations such as deleting a boolean array, a static address array, or a multi-dimensional integer array all utilize the exact same underlying clearing helper as deleting a basic uint256 variable, regardless of the actual element type declared in the source code.
For example, a contract containing a boolean array and a transient uint256 variable can experience a collision between array clearing and transient deletion, despite the developer having declared fundamentally different types in the source code. This slot-granularity expansion, however, does not apply to .pop() operations, which correctly utilize the actual element type, nor does it apply to struct member clearing for members smaller than 32 bytes, which bypasses the shared helper entirely through direct sstore instructions.
The conditions required for a collision do not even require both operations to reside within the same contract scope. A base contract containing a transient variable combined with a derived contract housing a persistent variable or mapping of the same type can successfully trigger the bug. Free functions and library functions utilized throughout the contract architecture can also contribute to the collision.
Finally, both clearing operations must be compiled within the same Yul object. A delete statement restricted exclusively to contract creation code, such as inside a constructor, will not interact with a delete statement residing in deployed runtime code, because the compiler builds these as separate Yul objects equipped with independent helper function sets.
The Bug Mechanics
During code generation, the IR pipeline builds reusable Yul helper functions designed to optimize contract size and execution structure. These helper functions are deduplicated by name, meaning that any given name can point to only one Yul function body, forcing the function name to completely and accurately encode its underlying behavior.
The specific helper responsible for clearing a storage slot derives its name directly from the Solidity type being cleared—such as storage_set_to_zero_t_address for an address type in storage. However, prior to the fix, this naming convention omitted the storage kind, meaning persistent and transient storage operations generated identical function names for identical types.
Because the compiler maintains only one function per name, the implementation is dictated entirely by whichever clearing operation the compiler encounters first. If the pipeline processes a persistent clearing operation first, the generated function emits an sstore opcode. If a transient delete statement is processed first, it emits a tstore opcode. Any subsequent operation of the opposite storage kind simply reuses the existing function, inadvertently executing the wrong opcode.
The order in which the compiler encounters these operations depends on function selectors and the syntax tree structure. The optimizer stage, which runs separately after code generation, does not influence this ordering. The official fix introduces a clear distinction between data locations directly into the clearing helper’s function name, resulting in separate Yul functions—such as storage_set_to_zero_t_address for persistent storage and transient_storage_set_to_zero_t_address for transient storage—thereby guaranteeing that every operation executes the correct opcode.
Examples of State Overwrites
Simplified implementations illustrate the unpredictable nature of the bug in both directions. In a scenario where a persistent clearing operation is processed first, a contract might feature a persistent mapping for delegate addresses alongside a transient address variable acting as an execution lock. If the compiler encounters the persistent deletion first, it generates an sstore helper. When the transient lock is subsequently cleared via delete, it reuses that same helper, incorrectly executing an sstore on persistent slot zero instead of updating transient storage. This action inadvertently overwrites the contract’s primary owner state variable with zero. Furthermore, because the transient lock never actually clears its transient slot, the guarded function remains permanently locked for the remainder of the transaction.
Conversely, if the transient deletion is encountered first, the compiler generates a tstore helper. When a developer subsequently attempts to clear a persistent mapping approval, the operation mistakenly reuses the transient helper. Instead of removing the approval from persistent storage, the transaction clears the corresponding slot in transient storage, leaving the persistent approval intact and fully operational.
Severity Assessment and Industry Reaction
The compiler emits no warnings when this collision occurs, and the resulting bytecode does not trigger runtime reverts. Instead, the bug manifests as silent state corruption, making diagnosis challenging. Nevertheless, thorough test suites executed with the --via-ir flag enabled are typically capable of catching aberrant contract behavior prior to mainnet deployment.
Following the initial disclosure, a collaborative remediation effort was launched with the support of SEAL 911, Etherscan, Dedaub, and Hexens to scan EVM-compatible networks for vulnerable contracts. Out of thousands of deployed applications, only three contracts were identified, and their respective development teams were notified immediately. None of the affected projects were active public applications handling significant external funds in production.
The Solidity core team has verified that no other helper functions within the compiler share this vulnerability and has scheduled architectural refactoring to prevent similar naming collision classes in future releases. Developers who suspect their projects might be affected are encouraged to compare unoptimized Yul outputs generated with the --ir flag between vulnerable compiler versions and version 0.8.34 to verify whether shared clearing helpers have been correctly separated. Updating to Solidity 0.8.34 and thoroughly testing all state-clearing logic remains the primary recommendation for mitigating any potential exposure.





