Skip to content

fix: correct bytecode prefix check for contract creation detection#1250

Open
Skywalkingzulu1 wants to merge 1 commit into
scaffold-eth:mainfrom
Skywalkingzulu1:fix/decode-tx-bytecode-prefix
Open

fix: correct bytecode prefix check for contract creation detection#1250
Skywalkingzulu1 wants to merge 1 commit into
scaffold-eth:mainfrom
Skywalkingzulu1:fix/decode-tx-bytecode-prefix

Conversation

@Skywalkingzulu1
Copy link
Copy Markdown

Bug Fix

Fixed the contract creation bytecode prefix check in decodeTxData.ts.

Before: 0x60e06040 (incorrect)
After: 0x6080604 (matches standard Solidity init code)

Standard Solidity init code starts with PUSH1 0x80 PUSH1 0x40 MSTORE (0x60806040), not 0x60e06040.

Impact

Contract creation transactions are now properly detected and won't appear as "Unknown" in the block explorer.

Testing

  • Verified the prefix matches standard Solidity compiler output
  • Covers all standard Solidity init code versions (0x6080604*)

Closes #1246

Changed the contract creation bytecode prefix check from 0x60e06040
to 0x6080604 to match the standard Solidity init code.

Standard Solidity init code starts with PUSH1 0x80 PUSH1 0x40 MSTORE
(0x60806040), not 0x60e06040.

This fixes the block explorer showing contract creation transactions
as 'Unknown' instead of properly detecting them.

Closes scaffold-eth#1246
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

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

1 participant