Module utils

Source
Expand description

Utilities for performing commonly used algorithms in Starknet.

Structs§

NonAsciiNameError
The string provided contains non-ASCII characters.
UdcUniqueSettings
The uniqueness settings when using UdcUniqueness::Unique for contract deployment.

Enums§

CairoShortStringToFeltError
Possible errors for encoding a Cairo short string.
ParseCairoShortStringError
Possible errors for decoding a Cairo short string.
UdcUniqueness
The uniqueness settings for UDC deployments.

Functions§

cairo_short_string_to_felt
Converts Cairo short string to Felt.
get_contract_address
Computes the target contract address of a “native” contract deployment. Use get_udc_deployed_address instead if you want to compute the target address for deployments through the Universal Deployer Contract.
get_selector_from_name
Calculates the entrypoint selector from a human-readable function name.
get_storage_var_address
Calculates the standard storage slot address of storage variable in a Cairo contract.
get_udc_deployed_address
Computes the target contract address for deployments through the Universal Deploy Contract.
normalize_address
Normalizes an address to be in the range of [0, 2^251 - 256).
parse_cairo_short_string
Converts Felt to Cairo short string.
starknet_keccak
A variant of eth-keccak that computes a value that fits in a Starknet field element. It performs a standard Keccak-256 but with the 6 most significant bits removed.