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.