Skip to content

cartoonitunes/solc-native-builds

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 

Repository files navigation

Native C++ Solidity Compiler Builds

Pre-built native C++ solc binaries from webthree-umbrella for Ethereum bytecode archaeology. These produce different bytecode than the Emscripten/soljson builds available on npm, which is critical for verifying frontier-era contracts (2015-2016).

Why Native Builds?

The npm solc package uses Emscripten-compiled JavaScript builds (soljson). The original Ethereum developers used the native C++ compiler. The two produce subtly different bytecode — typically 1-5 byte differences in CODECOPY offsets, stack manipulation, and dispatcher layout. If you're getting a close-but-not-exact match with soljson, you need the native build.

Available Binaries

All binaries are Linux x86_64 (built on Ubuntu 16.04). Run via Docker or WSL on macOS/Windows.

Binary Era Solidity Version webthree-umbrella Notes
solc-poc8 Feb 2015 v0.8.2 internal poc-8-tag Pre-0.1.0, very compact bytecode
solc-frontier Jul 2015 ~0.1.0 frontier-era Ethereum launch compiler
solc-frontier-jul29 Jul 29, 2015 ~0.1.0 frontier-era Day before mainnet launch
solc-v011 Aug 2015 0.1.1 v1.0.0-era First stable post-launch
solc-v015 Sep 2015 0.1.5 ~v1.0.1
solc-v016 Oct 2015 0.1.6 ~v1.1.0
solc-v017 Nov 2015 0.1.7 ~v1.1.1
solc-v020 Jan 2016 0.2.0 ~v1.1.2
solc-jan20 Jan 20, 2016 0.2.0 (67c855c5) v1.1.2 Exact bytecode matches for Jan 2016 contracts
solc-umbrella Feb 2016 0.2.1 v1.1.2 Most widely useful, full build env

Usage

With Docker (recommended)

# Run a binary inside the matching Docker image
docker run --rm -v $(pwd)/mycontract.sol:/src.sol solc-umbrella \
  /umbrella/build/solidity/solc/solc --optimize --bin-runtime /src.sol

# Or mount the extracted binary into any Linux container
docker run --rm -v $(pwd)/binaries/solc-umbrella:/solc -v $(pwd)/mycontract.sol:/src.sol ubuntu:16.04 \
  /solc --optimize --bin-runtime /src.sol

Typical cracking workflow

# 1. Get on-chain bytecode
curl "https://api.etherscan.io/v2/api?chainid=1&module=proxy&action=eth_getCode&address=0xCONTRACT&tag=latest&apikey=KEY"

# 2. Try each compiler version
for bin in binaries/solc-*; do
  docker run --rm -v $(pwd)/$bin:/solc -v $(pwd)/source.sol:/src.sol ubuntu:16.04 \
    /solc --optimize --bin-runtime /src.sol 2>/dev/null
done

# 3. Compare output to on-chain bytecode

Building From Source

Each Docker image was built from the webthree-umbrella monorepo. Build recipe:

  • Base: Ubuntu 16.04
  • CryptoPP 5.6.2 from source
  • webthree-umbrella recursive clone at target tag
  • Strip non-solc components
  • ARM64: debugbreak.h patch required

See dockerfiles/ for exact build instructions.

Contributing

Found a compiler version we're missing? Open an issue with the contract address and deployment date. We'll build the matching compiler.

Related

About

Native C++ Solidity compiler builds for Ethereum bytecode archaeology (frontier-era 2015-2016)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors