Immutable Variable Extractor from Bytecode
Free to download on every platform. Comes pre-installed on BotFone, BotPad and BotFlip — with extra free apps included.
About this app
WHAT IT DOES
Immutable Variable Extractor from Bytecode is a read-only developer tool that extracts immutable variable values embedded in EVM smart contract bytecode. It scans contract bytecode for 32-byte, 20-byte (address), and 4-byte (selector) constant values that are inlined by the Solidity compiler, identifies potential immutable variables, and presents them in a structured format. The tool helps developers verify immutable values without running the contract, audit constructor-assigned constants, and understand the compiled state of immutable variables that are critical for contract behavior such as owner addresses, token names, or configuration parameters.
HOW TO USE
Connect your EVM-compatible wallet via the BGWallet bridge and select the network where your contract is deployed. Enter the contract address and click "Extract Immutables". The tool fetches the bytecode, scans for PUSH32 (0x7f), PUSH20 (0x73), and PUSH4 (0x63) opcodes to extract large values embedded in the code, and presents them in a table with inferred types. Results include a count of extracted values, a table with names, types, and values, and a textarea for copying the full list. The tool also detects metadata hashes if present. All analysis is read-only—no signatures or transactions are submitted.
TECHNICAL MECHANISM
The tool uses ethers.js v5.7.2 to fetch contract bytecode via provider.getCode(address), then performs pattern scanning on the hex string. The Solidity compiler inlines immutable variable values directly into the bytecode, often as PUSH32 (0x7f) for 32-byte values like addresses, hashes, or large numbers, PUSH20 (0x73) for Ethereum addresses, and PUSH4 (0x63) for function selectors. The tool scans for these opcodes and extracts the following 64, 40, or 8 hex characters respectively. It filters out zero values to avoid noise and deduplicates values where possible. Each extracted value is annotated with a name (immutable_0, immutable_1, etc.) and type (bytes32, address, bytes4). The tool also checks for the metadata hash marker (a264697066735822) to extract the IPFS/Swarm metadata hash as a special value. The extraction is deterministic and does not require source code verification, though naming and type inference are heuristic. The tool presents the values in a table with position metadata, enabling developers to cross-reference with disassembled bytecode.
WHAT IT CANNOT SEE
This tool has fundamental limitations that users must understand. It cannot extract immutable variables from contracts compiled without immutable support—contracts using older Solidity versions without the immutable keyword or where values are not inlined will show no immutables. It cannot determine variable names without source code verification—the tool can only assign generic names (immutable_0, etc.) without access to the original source code or ABI. It cannot distinguish immutable values from other constants embedded in bytecode—the tool may extract literals, constants, or even metadata that are not actually immutable variables. It cannot extract values for immutables that are set dynamically via complex expressions or external calls—if the immutable is assigned from a library call, external function, or computed value, it may not be inlined as a simple constant. It cannot extract values for immutables that are computed using non-constant expressions—immutable values must be compile-time constant or set in the constructor, and complex expressions may not be represented as single inlined values. It cannot extract immutables from contracts where the compiler optimized them away or where they are stored in a different format. The tool's type inference is heuristic and may mislabel values. It cannot verify that extracted values are actually immutable variables rather than other bytecode constants.
PLEASE NOTE
This tool only supports EVM-compatible blockchains (Ethereum, Polygon, BSC, Avalanche C-Chain, Optimism, Arbitrum, and their testnets). Solana, Tron, Starknet, SUI, TON, Aptos, Bitcoin, Cosmos, and XRP are not supported. The tool is free, open-source, requires no API keys, and uses the wallet's native provider for all read operations. Extracted values should be verified against the contract's source code and ABI for accuracy.