Try it Live
Run Opcode examples in the interactive playground
Opcode.info()
Get complete opcode metadata (gas cost, stack I/O, name).- Functional API
Parameters
opcode: BrandedOpcode- Opcode to query
Returns
Info | undefined - Metadata or undefined if invalid opcode
Gas Costs
Base gas costs returned byinfo(). Many opcodes have dynamic costs at runtime:
Fixed Cost Opcodes
Dynamic Cost Opcodes
For accurate gas estimation, you need runtime state (warm/cold access, storage transitions, memory expansion, etc.). The
gasCost field returns only the static base cost.Stack Effects
Binary Operations
Memory/Storage
Stack Manipulation
Use Cases
Calculate Gas for Bytecode
Validate Stack Depth
Generate Opcode Statistics
Find Expensive Operations
Performance
- O(1) lookup time
- Pre-computed metadata table
- Zero allocation for query
- Extremely fast
Related
- name() - Get opcode name only
- getGasCost() - Get gas cost only
- getStackEffect() - Get net stack change
- GasConstants - Gas cost specifications

