Bytecode Differ

Compare two contract bytecodes and identify differences


1. What is Bytecode?

Bytecode is the compiled machine-readable code that runs on the Ethereum Virtual Machine (EVM). When you deploy a smart contract, the Solidity code is compiled into bytecode.

2. How does it work?

Bytecode comparison analyzes two hex strings byte-by-byte, calculating similarity percentage and highlighting differences. The tool separates runtime code from metadata (CBOR-encoded compiler settings at the end). Identical logic can have different metadata due to compiler versions or settings.

Why Compare Bytecode?

Comparing bytecode helps verify proxy upgrades, check if two contracts are identical, and detect unauthorized modifications. Even small differences can indicate security issues.

Metadata Hash

Solidity appends metadata (CBOR-encoded) at the end of bytecode containing compiler settings and source code hash. This often differs even for identical logic due to compiler settings.

Use Cases

Verify proxy implementation upgrades, confirm contract deployments across chains, detect malicious modifications, and audit contract authenticity.

3. Examples

Compare BAYC & MAYC (RPC)

Contract 1: 0xBC4CA0EdA7647A8aB7C2061c2E2ad88F2A180A79 (BAYC) Contract 2: 0x60E4d786d1ad0075Bcb3152CA902be87E17dc708 (MAYC) Both are popular ape-themed NFT collections with similar architectures

Direct Bytecode Comparison

Paste compiled contract bytecode (0x608060...) to identify implementation differences, verify proxy upgrades, or detect unauthorized modifications

Proxy Upgrade Verification

Compare implementation contracts before and after upgrades to ensure only expected changes were made. BAYC and MAYC implementations should have high similarity despite different parameters

References