Skip to content

Bug: decodeTxData.ts checks wrong bytecode prefix (0x60e06040 vs 0x60806040) #1246

@mstattma

Description

@mstattma

Bug

In packages/nextjs/utils/scaffold-eth/decodeTxData.ts, line 20:

if (tx.input.length >= 10 && !tx.input.startsWith("0x60e06040")) {

This check is intended to skip contract creation transactions (which can't be decoded as function calls). However, the standard Solidity contract creation bytecode starts with 0x60806040 (PUSH1 0x80 PUSH1 0x40 MSTORE), not 0x60e06040.

As a result, contract creation transactions are not excluded and fall through to the function decoder, which fails to match any ABI and labels them as ⚠️ Unknown in the block explorer.

Expected behavior

Contract creation transactions should be detected and either skipped or labeled as "Contract Creation" in the block explorer.

Suggested fix

- if (tx.input.length >= 10 && !tx.input.startsWith("0x60e06040")) {
+ if (tx.input.length >= 10 && !tx.input.startsWith("0x6080604")) {

Using 0x6080604 (without the trailing digit) covers all standard Solidity init code variants. The 0x60e06040 check can be kept as an additional prefix if there are edge cases.

Environment

  • Scaffold-ETH 2 (latest main, cloned 2026-03-14)
  • Hardhat network (chainId 31337)
  • Contracts deployed via external deploy script (not SE2's built-in deploy)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions