Overview
Opcode:0x3d
Introduced: Byzantium (EIP-211)
RETURNDATASIZE returns the size in bytes of the return data from the most recent external call.
Specification
Stack Input:Behavior
Returns the length of the return data buffer populated by the last CALL, STATICCALL, DELEGATECALL, or CALLCODE. Key characteristics:- Introduced in Byzantium hardfork
- Updated after each external call
- 0 if no call made yet or call failed
- Persists until next call
Examples
Basic Usage
Efficient Return Data Handling
Gas Cost
Cost: 2 gas (GasQuickStep)Common Usage
Proxy Pattern
Dynamic Return Handling
Security
Safe opcode - just returns buffer size.Implementation
- TypeScript
References
- EIP-211 - RETURNDATASIZE and RETURNDATACOPY
- EVM Codes - RETURNDATASIZE

