Skip to main content

Try it Live

Run Opcode examples in the interactive playground

Opcode.pushOpcode()

Get PUSH opcode for given byte count.
import { pushOpcode } from 'tevm/Opcode'

const op = pushOpcode(1)   // 0x60 (PUSH1)

Parameters

  • byteCount: number - Number of bytes to push (1-32)

Returns

BrandedOpcode - Corresponding PUSH opcode

Throws

  • Error if byteCount < 1 or > 32