Cairo Program Runner
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
Cairo Program Runner enables developers to execute and debug Cairo programs in a simulated environment. It reads and displays Cairo source code input with full program support, program output showing execution results, compilation status indicating success or failure, error messages with detailed descriptions, warning messages highlighting potential issues, program execution results with computed outputs, execution trace showing step-by-step program flow through the Cairo VM, memory state tracking all memory cells and values, register state displaying current register values (ap, fp, pc), program counter indicating the current instruction position, gas usage estimation for cost analysis, step counts tracking total execution steps, function call stacks showing call hierarchy, variable values for debugging, input parameters for program configuration, program metadata including function names and entry points, dependency resolution tracking imported modules, imported modules showing dependencies, execution logs for detailed debugging, performance metrics including execution time and step rates, program analysis results with structural insights, builtin usage tracking Cairo builtins (pedersen, range_check, etc.), segment information for memory organization, and relocatable values for program relocation. All data is organized in a clean dashboard with source code display, execution results, execution logs, and execution trace.
HOW TO USE
Enter your Cairo source code in the input area. Specify input parameters as a comma-separated list (e.g., 5,7). Click "Run Program" to start the execution. The tool will compile the source code, validate the syntax, and execute the program in a simulated Cairo VM environment. Results are displayed in organized cards showing compilation status, execution steps, gas estimate, output value, program counter, and memory state. The execution log section provides detailed logs of the compilation and execution process. The trace section shows step-by-step program execution. The tool works with any Cairo program that follows standard Cairo syntax and uses compatible builtins.
THE MECHANISM
Cairo Program Runner performs client-side simulation of the Cairo VM execution environment. The tool first parses the source code to identify function definitions, imports, and builtin usage. It then compiles the source code by validating syntax, checking for required imports, and building an execution plan. The compiler detects function signatures, parameter types, and return types. During execution, the tool simulates the Cairo VM by creating a virtual memory space, initializing registers (ap, fp, pc), and executing instructions step by step. Each instruction is processed by updating the program counter, modifying memory cells, and tracking register values. The tool supports common Cairo operations including arithmetic (add, sub, mul), function calls, and builtin usage. Memory state is maintained as a set of cells with values, and register state tracks the current ap (allocation pointer), fp (frame pointer), and pc (program counter). Gas estimation is performed by counting execution steps and applying a cost model based on operation complexity. Execution traces are generated by recording each instruction execution with detailed information about registers, memory, and operation results. The tool also analyzes program structure to identify function entry points, call relationships, and dependency imports.
WHAT IT CANNOT SEE
Cairo Program Runner cannot execute Cairo programs on-chain to verify behavior against actual Starknet state, as the simulation environment does not replicate on-chain conditions. The tool cannot detect runtime errors that only occur when executed in the actual Starknet VM environment, as the simulator may not reproduce all edge cases. It cannot verify that the Cairo code is secure or free from vulnerabilities without formal verification, which requires additional security analysis. The tool cannot guarantee that the executed program will behave identically when deployed to different Cairo versions or Starknet environments, as VM implementations may vary. It cannot predict actual L2 gas costs accurately without on-chain context, as L2 gas costs depend on network conditions. The tool also cannot detect issues that only manifest under specific transaction contexts or with particular input values.
PLEASE NOTE
Cairo Program Runner supports EVM-compatible chains only. The tool is a client-side simulation and does not execute or deploy code to any blockchain. Execution results are for development and testing purposes only — always test programs thoroughly on test networks before mainnet deployment. The tool is free to use and does not store or transmit any source code or execution results off-device. Always review execution logs and traces carefully before relying on program behavior.