Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var PREFIX_CONTRACT_ADDRESS = new(felt.Felt).SetBytes([]byte("STARKNET_CONTRACT_ADDRESS"))
Functions ¶
func PrecomputeAddress ¶ added in v0.7.1
func PrecomputeAddress(deployerAddress *felt.Felt, salt *felt.Felt, classHash *felt.Felt, constructorCalldata []*felt.Felt) *felt.Felt
PrecomputeAddress calculates the precomputed address for a contract instance. ref: https://github.com/starkware-libs/cairo-lang/blob/master/src/starkware/starknet/core/os/contract_address/contract_address.py
Parameters: - deployerAddress: the deployer address - salt: the salt - classHash: the class hash - constructorCalldata: the constructor calldata Returns: - *felt.Felt: the precomputed address as a *felt.Felt
Types ¶
type CasmClass ¶ added in v0.4.6
type CasmClass struct { Prime string `json:"prime"` Version string `json:"compiler_version"` ByteCode []*felt.Felt `json:"bytecode"` EntryPointByType CasmClassEntryPointsByType `json:"entry_points_by_type"` }
func UnmarshalCasmClass ¶ added in v0.4.6
UnmarshalCasmClass is a function that unmarshals a CasmClass object from a file. CASM = Cairo instructions
It takes a file path as a parameter and returns a pointer to the unmarshaled CasmClass object and an error.
type CasmClassEntryPoint ¶ added in v0.4.6
type CasmClassEntryPointsByType ¶ added in v0.4.6
type CasmClassEntryPointsByType struct { Constructor []CasmClassEntryPoint `json:"CONSTRUCTOR"` External []CasmClassEntryPoint `json:"EXTERNAL"` L1Handler []CasmClassEntryPoint `json:"L1_HANDLER"` }
Click to show internal directories.
Click to hide internal directories.