---
eip: 1285
label: EIP-1285
title: Increase Gcallstipend gas in the CALL opcode
status: Stagnant
type: Standards Track
category: Core
created: 2018-08-01
official: https://eips.ethereum.org/EIPS/eip-1285
source: https://github.com/ethereum/EIPs/blob/master/EIPS/eip-1285.md
canonical: https://eips.huatuo.xyz/zh/eip-1285/
lang: zh
tldr: 曾提议把通过 CALL 接收 ETH 的合约所获得的免费 2,300 gas 津贴提高到 3,500，让代理合约能运行有实际意义的 fallback。
tags: [evm, gas, call, proxy, stagnant]
---

# EIP-1285: Increase Gcallstipend gas in the CALL opcode

> Increase the Gcallstipend fee parameter in the CALL opcode from 2,300 to 3,500 gas units.

**TL;DR:** 曾提议把通过 CALL 接收 ETH 的合约所获得的免费 2,300 gas 津贴提高到 3,500，让代理合约能运行有实际意义的 fallback。

## 它解决什么问题？

当合约用带 value 的 `CALL` 发送 ETH 时，EVM 会额外给出一小笔免费 gas，即**调用津贴**（`Gcallstipend`，2,300 gas），使接收合约的 fallback 得以运行。它被有意设得很小：足够发出一条日志，却不足以写存储或以危险的方式重入。Solidity 的 `transfer()` 和 `send()` 只转发这笔津贴。

2018 年提出的问题与**代理合约**有关。代理用 `DELEGATECALL` 把每次调用转发给逻辑合约，作者估计仅这一步就要消耗约 1,000 gas。这样留给真正的 fallback 逻辑的只有约 1,300 gas，连一条典型的 `LOG` 都不够。实际上，用 `transfer()` 向基于代理的钱包发送 ETH 可能会失败。

## 它如何运作

改动只是一个常量：

| 参数 | 之前 | 提议 |
| --- | --- | --- |
| `Gcallstipend` | 2,300 | 3,500 |

多出的 1,200 gas 是为了留出少量余量，覆盖一次 `DELEGATECALL` 加一次 `SLOAD`（读取实现地址），同时仍然低到无法修改状态。客户端只需更新自己保存的常量；作者附上了一个正是这样做的 Geth 分支链接。

这是一项不向后兼容的共识改动，需要一次硬分叉。

## 示例代码

促成这份 EIP 的模式：一个用受津贴限制的 `transfer` 付款的合约，以及一个 fallback 必须在津贴范围内完成的代理。

```solidity
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.20;

contract Payer {
    function pay(address payable to) external payable {
        // Forwards only the 2,300 gas stipend to `to`.
        // If `to` is a proxy, DELEGATECALL + logic must fit in that budget.
        to.transfer(msg.value);
    }

    function paySafe(address payable to) external payable {
        // Modern practice: forward all gas and check the result,
        // guarding against reentrancy elsewhere.
        (bool ok, ) = to.call{value: msg.value}("");
        require(ok, "send failed");
    }
}
```

客户端改动的伪代码：

```python
CALL_STIPEND = 2300   # current
CALL_STIPEND = 3500   # EIP-1285
```

## 需要注意

- **状态：Stagnant。** 它从未被排入硬分叉；以太坊主网上的津贴仍然是 2,300 gas。
- 之后的重新定价方向恰好相反：存储访问变得更贵（[EIP-1884](/eip-1884/)、[EIP-2929](/eip-2929/)），使固定津贴对代理来说更加紧张。
- 常见的变通办法是避免使用 `transfer()`/`send()`，改用带重入保护的 `call{value: ...}("")`，让接收方获得足够的 gas。
- 代理通常从 [ERC-1967](/eip-1967/) 这样的标准槽位读取其实现地址；这次 `SLOAD` 也是津贴太小的原因之一。


---

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