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: 0x38 Introduced: Frontier (EVM genesis) CODESIZE pushes the byte length of the currently executing code onto the stack.

Specification

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

Behavior

Returns the size of the currently executing bytecode, including deployed code and constructor code.

Examples

Basic Usage

Code Copying

Gas Cost

Cost: 2 gas (GasQuickStep)

Common Usage

Constructor Detection

During contract construction, CODESIZE includes constructor code. After deployment, only runtime code.

Implementation

References