Immutable Variable Explainer
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 Explainer is a read-only tool that analyzes immutable variables in contracts, generating AI-powered plain-language explanations of what immutable variables are set, what values they hold, why they are immutable, and the risks of trusting these values. It reads immutable variable values, immutable variable declarations, contract bytecode, constructor arguments, deployment transaction, compiler version, optimization settings, variable types, storage layout, proxy pattern detection, upgradeable contract status, event logs, transaction history, and privileged function signatures. The tool then presents this data alongside an AI-generated analysis of the immutable variables, identifying whether the values appear reasonable, suspicious, or if the contract is upgradeable despite having immutables — helping you understand the contract's fixed configuration before interacting with or relying on it.
HOW TO USE
Connect your wallet using the BGWallet bridge and select your target network. Enter the contract address you want to analyze. Optionally enter a contract name for reference. Click "Analyze immutable variables" to read on-chain contract data. The tool displays the contract address, immutable count, variable names, variable values, and immutable risk level (Low/Medium/High). Detailed information includes compiler version, optimization settings, variable types, constructor arguments, storage layout, proxy pattern, upgradeable status, and deployment transaction. A risk assessment box provides a summary risk evaluation. An AI explanation appears below the on-chain data, explaining what immutable variables are set in the contract, what values they hold, why they are immutable, and the risks of trusting these values before you interact with or rely on the contract. The wallet's own signature step still protects you — this explanation is informational only and does not replace reviewing what you approve in your wallet.
TECHNICAL MECHANISM
The tool uses ethers.js v5.7.2 with the provider from the BGWallet bridge to read on-chain contract data. No hardcoded contract addresses are used — you are always in control of which contract you trust. When analyzing immutable variables, the tool reads immutable variable values by analyzing the contract bytecode and construction data, reads immutable variable declarations from the contract metadata, reads contract bytecode via provider.getCode(contract), reads constructor arguments from the deployment transaction, reads deployment transaction via provider.getTransactionReceipt(contract), reads compiler version from the contract metadata, reads optimization settings from the contract metadata, reads variable types by analyzing the ABI or metadata, reads storage layout by analyzing the bytecode, detects proxy patterns by scanning for known proxy opcode patterns and storage slots, detects upgradeable contract status by checking for proxy patterns and upgrade functions, reads event logs by scanning for deployment-related events, reads transaction history via provider.getTransactionCount(contract), and reads privileged function signatures by analyzing function selectors. The tool fetches event logs by walking backwards in chunks and halving chunk size on failure, ensuring logs are properly read despite varying RPC limitations. The data is formatted and passed to the AI bridge via BGAI.generate() with a structured prompt that includes all the on-chain data read. The AI is instructed to explain what immutable variables are set in the contract, what values they hold, why they are immutable, and the risks of trusting these values — while stating plainly that it cannot detect immutable variables that are set via off-chain constructor arguments not visible on-chain, cannot guarantee that immutable values will remain unchanged after deployment, and cannot detect immutable variables in contracts that use inline assembly or non-standard patterns. The AI response is capped at 1,024 tokens to ensure concise, focused immutable variable assessments. All computed values are guarded against negative numbers — if a value count or variable type appears invalid, the tool flags it rather than displaying nonsensical values.
WHAT IT CANNOT SEE
This tool cannot detect immutable variables that are set via off-chain constructor arguments not visible on-chain. It cannot guarantee that immutable values will remain unchanged after deployment. It cannot detect immutable variables in contracts that use inline assembly or non-standard patterns. It cannot detect malicious intent behind immutable variable values beyond bytecode analysis. The AI explanation is generated from on-chain data only and cannot detect off-chain constructor arguments, hidden immutable values, or social engineering attacks. It cannot predict whether an immutable value will cause issues in the future. The tool does not continuously monitor immutable variables; each analysis is a snapshot at the time of the lookup. It cannot detect delayed issues, hidden immutables, or off-chain factors. The tool does not store any data persistently; all state is in-memory and resets on reload. The AI explanation is informational and does not constitute financial advice, legal advice, or a guarantee of contract safety or immutable variable correctness.
PLEASE NOTE
Immutable Variable Explainer works exclusively with EVM-compatible chains. It requires a Web3 wallet (MetaMask or similar) and the BGWallet bridge. Explanations are AI-generated from data the app reads on-chain — always review what you are actually signing in your wallet before approving it. Immutable variables carry significant risk including hardcoded values that may be incorrect, malicious, or incompatible with upgradeable contracts. Use this tool as a guide only; always cross-check with independent sources and contract audits for critical decisions. This is experimental software; use at your own risk.