Introduction
Hi, I'm cardene, a software engineer and technical writer focused on blockchain and AI.
I've also authored Japanese technical books on specification-driven development with LLMs and decentralized application (DApp) development.
I also build and publish a variety of tools, libraries, and open-source projects.
EIP-1706 proposes preventing the EVM's storage-writing instruction (SSTORE) from executing when the remaining gas is 2,300 or less, addressing a reentrancy risk affecting older smart contracts.
This article translates, summarizes, and expands on the following proposal.
More EIP explainers:
Overview
EIP-1706 addresses the security implications of changes to Ethereum's gas rules for already deployed smart contracts.
EIP-1283 proposed substantially reducing the gas cost of certain storage writes. Although this improves gas efficiency, it also raised concerns about introducing reentrancy vulnerabilities into existing contracts.
For EIP-1283, see the following article.
EIP-1283: Understanding SSTORE gas optimization
EIP-1706 aims to preserve the security properties and assumptions that existing contracts relied on before the proposed EIP-1283 changes. This would reduce the need to modify or revalidate widely deployed contract code specifically because of the change.
Motivation
EIP-1283 introduces a dynamic gas accounting scheme for SSTORE, charging according to the changes made to storage state. Many contracts could benefit from lower transaction gas costs.
However, a longstanding security assumption in Ethereum contracts concerned the 2,300-gas stipend. Solidity's transfer() and send() provide a limited gas allowance to the receiving contract, and some developers relied on this limitation to prevent reentrant state changes.
Under EIP-1283, certain storage writes could become possible even within that allowance. Consequently, contracts previously assumed to be safe could exhibit unexpected behavior.
The Ethereum community raised concerns about this issue, including in the following Reddit discussion. Prohibiting SSTORE under low-gas conditions was proposed as a way to preserve compatibility with existing contracts while addressing the risk.
EIP-1706 therefore seeks to allow Ethereum's gas rules to evolve without invalidating the particular security assumptions made by older contracts.
Specification
EIP-1706 introduces an additional restriction on the EVM's SSTORE instruction. If the remaining gas (gasleft) is less than or equal to 2,300 when SSTORE is about to execute, the instruction fails with an out-of-gas exception in the current call frame.
This prevents persistent storage writes under the limited gas allowance provided by Solidity's transfer and send operations.
The 2,300-gas stipend limits the work that a receiving contract can perform. Historically, developers expected it to permit lightweight operations, such as certain log emissions, while preventing expensive state changes. This is not a general guarantee that every ETH transfer is limited to 2,300 gas: other call mechanisms can forward more gas, and opcode repricing can affect what fits within the stipend.
EIP-1283's dynamic accounting reduces the cost of certain SSTORE operations sufficiently that they could otherwise fit within the stipend.
EIP-1706 resolves this particular issue by checking the remaining gas before executing SSTORE. If it is 2,300 or less, the current call frame fails, regardless of the storage write's calculated gas cost.
This preserves the specific assumption that persistent storage cannot be modified using only the stipend. It does not establish that stipend-limited calls are universally immune to reentrancy or other security risks.
The proposed rule is simple, but it addresses an important compatibility concern arising from storage gas optimization.
Additional considerations
EIP-1283 makes the gas cost of storage updates more closely reflect the changes made to storage. However, this undermines the previous assumption that SSTORE could not execute within the 2,300-gas stipend.
EIP-1706 seeks to retain the benefits of net gas metering while preserving that assumption by disallowing SSTORE whenever the remaining gas is 2,300 or less.
Alternative approaches and their drawbacks
Several alternatives were considered.
Withdraw EIP-1283 entirely. This would avoid the immediate problem, but the proposal had already been incorporated into client implementations and test networks and accepted for a planned network upgrade. Abandoning its benefits was undesirable.
Introduce a new call context that permits logging but prohibits state changes. Such a solution would require a new EVM call type, increasing design and implementation complexity.
Increase the gas cost of writing to a dirty storage slot above 2,300. This would undermine EIP-1283's goal of accurate net gas metering and refund optimization.
Reduce the stipend itself. This could invalidate assumptions about the operations Solidity's transfer and send allow the recipient to perform.
Charge 5,000 gas for dirty-slot writes and refund 4,800. This would require contracts to supply additional gas upfront without directly expressing the security restriction that the stipend is supposed to preserve.
Introduce per-contract EVM versions and apply the new SSTORE rules only to newer contracts. This would complicate the execution environment and the management of compatibility across contract versions.
Compatibility
EIP-1706 proposes that SSTORE fail whenever the remaining gas is 2,300 or less. Under the storage gas schedule predating net gas metering, a storage write required at least 5,000 gas, so it was already impossible to execute SSTORE using only the stipend.
The proposal explicitly preserves that previously implicit restriction rather than introducing an incompatible capability change relative to those earlier rules.
Gas estimation tools and client implementations must also account for the restriction when determining the gas required for transactions.
For historical context, the stipend check was subsequently incorporated into EIP-2200, which combines net gas metering with this restriction. EIP-1283 was not activated on Ethereum mainnet as originally planned for Constantinople. The discussion above concerns that historical proposal, not a claim that all modern storage writes cost at least 5,000 gas.
Citation
Alex Forshtat alex@tabookey.com, Yoav Weiss yoav@tabookey.com, "EIP-1706: Disable SSTORE with gasleft lower than call stipend [DRAFT]," Ethereum Improvement Proposals, no. 1706, January 2019. [Online serial]. Available: https://eips.ethereum.org/EIPS/eip-1706.
Conclusion
EIP-1706 preserves an important security assumption made by existing Ethereum contracts by preventing SSTORE from executing with 2,300 gas or less, while allowing the benefits of storage gas optimization.
Questions are welcome via Twitter @cardene777.
Other publications:



