---
eip: 1706
label: EIP-1706
title: Disable SSTORE with gasleft lower than call stipend
status: Withdrawn
type: Standards Track
category: Core
created: 2019-01-15
requires: 1283
official: https://eips.ethereum.org/EIPS/eip-1706
source: https://github.com/ethereum/EIPs/blob/master/EIPS/eip-1706.md
canonical: https://eips.huatuo.xyz/eip-1706/
lang: en
tldr: Proposed making SSTORE fail when 2300 gas or less remains, so cheaper storage writes could not break the reentrancy protection old contracts got from the transfer/send stipend; the idea was folded into EIP-2200.
tags: [gas, sstore, security, reentrancy, core]
---

# EIP-1706: Disable SSTORE with gasleft lower than call stipend

> The proposal that had been accepted changes security properties of a large portion of an existing contract code base that may be infeasible to update and validate. This proposal will make the old assumptions hold even after a network upgrade.

**TL;DR:** Proposed making SSTORE fail when 2300 gas or less remains, so cheaper storage writes could not break the reentrancy protection old contracts got from the transfer/send stipend; the idea was folded into EIP-2200.

## What problem does it solve?

When a Solidity contract uses `transfer` or `send` to pay ETH, the recipient receives only a **2300 gas stipend**. Many contracts relied on this, implicitly: with 2300 gas a malicious recipient could not write to storage, because `SSTORE` always cost at least 5000 gas. That made reentrancy through `transfer` effectively harmless.

[EIP-1283](/eip-1283/) (net gas metering) made repeated writes to the same storage slot within a transaction much cheaper, as low as a few hundred gas. Shortly before the Constantinople upgrade, security researchers showed this let a recipient modify state within the 2300 stipend, opening a new reentrancy attack on existing contracts. Constantinople was postponed, and EIP-1283 was removed in the Petersburg fork ([EIP-1716](/eip-1716/)).

EIP-1706 proposed a way to keep cheap storage writes *and* the old safety assumption.

## How it works

One extra rule in the `SSTORE` gas calculation:

- If `gasleft` is **less than or equal to 2300** when `SSTORE` executes, the current call frame fails with an out-of-gas exception.

Since a stipend-only call starts with exactly 2300 gas, any `SSTORE` it attempts fails, regardless of how cheap the write would otherwise be. Contracts that rely on the stipend stay safe, and normal calls with more gas are unaffected.

Because `SSTORE` had never been possible with less than 5000 gas, the authors argued nothing on mainnet would break.

## Sample code

The rule as pseudocode, inserted before any other `SSTORE` gas accounting:

```python
CALL_STIPEND = 2300

def sstore(evm, key, value):
    if evm.gas_left <= CALL_STIPEND:
        raise OutOfGas("SSTORE with gas left <= stipend")
    # ... normal net-metered SSTORE cost and refund logic follows
```

Why it matters for this pattern:

```solidity
// Many contracts assumed `to` cannot change state during this call
payable(to).transfer(amount); // forwards only 2300 gas
```

## Things to know

- Status is **Withdrawn**. The authors preferred [EIP-2200](/eip-2200/), which re-introduced net gas metering and includes the same "fail if gasleft ≤ 2300" sentinel. EIP-2200 shipped in Istanbul.
- The episode is the main reason the 2300 stipend is still treated as a protocol-level invariant for `SSTORE`.
- Do not rely on the stipend as a security mechanism in new code. Gas costs can change, and modern guidance is to use `call` with explicit reentrancy guards instead of `transfer`/`send`.


---

This is an unofficial plain-language summary. Read the full specification: https://eips.ethereum.org/EIPS/eip-1706
