Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

snforge_std

Fully qualified path: snforge_std

Modules


Re-exports:

cheat_block_hashChanges the block hash for the given block number and contract address....
start_cheat_block_hashStarts a block hash modification for a specific contract....
start_cheat_block_hash_globalStarts a global block hash modification....
stop_cheat_block_hashCancels the cheat_block_hash / start_cheat_block_hash for a specific contract....
stop_cheat_block_hash_globalCancels the start_cheat_block_hash_global ....
declareDeclares a contract contract - name of a contract as Cairo string. It is a name of the contract (part after mod keyword) e.g. "HelloStarknet" Returns the DeclareResult...
get_class_hashRetrieves a class hash of a contract deployed under the given address contract_address - target contract address Returns the ClassHash under given address
set_balanceSets the balance of token`` for target `` contract to new_balance...
spy_eventsCreates EventSpy instance that spies on all events emitted after its creation.
cheat_account_contract_addressChanges the address of an account which the transaction originates from, for the given contract address and span....
start_cheat_account_contract_addressChanges the address of an account which the transaction originates from, for the given contract_address....
start_cheat_account_contract_address_globalChanges the address of an account which the transaction originates from....
stop_cheat_account_contract_addressCancels the cheat_account_contract_address / start_cheat_account_contract_address for the given contract_address....
stop_cheat_account_contract_address_globalCancels the start_cheat_account_contract_address_global .
cheat_account_deployment_dataChanges the transaction account deployment data for the given contract address and span....
start_cheat_account_deployment_dataChanges the transaction account deployment data for the given contract_address....
start_cheat_account_deployment_data_globalChanges the transaction account deployment data....
stop_cheat_account_deployment_dataCancels the cheat_account_deployment_data / start_cheat_account_deployment_data for the given contract_address....
stop_cheat_account_deployment_data_globalCancels the cheat_account_deployment_data_global .
cheat_block_numberChanges the block number for the given contract address and span....
start_cheat_block_numberChanges the block number for the given contract_address....
start_cheat_block_number_globalChanges the block number....
stop_cheat_block_numberCancels the cheat_block_number / start_cheat_block_number for the given contract_address....
stop_cheat_block_number_globalCancels the start_cheat_block_number_global .
cheat_block_timestampChanges the block timestamp for the given contract address and span....
start_cheat_block_timestampChanges the block timestamp for the given contract_address....
start_cheat_block_timestamp_globalChanges the block timestamp....
stop_cheat_block_timestampCancels the cheat_block_timestamp / start_cheat_block_timestamp for the given contract_address....
stop_cheat_block_timestamp_globalCancels the start_cheat_block_timestamp_global .
cheat_caller_addressChanges the caller address for the given contract address and span....
start_cheat_caller_addressChanges the caller address for the given contract_address....
start_cheat_caller_address_globalChanges the caller address....
stop_cheat_caller_addressCancels the cheat_caller_address / start_cheat_caller_address for the given contract_address....
stop_cheat_caller_address_globalCancels the start_cheat_caller_address_global .
cheat_chain_idChanges the transaction chain_id for the given contract address and span....
start_cheat_chain_idChanges the transaction chain_id for the given contract_address....
start_cheat_chain_id_globalChanges the transaction chain_id....
stop_cheat_chain_idCancels the cheat_chain_id / start_cheat_chain_id for the given contract_address....
stop_cheat_chain_id_globalCancels the start_cheat_chain_id_global .
cheat_fee_data_availability_modeChanges the transaction fee data availability mode for the given contract address and span....
start_cheat_fee_data_availability_modeChanges the transaction fee data availability mode for the given contract_address....
start_cheat_fee_data_availability_mode_globalChanges the transaction fee data availability mode....
stop_cheat_fee_data_availability_modeCancels the cheat_fee_data_availability_mode / start_cheat_fee_data_availability_mode for the given contract_address....
stop_cheat_fee_data_availability_mode_globalCancels the start_cheat_fee_data_availability_mode_global .
cheat_max_feeChanges the transaction max fee for the given contract address and span....
start_cheat_max_feeChanges the transaction max fee for the given contract_address....
start_cheat_max_fee_globalChanges the transaction max fee....
stop_cheat_max_feeCancels the cheat_max_fee / start_cheat_max_fee for the given contract_address....
stop_cheat_max_fee_globalCancels the start_cheat_max_fee_global .
cheat_nonceChanges the transaction nonce for the given contract address and span....
start_cheat_nonceChanges the transaction nonce for the given contract_address....
start_cheat_nonce_globalChanges the transaction nonce....
stop_cheat_nonceCancels the cheat_nonce / start_cheat_nonce for the given contract_address....
stop_cheat_nonce_globalCancels the start_cheat_nonce_global .
cheat_nonce_data_availability_modeChanges the transaction nonce data availability mode for the given contract address and span....
start_cheat_nonce_data_availability_modeChanges the transaction nonce data availability mode for the given contract_address....
start_cheat_nonce_data_availability_mode_globalChanges the transaction nonce data availability mode....
stop_cheat_nonce_data_availability_modeCancels the cheat_nonce_data_availability_mode / start_cheat_nonce_data_availability_mode for the given contract_address....
stop_cheat_nonce_data_availability_mode_globalCancels the start_cheat_nonce_data_availability_mode_global .
cheat_paymaster_dataChanges the transaction paymaster data for the given contract address and span....
start_cheat_paymaster_dataChanges the transaction paymaster data for the given contract_address....
start_cheat_paymaster_data_globalChanges the transaction paymaster data....
stop_cheat_paymaster_dataCancels the cheat_paymaster_data / start_cheat_paymaster_data for the given contract_address....
stop_cheat_paymaster_data_globalCancels the start_cheat_paymaster_data_global .
cheat_resource_boundsChanges the transaction resource bounds for the given contract address and span....
start_cheat_resource_boundsChanges the transaction resource bounds for the given contract_address....
start_cheat_resource_bounds_globalChanges the transaction resource bounds....
stop_cheat_resource_boundsCancels the cheat_resource_bounds / start_cheat_resource_bounds for the given contract_address....
stop_cheat_resource_bounds_globalCancels the start_cheat_resource_bounds_global .
cheat_sequencer_addressChanges the sequencer address for the given contract address and span....
start_cheat_sequencer_addressChanges the sequencer address for the given contract_address....
start_cheat_sequencer_address_globalChanges the sequencer address....
stop_cheat_sequencer_addressCancels the cheat_sequencer_address / start_cheat_sequencer_address for the given contract_address....
stop_cheat_sequencer_address_globalCancels the start_cheat_sequencer_address_global .
cheat_signatureChanges the transaction signature for the given contract address and span....
start_cheat_signatureChanges the transaction signature for the given contract_address....
start_cheat_signature_globalChanges the transaction signature....
stop_cheat_signatureCancels the cheat_signature / start_cheat_signature for the given contract_address....
stop_cheat_signature_globalCancels the start_cheat_signature_global .
cheat_tipChanges the transaction tip for the given contract address and span....
start_cheat_tipChanges the transaction tip for the given contract_address....
start_cheat_tip_globalChanges the transaction tip....
stop_cheat_tipCancels the cheat_tip / start_cheat_tip for the given contract_address....
stop_cheat_tip_globalCancels the start_cheat_tip_global .
cheat_transaction_hashChanges the transaction hash for the given contract address and span....
start_cheat_transaction_hashChanges the transaction hash for the given contract_address....
start_cheat_transaction_hash_globalChanges the transaction hash....
stop_cheat_transaction_hashCancels the cheat_transaction_hash / start_cheat_transaction_hash for the given contract_address....
stop_cheat_transaction_hash_globalCancels the start_cheat_transaction_hash_global .
cheat_transaction_versionChanges the transaction version for the given contract address and span....
start_cheat_transaction_versionChanges the transaction version for the given contract_address....
start_cheat_transaction_version_globalChanges the transaction version....
stop_cheat_transaction_versionCancels the cheat_transaction_version / start_cheat_transaction_version for the given contract_address....
stop_cheat_transaction_version_globalCancels the start_cheat_transaction_version_global .
generate_random_feltGenerates a random felt value Returns a random felt within the range of 0 and 2^252 - 1
spy_messages_to_l1Creates MessageToL1Spy instance that spies on all messages sent to L1
storeStores felts from serialized_value in target contract's storage, starting at storage_address ....
interact_with_state
loadLoads size felts from target contract's storage into an Array , starting at storage_address ....
map_entry_address
mock_callMocks contract call to a function_selector of a contract at the given address, for n_times first calls that are made to the contract. A call to function function_selector...
replace_bytecodeReplaces class for given contract address. The new_class hash has to be declared in order for the replacement class to execute the code, when interacting with the contract....
start_mock_callMocks contract call to a function of a contract at the given address, indefinitely. See mock_call for comprehensive definition of how it can be used....
stop_mock_callCancels the mock_call / start_mock_call for the function with given name and contract address....
test_address
test_selector

ContractClass
CustomToken
EventRaw event format (as seen via the RPC-API), can be used for asserting the emitted events.
EventSpyAn event spy structure allowing to get events emitted only after its creation.
L1Handler
MessageToL1Raw message to L1 format (as seen via the RPC-API), can be used for asserting the sent messages.
MessageToL1SpyA message spy structure allowing to get messages emitted only after its creation.

CheatSpanEnum used to specify how long the target should be cheated for.
DeclareResult
Token
ReplaceBytecodeError

ContractClassTrait
DeclareResultTrait
TokenTrait
EventSpyAssertionsTraitAllows to assert the expected events emission (or lack thereof), in the scope of EventSpy structure.
EventSpyTrait
EventsFilterTrait
IsEmitted
L1HandlerTrait
MessageToL1FilterTrait
MessageToL1SpyAssertionsTraitAllows to assert the expected sent messages (or lack thereof), in the scope of MessageToL1Spy structure.
MessageToL1SpyTrait