Skip to main content
This page is a placeholder. All examples on this page are currently AI-generated and are not correct. This documentation will be completed in the future with accurate, tested examples.

Overview

Opcode: 0x33 Introduced: Frontier (EVM genesis) CALLER pushes the address of the immediate caller onto the stack. This is the address that directly invoked the current execution context, changing with each call in the call chain.

Specification

Stack Input:
Stack Output:
Gas Cost: 2 (GasQuickStep) Operation:

Behavior

CALLER provides the address that made the current call. Unlike ORIGIN which remains constant, CALLER changes with each contract call in the execution chain. Key characteristics:
  • Changes with each call (CALL, STATICCALL, DELEGATECALL)
  • Can be either EOA or contract address
  • Used for authentication and access control
  • Safe for authorization checks

Examples

Basic Usage

Access Control

Call Chain Tracking

Gas Cost

Cost: 2 gas (GasQuickStep) Same cost as other environment access opcodes:
  • ADDRESS (0x30): 2 gas
  • ORIGIN (0x32): 2 gas
  • CALLVALUE (0x34): 2 gas

Common Usage

Ownership Pattern

Access Control Lists

Payment Tracking

Delegation Pattern

Security

CALLER vs ORIGIN

SAFE pattern - use msg.sender (CALLER):
UNSAFE pattern - use tx.origin (ORIGIN):

DELEGATECALL Context Preservation

Reentrancy Protection

Authorization Checks

Implementation

Edge Cases

Contract as Caller

Stack Overflow

Out of Gas

Best Practices

✅ DO: Use for access control

✅ DO: Track caller identity

✅ DO: Validate caller

❌ DON’T: Confuse with tx.origin

References