Crates.io | cairo-lang-runner |
lib.rs | cairo-lang-runner |
version | 2.9.0-dev.0 |
source | src |
created_at | 2023-01-04 07:44:54.403145 |
updated_at | 2024-10-20 19:04:51.006893 |
description | Basic cairo runner. |
homepage | |
repository | https://github.com/starkware-libs/cairo/ |
max_upload_size | |
id | 750723 |
size | 307,541 |
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 beside 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.