Skip to main content

Try it Live

Run Opcode examples in the interactive playground

Opcode.isDup()

Check if opcode is DUP1-DUP16.
import { isDup, DUP1, DUP16 } from 'tevm/Opcode'

isDup(DUP1)   // true
isDup(DUP16)  // true

Parameters

  • opcode: BrandedOpcode - Opcode to check

Returns

boolean - True if DUP1-DUP16 (0x80-0x8F)

DUP Operations

Duplicate stack item at depth 1-16:
  • DUP1 (0x80): Duplicate top item
  • DUP2 (0x81): Duplicate 2nd item
  • DUP16 (0x8F): Duplicate 16th item