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: 0x30
Introduced: Frontier (EVM genesis)
ADDRESS pushes the address of the currently executing account onto the stack. This is the address of the contract whose code is being executed, not the address of the contract that initiated the call chain.
Specification
Stack Input:
Stack Output:
Gas Cost: 2 (GasQuickStep)
Operation:
Behavior
ADDRESS provides access to the address of the contract currently executing. In the context of DELEGATECALL, this returns the address of the contract being called into (the caller’s address), not the implementation contract.
Key characteristics:
- Returns the address where code is executing
- Value is a 160-bit address stored as uint256 (20 bytes right-padded)
- Does not change with CALL but changes with DELEGATECALL
- Always available (cannot fail)
Examples
Basic Usage
Contract Self-Reference
CALL vs DELEGATECALL
Gas Cost
Cost: 2 gas (GasQuickStep)
ADDRESS is one of the cheapest operations, sharing the same cost tier with:
- ORIGIN (0x32)
- CALLER (0x33)
- CALLVALUE (0x34)
- CALLDATASIZE (0x36)
- CODESIZE (0x38)
- GASPRICE (0x3a)
- RETURNDATASIZE (0x3d)
Comparison:
- Environment context (ADDRESS, CALLER, ORIGIN): 2 gas
- Data loading (CALLDATALOAD): 3 gas
- External account access (BALANCE, EXTCODESIZE): 700+ gas
Common Usage
Proxy Pattern Identification
Self-Destruct Recipient
Token Address Validation
Ether Reception Check
Security
ADDRESS vs CALLER vs ORIGIN
Critical distinction:
Example call chain:
DELEGATECALL Context Preservation
Safe Patterns
Implementation
Edge Cases
Maximum Address Value
Zero Address
Stack Overflow
Out of Gas
References