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"`
BytecodeSegmentLengths *NestedUints `json:"bytecode_segment_lengths,omitempty"`
}
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"`
}
type NestedUints ¶ added in v0.8.0
type NestedUints struct {
IsArray bool
Value *uint64
Values []NestedUints
}
func (NestedUints) MarshalJSON ¶ added in v0.8.0
func (ns NestedUints) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaler interface for NestedUints. It converts the NestedUints structure back into a JSON array format.
func (*NestedUints) UnmarshalJSON ¶ added in v0.8.0
func (ns *NestedUints) UnmarshalJSON(data []byte) error
Click to show internal directories.
Click to hide internal directories.