repo
stringlengths
6
65
file_url
stringlengths
81
311
file_path
stringlengths
6
227
content
stringlengths
0
32.8k
language
stringclasses
1 value
license
stringclasses
7 values
commit_sha
stringlengths
40
40
retrieved_at
stringdate
2026-01-04 15:31:58
2026-01-04 20:25:31
truncated
bool
2 classes
lambdaclass/cairo_native
https://github.com/lambdaclass/cairo_native/blob/f0a4fdbbad8a1730dea3b20c0b2ea140b9b853ce/src/types/coupon.rs
src/types/coupon.rs
//! # Coupon type. use super::WithSelf; use crate::{error::Result, metadata::MetadataStorage}; use cairo_lang_sierra::{ extensions::{ core::{CoreLibfunc, CoreType}, coupon::CouponConcreteType, }, program_registry::ProgramRegistry, }; use melior::{ dialect::llvm, ir::{r#type::Integer...
rust
Apache-2.0
f0a4fdbbad8a1730dea3b20c0b2ea140b9b853ce
2026-01-04T20:20:54.031924Z
false
lambdaclass/cairo_native
https://github.com/lambdaclass/cairo_native/blob/f0a4fdbbad8a1730dea3b20c0b2ea140b9b853ce/src/types/box.rs
src/types/box.rs
//! # Box type //! //! The type box for a given type `T`. //! //! ## Layout //! //! Its layout is that of whatever it wraps. In other words, if it was Rust it would be equivalent //! to the following: //! //! ``` //! #[repr(transparent)] //! pub struct Box<T>(pub T); //! ``` use super::WithSelf; use crate::{ error...
rust
Apache-2.0
f0a4fdbbad8a1730dea3b20c0b2ea140b9b853ce
2026-01-04T20:20:54.031924Z
false
lambdaclass/cairo_native
https://github.com/lambdaclass/cairo_native/blob/f0a4fdbbad8a1730dea3b20c0b2ea140b9b853ce/src/types/uint32.rs
src/types/uint32.rs
//! # Unsigned 32-bit integer type use super::WithSelf; use crate::{error::Result, metadata::MetadataStorage}; use cairo_lang_sierra::{ extensions::{ core::{CoreLibfunc, CoreType}, types::InfoOnlyConcreteType, }, program_registry::ProgramRegistry, }; use melior::{ ir::{r#type::IntegerTy...
rust
Apache-2.0
f0a4fdbbad8a1730dea3b20c0b2ea140b9b853ce
2026-01-04T20:20:54.031924Z
false
lambdaclass/cairo_native
https://github.com/lambdaclass/cairo_native/blob/f0a4fdbbad8a1730dea3b20c0b2ea140b9b853ce/src/types/ec_op.rs
src/types/ec_op.rs
//! # Elliptic curve operation type //! //! The ec operation type is used in the VM for computing bitwise operations. Since this can be done //! natively in MLIR, this type is effectively an unit type. use super::WithSelf; use crate::{error::Result, metadata::MetadataStorage}; use cairo_lang_sierra::{ extensions::...
rust
Apache-2.0
f0a4fdbbad8a1730dea3b20c0b2ea140b9b853ce
2026-01-04T20:20:54.031924Z
false
lambdaclass/cairo_native
https://github.com/lambdaclass/cairo_native/blob/f0a4fdbbad8a1730dea3b20c0b2ea140b9b853ce/src/types/int_range.rs
src/types/int_range.rs
//! # Int range of type T //! //! A range [x, y) where x <= y //! //! ## Layout //! //! A struct with 2 fields of type T //! //! ``` //! #[repr(transparent)] //! pub struct NonZero<T>(pub T); //! ``` use super::WithSelf; use crate::{error::Result, metadata::MetadataStorage, utils::ProgramRegistryExt}; use cairo_lang_s...
rust
Apache-2.0
f0a4fdbbad8a1730dea3b20c0b2ea140b9b853ce
2026-01-04T20:20:54.031924Z
false
lambdaclass/cairo_native
https://github.com/lambdaclass/cairo_native/blob/f0a4fdbbad8a1730dea3b20c0b2ea140b9b853ce/src/types/bounded_int.rs
src/types/bounded_int.rs
//! # `BoundedInt` type //! //! A `BoundedInt` is a int with a lower and high bound. //! //! It's represented as the offseted range using the minimal number of bits. For example: //! - 10 as `BoundedInt<10, 20>` is represented as `0 : i4`. //! - 15 as `BoundedInt<10, 20>` is represented as `5 : i4`. //! - 1 as `B...
rust
Apache-2.0
f0a4fdbbad8a1730dea3b20c0b2ea140b9b853ce
2026-01-04T20:20:54.031924Z
false
lambdaclass/cairo_native
https://github.com/lambdaclass/cairo_native/blob/f0a4fdbbad8a1730dea3b20c0b2ea140b9b853ce/src/types/pedersen.rs
src/types/pedersen.rs
//! # Pedersen type //! //! Type representing the Pedersen hash builtin. use super::WithSelf; use crate::{error::Result, metadata::MetadataStorage}; use cairo_lang_sierra::{ extensions::{ core::{CoreLibfunc, CoreType}, types::InfoOnlyConcreteType, }, program_registry::ProgramRegistry, }; us...
rust
Apache-2.0
f0a4fdbbad8a1730dea3b20c0b2ea140b9b853ce
2026-01-04T20:20:54.031924Z
false
lambdaclass/cairo_native
https://github.com/lambdaclass/cairo_native/blob/f0a4fdbbad8a1730dea3b20c0b2ea140b9b853ce/src/types/uint128.rs
src/types/uint128.rs
//! # Unsigned 128-bit integer type use super::WithSelf; use crate::{error::Result, metadata::MetadataStorage}; use cairo_lang_sierra::{ extensions::{ core::{CoreLibfunc, CoreType}, types::InfoOnlyConcreteType, }, program_registry::ProgramRegistry, }; use melior::{ ir::{r#type::IntegerT...
rust
Apache-2.0
f0a4fdbbad8a1730dea3b20c0b2ea140b9b853ce
2026-01-04T20:20:54.031924Z
false
lambdaclass/cairo_native
https://github.com/lambdaclass/cairo_native/blob/f0a4fdbbad8a1730dea3b20c0b2ea140b9b853ce/src/types/felt252_dict_entry.rs
src/types/felt252_dict_entry.rs
//! # `Felt` dictionary entry type //! //! The entry type returning when getting a value from a dictionary. //! //! It is represented as the following struct: //! //! | Index | Type | Description | //! | ----- | -------------- | -------------------------------------------- | /...
rust
Apache-2.0
f0a4fdbbad8a1730dea3b20c0b2ea140b9b853ce
2026-01-04T20:20:54.031924Z
false
lambdaclass/cairo_native
https://github.com/lambdaclass/cairo_native/blob/f0a4fdbbad8a1730dea3b20c0b2ea140b9b853ce/src/types/gas_reserve.rs
src/types/gas_reserve.rs
use super::WithSelf; use crate::{error::Result, metadata::MetadataStorage}; use cairo_lang_sierra::{ extensions::{ core::{CoreLibfunc, CoreType}, types::InfoOnlyConcreteType, }, program_registry::ProgramRegistry, }; use melior::{ ir::{r#type::IntegerType, Module, Type}, Context, }; ...
rust
Apache-2.0
f0a4fdbbad8a1730dea3b20c0b2ea140b9b853ce
2026-01-04T20:20:54.031924Z
false
lambdaclass/cairo_native
https://github.com/lambdaclass/cairo_native/blob/f0a4fdbbad8a1730dea3b20c0b2ea140b9b853ce/src/types/uninitialized.rs
src/types/uninitialized.rs
//! # Uninitialized type use super::WithSelf; use crate::{error::Result, metadata::MetadataStorage, utils::ProgramRegistryExt}; use cairo_lang_sierra::{ extensions::{ core::{CoreLibfunc, CoreType}, types::InfoAndTypeConcreteType, }, program_registry::ProgramRegistry, }; use melior::{ ir...
rust
Apache-2.0
f0a4fdbbad8a1730dea3b20c0b2ea140b9b853ce
2026-01-04T20:20:54.031924Z
false
lambdaclass/cairo_native
https://github.com/lambdaclass/cairo_native/blob/f0a4fdbbad8a1730dea3b20c0b2ea140b9b853ce/src/types/builtin_costs.rs
src/types/builtin_costs.rs
//! # Builtin costs type //! //! A ptr to a list of u64, this list will not change at runtime in size and thus we only really need to store the pointer, //! it can be allocated on the stack on rust side and passed. use super::WithSelf; use crate::{error::Result, metadata::MetadataStorage}; use cairo_lang_sierra::{ ...
rust
Apache-2.0
f0a4fdbbad8a1730dea3b20c0b2ea140b9b853ce
2026-01-04T20:20:54.031924Z
false
lambdaclass/cairo_native
https://github.com/lambdaclass/cairo_native/blob/f0a4fdbbad8a1730dea3b20c0b2ea140b9b853ce/src/types/ec_point.rs
src/types/ec_point.rs
//! # Elliptic curve point type use super::WithSelf; use crate::{error::Result, metadata::MetadataStorage}; use cairo_lang_sierra::{ extensions::{ core::{CoreLibfunc, CoreType}, types::InfoOnlyConcreteType, }, program_registry::ProgramRegistry, }; use melior::{ dialect::llvm, ir::{r...
rust
Apache-2.0
f0a4fdbbad8a1730dea3b20c0b2ea140b9b853ce
2026-01-04T20:20:54.031924Z
false
lambdaclass/cairo_native
https://github.com/lambdaclass/cairo_native/blob/f0a4fdbbad8a1730dea3b20c0b2ea140b9b853ce/src/types/nullable.rs
src/types/nullable.rs
//! # Nullable type //! //! Nullable is represented as a pointer, usually the null value will point to a alloca in the stack. //! //! A nullable is functionally equivalent to Rust's `Option<Box<T>>`. Since it's always paired with //! `Box<T>` we can reuse its pointer, just leaving it null when there's no value. use su...
rust
Apache-2.0
f0a4fdbbad8a1730dea3b20c0b2ea140b9b853ce
2026-01-04T20:20:54.031924Z
false
lambdaclass/cairo_native
https://github.com/lambdaclass/cairo_native/blob/f0a4fdbbad8a1730dea3b20c0b2ea140b9b853ce/src/types/starknet.rs
src/types/starknet.rs
//! # Starknet types //! //! ## ClassHash //! Type for Starknet class hash, a value in the range [0, 2 ** 251). //! //! ## ContractAddress //! Type for Starknet contract address, a value in the range [0, 2 ** 251). //! //! ## StorageBaseAddress //! Type for Starknet storage base address, a value in the range [0, 2 ** 2...
rust
Apache-2.0
f0a4fdbbad8a1730dea3b20c0b2ea140b9b853ce
2026-01-04T20:20:54.031924Z
false
lambdaclass/cairo_native
https://github.com/lambdaclass/cairo_native/blob/f0a4fdbbad8a1730dea3b20c0b2ea140b9b853ce/src/types/segment_arena.rs
src/types/segment_arena.rs
//! # Segment arena type use super::WithSelf; use crate::{error::Result, metadata::MetadataStorage}; use cairo_lang_sierra::{ extensions::{ core::{CoreLibfunc, CoreType}, types::InfoOnlyConcreteType, }, program_registry::ProgramRegistry, }; use melior::{ ir::{r#type::IntegerType, Module...
rust
Apache-2.0
f0a4fdbbad8a1730dea3b20c0b2ea140b9b853ce
2026-01-04T20:20:54.031924Z
false
lambdaclass/cairo_native
https://github.com/lambdaclass/cairo_native/blob/f0a4fdbbad8a1730dea3b20c0b2ea140b9b853ce/src/types/felt252.rs
src/types/felt252.rs
//! # `felt252` type //! //! A `felt252` is a 252-bit number within a //! [finite field](https://en.wikipedia.org/wiki/Finite_field) modulo //! [a prime number](crate::utils::PRIME). use super::WithSelf; use crate::{error::Result, metadata::MetadataStorage}; use cairo_lang_sierra::{ extensions::{ core::{Co...
rust
Apache-2.0
f0a4fdbbad8a1730dea3b20c0b2ea140b9b853ce
2026-01-04T20:20:54.031924Z
false
lambdaclass/cairo_native
https://github.com/lambdaclass/cairo_native/blob/f0a4fdbbad8a1730dea3b20c0b2ea140b9b853ce/src/types/bytes31.rs
src/types/bytes31.rs
//! # `bytes31` type //! //! A `bytes31` is a 248-bit number (31 bytes). use crate::{error::Result, metadata::MetadataStorage}; use cairo_lang_sierra::{ extensions::{ core::{CoreLibfunc, CoreType}, types::InfoOnlyConcreteType, }, program_registry::ProgramRegistry, }; use melior::{ ir::{...
rust
Apache-2.0
f0a4fdbbad8a1730dea3b20c0b2ea140b9b853ce
2026-01-04T20:20:54.031924Z
false
lambdaclass/cairo_native
https://github.com/lambdaclass/cairo_native/blob/f0a4fdbbad8a1730dea3b20c0b2ea140b9b853ce/src/types/uint16.rs
src/types/uint16.rs
//! # Unsigned 16-bit integer type use super::WithSelf; use crate::{error::Result, metadata::MetadataStorage}; use cairo_lang_sierra::{ extensions::{ core::{CoreLibfunc, CoreType}, types::InfoOnlyConcreteType, }, program_registry::ProgramRegistry, }; use melior::{ ir::{r#type::IntegerTy...
rust
Apache-2.0
f0a4fdbbad8a1730dea3b20c0b2ea140b9b853ce
2026-01-04T20:20:54.031924Z
false
lambdaclass/cairo_native
https://github.com/lambdaclass/cairo_native/blob/f0a4fdbbad8a1730dea3b20c0b2ea140b9b853ce/src/types/squashed_felt252_dict.rs
src/types/squashed_felt252_dict.rs
//! # Squashed `Felt` dictionary type use super::WithSelf; use crate::{error::Result, metadata::MetadataStorage}; use cairo_lang_sierra::{ extensions::{ core::{CoreLibfunc, CoreType}, types::InfoAndTypeConcreteType, }, program_registry::ProgramRegistry, }; use melior::{ ir::{Module, Typ...
rust
Apache-2.0
f0a4fdbbad8a1730dea3b20c0b2ea140b9b853ce
2026-01-04T20:20:54.031924Z
false
lambdaclass/cairo_native
https://github.com/lambdaclass/cairo_native/blob/f0a4fdbbad8a1730dea3b20c0b2ea140b9b853ce/src/types/snapshot.rs
src/types/snapshot.rs
//! # Snapshot type //! //! The type snapshot for a given type `T`. //! //! ## Layout //! //! Its layout is that of whatever it wraps. In other words, if it was Rust it would be equivalent //! to the following: //! //! ``` //! #[repr(transparent)] //! pub struct Snapshot<T>(pub T); //! ``` use super::{TypeBuilder, Wit...
rust
Apache-2.0
f0a4fdbbad8a1730dea3b20c0b2ea140b9b853ce
2026-01-04T20:20:54.031924Z
false
lambdaclass/cairo_native
https://github.com/lambdaclass/cairo_native/blob/f0a4fdbbad8a1730dea3b20c0b2ea140b9b853ce/src/types/felt252_dict.rs
src/types/felt252_dict.rs
//! # `Felt` dictionary type //! //! A key value storage for values whose type implement Copy. The key is always a felt. //! //! This type is represented as a pointer to a tuple of a heap allocated Rust hashmap along with a u64 //! used to count accesses to the dictionary. The type is interacted through the runtime fun...
rust
Apache-2.0
f0a4fdbbad8a1730dea3b20c0b2ea140b9b853ce
2026-01-04T20:20:54.031924Z
false
lambdaclass/cairo_native
https://github.com/lambdaclass/cairo_native/blob/f0a4fdbbad8a1730dea3b20c0b2ea140b9b853ce/src/types/poseidon.rs
src/types/poseidon.rs
//! # Poseidon type //! //! Type representing the Poseidon builtin. use super::WithSelf; use crate::{error::Result, metadata::MetadataStorage}; use cairo_lang_sierra::{ extensions::{ core::{CoreLibfunc, CoreType}, types::InfoOnlyConcreteType, }, program_registry::ProgramRegistry, }; use mel...
rust
Apache-2.0
f0a4fdbbad8a1730dea3b20c0b2ea140b9b853ce
2026-01-04T20:20:54.031924Z
false
lambdaclass/cairo_native
https://github.com/lambdaclass/cairo_native/blob/f0a4fdbbad8a1730dea3b20c0b2ea140b9b853ce/src/types/enum.rs
src/types/enum.rs
//! # Enum type //! //! Enumerations are special because they can potentially represent an unlimited amount of things at //! the same time. They are similar to Rust enums since they can contain data along with the //! discriminator. //! //! ## Layout //! //! | Index | Type | Description | /...
rust
Apache-2.0
f0a4fdbbad8a1730dea3b20c0b2ea140b9b853ce
2026-01-04T20:20:54.031924Z
false
lambdaclass/cairo_native
https://github.com/lambdaclass/cairo_native/blob/f0a4fdbbad8a1730dea3b20c0b2ea140b9b853ce/src/types/uint64.rs
src/types/uint64.rs
//! # Unsigned 64-bit integer type use super::WithSelf; use crate::{error::Result, metadata::MetadataStorage}; use cairo_lang_sierra::{ extensions::{ core::{CoreLibfunc, CoreType}, types::InfoOnlyConcreteType, }, program_registry::ProgramRegistry, }; use melior::{ ir::{r#type::IntegerTy...
rust
Apache-2.0
f0a4fdbbad8a1730dea3b20c0b2ea140b9b853ce
2026-01-04T20:20:54.031924Z
false
lambdaclass/cairo_native
https://github.com/lambdaclass/cairo_native/blob/f0a4fdbbad8a1730dea3b20c0b2ea140b9b853ce/src/types/ec_state.rs
src/types/ec_state.rs
//! # Elliptic curve state type use super::WithSelf; use crate::{error::Result, metadata::MetadataStorage}; use cairo_lang_sierra::{ extensions::{ core::{CoreLibfunc, CoreType}, types::InfoOnlyConcreteType, }, program_registry::ProgramRegistry, }; use melior::{ dialect::llvm, ir::{r...
rust
Apache-2.0
f0a4fdbbad8a1730dea3b20c0b2ea140b9b853ce
2026-01-04T20:20:54.031924Z
false
lambdaclass/cairo_native
https://github.com/lambdaclass/cairo_native/blob/f0a4fdbbad8a1730dea3b20c0b2ea140b9b853ce/src/types/non_zero.rs
src/types/non_zero.rs
//! # Non-zero type //! //! The non-zero generic type guarantees that whatever value it has is not zero. //! //! ## Layout //! //! Its layout is that of whatever it wraps. In other words, if it was Rust it would be equivalent //! to the following: //! //! ``` //! #[repr(transparent)] //! pub struct NonZero<T>(pub T); /...
rust
Apache-2.0
f0a4fdbbad8a1730dea3b20c0b2ea140b9b853ce
2026-01-04T20:20:54.031924Z
false
lambdaclass/cairo_native
https://github.com/lambdaclass/cairo_native/blob/f0a4fdbbad8a1730dea3b20c0b2ea140b9b853ce/src/arch/x86_64.rs
src/arch/x86_64.rs
//! # Implementations of `AbiArgument` for the `x86_64` architecture. //! //! The x86_64 architecture uses 6 64-bit registers for arguments. This means that the first 48 //! bytes of the buffer will go into registers while the rest will be on the stack. //! //! The values that span multiple registers may be split or mo...
rust
Apache-2.0
f0a4fdbbad8a1730dea3b20c0b2ea140b9b853ce
2026-01-04T20:20:54.031924Z
false
lambdaclass/cairo_native
https://github.com/lambdaclass/cairo_native/blob/f0a4fdbbad8a1730dea3b20c0b2ea140b9b853ce/src/arch/aarch64.rs
src/arch/aarch64.rs
//! # Implementations of `AbiArgument` for the `aarch64` architecture. //! //! The aarch64 architecture uses 8 64-bit registers for arguments. This means that the first 64 //! bytes of the buffer will go into registers while the rest will be on the stack. //! //! The values that span multiple registers may be split or ...
rust
Apache-2.0
f0a4fdbbad8a1730dea3b20c0b2ea140b9b853ce
2026-01-04T20:20:54.031924Z
false
lambdaclass/cairo_native
https://github.com/lambdaclass/cairo_native/blob/f0a4fdbbad8a1730dea3b20c0b2ea140b9b853ce/src/executor/contract.rs
src/executor/contract.rs
//! A specialized executor for Starknet contracts, avoiding the overhead of storing the sierra program registry and //! enabling efficient serialization of the program/data once compiled. //! //! This executor heavily relies on the stability of the contract entry point argument order. //! //! Right now this order is li...
rust
Apache-2.0
f0a4fdbbad8a1730dea3b20c0b2ea140b9b853ce
2026-01-04T20:20:54.031924Z
true
lambdaclass/cairo_native
https://github.com/lambdaclass/cairo_native/blob/f0a4fdbbad8a1730dea3b20c0b2ea140b9b853ce/src/executor/aot.rs
src/executor/aot.rs
use crate::{ error::Error, execution_result::{ContractExecutionResult, ExecutionResult}, metadata::{ felt252_dict::Felt252DictOverrides, gas::GasMetadata, runtime_bindings::setup_runtime, }, module::NativeModule, starknet::{DummySyscallHandler, StarknetSyscallHandler}, utils::generat...
rust
Apache-2.0
f0a4fdbbad8a1730dea3b20c0b2ea140b9b853ce
2026-01-04T20:20:54.031924Z
false
lambdaclass/cairo_native
https://github.com/lambdaclass/cairo_native/blob/f0a4fdbbad8a1730dea3b20c0b2ea140b9b853ce/src/executor/jit.rs
src/executor/jit.rs
use crate::{ error::Error, execution_result::{ContractExecutionResult, ExecutionResult}, metadata::{ felt252_dict::Felt252DictOverrides, gas::GasMetadata, runtime_bindings::setup_runtime, }, module::NativeModule, starknet::{DummySyscallHandler, StarknetSyscallHandler}, utils::{create...
rust
Apache-2.0
f0a4fdbbad8a1730dea3b20c0b2ea140b9b853ce
2026-01-04T20:20:54.031924Z
false
lambdaclass/cairo_native
https://github.com/lambdaclass/cairo_native/blob/f0a4fdbbad8a1730dea3b20c0b2ea140b9b853ce/tests/common.rs
tests/common.rs
//! This module contains common code used by all integration tests, which use proptest to compare various outputs based on the inputs //! The general idea is to have a test for each libfunc if possible. #![allow(dead_code)] use ark_ff::One; use cairo_lang_compiler::{ compile_prepared_db, db::RootDatabase, project...
rust
Apache-2.0
f0a4fdbbad8a1730dea3b20c0b2ea140b9b853ce
2026-01-04T20:20:54.031924Z
true
lambdaclass/cairo_native
https://github.com/lambdaclass/cairo_native/blob/f0a4fdbbad8a1730dea3b20c0b2ea140b9b853ce/tests/entry.rs
tests/entry.rs
//! To avoid generating lot of test executables, this is the single entry point of all tests. pub mod common; pub mod tests;
rust
Apache-2.0
f0a4fdbbad8a1730dea3b20c0b2ea140b9b853ce
2026-01-04T20:20:54.031924Z
false
lambdaclass/cairo_native
https://github.com/lambdaclass/cairo_native/blob/f0a4fdbbad8a1730dea3b20c0b2ea140b9b853ce/tests/tests/circuit.rs
tests/tests/circuit.rs
use crate::common::{compare_outputs, DEFAULT_GAS}; use crate::common::{load_cairo, run_native_program, run_vm_program}; use cairo_lang_runner::SierraCasmRunner; use cairo_lang_sierra::program::Program; use cairo_native::starknet::DummySyscallHandler; use cairo_native::Value; use lazy_static::lazy_static; lazy_static! ...
rust
Apache-2.0
f0a4fdbbad8a1730dea3b20c0b2ea140b9b853ce
2026-01-04T20:20:54.031924Z
true
lambdaclass/cairo_native
https://github.com/lambdaclass/cairo_native/blob/f0a4fdbbad8a1730dea3b20c0b2ea140b9b853ce/tests/tests/boolean.rs
tests/tests/boolean.rs
use crate::common::{compare_outputs, load_cairo, run_native_program, run_vm_program, DEFAULT_GAS}; use cairo_lang_runner::{Arg, SierraCasmRunner}; use cairo_lang_sierra::program::Program; use cairo_native::{starknet::DummySyscallHandler, Value}; use lazy_static::lazy_static; use proptest::prelude::*; use starknet_types...
rust
Apache-2.0
f0a4fdbbad8a1730dea3b20c0b2ea140b9b853ce
2026-01-04T20:20:54.031924Z
false
lambdaclass/cairo_native
https://github.com/lambdaclass/cairo_native/blob/f0a4fdbbad8a1730dea3b20c0b2ea140b9b853ce/tests/tests/trampoline.rs
tests/tests/trampoline.rs
use crate::common::load_cairo; use cairo_lang_sierra::program::Program; use cairo_native::{ context::NativeContext, execution_result::{BuiltinStats, ExecutionResult}, executor::JitNativeExecutor, utils::find_function_id, OptLevel, Value, }; use starknet_types_core::felt::Felt; fn run_program(progra...
rust
Apache-2.0
f0a4fdbbad8a1730dea3b20c0b2ea140b9b853ce
2026-01-04T20:20:54.031924Z
false
lambdaclass/cairo_native
https://github.com/lambdaclass/cairo_native/blob/f0a4fdbbad8a1730dea3b20c0b2ea140b9b853ce/tests/tests/arrays.rs
tests/tests/arrays.rs
use crate::common::{any_felt, load_cairo, run_native_program, run_vm_program}; use crate::common::{compare_outputs, DEFAULT_GAS}; use cairo_lang_runner::{Arg, SierraCasmRunner}; use cairo_lang_sierra::program::Program; use cairo_native::starknet::DummySyscallHandler; use cairo_native::Value; use lazy_static::lazy_stati...
rust
Apache-2.0
f0a4fdbbad8a1730dea3b20c0b2ea140b9b853ce
2026-01-04T20:20:54.031924Z
false
lambdaclass/cairo_native
https://github.com/lambdaclass/cairo_native/blob/f0a4fdbbad8a1730dea3b20c0b2ea140b9b853ce/tests/tests/alexandria.rs
tests/tests/alexandria.rs
use crate::common::{compare_outputs, run_native_program, run_vm_program, DEFAULT_GAS}; use cairo_lang_runner::SierraCasmRunner; use cairo_lang_sierra::program::Program; use cairo_native::starknet::DummySyscallHandler; use std::{fs::File, io::BufReader}; use test_case::test_case; #[track_caller] fn compare_inputless_fu...
rust
Apache-2.0
f0a4fdbbad8a1730dea3b20c0b2ea140b9b853ce
2026-01-04T20:20:54.031924Z
false
lambdaclass/cairo_native
https://github.com/lambdaclass/cairo_native/blob/f0a4fdbbad8a1730dea3b20c0b2ea140b9b853ce/tests/tests/uint.rs
tests/tests/uint.rs
use crate::common::{compare_outputs, load_cairo, run_native_program, run_vm_program, DEFAULT_GAS}; use cairo_lang_runner::{Arg, SierraCasmRunner}; use cairo_lang_sierra::program::Program; use cairo_native::{starknet::DummySyscallHandler, Value}; use lazy_static::lazy_static; use proptest::prelude::*; lazy_static! { ...
rust
Apache-2.0
f0a4fdbbad8a1730dea3b20c0b2ea140b9b853ce
2026-01-04T20:20:54.031924Z
false
lambdaclass/cairo_native
https://github.com/lambdaclass/cairo_native/blob/f0a4fdbbad8a1730dea3b20c0b2ea140b9b853ce/tests/tests/result.rs
tests/tests/result.rs
use cairo_native::{ execution_result::{BuiltinStats, ContractExecutionResult, ExecutionResult}, Value, }; use test_case::test_case; fn from_execution_result( res: ExecutionResult, ) -> Result<ContractExecutionResult, cairo_native::error::Error> { ContractExecutionResult::from_execution_result(res) } #...
rust
Apache-2.0
f0a4fdbbad8a1730dea3b20c0b2ea140b9b853ce
2026-01-04T20:20:54.031924Z
false
lambdaclass/cairo_native
https://github.com/lambdaclass/cairo_native/blob/f0a4fdbbad8a1730dea3b20c0b2ea140b9b853ce/tests/tests/libfuncs.rs
tests/tests/libfuncs.rs
use crate::common::{compare_outputs, load_cairo, run_native_program, run_vm_program}; use cairo_native::starknet::DummySyscallHandler; #[test] fn enum_init() { let program = load_cairo! { enum MySmallEnum { A: felt252, } enum MyEnum { A: felt252, B: u8, ...
rust
Apache-2.0
f0a4fdbbad8a1730dea3b20c0b2ea140b9b853ce
2026-01-04T20:20:54.031924Z
false
lambdaclass/cairo_native
https://github.com/lambdaclass/cairo_native/blob/f0a4fdbbad8a1730dea3b20c0b2ea140b9b853ce/tests/tests/compile_library.rs
tests/tests/compile_library.rs
use crate::common::load_cairo; use cairo_native::context::NativeContext; use std::error::Error; use tempfile::NamedTempFile; #[test] pub fn compile_library() -> Result<(), Box<dyn Error>> { // Load the program. let context = NativeContext::new(); let program = load_cairo! { fn run_test(lhs: felt25...
rust
Apache-2.0
f0a4fdbbad8a1730dea3b20c0b2ea140b9b853ce
2026-01-04T20:20:54.031924Z
false
lambdaclass/cairo_native
https://github.com/lambdaclass/cairo_native/blob/f0a4fdbbad8a1730dea3b20c0b2ea140b9b853ce/tests/tests/mod.rs
tests/tests/mod.rs
pub mod alexandria; pub mod arrays; pub mod boolean; pub mod cases; pub mod circuit; pub mod compile_library; pub mod dict; pub mod ec; pub mod felt252; pub mod libfuncs; pub mod programs; pub mod result; pub mod starknet; pub mod trampoline; pub mod uint;
rust
Apache-2.0
f0a4fdbbad8a1730dea3b20c0b2ea140b9b853ce
2026-01-04T20:20:54.031924Z
false
lambdaclass/cairo_native
https://github.com/lambdaclass/cairo_native/blob/f0a4fdbbad8a1730dea3b20c0b2ea140b9b853ce/tests/tests/felt252.rs
tests/tests/felt252.rs
use crate::common::{ any_felt, compare_outputs, load_cairo, nonzero_felt, run_native_program, run_vm_program, DEFAULT_GAS, }; use cairo_lang_runner::{Arg, SierraCasmRunner}; use cairo_lang_sierra::program::Program; use cairo_native::{starknet::DummySyscallHandler, Value}; use lazy_static::lazy_static; use propt...
rust
Apache-2.0
f0a4fdbbad8a1730dea3b20c0b2ea140b9b853ce
2026-01-04T20:20:54.031924Z
false
lambdaclass/cairo_native
https://github.com/lambdaclass/cairo_native/blob/f0a4fdbbad8a1730dea3b20c0b2ea140b9b853ce/tests/tests/ec.rs
tests/tests/ec.rs
use crate::common::{ any_felt, compare_outputs, load_cairo, run_native_program, run_vm_program, DEFAULT_GAS, }; use cairo_lang_runner::{Arg, SierraCasmRunner}; use cairo_lang_sierra::program::Program; use cairo_native::{starknet::DummySyscallHandler, Value}; use lazy_static::lazy_static; use num_bigint::BigUint; us...
rust
Apache-2.0
f0a4fdbbad8a1730dea3b20c0b2ea140b9b853ce
2026-01-04T20:20:54.031924Z
false
lambdaclass/cairo_native
https://github.com/lambdaclass/cairo_native/blob/f0a4fdbbad8a1730dea3b20c0b2ea140b9b853ce/tests/tests/programs.rs
tests/tests/programs.rs
use crate::common::{any_felt, load_cairo, run_native_program, run_vm_program}; use crate::common::{compare_outputs, DEFAULT_GAS}; use cairo_lang_runner::{Arg, SierraCasmRunner}; use cairo_lang_sierra::program::Program; use cairo_native::starknet::DummySyscallHandler; use cairo_native::utils::felt252_str; use cairo_nati...
rust
Apache-2.0
f0a4fdbbad8a1730dea3b20c0b2ea140b9b853ce
2026-01-04T20:20:54.031924Z
false
lambdaclass/cairo_native
https://github.com/lambdaclass/cairo_native/blob/f0a4fdbbad8a1730dea3b20c0b2ea140b9b853ce/tests/tests/cases.rs
tests/tests/cases.rs
use crate::common::{ compare_inputless_program, load_cairo_contract_path, run_native_starknet_contract, run_vm_contract, }; use cairo_native::starknet::DummySyscallHandler; use itertools::Itertools; use pretty_assertions_sorted::assert_eq_sorted; use test_case::test_case; // Test cases for programs without inp...
rust
Apache-2.0
f0a4fdbbad8a1730dea3b20c0b2ea140b9b853ce
2026-01-04T20:20:54.031924Z
false
lambdaclass/cairo_native
https://github.com/lambdaclass/cairo_native/blob/f0a4fdbbad8a1730dea3b20c0b2ea140b9b853ce/tests/tests/dict.rs
tests/tests/dict.rs
use crate::common::{ any_felt, compare_outputs, load_cairo, run_native_program, run_vm_program, DEFAULT_GAS, }; use cairo_lang_runner::{Arg, SierraCasmRunner}; use cairo_lang_sierra::program::Program; use cairo_native::{starknet::DummySyscallHandler, Value}; use lazy_static::lazy_static; use proptest::prelude::*; u...
rust
Apache-2.0
f0a4fdbbad8a1730dea3b20c0b2ea140b9b853ce
2026-01-04T20:20:54.031924Z
false
lambdaclass/cairo_native
https://github.com/lambdaclass/cairo_native/blob/f0a4fdbbad8a1730dea3b20c0b2ea140b9b853ce/tests/tests/starknet/secp256.rs
tests/tests/starknet/secp256.rs
use crate::common::{load_cairo_path, run_native_program}; use cairo_lang_runner::SierraCasmRunner; use cairo_lang_sierra::program::Program; use cairo_native::{ starknet::{Secp256k1Point, Secp256r1Point, StarknetSyscallHandler, SyscallResult, U256}, Value, }; use lazy_static::lazy_static; use pretty_assertions_s...
rust
Apache-2.0
f0a4fdbbad8a1730dea3b20c0b2ea140b9b853ce
2026-01-04T20:20:54.031924Z
true
lambdaclass/cairo_native
https://github.com/lambdaclass/cairo_native/blob/f0a4fdbbad8a1730dea3b20c0b2ea140b9b853ce/tests/tests/starknet/syscalls.rs
tests/tests/starknet/syscalls.rs
use crate::common::{load_cairo_path, run_native_program}; use cairo_lang_runner::SierraCasmRunner; use cairo_lang_sierra::program::Program; use cairo_native::{ starknet::{ BlockInfo, ExecutionInfo, ExecutionInfoV2, ExecutionInfoV3, Secp256k1Point, Secp256r1Point, StarknetSyscallHandler, SyscallResul...
rust
Apache-2.0
f0a4fdbbad8a1730dea3b20c0b2ea140b9b853ce
2026-01-04T20:20:54.031924Z
true
lambdaclass/cairo_native
https://github.com/lambdaclass/cairo_native/blob/f0a4fdbbad8a1730dea3b20c0b2ea140b9b853ce/tests/tests/starknet/u256.rs
tests/tests/starknet/u256.rs
use crate::common::run_native_starknet_contract; use cairo_lang_compiler::CompilerConfig; use cairo_lang_lowering::utils::InliningStrategy; use cairo_lang_starknet::compile::compile_path; use cairo_native::starknet_stub::StubSyscallHandler; use lazy_static::lazy_static; use starknet_types_core::felt::Felt; use std::pat...
rust
Apache-2.0
f0a4fdbbad8a1730dea3b20c0b2ea140b9b853ce
2026-01-04T20:20:54.031924Z
false
lambdaclass/cairo_native
https://github.com/lambdaclass/cairo_native/blob/f0a4fdbbad8a1730dea3b20c0b2ea140b9b853ce/tests/tests/starknet/keccak.rs
tests/tests/starknet/keccak.rs
use crate::common::{run_native_starknet_aot_contract, run_native_starknet_contract}; use cairo_lang_compiler::CompilerConfig; use cairo_lang_lowering::utils::InliningStrategy; use cairo_lang_starknet::compile::compile_path; use cairo_native::starknet_stub::StubSyscallHandler; use lazy_static::lazy_static; use std::path...
rust
Apache-2.0
f0a4fdbbad8a1730dea3b20c0b2ea140b9b853ce
2026-01-04T20:20:54.031924Z
false
lambdaclass/cairo_native
https://github.com/lambdaclass/cairo_native/blob/f0a4fdbbad8a1730dea3b20c0b2ea140b9b853ce/tests/tests/starknet/mod.rs
tests/tests/starknet/mod.rs
mod keccak; mod secp256; mod u256; #[cfg(feature = "with-cheatcode")] mod syscalls;
rust
Apache-2.0
f0a4fdbbad8a1730dea3b20c0b2ea140b9b853ce
2026-01-04T20:20:54.031924Z
false
lambdaclass/cairo_native
https://github.com/lambdaclass/cairo_native/blob/f0a4fdbbad8a1730dea3b20c0b2ea140b9b853ce/binaries/cairo-native-test/src/main.rs
binaries/cairo-native-test/src/main.rs
use anyhow::bail; use cairo_lang_compiler::project::check_compiler_path; use cairo_lang_test_plugin::TestsCompilationConfig; use cairo_lang_test_runner::TestCompiler; use cairo_native_bin_utils::{ test::{display_tests_summary, filter_test_cases, run_tests}, RunArgs, }; use clap::Parser; use std::path::PathBuf; ...
rust
Apache-2.0
f0a4fdbbad8a1730dea3b20c0b2ea140b9b853ce
2026-01-04T20:20:54.031924Z
false
lambdaclass/cairo_native
https://github.com/lambdaclass/cairo_native/blob/f0a4fdbbad8a1730dea3b20c0b2ea140b9b853ce/binaries/scarb-native-test/src/main.rs
binaries/scarb-native-test/src/main.rs
use anyhow::Context; use cairo_lang_sierra::program::VersionedProgram; use cairo_lang_test_plugin::{TestCompilation, TestCompilationMetadata}; use cairo_native_bin_utils::{ test::{display_tests_summary, filter_test_cases, find_testable_targets, run_tests}, RunArgs, }; use clap::{Parser, ValueEnum}; use scarb_me...
rust
Apache-2.0
f0a4fdbbad8a1730dea3b20c0b2ea140b9b853ce
2026-01-04T20:20:54.031924Z
false
lambdaclass/cairo_native
https://github.com/lambdaclass/cairo_native/blob/f0a4fdbbad8a1730dea3b20c0b2ea140b9b853ce/binaries/cairo-native-bin-utils/src/test.rs
binaries/cairo-native-bin-utils/src/test.rs
use super::{find_function, format_for_panic, result_to_runresult, RunArgs}; use anyhow::Context; use cairo_lang_runner::{RunResultValue, SierraCasmRunner}; use cairo_lang_sierra::{extensions::gas::CostTokenType, ids::FunctionId, program::Program}; use cairo_lang_sierra_to_casm::metadata::MetadataComputationConfig; use ...
rust
Apache-2.0
f0a4fdbbad8a1730dea3b20c0b2ea140b9b853ce
2026-01-04T20:20:54.031924Z
false
lambdaclass/cairo_native
https://github.com/lambdaclass/cairo_native/blob/f0a4fdbbad8a1730dea3b20c0b2ea140b9b853ce/binaries/cairo-native-bin-utils/src/lib.rs
binaries/cairo-native-bin-utils/src/lib.rs
#![allow(dead_code)] use anyhow::bail; use cairo_lang_runner::{casm_run::format_next_item, RunResultValue}; use cairo_lang_sierra::program::{Function, Program}; use cairo_native::{ execution_result::ExecutionResult, starknet::{Secp256k1Point, Secp256r1Point}, Value, }; use itertools::Itertools; use starkne...
rust
Apache-2.0
f0a4fdbbad8a1730dea3b20c0b2ea140b9b853ce
2026-01-04T20:20:54.031924Z
false
lambdaclass/cairo_native
https://github.com/lambdaclass/cairo_native/blob/f0a4fdbbad8a1730dea3b20c0b2ea140b9b853ce/binaries/cairo-native-dump/src/main.rs
binaries/cairo-native-dump/src/main.rs
use cairo_lang_compiler::{ compile_prepared_db, db::RootDatabase, project::setup_project, CompilerConfig, }; use cairo_lang_defs::plugin::NamedPlugin; use cairo_lang_filesystem::ids::CrateInput; use cairo_lang_semantic::plugin::PluginSuite; use cairo_lang_sierra::{program::Program, ProgramParser}; use cairo_lang_st...
rust
Apache-2.0
f0a4fdbbad8a1730dea3b20c0b2ea140b9b853ce
2026-01-04T20:20:54.031924Z
false
lambdaclass/cairo_native
https://github.com/lambdaclass/cairo_native/blob/f0a4fdbbad8a1730dea3b20c0b2ea140b9b853ce/binaries/starknet-native-compile/src/main.rs
binaries/starknet-native-compile/src/main.rs
use anyhow::{anyhow, bail, Context}; use cairo_native::statistics::Statistics; use std::fs; use std::path::PathBuf; use cairo_lang_sierra::program::Program; use cairo_lang_starknet_classes::compiler_version::VersionId; use cairo_lang_starknet_classes::contract_class::ContractClass; use cairo_native::executor::AotContr...
rust
Apache-2.0
f0a4fdbbad8a1730dea3b20c0b2ea140b9b853ce
2026-01-04T20:20:54.031924Z
false
lambdaclass/cairo_native
https://github.com/lambdaclass/cairo_native/blob/f0a4fdbbad8a1730dea3b20c0b2ea140b9b853ce/binaries/cairo-native-compile/src/main.rs
binaries/cairo-native-compile/src/main.rs
use anyhow::Context; use cairo_lang_compiler::project::check_compiler_path; use cairo_native::{ clone_option_mut, context::NativeContext, module_to_object, object_to_shared_lib, statistics::Statistics, utils::testing::cairo_to_sierra, }; use clap::Parser; use std::{ fs::{self, File}, path::PathBuf, ...
rust
Apache-2.0
f0a4fdbbad8a1730dea3b20c0b2ea140b9b853ce
2026-01-04T20:20:54.031924Z
false
lambdaclass/cairo_native
https://github.com/lambdaclass/cairo_native/blob/f0a4fdbbad8a1730dea3b20c0b2ea140b9b853ce/binaries/cairo-native-run/src/main.rs
binaries/cairo-native-run/src/main.rs
use anyhow::Context; use cairo_lang_compiler::{ compile_prepared_db, db::RootDatabase, project::setup_project, CompilerConfig, }; use cairo_lang_filesystem::ids::CrateInput; use cairo_lang_runner::short_string::as_cairo_short_string; #[cfg(feature = "with-libfunc-profiling")] use cairo_lang_sierra::ids::ConcreteLib...
rust
Apache-2.0
f0a4fdbbad8a1730dea3b20c0b2ea140b9b853ce
2026-01-04T20:20:54.031924Z
false
lambdaclass/cairo_native
https://github.com/lambdaclass/cairo_native/blob/f0a4fdbbad8a1730dea3b20c0b2ea140b9b853ce/binaries/scarb-native-dump/src/main.rs
binaries/scarb-native-dump/src/main.rs
use anyhow::Context; use cairo_lang_sierra::program::VersionedProgram; use cairo_native::context::NativeContext; use melior::ir::operation::OperationPrintingFlags; use scarb_metadata::{MetadataCommand, ScarbCommand}; use std::{env, fs}; /// Compiles all packages from a Scarb project on the current directory. fn main()...
rust
Apache-2.0
f0a4fdbbad8a1730dea3b20c0b2ea140b9b853ce
2026-01-04T20:20:54.031924Z
false
lambdaclass/cairo_native
https://github.com/lambdaclass/cairo_native/blob/f0a4fdbbad8a1730dea3b20c0b2ea140b9b853ce/benches/compile_time.rs
benches/compile_time.rs
use cairo_native::{context::NativeContext, module_to_object, OptLevel}; use criterion::{black_box, criterion_group, criterion_main, BenchmarkId, Criterion}; use util::prepare_programs; mod util; pub fn bench_compile_time(c: &mut Criterion) { let programs = prepare_programs("programs/compile_benches"); { ...
rust
Apache-2.0
f0a4fdbbad8a1730dea3b20c0b2ea140b9b853ce
2026-01-04T20:20:54.031924Z
false
lambdaclass/cairo_native
https://github.com/lambdaclass/cairo_native/blob/f0a4fdbbad8a1730dea3b20c0b2ea140b9b853ce/benches/util.rs
benches/util.rs
#![cfg(feature = "testing")] use cairo_lang_runner::SierraCasmRunner; use cairo_lang_sierra::program::Program; use std::sync::Arc; use walkdir::WalkDir; pub fn prepare_programs(path: &str) -> Vec<(Arc<Program>, String)> { WalkDir::new(path) .into_iter() .filter_map(|entry| { let e = en...
rust
Apache-2.0
f0a4fdbbad8a1730dea3b20c0b2ea140b9b853ce
2026-01-04T20:20:54.031924Z
false
lambdaclass/cairo_native
https://github.com/lambdaclass/cairo_native/blob/f0a4fdbbad8a1730dea3b20c0b2ea140b9b853ce/benches/libfuncs.rs
benches/libfuncs.rs
use cairo_lang_runner::StarknetState; use cairo_native::{ context::NativeContext, executor::{AotNativeExecutor, JitNativeExecutor}, OptLevel, }; use criterion::{black_box, criterion_group, criterion_main, BenchmarkId, Criterion}; use util::{create_vm_runner, prepare_programs}; mod util; pub fn bench_libfu...
rust
Apache-2.0
f0a4fdbbad8a1730dea3b20c0b2ea140b9b853ce
2026-01-04T20:20:54.031924Z
false
lambdaclass/cairo_native
https://github.com/lambdaclass/cairo_native/blob/f0a4fdbbad8a1730dea3b20c0b2ea140b9b853ce/benches/benches.rs
benches/benches.rs
use cairo_lang_compiler::{ compile_prepared_db, db::RootDatabase, project::setup_project, CompilerConfig, }; use cairo_lang_filesystem::ids::CrateInput; use cairo_lang_runner::{RunResultValue, SierraCasmRunner, StarknetState}; use cairo_lang_sierra::program::Program; use cairo_lang_sierra_generator::replace_ids::De...
rust
Apache-2.0
f0a4fdbbad8a1730dea3b20c0b2ea140b9b853ce
2026-01-04T20:20:54.031924Z
false
lambdaclass/cairo_native
https://github.com/lambdaclass/cairo_native/blob/f0a4fdbbad8a1730dea3b20c0b2ea140b9b853ce/debug_utils/src/bin/contract-to-sierra.rs
debug_utils/src/bin/contract-to-sierra.rs
use std::fs::File; use cairo_lang_starknet_classes::contract_class::ContractClass; use clap::{command, Parser}; /// Extracts sierra program from contract #[derive(Parser, Debug)] #[command(version, about, long_about = None)] struct Args { // Path to cairo contract contract_path: String, } fn main() { let...
rust
Apache-2.0
f0a4fdbbad8a1730dea3b20c0b2ea140b9b853ce
2026-01-04T20:20:54.031924Z
false
lambdaclass/cairo_native
https://github.com/lambdaclass/cairo_native/blob/f0a4fdbbad8a1730dea3b20c0b2ea140b9b853ce/debug_utils/casm-data-flow/src/lib.rs
debug_utils/casm-data-flow/src/lib.rs
pub use self::{ mappings::GraphMappings, memory::Memory, program::decode_instruction, search::run_search_algorithm, trace::Trace, }; mod mappings; mod memory; mod program; pub mod search; mod trace; #[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)] #[repr(transparent)] pub struct StepId(pub ...
rust
Apache-2.0
f0a4fdbbad8a1730dea3b20c0b2ea140b9b853ce
2026-01-04T20:20:54.031924Z
false
lambdaclass/cairo_native
https://github.com/lambdaclass/cairo_native/blob/f0a4fdbbad8a1730dea3b20c0b2ea140b9b853ce/debug_utils/casm-data-flow/src/program.rs
debug_utils/casm-data-flow/src/program.rs
use crate::Memory; use cairo_lang_casm::{ instructions::{ AddApInstruction, AssertEqInstruction, CallInstruction, Instruction, InstructionBody, JnzInstruction, JumpInstruction, RetInstruction, }, operand::{BinOpOperand, CellRef, DerefOrImmediate, Operation, ResOperand}, }; use cairo_lang_uti...
rust
Apache-2.0
f0a4fdbbad8a1730dea3b20c0b2ea140b9b853ce
2026-01-04T20:20:54.031924Z
false
lambdaclass/cairo_native
https://github.com/lambdaclass/cairo_native/blob/f0a4fdbbad8a1730dea3b20c0b2ea140b9b853ce/debug_utils/casm-data-flow/src/trace.rs
debug_utils/casm-data-flow/src/trace.rs
use bincode::{de::read::Reader, error::DecodeError}; use cairo_vm::vm::trace::trace_entry::RelocatedTraceEntry; use std::ops::Deref; #[derive(Debug)] pub struct Trace(Vec<RelocatedTraceEntry>); impl Trace { pub fn decode(mut data: impl Reader) -> Self { let mut trace = Vec::new(); let mut buf = [...
rust
Apache-2.0
f0a4fdbbad8a1730dea3b20c0b2ea140b9b853ce
2026-01-04T20:20:54.031924Z
false
lambdaclass/cairo_native
https://github.com/lambdaclass/cairo_native/blob/f0a4fdbbad8a1730dea3b20c0b2ea140b9b853ce/debug_utils/casm-data-flow/src/memory.rs
debug_utils/casm-data-flow/src/memory.rs
use bincode::{de::read::Reader, error::DecodeError}; use starknet_types_core::felt::Felt; use std::ops::Deref; #[derive(Debug)] pub struct Memory(Vec<Option<Felt>>); impl Memory { pub fn decode(mut data: impl Reader) -> Self { let mut memory = Vec::new(); let mut addr_data = [0u8; 8]; let...
rust
Apache-2.0
f0a4fdbbad8a1730dea3b20c0b2ea140b9b853ce
2026-01-04T20:20:54.031924Z
false
lambdaclass/cairo_native
https://github.com/lambdaclass/cairo_native/blob/f0a4fdbbad8a1730dea3b20c0b2ea140b9b853ce/debug_utils/casm-data-flow/src/search.rs
debug_utils/casm-data-flow/src/search.rs
use crate::{GraphMappings, Memory, StepId, ValueId}; use std::collections::VecDeque; #[derive(Clone, Copy, Debug, Eq, Hash, PartialEq)] pub enum NodeId { Step(StepId), Value(ValueId), } pub trait QueueContainer<T> { fn new(init: T) -> Self; fn extend<I>(&mut self, iter: I) where I: IntoIt...
rust
Apache-2.0
f0a4fdbbad8a1730dea3b20c0b2ea140b9b853ce
2026-01-04T20:20:54.031924Z
false
lambdaclass/cairo_native
https://github.com/lambdaclass/cairo_native/blob/f0a4fdbbad8a1730dea3b20c0b2ea140b9b853ce/debug_utils/casm-data-flow/src/mappings.rs
debug_utils/casm-data-flow/src/mappings.rs
use crate::{decode_instruction, Memory, StepId, Trace, ValueId}; use cairo_lang_casm::{ hints::{CoreHint, CoreHintBase, DeprecatedHint, ExternalHint, Hint, StarknetHint}, instructions::InstructionBody, operand::{CellRef, DerefOrImmediate, Register, ResOperand}, }; use cairo_vm::vm::trace::trace_entry::Reloc...
rust
Apache-2.0
f0a4fdbbad8a1730dea3b20c0b2ea140b9b853ce
2026-01-04T20:20:54.031924Z
false
lambdaclass/cairo_native
https://github.com/lambdaclass/cairo_native/blob/f0a4fdbbad8a1730dea3b20c0b2ea140b9b853ce/debug_utils/casm-data-flow/src/main.rs
debug_utils/casm-data-flow/src/main.rs
use bincode::de::read::SliceReader; use cairo_lang_casm::hints::Hint; use casm_data_flow::{ run_search_algorithm, search::{DfsQueue, NodeId}, GraphMappings, Memory, Trace, }; use clap::Parser; use serde_json::Value; use starknet_types_core::felt::Felt; use std::{collections::HashMap, fs, path::PathBuf, str:...
rust
Apache-2.0
f0a4fdbbad8a1730dea3b20c0b2ea140b9b853ce
2026-01-04T20:20:54.031924Z
false
lambdaclass/cairo_native
https://github.com/lambdaclass/cairo_native/blob/f0a4fdbbad8a1730dea3b20c0b2ea140b9b853ce/debug_utils/casm-data-flow/examples/run-contract.rs
debug_utils/casm-data-flow/examples/run-contract.rs
use std::{fs::File, io::Write, path::PathBuf}; use bincode::enc::write::Writer; use cairo_lang_starknet_classes::casm_contract_class::CasmContractClass; use cairo_vm::{ cairo_run::{write_encoded_memory, write_encoded_trace}, hint_processor::cairo_1_hint_processor::hint_processor::Cairo1HintProcessor, types...
rust
Apache-2.0
f0a4fdbbad8a1730dea3b20c0b2ea140b9b853ce
2026-01-04T20:20:54.031924Z
false
lambdaclass/cairo_native
https://github.com/lambdaclass/cairo_native/blob/f0a4fdbbad8a1730dea3b20c0b2ea140b9b853ce/debug_utils/casm-data-flow/examples/basic.rs
debug_utils/casm-data-flow/examples/basic.rs
use bincode::de::read::SliceReader; use casm_data_flow::{decode_instruction, GraphMappings, Memory, Trace, ValueId}; use std::{collections::HashMap, fs}; fn main() { let memory = Memory::decode(SliceReader::new(&fs::read("memory-2.bin").unwrap())); let trace = Trace::decode(SliceReader::new(&fs::read("trace-2....
rust
Apache-2.0
f0a4fdbbad8a1730dea3b20c0b2ea140b9b853ce
2026-01-04T20:20:54.031924Z
false
lambdaclass/cairo_native
https://github.com/lambdaclass/cairo_native/blob/f0a4fdbbad8a1730dea3b20c0b2ea140b9b853ce/debug_utils/sierra-emu/src/vm.rs
debug_utils/sierra-emu/src/vm.rs
use crate::{ debug::libfunc_to_name, gas::{BuiltinCosts, GasMetadata}, starknet::StarknetSyscallHandler, ContractExecutionResult, ProgramTrace, StateDump, Value, }; use cairo_lang_sierra::{ edit_state, extensions::{ circuit::CircuitTypeConcrete, core::{CoreConcreteLibfunc, CoreLi...
rust
Apache-2.0
f0a4fdbbad8a1730dea3b20c0b2ea140b9b853ce
2026-01-04T20:20:54.031924Z
false
lambdaclass/cairo_native
https://github.com/lambdaclass/cairo_native/blob/f0a4fdbbad8a1730dea3b20c0b2ea140b9b853ce/debug_utils/sierra-emu/src/lib.rs
debug_utils/sierra-emu/src/lib.rs
use std::{num::ParseIntError, str::FromStr, sync::Arc}; use cairo_lang_sierra::{ extensions::{ circuit::CircuitTypeConcrete, core::{CoreLibfunc, CoreType, CoreTypeConcrete}, starknet::StarknetTypeConcrete, }, ids::ConcreteTypeId, program::{GenFunction, Program, StatementIdx}, ...
rust
Apache-2.0
f0a4fdbbad8a1730dea3b20c0b2ea140b9b853ce
2026-01-04T20:20:54.031924Z
false
lambdaclass/cairo_native
https://github.com/lambdaclass/cairo_native/blob/f0a4fdbbad8a1730dea3b20c0b2ea140b9b853ce/debug_utils/sierra-emu/src/value.rs
debug_utils/sierra-emu/src/value.rs
use cairo_lang_sierra::{ extensions::{ circuit::CircuitTypeConcrete, core::{CoreLibfunc, CoreType, CoreTypeConcrete}, starknet::StarknetTypeConcrete, ConcreteType, }, ids::ConcreteTypeId, program_registry::ProgramRegistry, }; use num_bigint::{BigInt, BigUint}; use serde::...
rust
Apache-2.0
f0a4fdbbad8a1730dea3b20c0b2ea140b9b853ce
2026-01-04T20:20:54.031924Z
false
lambdaclass/cairo_native
https://github.com/lambdaclass/cairo_native/blob/f0a4fdbbad8a1730dea3b20c0b2ea140b9b853ce/debug_utils/sierra-emu/src/args.rs
debug_utils/sierra-emu/src/args.rs
use clap::Parser; use sierra_emu::EntryPoint; use std::path::PathBuf; #[derive(Debug, Parser)] pub struct CmdArgs { pub program: PathBuf, pub entry_point: EntryPoint, pub args: Vec<String>, #[clap(long)] pub available_gas: Option<u64>, #[clap(long, short)] pub output: Option<PathBuf>, }
rust
Apache-2.0
f0a4fdbbad8a1730dea3b20c0b2ea140b9b853ce
2026-01-04T20:20:54.031924Z
false
lambdaclass/cairo_native
https://github.com/lambdaclass/cairo_native/blob/f0a4fdbbad8a1730dea3b20c0b2ea140b9b853ce/debug_utils/sierra-emu/src/test_utils.rs
debug_utils/sierra-emu/src/test_utils.rs
#![cfg(test)] use std::{fs, path::Path, sync::Arc}; use cairo_lang_compiler::{ compile_prepared_db, db::RootDatabase, diagnostics::DiagnosticsReporter, project::setup_project, CompilerConfig, }; use cairo_lang_filesystem::{db::init_dev_corelib, ids::CrateInput}; use cairo_lang_sierra::program::Program; use c...
rust
Apache-2.0
f0a4fdbbad8a1730dea3b20c0b2ea140b9b853ce
2026-01-04T20:20:54.031924Z
false
lambdaclass/cairo_native
https://github.com/lambdaclass/cairo_native/blob/f0a4fdbbad8a1730dea3b20c0b2ea140b9b853ce/debug_utils/sierra-emu/src/debug.rs
debug_utils/sierra-emu/src/debug.rs
use cairo_lang_sierra::{ extensions::{ array::ArrayConcreteLibfunc, boolean::BoolConcreteLibfunc, bounded_int::BoundedIntConcreteLibfunc, boxing::BoxConcreteLibfunc, bytes31::Bytes31ConcreteLibfunc, casts::CastConcreteLibfunc, circuit::{CircuitConcreteLibfunc,...
rust
Apache-2.0
f0a4fdbbad8a1730dea3b20c0b2ea140b9b853ce
2026-01-04T20:20:54.031924Z
false
lambdaclass/cairo_native
https://github.com/lambdaclass/cairo_native/blob/f0a4fdbbad8a1730dea3b20c0b2ea140b9b853ce/debug_utils/sierra-emu/src/dump.rs
debug_utils/sierra-emu/src/dump.rs
use crate::value::Value; use cairo_lang_sierra::{ids::VarId, program::StatementIdx}; use cairo_lang_utils::ordered_hash_map::OrderedHashMap; use serde::{ser::SerializeMap, Serialize}; use starknet_crypto::Felt; use std::collections::BTreeMap; #[derive(Clone, Debug, Default, Serialize, Eq, PartialEq)] pub struct Progra...
rust
Apache-2.0
f0a4fdbbad8a1730dea3b20c0b2ea140b9b853ce
2026-01-04T20:20:54.031924Z
false
lambdaclass/cairo_native
https://github.com/lambdaclass/cairo_native/blob/f0a4fdbbad8a1730dea3b20c0b2ea140b9b853ce/debug_utils/sierra-emu/src/starknet.rs
debug_utils/sierra-emu/src/starknet.rs
use std::{ collections::{BTreeMap, VecDeque}, iter::once, }; pub use self::{ block_info::BlockInfo, execution_info::ExecutionInfo, execution_info_v2::ExecutionInfoV2, resource_bounds::ResourceBounds, secp256k1_point::Secp256k1Point, secp256r1_point::Secp256r1Point, tx_info::TxInfo, tx_v2_info::TxV2...
rust
Apache-2.0
f0a4fdbbad8a1730dea3b20c0b2ea140b9b853ce
2026-01-04T20:20:54.031924Z
false
lambdaclass/cairo_native
https://github.com/lambdaclass/cairo_native/blob/f0a4fdbbad8a1730dea3b20c0b2ea140b9b853ce/debug_utils/sierra-emu/src/utils.rs
debug_utils/sierra-emu/src/utils.rs
use cairo_lang_sierra::{ extensions::{ core::{CoreLibfunc, CoreType, CoreTypeConcrete}, utils::Range, }, ids::ConcreteTypeId, program_registry::ProgramRegistry, }; use num_bigint::BigInt; use num_traits::{Bounded, One, ToPrimitive}; use starknet_types_core::felt::CAIRO_PRIME_BIGINT; use...
rust
Apache-2.0
f0a4fdbbad8a1730dea3b20c0b2ea140b9b853ce
2026-01-04T20:20:54.031924Z
false
lambdaclass/cairo_native
https://github.com/lambdaclass/cairo_native/blob/f0a4fdbbad8a1730dea3b20c0b2ea140b9b853ce/debug_utils/sierra-emu/src/gas.rs
debug_utils/sierra-emu/src/gas.rs
use std::{fmt::Debug, ops::Deref}; use cairo_lang_runner::token_gas_cost; use cairo_lang_sierra::{ extensions::gas::CostTokenType, ids::FunctionId, program::{Program, StatementIdx}, }; use cairo_lang_sierra_ap_change::{ap_change_info::ApChangeInfo, ApChangeError}; use cairo_lang_sierra_gas::{gas_info::GasI...
rust
Apache-2.0
f0a4fdbbad8a1730dea3b20c0b2ea140b9b853ce
2026-01-04T20:20:54.031924Z
false
lambdaclass/cairo_native
https://github.com/lambdaclass/cairo_native/blob/f0a4fdbbad8a1730dea3b20c0b2ea140b9b853ce/debug_utils/sierra-emu/src/main.rs
debug_utils/sierra-emu/src/main.rs
use self::args::CmdArgs; use cairo_lang_compiler::{ compile_prepared_db, db::RootDatabase, project::setup_project, CompilerConfig, }; use cairo_lang_filesystem::ids::CrateInput; use clap::Parser; use sierra_emu::run_program; use std::{fs::File, io::stdout}; use tracing::{info, Level}; use tracing_subscriber::{EnvFi...
rust
Apache-2.0
f0a4fdbbad8a1730dea3b20c0b2ea140b9b853ce
2026-01-04T20:20:54.031924Z
false
lambdaclass/cairo_native
https://github.com/lambdaclass/cairo_native/blob/f0a4fdbbad8a1730dea3b20c0b2ea140b9b853ce/debug_utils/sierra-emu/src/starknet/secp256r1_point.rs
debug_utils/sierra-emu/src/starknet/secp256r1_point.rs
use super::U256; use crate::Value; #[derive(Clone, Copy, Debug, Eq, Hash, PartialEq)] pub struct Secp256r1Point { pub x: U256, pub y: U256, } impl Secp256r1Point { #[allow(unused)] pub fn into_value(self) -> Value { Value::Struct(vec![ Value::Struct(vec![Value::U128(self.x.lo), Val...
rust
Apache-2.0
f0a4fdbbad8a1730dea3b20c0b2ea140b9b853ce
2026-01-04T20:20:54.031924Z
false
lambdaclass/cairo_native
https://github.com/lambdaclass/cairo_native/blob/f0a4fdbbad8a1730dea3b20c0b2ea140b9b853ce/debug_utils/sierra-emu/src/starknet/tx_info.rs
debug_utils/sierra-emu/src/starknet/tx_info.rs
use crate::Value; use cairo_lang_sierra::ids::ConcreteTypeId; use starknet_types_core::felt::Felt; #[derive(Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)] pub struct TxInfo { pub version: Felt, pub account_contract_address: Felt, pub max_fee: u128, pub signature: Vec<Felt>, pub transaction_ha...
rust
Apache-2.0
f0a4fdbbad8a1730dea3b20c0b2ea140b9b853ce
2026-01-04T20:20:54.031924Z
false
lambdaclass/cairo_native
https://github.com/lambdaclass/cairo_native/blob/f0a4fdbbad8a1730dea3b20c0b2ea140b9b853ce/debug_utils/sierra-emu/src/starknet/execution_info_v2.rs
debug_utils/sierra-emu/src/starknet/execution_info_v2.rs
use super::{BlockInfo, TxV2Info}; use crate::Value; use cairo_lang_sierra::ids::ConcreteTypeId; use serde::Serialize; use starknet_types_core::felt::Felt; #[derive(Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash, Serialize)] pub struct ExecutionInfoV2 { pub block_info: BlockInfo, pub tx_info: TxV2Info, ...
rust
Apache-2.0
f0a4fdbbad8a1730dea3b20c0b2ea140b9b853ce
2026-01-04T20:20:54.031924Z
false
lambdaclass/cairo_native
https://github.com/lambdaclass/cairo_native/blob/f0a4fdbbad8a1730dea3b20c0b2ea140b9b853ce/debug_utils/sierra-emu/src/starknet/secp256k1_point.rs
debug_utils/sierra-emu/src/starknet/secp256k1_point.rs
use super::U256; use crate::Value; #[derive(Clone, Copy, Debug, Eq, Hash, PartialEq)] pub struct Secp256k1Point { pub x: U256, pub y: U256, } impl Secp256k1Point { #[allow(unused)] pub fn into_value(self) -> Value { Value::Struct(vec![ Value::Struct(vec![Value::U128(self.x.lo), Val...
rust
Apache-2.0
f0a4fdbbad8a1730dea3b20c0b2ea140b9b853ce
2026-01-04T20:20:54.031924Z
false
lambdaclass/cairo_native
https://github.com/lambdaclass/cairo_native/blob/f0a4fdbbad8a1730dea3b20c0b2ea140b9b853ce/debug_utils/sierra-emu/src/starknet/block_info.rs
debug_utils/sierra-emu/src/starknet/block_info.rs
use crate::Value; use serde::Serialize; use starknet_types_core::felt::Felt; #[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash, Serialize)] pub struct BlockInfo { pub block_number: u64, pub block_timestamp: u64, pub sequencer_address: Felt, } impl BlockInfo { pub(crate) fn into_value(s...
rust
Apache-2.0
f0a4fdbbad8a1730dea3b20c0b2ea140b9b853ce
2026-01-04T20:20:54.031924Z
false
lambdaclass/cairo_native
https://github.com/lambdaclass/cairo_native/blob/f0a4fdbbad8a1730dea3b20c0b2ea140b9b853ce/debug_utils/sierra-emu/src/starknet/u256.rs
debug_utils/sierra-emu/src/starknet/u256.rs
use crate::Value; #[derive(Clone, Copy, Debug, Default, Eq, Hash, Ord, PartialEq, PartialOrd)] pub struct U256 { pub lo: u128, pub hi: u128, } impl U256 { #[allow(unused)] pub(crate) fn into_value(self) -> Value { Value::Struct(vec![Value::U128(self.lo), Value::U128(self.hi)]) } pub f...
rust
Apache-2.0
f0a4fdbbad8a1730dea3b20c0b2ea140b9b853ce
2026-01-04T20:20:54.031924Z
false
lambdaclass/cairo_native
https://github.com/lambdaclass/cairo_native/blob/f0a4fdbbad8a1730dea3b20c0b2ea140b9b853ce/debug_utils/sierra-emu/src/starknet/resource_bounds.rs
debug_utils/sierra-emu/src/starknet/resource_bounds.rs
use crate::Value; use serde::Serialize; use starknet_types_core::felt::Felt; #[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash, Serialize)] pub struct ResourceBounds { pub resource: Felt, pub max_amount: u64, pub max_price_per_unit: u128, } impl ResourceBounds { pub(crate) fn into_valu...
rust
Apache-2.0
f0a4fdbbad8a1730dea3b20c0b2ea140b9b853ce
2026-01-04T20:20:54.031924Z
false
lambdaclass/cairo_native
https://github.com/lambdaclass/cairo_native/blob/f0a4fdbbad8a1730dea3b20c0b2ea140b9b853ce/debug_utils/sierra-emu/src/starknet/tx_v2_info.rs
debug_utils/sierra-emu/src/starknet/tx_v2_info.rs
use super::ResourceBounds; use crate::Value; use cairo_lang_sierra::ids::ConcreteTypeId; use serde::Serialize; use starknet_types_core::felt::Felt; #[derive(Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash, Serialize)] pub struct TxV2Info { pub version: Felt, pub account_contract_address: Felt, pub max_f...
rust
Apache-2.0
f0a4fdbbad8a1730dea3b20c0b2ea140b9b853ce
2026-01-04T20:20:54.031924Z
false
lambdaclass/cairo_native
https://github.com/lambdaclass/cairo_native/blob/f0a4fdbbad8a1730dea3b20c0b2ea140b9b853ce/debug_utils/sierra-emu/src/starknet/execution_info.rs
debug_utils/sierra-emu/src/starknet/execution_info.rs
use super::{BlockInfo, TxInfo}; use crate::Value; use cairo_lang_sierra::ids::ConcreteTypeId; use starknet_types_core::felt::Felt; #[derive(Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)] pub struct ExecutionInfo { pub block_info: BlockInfo, pub tx_info: TxInfo, pub caller_address: Felt, pub contr...
rust
Apache-2.0
f0a4fdbbad8a1730dea3b20c0b2ea140b9b853ce
2026-01-04T20:20:54.031924Z
false
lambdaclass/cairo_native
https://github.com/lambdaclass/cairo_native/blob/f0a4fdbbad8a1730dea3b20c0b2ea140b9b853ce/debug_utils/sierra-emu/src/vm/struct.rs
debug_utils/sierra-emu/src/vm/struct.rs
use super::EvalAction; use crate::Value; use cairo_lang_sierra::{ extensions::{ core::{CoreLibfunc, CoreType, CoreTypeConcrete}, lib_func::SignatureOnlyConcreteLibfunc, structure::{StructConcreteLibfunc, StructConcreteType}, }, program_registry::ProgramRegistry, }; use smallvec::smal...
rust
Apache-2.0
f0a4fdbbad8a1730dea3b20c0b2ea140b9b853ce
2026-01-04T20:20:54.031924Z
false
lambdaclass/cairo_native
https://github.com/lambdaclass/cairo_native/blob/f0a4fdbbad8a1730dea3b20c0b2ea140b9b853ce/debug_utils/sierra-emu/src/vm/circuit.rs
debug_utils/sierra-emu/src/vm/circuit.rs
use super::EvalAction; use crate::Value; use cairo_lang_sierra::{ extensions::{ circuit::{ CircuitConcreteLibfunc, CircuitTypeConcrete, ConcreteGetOutputLibFunc, ConcreteU96LimbsLessThanGuaranteeVerifyLibfunc, }, core::{CoreLibfunc, CoreType, CoreTypeConcrete}, ...
rust
Apache-2.0
f0a4fdbbad8a1730dea3b20c0b2ea140b9b853ce
2026-01-04T20:20:54.031924Z
false
lambdaclass/cairo_native
https://github.com/lambdaclass/cairo_native/blob/f0a4fdbbad8a1730dea3b20c0b2ea140b9b853ce/debug_utils/sierra-emu/src/vm/array.rs
debug_utils/sierra-emu/src/vm/array.rs
use super::EvalAction; use crate::{find_real_type, Value}; use cairo_lang_sierra::{ extensions::{ array::ArrayConcreteLibfunc, core::{CoreLibfunc, CoreType, CoreTypeConcrete}, lib_func::{SignatureAndTypeConcreteLibfunc, SignatureOnlyConcreteLibfunc}, ConcreteLibfunc, }, progr...
rust
Apache-2.0
f0a4fdbbad8a1730dea3b20c0b2ea140b9b853ce
2026-01-04T20:20:54.031924Z
false