pub struct CasmContractClass {
pub prime: BigUint,
pub compiler_version: String,
pub bytecode: Vec<BigUintAsHex>,
pub bytecode_segment_lengths: Option<NestedIntList>,
pub hints: Vec<(usize, Vec<Hint>)>,
pub pythonic_hints: Option<Vec<(usize, Vec<String>)>>,
pub entry_points_by_type: CasmContractEntryPoints,
}Expand description
Represents a contract in the Starknet network.
Fields§
§prime: BigUint§compiler_version: String§bytecode: Vec<BigUintAsHex>§bytecode_segment_lengths: Option<NestedIntList>§hints: Vec<(usize, Vec<Hint>)>§pythonic_hints: Option<Vec<(usize, Vec<String>)>>§entry_points_by_type: CasmContractEntryPointsImplementations§
Source§impl CasmContractClass
impl CasmContractClass
Sourcepub fn compiled_class_hash(&self) -> Felt252
pub fn compiled_class_hash(&self) -> Felt252
Returns the Poseidon hash value for the compiled contract class.
Sourcepub fn get_bytecode_segment_lengths(&self) -> NestedIntList
pub fn get_bytecode_segment_lengths(&self) -> NestedIntList
Returns the lengths of the bytecode segments.
If the length field is missing, the entire bytecode is considered a single segment.
Source§impl CasmContractClass
impl CasmContractClass
pub fn from_contract_class( contract_class: ContractClass, add_pythonic_hints: bool, max_bytecode_size: usize, ) -> Result<Self, StarknetSierraCompilationError>
pub fn from_contract_class_with_debug_info( contract_class: ContractClass, add_pythonic_hints: bool, max_bytecode_size: usize, ) -> Result<(Self, CairoProgramDebugInfo), StarknetSierraCompilationError>
Trait Implementations§
Source§impl Clone for CasmContractClass
impl Clone for CasmContractClass
Source§fn clone(&self) -> CasmContractClass
fn clone(&self) -> CasmContractClass
Returns a duplicate of the value. Read more
1.0.0§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for CasmContractClass
impl Debug for CasmContractClass
Source§impl<'de> Deserialize<'de> for CasmContractClass
impl<'de> Deserialize<'de> for CasmContractClass
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for CasmContractClass
impl PartialEq for CasmContractClass
Source§impl Serialize for CasmContractClass
impl Serialize for CasmContractClass
impl Eq for CasmContractClass
impl StructuralPartialEq for CasmContractClass
Auto Trait Implementations§
impl Freeze for CasmContractClass
impl RefUnwindSafe for CasmContractClass
impl Send for CasmContractClass
impl Sync for CasmContractClass
impl Unpin for CasmContractClass
impl UnwindSafe for CasmContractClass
Blanket Implementations§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
🔬This is a nightly-only experimental API. (
clone_to_uninit)Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more