| Crates.io | cairo-lang-runner |
| lib.rs | cairo-lang-runner |
| version | 2.12.4-dev.1 |
| created_at | 2023-01-04 07:44:54.403145+00 |
| updated_at | 2025-09-21 11:29:40.913893+00 |
| description | Basic cairo runner. |
| homepage | |
| repository | https://github.com/starkware-libs/cairo/ |
| max_upload_size | |
| id | 750723 |
| size | 383,401 |
cargo run --bin cairo-run -- --single-file /path/to/file.cairo
If we want to run code that is gas tested:
cargo run --bin cairo-run -- --single-file /path/to/file.cairo --available-gas 200
We currently only run the main function with no arguments besides implicits.
// Calculates fib...
fn main() -> u128 {
fib(1_u128, 1_u128, 100_u128)
}
fn fib(a: u128, b: u128, n: u128) -> u128 {
if n == 0 {
a
} else {
fib(b, a + b, n - 1_u128)
}
}
withdraw_gas_all will be automatically added.withdraw_gas_all will not compile without --available-gas value.withdraw_gas_all will not compile with --available-gas value.--print-full-memory should probably be used,
to actually see the values contained in the array.