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: 0x89
Introduced: Frontier (EVM genesis)
DUP10 duplicates the 10th stack item and pushes it to the top of the stack. The original 10th item remains in place.
Specification
Stack Input:
Stack Output:
Gas Cost: 3 (GasFastestStep)
Operation:
Behavior
DUP10 copies the 10th-from-top stack item without removing it. Requires stack depth ≥ 10.
Key characteristics:
- Requires stack depth ≥ 10
- Original value unchanged
- New copy pushed to top
- StackUnderflow if depth < 10
- Stack depth increases by 1
Examples
Basic Usage
Solidity Compilation
Assembly Usage
Gas Cost
Cost: 3 gas (GasFastestStep)
All DUP1-16 operations cost the same despite different stack depths accessed.
Comparison:
| Operation | Gas | Note |
|---|
| DUP10 | 3 | Duplicate 10th item |
| PUSH1-32 | 3 | Same cost tier |
| POP | 2 | Cheaper |
Common Usage
Deep Stack Access
Conditional Logic
Stack Depth Requirements
Minimum Depth
Safe Usage
Implementation
Edge Cases
Stack Underflow
Stack Overflow
Out of Gas
Maximum Value
References