Solidity Profiler
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
Solidity Profiler is a developer tool that simulates gas and performance profiling for Solidity smart contracts. Paste your Solidity code and contract name — the tool analyzes the code structure and generates simulated metrics including estimated gas usage (with deployment gas), lines of code, function count, mappings, arrays, storage slots, optimization recommendations, and an optimization score (0-100). It displays the gas usage with a visual bar chart, optimization recommendations with color-coded badges, and a summary of the contract's complexity. This is essential for developers optimizing gas costs, identifying performance bottlenecks, or learning about Solidity optimization techniques.
HOW TO USE
Connect your wallet using the BGWallet bridge (MetaMask or any Web3 wallet). Enter the contract name. Paste your Solidity code in the text area — include the license identifier, pragma statement, and the contract code. Click "Profile contract" to generate the simulation. Results display the profiling status, contract name, estimated gas (deployment and execution), optimization score, and a detailed breakdown of code metrics including lines of code, functions, mappings, arrays, and storage slots. A gas usage bar shows the estimated cost relative to typical thresholds. Optimization recommendations are provided with badges (green for improvements, red for warnings). This is useful for understanding potential gas costs and optimizing code before deployment.
TECHNICAL MECHANISM
The tool simulates Solidity profiling using client-side analysis. It counts lines of code, functions (using regex to find function declarations), mappings, arrays, and storage slots (using pattern matching). Gas estimates are calculated based on the contract's complexity — base gas (100,000) plus per-line (500), per-function (10,000), per-mapping (15,000), and per-array (20,000) costs. Deployment gas is estimated as double the execution gas plus 100,000. Optimization recommendations are generated based on the code's characteristics — mappings suggest packing, arrays suggest dynamic vs fixed-size considerations, memory usage suggests using calldata, and large contracts suggest splitting into modules. The optimization score is calculated from the number of recommendations and code quality indicators. The tool does not actually execute the code — the profiling is a simulation for demonstration and planning purposes. All operations are performed client-side — no data is stored or transmitted. The tool is read-only and does not sign any transactions.
WHAT IT CANNOT SEE
The tool cannot actually profile Solidity code without a local development environment and execution framework — the profiling is a simulation. It cannot measure real gas usage or execution time without running the code — the estimates are based on code structure. It cannot detect performance bottlenecks without actual execution data — the simulation uses pattern matching. It cannot generate flame graphs or detailed performance reports — only basic metrics are provided. It cannot profile deployed contracts without transaction data — the tool only analyzes source code. It cannot provide exact gas costs for complex functions. The tool is read-only and does not sign any transactions.
PLEASE NOTE
This tool works exclusively with EVM-compatible chains for the wallet connection, but the profiling simulation is chain-agnostic. Solana, Tron, Starknet, SUI, TON, Aptos, Bitcoin, Cosmos, and XRP are not supported for wallet connection but the simulation works for Solidity code. The tool provides a simulation — for real profiling, use Hardhat, Foundry, or Truffle with gas reporting. The tool does not store any data — all operations are performed client-side. The tool is provided as-is with no warranty or liability. Always verify gas costs with a local development environment before deployment.