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: 0x73 Introduced: Frontier (EVM genesis) PUSH20 pushes a 20-byte immediate value from the bytecode onto the stack. The 20 bytes immediately following the opcode are read and zero-padded to 256 bits.

Specification

Stack Input:
Stack Output:
Gas Cost: 3 (GasFastestStep) Bytecode: 1 byte opcode + 20 bytes immediate data Operation:

Behavior

PUSH20 reads 20 bytes from bytecode starting at position pc + 1, interprets them as a big-endian unsigned integer, and pushes the result onto the stack. Key characteristics:
  • Reads exactly 20 bytes following opcode
  • Big-endian byte order (most significant byte first)
  • Zero-padded to 256 bits if less than 32 bytes
  • InvalidOpcode if insufficient bytecode remaining
  • PC advances by 21 (opcode + data)

Examples

Basic Usage

Solidity Compilation

Assembly Usage

Gas Cost

Cost: 3 gas (GasFastestStep) All PUSH1-32 instructions cost the same despite different data sizes. Bytecode size impact:
  • PUSH20: 21 bytes (1 opcode + 20 data)
  • PUSH32: 33 bytes (1 opcode + 32 data)
Comparison:
OpcodeGasBytesUse Case
PUSH021Zero constant (Shanghai+)
PUSH132Small numbers (0-255)
| PUSH20 | 3 | 21 | Address literals |

Common Usage

Address Constants

Big-Endian Encoding

Implementation

Edge Cases

Insufficient Bytecode

Stack Overflow

Out of Gas

Maximum Value

References