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: 0x36
Introduced: Frontier (EVM genesis)
CALLDATASIZE pushes the byte length of the call data (input data) onto the stack.
Specification
Stack Input:
Stack Output:
Gas Cost: 2 (GasQuickStep)
Operation:
Behavior
CALLDATASIZE returns the total number of bytes in the call data, including function selector.
Key characteristics:
- Returns exact byte count
- Includes 4-byte function selector (if present)
- Always >= 0
- Constant throughout execution
Examples
Basic Usage
Validation
Gas Cost
Cost: 2 gas (GasQuickStep)
Same as ADDRESS, ORIGIN, CALLER, etc.
Common Usage
Bounds Checking
Copying Entire Calldata
Security
Safe opcode, no vulnerabilities.
Implementation
References