---
eip: 3322
label: EIP-3322
title: Account gas storage opcodes
status: Stagnant
type: Standards Track
category: Core
created: 2020-03-04
official: https://eips.ethereum.org/EIPS/eip-3322
source: https://github.com/ethereum/EIPs/blob/master/EIPS/eip-3322.md
canonical: https://eips.huatuo.xyz/eip-3322/
lang: en
tldr: "A stagnant proposal for three opcodes that let a contract bank gas in an account-level counter and later release it into the transaction's refund counter, replacing storage-bloating gas tokens."
tags: [evm, opcodes, gas, refunds, core]
---

# EIP-3322: Account gas storage opcodes

> Allows contract accounts to store gas that can be transferred to the refund counter.

**TL;DR:** A stagnant proposal for three opcodes that let a contract bank gas in an account-level counter and later release it into the transaction's refund counter, replacing storage-bloating gas tokens.

## What problem does it solve?

In 2020, gas tokens (GST2, CHI and similar) exploited the refund for clearing storage: you filled storage slots or created contracts when gas was cheap, then deleted them when gas was expensive and collected the refund. This shifted gas from quiet blocks to busy ones, which is arguably useful, but it did so by **writing useless data into state**, bloating every node's database.

EIP-3322 proposed doing the same thing directly: let a contract store "gas" in a counter on its account, and release it later into the refund counter, with no junk storage involved.

## How it works

Every contract account gains an unsigned **gas refund counter**, starting at zero. Three opcodes manage it:

| Opcode | Byte | Stack | Gas | Effect |
| --- | --- | --- | --- | --- |
| `SELFGAS` | `0x49` | → counter | same as `SELFBALANCE` | Push this account's stored gas |
| `USEGAS` | `0x4a` | amount → | 5000 | Move `min(amount, counter)` from the account into the transaction's refund counter |
| `STOREGAS` | `0x4b` | amount → | 5000 + amount | Add `amount` to this account's counter |

Because released gas goes through the normal refund counter, it inherits the existing cap on refunds (at the time, 50 % of gas used), which limits how much it could stretch any one block. Gas costs were modelled on `SELFBALANCE` and `SSTORE`.

## Sample code

Illustrative assembly for "bank now, spend later" (the opcodes were never added to Ethereum, so this will not compile with current tools):

```text
; when gas is cheap: bank 100000 gas (costs 5000 + 100000)
PUSH3 0x0186a0
STOREGAS          ; 0x4b

; later, when gas is expensive: release up to 100000 into the refund counter
PUSH3 0x0186a0
USEGAS            ; 0x4a  (costs 5000)

; read the remaining balance
SELFGAS           ; 0x49
```

## Things to know

- Status is **Stagnant**; it was never scheduled for a fork.
- The motivation largely disappeared with [EIP-3529](/eip-3529/) (London), which removed the `SELFDESTRUCT` refund and cut the storage-clearing refund and refund cap, making gas tokens unprofitable.
- The spec's test-case table appears to use different opcode bytes from its own specification (for example `0x49` behaving like `USEGAS` and `0x4a` like `STOREGAS`), so the exact byte assignment is unclear.
- Opcode bytes `0x49`–`0x4b` have since been used by other proposals (for example `BLOBHASH` is `0x49` and `BLOBBASEFEE` is `0x4a`), so these assignments are no longer available.


---

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