---
eip: 2046
label: EIP-2046
title: Reduced gas cost for static calls made to precompiles
status: Stagnant
type: Standards Track
category: Core
created: 2019-05-17
requires: 214, 1352
official: https://eips.ethereum.org/EIPS/eip-2046
source: https://github.com/ethereum/EIPs/blob/master/EIPS/eip-2046.md
canonical: https://eips.huatuo.xyz/eip-2046/
lang: en
tldr: Proposed cutting the base cost of a STATICCALL to a precompile from 700 to 40 gas, making cheap cryptographic precompiles practical to call.
tags: [evm, gas, precompiles, staticcall, stagnant]
---

# EIP-2046: Reduced gas cost for static calls made to precompiles

> This change reduces the gas cost of using precompiled contracts.

**TL;DR:** Proposed cutting the base cost of a STATICCALL to a precompile from 700 to 40 gas, making cheap cryptographic precompiles practical to call.

## What problem does it solve?

**Precompiles** are built-in contracts at fixed low addresses (e.g. `ecrecover`, SHA-256, elliptic-curve operations) that clients implement natively. Calling one still goes through the normal `CALL`-family opcodes and pays their base cost.

The Spurious Dragon fork raised that base cost to 700 gas to reflect loading another contract's code from disk. Precompiles have no code to load, yet paid the same price. For a precompile whose own work costs much less than 700 gas, the call overhead dominated, and some uses became impractical.

## How it works

After the activating fork, the base cost of `STATICCALL` (`0xfa`, from [EIP-214](/eip-214/)) depends on the target:

| Target | Base cost |
| --- | --- |
| Precompile (address range defined by [EIP-1352](/eip-1352/)) | 40 |
| Any other address | 700 (unchanged) |

Design choices from the spec:

- **Only `STATICCALL`** is changed, to limit impact. Precompiles are stateless, so calling them statically loses nothing. Contracts deployed before Byzantium, which predate `STATICCALL`, would not benefit.
- **Not zero.** 40 gas is kept to represent the context switch. This also keeps the call from being free, so older proxy contracts cannot use it to sneak in state changes.
- An earlier, similar idea appeared in [EIP-1109](/eip-1109/), which later took a different approach.

## Sample code

Calling the SHA-256 precompile (address `0x02`) with `staticcall`, the kind of call this EIP would make cheaper:

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

contract Hasher {
    function sha(bytes memory data) external view returns (bytes32 out) {
        (bool ok, bytes memory ret) = address(0x02).staticcall(data);
        require(ok, "precompile failed");
        out = abi.decode(ret, (bytes32));
    }
}
```

Pseudocode of the pricing rule:

```python
def staticcall_base_cost(target):
    if is_precompile(target):   # per EIP-1352 range
        return 40
    return 700
```

## Things to know

- **Status: Stagnant.** It was never activated. The spec still has a "FIXME" in its motivation, and test cases and implementation are "TBA".
- Call pricing changed afterwards anyway: [EIP-2929](/eip-2929/) (Berlin) replaced the flat 700 with warm/cold access costs, and precompile addresses are always treated as warm, so a call to one costs 100 gas base. That addressed much of this EIP's motivation.
- Some later EIPs repriced individual precompiles directly instead of the call overhead.


---

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