Skip to main content

Try it Live

Run Hardfork examples in the interactive playground

    EIP-1153 Features

    Active Since: Cancun (March 13, 2024)

    Transient Storage Opcodes

    TLOAD (0x5C):
    • Load from transient storage
    • Gas cost: 100 gas (warm)
    TSTORE (0x5D):
    • Store to transient storage
    • Gas cost: 100 gas

    Storage Lifecycle

    Transaction-Scoped:
    • Storage cleared at end of transaction
    • Not persisted to state
    • Survives across internal calls within same transaction
    Namespace:
    • Same key space as regular storage
    • Separate from permanent storage
    • Per-contract transient storage

    Usage Patterns

    Reentrancy Locks

    Implement cheap reentrancy guards:

    Intermediate Calculations

    Store temporary values:

    Cross-Contract Communication

    Pass data between contracts in same transaction:

    Flash Accounting

    Track temporary balances:

    Gas Costs

    Transient Storage (EIP-1153)

    Regular Storage (Comparison)

    Savings Example

    Reentrancy lock pattern:

    Network Configuration

    Check transient storage support:

    Compiler Integration

    Enable transient storage in compiler:

    EIP References

    Primary:

    Impact

    For Developers:
    • Dramatically cheaper temporary storage (~100x cheaper)
    • Ideal for reentrancy locks, flash loans, temporary state
    • Must clear at transaction end (automatic)
    For Smart Contracts:
    • Typical savings: 15,000-25,000 gas per reentrancy lock
    • Enables new patterns (cheap cross-contract communication)
    • No persistence - not suitable for state that must survive transaction
    For Security:
    • Reentrancy locks become affordable
    • Reduces incentive to skip security checks for gas savings
    • Clearer separation of temporary vs permanent state

    Common Use Cases

    1. Reentrancy Guards: Save ~24k gas per lock
    2. Flash Accounting: Track temporary balances (flash loans)
    3. Cross-Contract Coordination: Pass data between contracts
    4. Intermediate Calculations: Cache expensive computations within transaction
    5. Access Control: Temporary permissions that expire at transaction end

    See Also

    • hasEIP4844 - Check blob transactions availability (Cancun)
    • hasEIP1559 - Check EIP-1559 base fee availability (London)
    • isAtLeast - General version comparison