snforge_std
Fully qualified path: snforge_std
Modules
cheatcodes | — |
byte_array | — |
env | — |
fs | — |
fuzzable | — |
signature | — |
trace | — |
Re-exports:
cheat_block_hash | Changes the block hash for the given block number and contract address.... |
start_cheat_block_hash | Starts a block hash modification for a specific contract.... |
start_cheat_block_hash_global | Starts a global block hash modification.... |
stop_cheat_block_hash | Cancels the cheat_block_hash / start_cheat_block_hash for a specific contract.... |
stop_cheat_block_hash_global | Cancels the start_cheat_block_hash_global .... |
declare | Declares 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_hash | Retrieves a class hash of a contract deployed under the given address contract_address - target contract address Returns the ClassHash under given address |
set_balance | Sets the balance of token`` for target `` contract to new_balance ... |
spy_events | Creates EventSpy instance that spies on all events emitted after its creation. |
cheat_account_contract_address | Changes the address of an account which the transaction originates from, for the given contract address and span.... |
start_cheat_account_contract_address | Changes the address of an account which the transaction originates from, for the given contract_address.... |
start_cheat_account_contract_address_global | Changes the address of an account which the transaction originates from.... |
stop_cheat_account_contract_address | Cancels the cheat_account_contract_address / start_cheat_account_contract_address for the given contract_address.... |
stop_cheat_account_contract_address_global | Cancels the start_cheat_account_contract_address_global . |
cheat_account_deployment_data | Changes the transaction account deployment data for the given contract address and span.... |
start_cheat_account_deployment_data | Changes the transaction account deployment data for the given contract_address.... |
start_cheat_account_deployment_data_global | Changes the transaction account deployment data.... |
stop_cheat_account_deployment_data | Cancels the cheat_account_deployment_data / start_cheat_account_deployment_data for the given contract_address.... |
stop_cheat_account_deployment_data_global | Cancels the cheat_account_deployment_data_global . |
cheat_block_number | Changes the block number for the given contract address and span.... |
start_cheat_block_number | Changes the block number for the given contract_address.... |
start_cheat_block_number_global | Changes the block number.... |
stop_cheat_block_number | Cancels the cheat_block_number / start_cheat_block_number for the given contract_address.... |
stop_cheat_block_number_global | Cancels the start_cheat_block_number_global . |
cheat_block_timestamp | Changes the block timestamp for the given contract address and span.... |
start_cheat_block_timestamp | Changes the block timestamp for the given contract_address.... |
start_cheat_block_timestamp_global | Changes the block timestamp.... |
stop_cheat_block_timestamp | Cancels the cheat_block_timestamp / start_cheat_block_timestamp for the given contract_address.... |
stop_cheat_block_timestamp_global | Cancels the start_cheat_block_timestamp_global . |
cheat_caller_address | Changes the caller address for the given contract address and span.... |
start_cheat_caller_address | Changes the caller address for the given contract_address.... |
start_cheat_caller_address_global | Changes the caller address.... |
stop_cheat_caller_address | Cancels the cheat_caller_address / start_cheat_caller_address for the given contract_address.... |
stop_cheat_caller_address_global | Cancels the start_cheat_caller_address_global . |
cheat_chain_id | Changes the transaction chain_id for the given contract address and span.... |
start_cheat_chain_id | Changes the transaction chain_id for the given contract_address.... |
start_cheat_chain_id_global | Changes the transaction chain_id.... |
stop_cheat_chain_id | Cancels the cheat_chain_id / start_cheat_chain_id for the given contract_address.... |
stop_cheat_chain_id_global | Cancels the start_cheat_chain_id_global . |
cheat_fee_data_availability_mode | Changes the transaction fee data availability mode for the given contract address and span.... |
start_cheat_fee_data_availability_mode | Changes the transaction fee data availability mode for the given contract_address.... |
start_cheat_fee_data_availability_mode_global | Changes the transaction fee data availability mode.... |
stop_cheat_fee_data_availability_mode | Cancels the cheat_fee_data_availability_mode / start_cheat_fee_data_availability_mode for the given contract_address.... |
stop_cheat_fee_data_availability_mode_global | Cancels the start_cheat_fee_data_availability_mode_global . |
cheat_max_fee | Changes the transaction max fee for the given contract address and span.... |
start_cheat_max_fee | Changes the transaction max fee for the given contract_address.... |
start_cheat_max_fee_global | Changes the transaction max fee.... |
stop_cheat_max_fee | Cancels the cheat_max_fee / start_cheat_max_fee for the given contract_address.... |
stop_cheat_max_fee_global | Cancels the start_cheat_max_fee_global . |
cheat_nonce | Changes the transaction nonce for the given contract address and span.... |
start_cheat_nonce | Changes the transaction nonce for the given contract_address.... |
start_cheat_nonce_global | Changes the transaction nonce.... |
stop_cheat_nonce | Cancels the cheat_nonce / start_cheat_nonce for the given contract_address.... |
stop_cheat_nonce_global | Cancels the start_cheat_nonce_global . |
cheat_nonce_data_availability_mode | Changes the transaction nonce data availability mode for the given contract address and span.... |
start_cheat_nonce_data_availability_mode | Changes the transaction nonce data availability mode for the given contract_address.... |
start_cheat_nonce_data_availability_mode_global | Changes the transaction nonce data availability mode.... |
stop_cheat_nonce_data_availability_mode | Cancels the cheat_nonce_data_availability_mode / start_cheat_nonce_data_availability_mode for the given contract_address.... |
stop_cheat_nonce_data_availability_mode_global | Cancels the start_cheat_nonce_data_availability_mode_global . |
cheat_paymaster_data | Changes the transaction paymaster data for the given contract address and span.... |
start_cheat_paymaster_data | Changes the transaction paymaster data for the given contract_address.... |
start_cheat_paymaster_data_global | Changes the transaction paymaster data.... |
stop_cheat_paymaster_data | Cancels the cheat_paymaster_data / start_cheat_paymaster_data for the given contract_address.... |
stop_cheat_paymaster_data_global | Cancels the start_cheat_paymaster_data_global . |
cheat_resource_bounds | Changes the transaction resource bounds for the given contract address and span.... |
start_cheat_resource_bounds | Changes the transaction resource bounds for the given contract_address.... |
start_cheat_resource_bounds_global | Changes the transaction resource bounds.... |
stop_cheat_resource_bounds | Cancels the cheat_resource_bounds / start_cheat_resource_bounds for the given contract_address.... |
stop_cheat_resource_bounds_global | Cancels the start_cheat_resource_bounds_global . |
cheat_sequencer_address | Changes the sequencer address for the given contract address and span.... |
start_cheat_sequencer_address | Changes the sequencer address for the given contract_address.... |
start_cheat_sequencer_address_global | Changes the sequencer address.... |
stop_cheat_sequencer_address | Cancels the cheat_sequencer_address / start_cheat_sequencer_address for the given contract_address.... |
stop_cheat_sequencer_address_global | Cancels the start_cheat_sequencer_address_global . |
cheat_signature | Changes the transaction signature for the given contract address and span.... |
start_cheat_signature | Changes the transaction signature for the given contract_address.... |
start_cheat_signature_global | Changes the transaction signature.... |
stop_cheat_signature | Cancels the cheat_signature / start_cheat_signature for the given contract_address.... |
stop_cheat_signature_global | Cancels the start_cheat_signature_global . |
cheat_tip | Changes the transaction tip for the given contract address and span.... |
start_cheat_tip | Changes the transaction tip for the given contract_address.... |
start_cheat_tip_global | Changes the transaction tip.... |
stop_cheat_tip | Cancels the cheat_tip / start_cheat_tip for the given contract_address.... |
stop_cheat_tip_global | Cancels the start_cheat_tip_global . |
cheat_transaction_hash | Changes the transaction hash for the given contract address and span.... |
start_cheat_transaction_hash | Changes the transaction hash for the given contract_address.... |
start_cheat_transaction_hash_global | Changes the transaction hash.... |
stop_cheat_transaction_hash | Cancels the cheat_transaction_hash / start_cheat_transaction_hash for the given contract_address.... |
stop_cheat_transaction_hash_global | Cancels the start_cheat_transaction_hash_global . |
cheat_transaction_version | Changes the transaction version for the given contract address and span.... |
start_cheat_transaction_version | Changes the transaction version for the given contract_address.... |
start_cheat_transaction_version_global | Changes the transaction version.... |
stop_cheat_transaction_version | Cancels the cheat_transaction_version / start_cheat_transaction_version for the given contract_address.... |
stop_cheat_transaction_version_global | Cancels the start_cheat_transaction_version_global . |
generate_random_felt | Generates a random felt value Returns a random felt within the range of 0 and 2^252 - 1 |
spy_messages_to_l1 | Creates MessageToL1Spy instance that spies on all messages sent to L1 |
store | Stores felts from serialized_value in target contract's storage, starting at storage_address .... |
interact_with_state | — |
load | Loads size felts from target contract's storage into an Array , starting at storage_address .... |
map_entry_address | — |
mock_call | Mocks 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_bytecode | Replaces 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_call | Mocks 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_call | Cancels the mock_call / start_mock_call for the function with given name and contract address.... |
test_address | — |
test_selector | — |
ContractClass | — |
CustomToken | — |
Event | Raw event format (as seen via the RPC-API), can be used for asserting the emitted events. |
EventSpy | An event spy structure allowing to get events emitted only after its creation. |
L1Handler | — |
MessageToL1 | Raw message to L1 format (as seen via the RPC-API), can be used for asserting the sent messages. |
MessageToL1Spy | A message spy structure allowing to get messages emitted only after its creation. |
CheatSpan | Enum used to specify how long the target should be cheated for. |
DeclareResult | — |
Token | — |
ReplaceBytecodeError | — |
ContractClassTrait | — |
DeclareResultTrait | — |
TokenTrait | — |
EventSpyAssertionsTrait | Allows to assert the expected events emission (or lack thereof), in the scope of EventSpy structure. |
EventSpyTrait | — |
EventsFilterTrait | — |
IsEmitted | — |
L1HandlerTrait | — |
MessageToL1FilterTrait | — |
MessageToL1SpyAssertionsTrait | Allows to assert the expected sent messages (or lack thereof), in the scope of MessageToL1Spy structure. |
MessageToL1SpyTrait | — |
Modules
cheatcodes | — |
byte_array | — |
env | — |
fs | — |
fuzzable | — |
signature | — |
trace | — |
cheatcodes
Fully qualified path: snforge_std::cheatcodes
Modules
block_hash | — |
contract_class | — |
erc20 | — |
events | — |
execution_info | — |
generate_arg | — |
generate_random_felt | — |
l1_handler | — |
message_to_l1 | — |
storage | — |
Free functions
test_selector | — |
test_address | — |
mock_call | Mocks 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 ... |
start_mock_call | Mocks 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_call | Cancels the mock_call / start_mock_call for the function with given name and contract address.... |
replace_bytecode | Replaces 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.... |
Enums
CheatSpan | Enum used to specify how long the target should be cheated for. |
ReplaceBytecodeError | — |
Modules
block_hash | — |
contract_class | — |
erc20 | — |
events | — |
execution_info | — |
generate_arg | — |
generate_random_felt | — |
l1_handler | — |
message_to_l1 | — |
storage | — |
block_hash
Fully qualified path: snforge_std::cheatcodes::block_hash
Free functions
cheat_block_hash | Changes the block hash for the given block number and contract address.... |
start_cheat_block_hash_global | Starts a global block hash modification.... |
stop_cheat_block_hash_global | Cancels the start_cheat_block_hash_global .... |
start_cheat_block_hash | Starts a block hash modification for a specific contract.... |
stop_cheat_block_hash | Cancels the cheat_block_hash / start_cheat_block_hash for a specific contract.... |
Free functions
cheat_block_hash | Changes the block hash for the given block number and contract address.... |
start_cheat_block_hash_global | Starts a global block hash modification.... |
stop_cheat_block_hash_global | Cancels the start_cheat_block_hash_global .... |
start_cheat_block_hash | Starts a block hash modification for a specific contract.... |
stop_cheat_block_hash | Cancels the cheat_block_hash / start_cheat_block_hash for a specific contract.... |
cheat_block_hash
Changes the block hash for the given block number and contract address.
contract_address
- The contract address to which the cheat applies.block_number
- Block number to be modified.block_hash
-felt252
representing the new block hash.span
- instance ofCheatSpan
specifying the number of syscalls with the cheat
Fully qualified path: snforge_std::cheatcodes::block_hash::cheat_block_hash
pub fn cheat_block_hash(
contract_address: ContractAddress, block_number: u64, block_hash: felt252, span: CheatSpan,
)
start_cheat_block_hash_global
Starts a global block hash modification.
block_number
- Block number to be modified.block_hash
- The block hash value to set globally.
Fully qualified path: snforge_std::cheatcodes::block_hash::start_cheat_block_hash_global
pub fn start_cheat_block_hash_global(block_number: u64, block_hash: felt252)
stop_cheat_block_hash_global
Cancels the start_cheat_block_hash_global
.
block_number
- Block number for which the cheat should be stopped.
Fully qualified path: snforge_std::cheatcodes::block_hash::stop_cheat_block_hash_global
pub fn stop_cheat_block_hash_global(block_number: u64)
start_cheat_block_hash
Starts a block hash modification for a specific contract.
contract_address
- Contract address associated with the modification.block_number
- Block number to be modified.block_hash
- The block hash to set.
Fully qualified path: snforge_std::cheatcodes::block_hash::start_cheat_block_hash
pub fn start_cheat_block_hash(
contract_address: ContractAddress, block_number: u64, block_hash: felt252,
)
stop_cheat_block_hash
Cancels the cheat_block_hash
/start_cheat_block_hash
for a specific contract.
block_number
- Block number for which the cheat should be stopped.contract_address
- The contract affected by the previous cheat.
Fully qualified path: snforge_std::cheatcodes::block_hash::stop_cheat_block_hash
pub fn stop_cheat_block_hash(contract_address: ContractAddress, block_number: u64)
contract_class
Fully qualified path: snforge_std::cheatcodes::contract_class
Free functions
declare | Declares 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_hash | Retrieves a class hash of a contract deployed under the given address contract_address - target contract address Returns the ClassHash under given address |
Structs
Enums
Traits
Free functions
declare | Declares 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_hash | Retrieves a class hash of a contract deployed under the given address contract_address - target contract address Returns the ClassHash under given address |
declare
Declares 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
that encapsulated possible outcomes in the enum:
Success
: Contains the successfully declaredContractClass
.AlreadyDeclared
: ContainsContractClass
and signals that the contract has already been declared.
Fully qualified path: snforge_std::cheatcodes::contract_class::declare
pub fn declare(contract: ByteArray) -> Result<DeclareResult, Array<felt252>>
get_class_hash
Retrieves a class hash of a contract deployed under the given address
contract_address
- target contract address
Returns the ClassHash
under given address
Fully qualified path: snforge_std::cheatcodes::contract_class::get_class_hash
pub fn get_class_hash(contract_address: ContractAddress) -> ClassHash
Structs
ContractClass
Fully qualified path: snforge_std::cheatcodes::contract_class::ContractClass
[derive(Drop, Serde, Copy)]
pub struct ContractClass {
pub class_hash: ClassHash,
}
Members
class_hash
Fully qualified path: snforge_std::cheatcodes::contract_class::ContractClass::class_hash
pub class_hash: ClassHash
Enums
DeclareResult
Fully qualified path: snforge_std::cheatcodes::contract_class::DeclareResult
pub enum DeclareResult {
Success: ContractClass,
AlreadyDeclared: ContractClass,
}
Variants
Success
Fully qualified path: snforge_std::cheatcodes::contract_class::DeclareResult::Success
Success: ContractClass
AlreadyDeclared
Fully qualified path: snforge_std::cheatcodes::contract_class::DeclareResult::AlreadyDeclared
AlreadyDeclared: ContractClass
Traits
ContractClassTrait
Fully qualified path: snforge_std::cheatcodes::contract_class::ContractClassTrait
pub trait ContractClassTrait
Trait functions
precalculate_address
Calculates an address of a contract in advance that would be returned when calling deploy
The precalculated address is only correct for the very next deployment
The constructor_calldata
has a direct impact on the resulting contract address
self
- an instance of the struct ContractClass
which is obtained by calling declare
and unpacking DeclareResult
constructor_calldata
- serialized calldata for the deploy constructor
Returns the precalculated ContractAddress
Fully qualified path: snforge_std::cheatcodes::contract_class::ContractClassTrait::precalculate_address
fn precalculate_address(
self: ContractClass, constructor_calldata: Array<felt252>,
) -> ContractAddress
deploy
Deploys a contract
self
- an instance of the struct ContractClass
which is obtained by calling declare
and unpacking DeclareResult
constructor_calldata
- calldata for the constructor, serialized with Serde
Returns the address the contract was deployed at and serialized constructor return data, or
panic data if it failed
Fully qualified path: snforge_std::cheatcodes::contract_class::ContractClassTrait::deploy
fn deploy(
self: ContractClass, constructor_calldata: Array<felt252>,
) -> Result<(ContractAddress, Span<felt252>), Array<felt252>>
deploy_at
Deploys a contract at a given address
self
- an instance of the struct ContractClass
which is obtained by calling declare
and unpacking DeclareResult
constructor_calldata
- serialized calldata for the constructor
contract_address
- address the contract should be deployed at
Returns the address the contract was deployed at and serialized constructor return data, or
panic data if it failed
Fully qualified path: snforge_std::cheatcodes::contract_class::ContractClassTrait::deploy_at
fn deploy_at(
self: ContractClass, constructor_calldata: Array<felt252>, contract_address: ContractAddress,
) -> Result<(ContractAddress, Span<felt252>), Array<felt252>>
new
Utility method for creating a new ContractClass
instance
class_hash
- a numeric value that can be converted into the class hash of ContractClass
Returns the created ContractClass
Fully qualified path: snforge_std::cheatcodes::contract_class::ContractClassTrait::new
fn new<T, +Into<T, ClassHash>>(class_hash: T) -> ContractClass
DeclareResultTrait
Fully qualified path: snforge_std::cheatcodes::contract_class::DeclareResultTrait
pub trait DeclareResultTrait
Trait functions
contract_class
Gets inner ContractClass
self
- an instance of the struct DeclareResult
which is obtained by calling declare
Fully qualified path: snforge_std::cheatcodes::contract_class::DeclareResultTrait::contract_class
fn contract_class(self: DeclareResult) -> ContractClass
erc20
Fully qualified path: snforge_std::cheatcodes::erc20
Free functions
set_balance | Sets the balance of token`` for target `` contract to new_balance ... |
Structs
Enums
Traits
Impls
Free functions
set_balance | Sets the balance of token`` for target `` contract to new_balance ... |
set_balance
Sets the balance of token`` for
target`` contract to new_balance
target
- address of the contract, which balance you want to modifynew_balance
- new balance valuetoken
- token for which the balance is being set
Fully qualified path: snforge_std::cheatcodes::erc20::set_balance
pub fn set_balance(target: ContractAddress, new_balance: u256, token: Token)
Structs
CustomToken
Fully qualified path: snforge_std::cheatcodes::erc20::CustomToken
[derive(Drop, Serde, Copy, Debug)]
pub struct CustomToken {
pub contract_address: ContractAddress,
pub balances_variable_selector: felt252,
}
Members
contract_address
Fully qualified path: snforge_std::cheatcodes::erc20::CustomToken::contract_address
pub contract_address: ContractAddress
balances_variable_selector
Fully qualified path: snforge_std::cheatcodes::erc20::CustomToken::balances_variable_selector
pub balances_variable_selector: felt252
Enums
Token
Fully qualified path: snforge_std::cheatcodes::erc20::Token
pub enum Token {
STRK,
ETH,
Custom: CustomToken,
}
Variants
STRK
Fully qualified path: snforge_std::cheatcodes::erc20::Token::STRK
STRK
ETH
Fully qualified path: snforge_std::cheatcodes::erc20::Token::ETH
ETH
Custom
Fully qualified path: snforge_std::cheatcodes::erc20::Token::Custom
Custom: CustomToken
Traits
TokenTrait
Fully qualified path: snforge_std::cheatcodes::erc20::TokenTrait
pub trait TokenTrait
Trait functions
contract_address
Fully qualified path: snforge_std::cheatcodes::erc20::TokenTrait::contract_address
fn contract_address(self: Token) -> ContractAddress
balances_variable_selector
Fully qualified path: snforge_std::cheatcodes::erc20::TokenTrait::balances_variable_selector
fn balances_variable_selector(self: Token) -> felt252
Impls
TokenImpl
Fully qualified path: snforge_std::cheatcodes::erc20::TokenImpl
pub impl TokenImpl of TokenTrait;
Impl functions
contract_address
Fully qualified path: snforge_std::cheatcodes::erc20::TokenImpl::contract_address
fn contract_address(self: Token) -> ContractAddress
balances_variable_selector
Fully qualified path: snforge_std::cheatcodes::erc20::TokenImpl::balances_variable_selector
fn balances_variable_selector(self: Token) -> felt252
events
Fully qualified path: snforge_std::cheatcodes::events
Free functions
spy_events | Creates EventSpy instance that spies on all events emitted after its creation. |
Structs
Event | Raw event format (as seen via the RPC-API), can be used for asserting the emitted events. |
EventSpy | An event spy structure allowing to get events emitted only after its creation. |
Events | A wrapper structure on an array of events to handle filtering smoothly. |
Traits
EventSpyTrait | — |
EventsFilterTrait | — |
EventSpyAssertionsTrait | Allows to assert the expected events emission (or lack thereof), in the scope of EventSpy structure. |
IsEmitted | — |
Free functions
spy_events | Creates EventSpy instance that spies on all events emitted after its creation. |
spy_events
Creates EventSpy
instance that spies on all events emitted after its creation.
Fully qualified path: snforge_std::cheatcodes::events::spy_events
pub fn spy_events() -> EventSpy
Structs
Event | Raw event format (as seen via the RPC-API), can be used for asserting the emitted events. |
EventSpy | An event spy structure allowing to get events emitted only after its creation. |
Events | A wrapper structure on an array of events to handle filtering smoothly. |
Event
Raw event format (as seen via the RPC-API), can be used for asserting the emitted events.
Fully qualified path: snforge_std::cheatcodes::events::Event
[derive(Drop, Clone, Serde, Debug, PartialEq)]
pub struct Event {
pub keys: Array<felt252>,
pub data: Array<felt252>,
}
Members
keys
Fully qualified path: snforge_std::cheatcodes::events::Event::keys
pub keys: Array<felt252>
data
Fully qualified path: snforge_std::cheatcodes::events::Event::data
pub data: Array<felt252>
EventSpy
An event spy structure allowing to get events emitted only after its creation.
Fully qualified path: snforge_std::cheatcodes::events::EventSpy
[derive(Drop, Serde)]
pub struct EventSpy {
event_offset: u32,
}
Events
A wrapper structure on an array of events to handle filtering smoothly.
Fully qualified path: snforge_std::cheatcodes::events::Events
[derive(Drop, Serde, Clone, Debug, PartialEq)]
pub struct Events {
pub events: Array<(ContractAddress, Event)>,
}
Members
events
Fully qualified path: snforge_std::cheatcodes::events::Events::events
pub events: Array<(ContractAddress, Event)>
Traits
EventSpyTrait | — |
EventsFilterTrait | — |
EventSpyAssertionsTrait | Allows to assert the expected events emission (or lack thereof), in the scope of EventSpy structure. |
IsEmitted | — |
EventSpyTrait
Fully qualified path: snforge_std::cheatcodes::events::EventSpyTrait
pub trait EventSpyTrait
Trait functions
get_events
Gets all events given EventSpy
spies for.
Fully qualified path: snforge_std::cheatcodes::events::EventSpyTrait::get_events
fn get_events(ref self: EventSpy) -> Events
EventsFilterTrait
Fully qualified path: snforge_std::cheatcodes::events::EventsFilterTrait
pub trait EventsFilterTrait
Trait functions
emitted_by
Filter events emitted by a given ContractAddress
.
Fully qualified path: snforge_std::cheatcodes::events::EventsFilterTrait::emitted_by
fn emitted_by(self: Events, contract_address: ContractAddress) -> Events
EventSpyAssertionsTrait
Allows to assert the expected events emission (or lack thereof),
in the scope of EventSpy
structure.
Fully qualified path: snforge_std::cheatcodes::events::EventSpyAssertionsTrait
pub trait EventSpyAssertionsTrait<T, impl Event<T>: Event<T>+Drop<T>>
Trait functions
assert_emitted
Fully qualified path: snforge_std::cheatcodes::events::EventSpyAssertionsTrait::assert_emitted
fn assert_emitted<T, +starknet::Event<T>, +Drop<T>, T, +starknet::Event<T>, +Drop<T>>(
ref self: EventSpy, events: @Array<(ContractAddress, T)>,
)
assert_not_emitted
Fully qualified path: snforge_std::cheatcodes::events::EventSpyAssertionsTrait::assert_not_emitted
fn assert_not_emitted<T, +starknet::Event<T>, +Drop<T>, T, +starknet::Event<T>, +Drop<T>>(
ref self: EventSpy, events: @Array<(ContractAddress, T)>,
)
IsEmitted
Fully qualified path: snforge_std::cheatcodes::events::IsEmitted
pub trait IsEmitted<T, impl Event<T>: Event<T>+Drop<T>>
Trait functions
is_emitted
Fully qualified path: snforge_std::cheatcodes::events::IsEmitted::is_emitted
fn is_emitted<T, +starknet::Event<T>, +Drop<T>, T, +starknet::Event<T>, +Drop<T>>(
self: Events, expected_emitted_by: ContractAddress, expected_event: @T,
) -> bool
execution_info
Fully qualified path: snforge_std::cheatcodes::execution_info
Modules
Modules
account_contract_address
Fully qualified path: snforge_std::cheatcodes::execution_info::account_contract_address
Free functions
cheat_account_contract_address | Changes the address of an account which the transaction originates from, for the given contract address and span.... |
start_cheat_account_contract_address_global | Changes the address of an account which the transaction originates from.... |
stop_cheat_account_contract_address_global | Cancels the start_cheat_account_contract_address_global . |
start_cheat_account_contract_address | Changes the address of an account which the transaction originates from, for the given contract_address.... |
stop_cheat_account_contract_address | Cancels the cheat_account_contract_address / start_cheat_account_contract_address for the given contract_address.... |
Free functions
cheat_account_contract_address | Changes the address of an account which the transaction originates from, for the given contract address and span.... |
start_cheat_account_contract_address_global | Changes the address of an account which the transaction originates from.... |
stop_cheat_account_contract_address_global | Cancels the start_cheat_account_contract_address_global . |
start_cheat_account_contract_address | Changes the address of an account which the transaction originates from, for the given contract_address.... |
stop_cheat_account_contract_address | Cancels the cheat_account_contract_address / start_cheat_account_contract_address for the given contract_address.... |
cheat_account_contract_address
Changes the address of an account which the transaction originates from, for the given contract address and span.
contract_address
- instance ofContractAddress
specifying which contracts to cheataccount_contract_address
- transaction account deployment data to be setspan
- instance ofCheatSpan
specifying the number of contract calls with the cheat applied
Fully qualified path: snforge_std::cheatcodes::execution_info::account_contract_address::cheat_account_contract_address
pub fn cheat_account_contract_address(
contract_address: ContractAddress, account_contract_address: ContractAddress, span: CheatSpan,
)
start_cheat_account_contract_address_global
Changes the address of an account which the transaction originates from.
account_contract_address
- transaction account deployment data to be set
Fully qualified path: snforge_std::cheatcodes::execution_info::account_contract_address::start_cheat_account_contract_address_global
pub fn start_cheat_account_contract_address_global(account_contract_address: ContractAddress)
stop_cheat_account_contract_address_global
Cancels the start_cheat_account_contract_address_global
.
Fully qualified path: snforge_std::cheatcodes::execution_info::account_contract_address::stop_cheat_account_contract_address_global
pub fn stop_cheat_account_contract_address_global()
start_cheat_account_contract_address
Changes the address of an account which the transaction originates from, for the given contract_address.
contract_address
- instance ofContractAddress
specifying which contract to cheataccount_contract_address
- transaction account deployment data to be set
Fully qualified path: snforge_std::cheatcodes::execution_info::account_contract_address::start_cheat_account_contract_address
pub fn start_cheat_account_contract_address(
contract_address: ContractAddress, account_contract_address: ContractAddress,
)
stop_cheat_account_contract_address
Cancels the cheat_account_contract_address
/ start_cheat_account_contract_address
for the
given contract_address.
contract_address
- instance ofContractAddress
specifying which contract to stop cheating
Fully qualified path: snforge_std::cheatcodes::execution_info::account_contract_address::stop_cheat_account_contract_address
pub fn stop_cheat_account_contract_address(contract_address: ContractAddress)
account_deployment_data
Fully qualified path: snforge_std::cheatcodes::execution_info::account_deployment_data
Free functions
cheat_account_deployment_data | Changes the transaction account deployment data for the given contract address and span.... |
start_cheat_account_deployment_data_global | Changes the transaction account deployment data.... |
stop_cheat_account_deployment_data_global | Cancels the cheat_account_deployment_data_global . |
start_cheat_account_deployment_data | Changes the transaction account deployment data for the given contract_address.... |
stop_cheat_account_deployment_data | Cancels the cheat_account_deployment_data / start_cheat_account_deployment_data for the given contract_address.... |
Free functions
cheat_account_deployment_data | Changes the transaction account deployment data for the given contract address and span.... |
start_cheat_account_deployment_data_global | Changes the transaction account deployment data.... |
stop_cheat_account_deployment_data_global | Cancels the cheat_account_deployment_data_global . |
start_cheat_account_deployment_data | Changes the transaction account deployment data for the given contract_address.... |
stop_cheat_account_deployment_data | Cancels the cheat_account_deployment_data / start_cheat_account_deployment_data for the given contract_address.... |
cheat_account_deployment_data
Changes the transaction account deployment data for the given contract address and span.
contract_address
- instance ofContractAddress
specifying which contracts to cheataccount_deployment_data
- transaction account deployment data to be setspan
- instance ofCheatSpan
specifying the number of contract calls with the cheat applied
Fully qualified path: snforge_std::cheatcodes::execution_info::account_deployment_data::cheat_account_deployment_data
pub fn cheat_account_deployment_data(
contract_address: ContractAddress, account_deployment_data: Span<felt252>, span: CheatSpan,
)
start_cheat_account_deployment_data_global
Changes the transaction account deployment data.
account_deployment_data
- transaction account deployment data to be set
Fully qualified path: snforge_std::cheatcodes::execution_info::account_deployment_data::start_cheat_account_deployment_data_global
pub fn start_cheat_account_deployment_data_global(account_deployment_data: Span<felt252>)
stop_cheat_account_deployment_data_global
Cancels the cheat_account_deployment_data_global
.
Fully qualified path: snforge_std::cheatcodes::execution_info::account_deployment_data::stop_cheat_account_deployment_data_global
pub fn stop_cheat_account_deployment_data_global()
start_cheat_account_deployment_data
Changes the transaction account deployment data for the given contract_address.
contract_address
- instance ofContractAddress
specifying which contract to cheataccount_deployment_data
- transaction account deployment data to be set
Fully qualified path: snforge_std::cheatcodes::execution_info::account_deployment_data::start_cheat_account_deployment_data
pub fn start_cheat_account_deployment_data(
contract_address: ContractAddress, account_deployment_data: Span<felt252>,
)
stop_cheat_account_deployment_data
Cancels the cheat_account_deployment_data
/ start_cheat_account_deployment_data
for the
given contract_address.
contract_address
- instance ofContractAddress
specifying which contract to stop cheating
Fully qualified path: snforge_std::cheatcodes::execution_info::account_deployment_data::stop_cheat_account_deployment_data
pub fn stop_cheat_account_deployment_data(contract_address: ContractAddress)
block_number
Fully qualified path: snforge_std::cheatcodes::execution_info::block_number
Free functions
cheat_block_number | Changes the block number for the given contract address and span.... |
start_cheat_block_number_global | Changes the block number.... |
stop_cheat_block_number_global | Cancels the start_cheat_block_number_global . |
start_cheat_block_number | Changes the block number for the given contract_address.... |
stop_cheat_block_number | Cancels the cheat_block_number / start_cheat_block_number for the given contract_address.... |
Free functions
cheat_block_number | Changes the block number for the given contract address and span.... |
start_cheat_block_number_global | Changes the block number.... |
stop_cheat_block_number_global | Cancels the start_cheat_block_number_global . |
start_cheat_block_number | Changes the block number for the given contract_address.... |
stop_cheat_block_number | Cancels the cheat_block_number / start_cheat_block_number for the given contract_address.... |
cheat_block_number
Changes the block number for the given contract address and span.
contract_address
- instance ofContractAddress
specifying which contract to cheatblock_number
- block number to be setspan
- instance ofCheatSpan
specifying the number of contract calls with the cheat applied
Fully qualified path: snforge_std::cheatcodes::execution_info::block_number::cheat_block_number
pub fn cheat_block_number(contract_address: ContractAddress, block_number: u64, span: CheatSpan)
start_cheat_block_number_global
Changes the block number.
block_number
- block number to be set
Fully qualified path: snforge_std::cheatcodes::execution_info::block_number::start_cheat_block_number_global
pub fn start_cheat_block_number_global(block_number: u64)
stop_cheat_block_number_global
Cancels the start_cheat_block_number_global
.
Fully qualified path: snforge_std::cheatcodes::execution_info::block_number::stop_cheat_block_number_global
pub fn stop_cheat_block_number_global()
start_cheat_block_number
Changes the block number for the given contract_address.
contract_address
- instance ofContractAddress
specifying which contract to cheatblock_number
- block number to be set
Fully qualified path: snforge_std::cheatcodes::execution_info::block_number::start_cheat_block_number
pub fn start_cheat_block_number(contract_address: ContractAddress, block_number: u64)
stop_cheat_block_number
Cancels the cheat_block_number
/ start_cheat_block_number
for the given contract_address.
contract_address
- instance ofContractAddress
specifying which contract to stop cheating
Fully qualified path: snforge_std::cheatcodes::execution_info::block_number::stop_cheat_block_number
pub fn stop_cheat_block_number(contract_address: ContractAddress)
block_timestamp
Fully qualified path: snforge_std::cheatcodes::execution_info::block_timestamp
Free functions
cheat_block_timestamp | Changes the block timestamp for the given contract address and span.... |
start_cheat_block_timestamp_global | Changes the block timestamp.... |
stop_cheat_block_timestamp_global | Cancels the start_cheat_block_timestamp_global . |
start_cheat_block_timestamp | Changes the block timestamp for the given contract_address.... |
stop_cheat_block_timestamp | Cancels the cheat_block_timestamp / start_cheat_block_timestamp for the given contract_address.... |
Free functions
cheat_block_timestamp | Changes the block timestamp for the given contract address and span.... |
start_cheat_block_timestamp_global | Changes the block timestamp.... |
stop_cheat_block_timestamp_global | Cancels the start_cheat_block_timestamp_global . |
start_cheat_block_timestamp | Changes the block timestamp for the given contract_address.... |
stop_cheat_block_timestamp | Cancels the cheat_block_timestamp / start_cheat_block_timestamp for the given contract_address.... |
cheat_block_timestamp
Changes the block timestamp for the given contract address and span.
contract_address
- instance ofContractAddress
specifying which contract to cheatblock_timestamp
- block timestamp to be setspan
- instance ofCheatSpan
specifying the number of contract calls with the cheat applied
Fully qualified path: snforge_std::cheatcodes::execution_info::block_timestamp::cheat_block_timestamp
pub fn cheat_block_timestamp(
contract_address: ContractAddress, block_timestamp: u64, span: CheatSpan,
)
start_cheat_block_timestamp_global
Changes the block timestamp.
block_timestamp
- block timestamp to be set
Fully qualified path: snforge_std::cheatcodes::execution_info::block_timestamp::start_cheat_block_timestamp_global
pub fn start_cheat_block_timestamp_global(block_timestamp: u64)
stop_cheat_block_timestamp_global
Cancels the start_cheat_block_timestamp_global
.
Fully qualified path: snforge_std::cheatcodes::execution_info::block_timestamp::stop_cheat_block_timestamp_global
pub fn stop_cheat_block_timestamp_global()
start_cheat_block_timestamp
Changes the block timestamp for the given contract_address.
contract_address
- instance ofContractAddress
specifying which contract to cheatblock_timestamp
- block timestamp to be set
Fully qualified path: snforge_std::cheatcodes::execution_info::block_timestamp::start_cheat_block_timestamp
pub fn start_cheat_block_timestamp(contract_address: ContractAddress, block_timestamp: u64)
stop_cheat_block_timestamp
Cancels the cheat_block_timestamp
/ start_cheat_block_timestamp
for the given
contract_address.
contract_address
- instance ofContractAddress
specifying which contract to stop cheating
Fully qualified path: snforge_std::cheatcodes::execution_info::block_timestamp::stop_cheat_block_timestamp
pub fn stop_cheat_block_timestamp(contract_address: ContractAddress)
caller_address
Fully qualified path: snforge_std::cheatcodes::execution_info::caller_address
Free functions
cheat_caller_address | Changes the caller address for the given contract address and span.... |
start_cheat_caller_address_global | Changes the caller address.... |
stop_cheat_caller_address_global | Cancels the start_cheat_caller_address_global . |
start_cheat_caller_address | Changes the caller address for the given contract_address.... |
stop_cheat_caller_address | Cancels the cheat_caller_address / start_cheat_caller_address for the given contract_address.... |
Free functions
cheat_caller_address | Changes the caller address for the given contract address and span.... |
start_cheat_caller_address_global | Changes the caller address.... |
stop_cheat_caller_address_global | Cancels the start_cheat_caller_address_global . |
start_cheat_caller_address | Changes the caller address for the given contract_address.... |
stop_cheat_caller_address | Cancels the cheat_caller_address / start_cheat_caller_address for the given contract_address.... |
cheat_caller_address
Changes the caller address for the given contract address and span.
contract_address
- instance ofContractAddress
specifying which contract to cheatcaller_address
- caller address to be setspan
- instance ofCheatSpan
specifying the number of contract calls with the cheat applied
Fully qualified path: snforge_std::cheatcodes::execution_info::caller_address::cheat_caller_address
pub fn cheat_caller_address(
contract_address: ContractAddress, caller_address: ContractAddress, span: CheatSpan,
)
start_cheat_caller_address_global
Changes the caller address.
caller_address
- caller address to be set
Fully qualified path: snforge_std::cheatcodes::execution_info::caller_address::start_cheat_caller_address_global
pub fn start_cheat_caller_address_global(caller_address: ContractAddress)
stop_cheat_caller_address_global
Cancels the start_cheat_caller_address_global
.
Fully qualified path: snforge_std::cheatcodes::execution_info::caller_address::stop_cheat_caller_address_global
pub fn stop_cheat_caller_address_global()
start_cheat_caller_address
Changes the caller address for the given contract_address.
contract_address
- instance ofContractAddress
specifying which contract to cheatcaller_address
- caller address to be set
Fully qualified path: snforge_std::cheatcodes::execution_info::caller_address::start_cheat_caller_address
pub fn start_cheat_caller_address(
contract_address: ContractAddress, caller_address: ContractAddress,
)
stop_cheat_caller_address
Cancels the cheat_caller_address
/ start_cheat_caller_address
for the given
contract_address.
contract_address
- instance ofContractAddress
specifying which contract to stop cheating
Fully qualified path: snforge_std::cheatcodes::execution_info::caller_address::stop_cheat_caller_address
pub fn stop_cheat_caller_address(contract_address: ContractAddress)
chain_id
Fully qualified path: snforge_std::cheatcodes::execution_info::chain_id
Free functions
cheat_chain_id | Changes the transaction chain_id for the given contract address and span.... |
start_cheat_chain_id_global | Changes the transaction chain_id.... |
stop_cheat_chain_id_global | Cancels the start_cheat_chain_id_global . |
start_cheat_chain_id | Changes the transaction chain_id for the given contract_address.... |
stop_cheat_chain_id | Cancels the cheat_chain_id / start_cheat_chain_id for the given contract_address.... |
Free functions
cheat_chain_id | Changes the transaction chain_id for the given contract address and span.... |
start_cheat_chain_id_global | Changes the transaction chain_id.... |
stop_cheat_chain_id_global | Cancels the start_cheat_chain_id_global . |
start_cheat_chain_id | Changes the transaction chain_id for the given contract_address.... |
stop_cheat_chain_id | Cancels the cheat_chain_id / start_cheat_chain_id for the given contract_address.... |
cheat_chain_id
Changes the transaction chain_id for the given contract address and span.
contract_address
- instance ofContractAddress
specifying which contract to cheatchain_id
- transaction chain_id to be setspan
- instance ofCheatSpan
specifying the number of contract calls with the cheat applied
Fully qualified path: snforge_std::cheatcodes::execution_info::chain_id::cheat_chain_id
pub fn cheat_chain_id(contract_address: ContractAddress, chain_id: felt252, span: CheatSpan)
start_cheat_chain_id_global
Changes the transaction chain_id.
chain_id
- transaction chain_id to be set
Fully qualified path: snforge_std::cheatcodes::execution_info::chain_id::start_cheat_chain_id_global
pub fn start_cheat_chain_id_global(chain_id: felt252)
stop_cheat_chain_id_global
Cancels the start_cheat_chain_id_global
.
Fully qualified path: snforge_std::cheatcodes::execution_info::chain_id::stop_cheat_chain_id_global
pub fn stop_cheat_chain_id_global()
start_cheat_chain_id
Changes the transaction chain_id for the given contract_address.
contract_address
- instance ofContractAddress
specifying which contract to cheatchain_id
- transaction chain_id to be set
Fully qualified path: snforge_std::cheatcodes::execution_info::chain_id::start_cheat_chain_id
pub fn start_cheat_chain_id(contract_address: ContractAddress, chain_id: felt252)
stop_cheat_chain_id
Cancels the cheat_chain_id
/ start_cheat_chain_id
for the given contract_address.
contract_address
- instance ofContractAddress
specifying which contract to stop cheating
Fully qualified path: snforge_std::cheatcodes::execution_info::chain_id::stop_cheat_chain_id
pub fn stop_cheat_chain_id(contract_address: ContractAddress)
fee_data_availability_mode
Fully qualified path: snforge_std::cheatcodes::execution_info::fee_data_availability_mode
Free functions
cheat_fee_data_availability_mode | Changes the transaction fee data availability mode for the given contract address and span.... |
start_cheat_fee_data_availability_mode_global | Changes the transaction fee data availability mode.... |
stop_cheat_fee_data_availability_mode_global | Cancels the start_cheat_fee_data_availability_mode_global . |
start_cheat_fee_data_availability_mode | Changes the transaction fee data availability mode for the given contract_address.... |
stop_cheat_fee_data_availability_mode | Cancels the cheat_fee_data_availability_mode / start_cheat_fee_data_availability_mode for the given contract_address.... |
Free functions
cheat_fee_data_availability_mode | Changes the transaction fee data availability mode for the given contract address and span.... |
start_cheat_fee_data_availability_mode_global | Changes the transaction fee data availability mode.... |
stop_cheat_fee_data_availability_mode_global | Cancels the start_cheat_fee_data_availability_mode_global . |
start_cheat_fee_data_availability_mode | Changes the transaction fee data availability mode for the given contract_address.... |
stop_cheat_fee_data_availability_mode | Cancels the cheat_fee_data_availability_mode / start_cheat_fee_data_availability_mode for the given contract_address.... |
cheat_fee_data_availability_mode
Changes the transaction fee data availability mode for the given contract address and span.
contract_address
- instance ofContractAddress
specifying which contracts to cheatfee_data_availability_mode
- transaction fee data availability mode to be setspan
- instance ofCheatSpan
specifying the number of contract calls with the cheat applied
Fully qualified path: snforge_std::cheatcodes::execution_info::fee_data_availability_mode::cheat_fee_data_availability_mode
pub fn cheat_fee_data_availability_mode(
contract_address: ContractAddress, fee_data_availability_mode: u32, span: CheatSpan,
)
start_cheat_fee_data_availability_mode_global
Changes the transaction fee data availability mode.
fee_data_availability_mode
- transaction fee data availability mode to be set
Fully qualified path: snforge_std::cheatcodes::execution_info::fee_data_availability_mode::start_cheat_fee_data_availability_mode_global
pub fn start_cheat_fee_data_availability_mode_global(fee_data_availability_mode: u32)
stop_cheat_fee_data_availability_mode_global
Cancels the start_cheat_fee_data_availability_mode_global
.
Fully qualified path: snforge_std::cheatcodes::execution_info::fee_data_availability_mode::stop_cheat_fee_data_availability_mode_global
pub fn stop_cheat_fee_data_availability_mode_global()
start_cheat_fee_data_availability_mode
Changes the transaction fee data availability mode for the given contract_address.
contract_address
- instance ofContractAddress
specifying which contract to cheatfee_data_availability_mode
- transaction fee data availability mode to be set
Fully qualified path: snforge_std::cheatcodes::execution_info::fee_data_availability_mode::start_cheat_fee_data_availability_mode
pub fn start_cheat_fee_data_availability_mode(
contract_address: ContractAddress, fee_data_availability_mode: u32,
)
stop_cheat_fee_data_availability_mode
Cancels the cheat_fee_data_availability_mode
/ start_cheat_fee_data_availability_mode
for
the given contract_address.
contract_address
- instance ofContractAddress
specifying which contract to stop cheating
Fully qualified path: snforge_std::cheatcodes::execution_info::fee_data_availability_mode::stop_cheat_fee_data_availability_mode
pub fn stop_cheat_fee_data_availability_mode(contract_address: ContractAddress)
max_fee
Fully qualified path: snforge_std::cheatcodes::execution_info::max_fee
Free functions
cheat_max_fee | Changes the transaction max fee for the given contract address and span.... |
start_cheat_max_fee_global | Changes the transaction max fee.... |
stop_cheat_max_fee_global | Cancels the start_cheat_max_fee_global . |
start_cheat_max_fee | Changes the transaction max fee for the given contract_address.... |
stop_cheat_max_fee | Cancels the cheat_max_fee / start_cheat_max_fee for the given contract_address.... |
Free functions
cheat_max_fee | Changes the transaction max fee for the given contract address and span.... |
start_cheat_max_fee_global | Changes the transaction max fee.... |
stop_cheat_max_fee_global | Cancels the start_cheat_max_fee_global . |
start_cheat_max_fee | Changes the transaction max fee for the given contract_address.... |
stop_cheat_max_fee | Cancels the cheat_max_fee / start_cheat_max_fee for the given contract_address.... |
cheat_max_fee
Changes the transaction max fee for the given contract address and span.
contract_address
- instance ofContractAddress
specifying which contract to cheatmax_fee
- transaction max fee to be setspan
- instance ofCheatSpan
specifying the number of contract calls with the cheat applied
Fully qualified path: snforge_std::cheatcodes::execution_info::max_fee::cheat_max_fee
pub fn cheat_max_fee(contract_address: ContractAddress, max_fee: u128, span: CheatSpan)
start_cheat_max_fee_global
Changes the transaction max fee.
max_fee
- transaction max fee to be set
Fully qualified path: snforge_std::cheatcodes::execution_info::max_fee::start_cheat_max_fee_global
pub fn start_cheat_max_fee_global(max_fee: u128)
stop_cheat_max_fee_global
Cancels the start_cheat_max_fee_global
.
Fully qualified path: snforge_std::cheatcodes::execution_info::max_fee::stop_cheat_max_fee_global
pub fn stop_cheat_max_fee_global()
start_cheat_max_fee
Changes the transaction max fee for the given contract_address.
contract_address
- instance ofContractAddress
specifying which contract to cheatmax_fee
- transaction max fee to be set
Fully qualified path: snforge_std::cheatcodes::execution_info::max_fee::start_cheat_max_fee
pub fn start_cheat_max_fee(contract_address: ContractAddress, max_fee: u128)
stop_cheat_max_fee
Cancels the cheat_max_fee
/ start_cheat_max_fee
for the given contract_address.
contract_address
- instance ofContractAddress
specifying which contract to stop cheating
Fully qualified path: snforge_std::cheatcodes::execution_info::max_fee::stop_cheat_max_fee
pub fn stop_cheat_max_fee(contract_address: ContractAddress)
nonce
Fully qualified path: snforge_std::cheatcodes::execution_info::nonce
Free functions
cheat_nonce | Changes the transaction nonce for the given contract address and span.... |
start_cheat_nonce_global | Changes the transaction nonce.... |
stop_cheat_nonce_global | Cancels the start_cheat_nonce_global . |
start_cheat_nonce | Changes the transaction nonce for the given contract_address.... |
stop_cheat_nonce | Cancels the cheat_nonce / start_cheat_nonce for the given contract_address.... |
Free functions
cheat_nonce | Changes the transaction nonce for the given contract address and span.... |
start_cheat_nonce_global | Changes the transaction nonce.... |
stop_cheat_nonce_global | Cancels the start_cheat_nonce_global . |
start_cheat_nonce | Changes the transaction nonce for the given contract_address.... |
stop_cheat_nonce | Cancels the cheat_nonce / start_cheat_nonce for the given contract_address.... |
cheat_nonce
Changes the transaction nonce for the given contract address and span.
contract_address
- instance ofContractAddress
specifying which contract to cheatnonce
- transaction nonce to be setspan
- instance ofCheatSpan
specifying the number of contract calls with the cheat applied
Fully qualified path: snforge_std::cheatcodes::execution_info::nonce::cheat_nonce
pub fn cheat_nonce(contract_address: ContractAddress, nonce: felt252, span: CheatSpan)
start_cheat_nonce_global
Changes the transaction nonce.
nonce
- transaction nonce to be set
Fully qualified path: snforge_std::cheatcodes::execution_info::nonce::start_cheat_nonce_global
pub fn start_cheat_nonce_global(nonce: felt252)
stop_cheat_nonce_global
Cancels the start_cheat_nonce_global
.
Fully qualified path: snforge_std::cheatcodes::execution_info::nonce::stop_cheat_nonce_global
pub fn stop_cheat_nonce_global()
start_cheat_nonce
Changes the transaction nonce for the given contract_address.
contract_address
- instance ofContractAddress
specifying which contract to cheatnonce
- transaction nonce to be set
Fully qualified path: snforge_std::cheatcodes::execution_info::nonce::start_cheat_nonce
pub fn start_cheat_nonce(contract_address: ContractAddress, nonce: felt252)
stop_cheat_nonce
Cancels the cheat_nonce
/ start_cheat_nonce
for the given contract_address.
contract_address
- instance ofContractAddress
specifying which contract to stop cheating
Fully qualified path: snforge_std::cheatcodes::execution_info::nonce::stop_cheat_nonce
pub fn stop_cheat_nonce(contract_address: ContractAddress)
nonce_data_availability_mode
Fully qualified path: snforge_std::cheatcodes::execution_info::nonce_data_availability_mode
Free functions
cheat_nonce_data_availability_mode | Changes the transaction nonce data availability mode for the given contract address and span.... |
start_cheat_nonce_data_availability_mode_global | Changes the transaction nonce data availability mode.... |
stop_cheat_nonce_data_availability_mode_global | Cancels the start_cheat_nonce_data_availability_mode_global . |
start_cheat_nonce_data_availability_mode | Changes the transaction nonce data availability mode for the given contract_address.... |
stop_cheat_nonce_data_availability_mode | Cancels the cheat_nonce_data_availability_mode / start_cheat_nonce_data_availability_mode for the given contract_address.... |
Free functions
cheat_nonce_data_availability_mode | Changes the transaction nonce data availability mode for the given contract address and span.... |
start_cheat_nonce_data_availability_mode_global | Changes the transaction nonce data availability mode.... |
stop_cheat_nonce_data_availability_mode_global | Cancels the start_cheat_nonce_data_availability_mode_global . |
start_cheat_nonce_data_availability_mode | Changes the transaction nonce data availability mode for the given contract_address.... |
stop_cheat_nonce_data_availability_mode | Cancels the cheat_nonce_data_availability_mode / start_cheat_nonce_data_availability_mode for the given contract_address.... |
cheat_nonce_data_availability_mode
Changes the transaction nonce data availability mode for the given contract address and span.
contract_address
- instance ofContractAddress
specifying which contracts to cheatnonce_data_availability_mode
- transaction nonce data availability mode to be setspan
- instance ofCheatSpan
specifying the number of contract calls with the cheat applied
Fully qualified path: snforge_std::cheatcodes::execution_info::nonce_data_availability_mode::cheat_nonce_data_availability_mode
pub fn cheat_nonce_data_availability_mode(
contract_address: ContractAddress, nonce_data_availability_mode: u32, span: CheatSpan,
)
start_cheat_nonce_data_availability_mode_global
Changes the transaction nonce data availability mode.
nonce_data_availability_mode
- transaction nonce data availability mode to be set
Fully qualified path: snforge_std::cheatcodes::execution_info::nonce_data_availability_mode::start_cheat_nonce_data_availability_mode_global
pub fn start_cheat_nonce_data_availability_mode_global(nonce_data_availability_mode: u32)
stop_cheat_nonce_data_availability_mode_global
Cancels the start_cheat_nonce_data_availability_mode_global
.
Fully qualified path: snforge_std::cheatcodes::execution_info::nonce_data_availability_mode::stop_cheat_nonce_data_availability_mode_global
pub fn stop_cheat_nonce_data_availability_mode_global()
start_cheat_nonce_data_availability_mode
Changes the transaction nonce data availability mode for the given contract_address.
contract_address
- instance ofContractAddress
specifying which contract to cheatnonce_data_availability_mode
- transaction nonce data availability mode to be set
Fully qualified path: snforge_std::cheatcodes::execution_info::nonce_data_availability_mode::start_cheat_nonce_data_availability_mode
pub fn start_cheat_nonce_data_availability_mode(
contract_address: ContractAddress, nonce_data_availability_mode: u32,
)
stop_cheat_nonce_data_availability_mode
Cancels the cheat_nonce_data_availability_mode
/ start_cheat_nonce_data_availability_mode
for the given contract_address.
contract_address
- instance ofContractAddress
specifying which contract to stop cheating
Fully qualified path: snforge_std::cheatcodes::execution_info::nonce_data_availability_mode::stop_cheat_nonce_data_availability_mode
pub fn stop_cheat_nonce_data_availability_mode(contract_address: ContractAddress)
paymaster_data
Fully qualified path: snforge_std::cheatcodes::execution_info::paymaster_data
Free functions
cheat_paymaster_data | Changes the transaction paymaster data for the given contract address and span.... |
start_cheat_paymaster_data_global | Changes the transaction paymaster data.... |
stop_cheat_paymaster_data_global | Cancels the start_cheat_paymaster_data_global . |
start_cheat_paymaster_data | Changes the transaction paymaster data for the given contract_address.... |
stop_cheat_paymaster_data | Cancels the cheat_paymaster_data / start_cheat_paymaster_data for the given contract_address.... |
Free functions
cheat_paymaster_data | Changes the transaction paymaster data for the given contract address and span.... |
start_cheat_paymaster_data_global | Changes the transaction paymaster data.... |
stop_cheat_paymaster_data_global | Cancels the start_cheat_paymaster_data_global . |
start_cheat_paymaster_data | Changes the transaction paymaster data for the given contract_address.... |
stop_cheat_paymaster_data | Cancels the cheat_paymaster_data / start_cheat_paymaster_data for the given contract_address.... |
cheat_paymaster_data
Changes the transaction paymaster data for the given contract address and span.
contract_address
- instance ofContractAddress
specifying which contract to cheatpaymaster_data
- transaction paymaster data to be setspan
- instance ofCheatSpan
specifying the number of contract calls with the cheat applied
Fully qualified path: snforge_std::cheatcodes::execution_info::paymaster_data::cheat_paymaster_data
pub fn cheat_paymaster_data(
contract_address: ContractAddress, paymaster_data: Span<felt252>, span: CheatSpan,
)
start_cheat_paymaster_data_global
Changes the transaction paymaster data.
paymaster_data
- transaction paymaster data to be set
Fully qualified path: snforge_std::cheatcodes::execution_info::paymaster_data::start_cheat_paymaster_data_global
pub fn start_cheat_paymaster_data_global(paymaster_data: Span<felt252>)
stop_cheat_paymaster_data_global
Cancels the start_cheat_paymaster_data_global
.
Fully qualified path: snforge_std::cheatcodes::execution_info::paymaster_data::stop_cheat_paymaster_data_global
pub fn stop_cheat_paymaster_data_global()
start_cheat_paymaster_data
Changes the transaction paymaster data for the given contract_address.
contract_address
- instance ofContractAddress
specifying which contract to cheatpaymaster_data
- transaction paymaster data to be set
Fully qualified path: snforge_std::cheatcodes::execution_info::paymaster_data::start_cheat_paymaster_data
pub fn start_cheat_paymaster_data(contract_address: ContractAddress, paymaster_data: Span<felt252>)
stop_cheat_paymaster_data
Cancels the cheat_paymaster_data
/ start_cheat_paymaster_data
for the given
contract_address.
contract_address
- instance ofContractAddress
specifying which contract to stop cheating
Fully qualified path: snforge_std::cheatcodes::execution_info::paymaster_data::stop_cheat_paymaster_data
pub fn stop_cheat_paymaster_data(contract_address: ContractAddress)
resource_bounds
Fully qualified path: snforge_std::cheatcodes::execution_info::resource_bounds
Free functions
cheat_resource_bounds | Changes the transaction resource bounds for the given contract address and span.... |
start_cheat_resource_bounds_global | Changes the transaction resource bounds.... |
stop_cheat_resource_bounds_global | Cancels the start_cheat_resource_bounds_global . |
start_cheat_resource_bounds | Changes the transaction resource bounds for the given contract_address.... |
stop_cheat_resource_bounds | Cancels the cheat_resource_bounds / start_cheat_resource_bounds for the given contract_address.... |
Free functions
cheat_resource_bounds | Changes the transaction resource bounds for the given contract address and span.... |
start_cheat_resource_bounds_global | Changes the transaction resource bounds.... |
stop_cheat_resource_bounds_global | Cancels the start_cheat_resource_bounds_global . |
start_cheat_resource_bounds | Changes the transaction resource bounds for the given contract_address.... |
stop_cheat_resource_bounds | Cancels the cheat_resource_bounds / start_cheat_resource_bounds for the given contract_address.... |
cheat_resource_bounds
Changes the transaction resource bounds for the given contract address and span.
contract_address
- instance ofContractAddress
specifying which contract to cheatresource_bounds
- transaction resource bounds to be setspan
- instance ofCheatSpan
specifying the number of contract calls with the cheat applied
Fully qualified path: snforge_std::cheatcodes::execution_info::resource_bounds::cheat_resource_bounds
pub fn cheat_resource_bounds(
contract_address: ContractAddress, resource_bounds: Span<ResourceBounds>, span: CheatSpan,
)
start_cheat_resource_bounds_global
Changes the transaction resource bounds.
resource_bounds
- transaction resource bounds to be set
Fully qualified path: snforge_std::cheatcodes::execution_info::resource_bounds::start_cheat_resource_bounds_global
pub fn start_cheat_resource_bounds_global(resource_bounds: Span<ResourceBounds>)
stop_cheat_resource_bounds_global
Cancels the start_cheat_resource_bounds_global
.
Fully qualified path: snforge_std::cheatcodes::execution_info::resource_bounds::stop_cheat_resource_bounds_global
pub fn stop_cheat_resource_bounds_global()
start_cheat_resource_bounds
Changes the transaction resource bounds for the given contract_address.
contract_address
- instance ofContractAddress
specifying which contract to cheatresource_bounds
- transaction resource bounds to be set
Fully qualified path: snforge_std::cheatcodes::execution_info::resource_bounds::start_cheat_resource_bounds
pub fn start_cheat_resource_bounds(
contract_address: ContractAddress, resource_bounds: Span<ResourceBounds>,
)
stop_cheat_resource_bounds
Cancels the cheat_resource_bounds
/ start_cheat_resource_bounds
for the given
contract_address.
contract_address
- instance ofContractAddress
specifying which contract to stop cheating
Fully qualified path: snforge_std::cheatcodes::execution_info::resource_bounds::stop_cheat_resource_bounds
pub fn stop_cheat_resource_bounds(contract_address: ContractAddress)
sequencer_address
Fully qualified path: snforge_std::cheatcodes::execution_info::sequencer_address
Free functions
cheat_sequencer_address | Changes the sequencer address for the given contract address and span.... |
start_cheat_sequencer_address_global | Changes the sequencer address.... |
stop_cheat_sequencer_address_global | Cancels the start_cheat_sequencer_address_global . |
start_cheat_sequencer_address | Changes the sequencer address for the given contract_address.... |
stop_cheat_sequencer_address | Cancels the cheat_sequencer_address / start_cheat_sequencer_address for the given contract_address.... |
Free functions
cheat_sequencer_address | Changes the sequencer address for the given contract address and span.... |
start_cheat_sequencer_address_global | Changes the sequencer address.... |
stop_cheat_sequencer_address_global | Cancels the start_cheat_sequencer_address_global . |
start_cheat_sequencer_address | Changes the sequencer address for the given contract_address.... |
stop_cheat_sequencer_address | Cancels the cheat_sequencer_address / start_cheat_sequencer_address for the given contract_address.... |
cheat_sequencer_address
Changes the sequencer address for the given contract address and span.
contract_address
- instance ofContractAddress
specifying which contract to cheatsequencer_address
- sequencer address to be setspan
- instance ofCheatSpan
specifying the number of contract calls with the cheat applied
Fully qualified path: snforge_std::cheatcodes::execution_info::sequencer_address::cheat_sequencer_address
pub fn cheat_sequencer_address(
contract_address: ContractAddress, sequencer_address: ContractAddress, span: CheatSpan,
)
start_cheat_sequencer_address_global
Changes the sequencer address.
sequencer_address
- sequencer address to be set
Fully qualified path: snforge_std::cheatcodes::execution_info::sequencer_address::start_cheat_sequencer_address_global
pub fn start_cheat_sequencer_address_global(sequencer_address: ContractAddress)
stop_cheat_sequencer_address_global
Cancels the start_cheat_sequencer_address_global
.
Fully qualified path: snforge_std::cheatcodes::execution_info::sequencer_address::stop_cheat_sequencer_address_global
pub fn stop_cheat_sequencer_address_global()
start_cheat_sequencer_address
Changes the sequencer address for the given contract_address.
contract_address
- instance ofContractAddress
specifying which contract to cheatsequencer_address
- sequencer address to be set
Fully qualified path: snforge_std::cheatcodes::execution_info::sequencer_address::start_cheat_sequencer_address
pub fn start_cheat_sequencer_address(
contract_address: ContractAddress, sequencer_address: ContractAddress,
)
stop_cheat_sequencer_address
Cancels the cheat_sequencer_address
/ start_cheat_sequencer_address
for the given
contract_address.
contract_address
- instance ofContractAddress
specifying which contract to stop cheating
Fully qualified path: snforge_std::cheatcodes::execution_info::sequencer_address::stop_cheat_sequencer_address
pub fn stop_cheat_sequencer_address(contract_address: ContractAddress)
signature
Fully qualified path: snforge_std::cheatcodes::execution_info::signature
Free functions
cheat_signature | Changes the transaction signature for the given contract address and span.... |
start_cheat_signature_global | Changes the transaction signature.... |
stop_cheat_signature_global | Cancels the start_cheat_signature_global . |
start_cheat_signature | Changes the transaction signature for the given contract_address.... |
stop_cheat_signature | Cancels the cheat_signature / start_cheat_signature for the given contract_address.... |
Free functions
cheat_signature | Changes the transaction signature for the given contract address and span.... |
start_cheat_signature_global | Changes the transaction signature.... |
stop_cheat_signature_global | Cancels the start_cheat_signature_global . |
start_cheat_signature | Changes the transaction signature for the given contract_address.... |
stop_cheat_signature | Cancels the cheat_signature / start_cheat_signature for the given contract_address.... |
cheat_signature
Changes the transaction signature for the given contract address and span.
contract_address
- instance ofContractAddress
specifying which contract to cheatsignature
- transaction signature to be setspan
- instance ofCheatSpan
specifying the number of contract calls with the cheat applied
Fully qualified path: snforge_std::cheatcodes::execution_info::signature::cheat_signature
pub fn cheat_signature(contract_address: ContractAddress, signature: Span<felt252>, span: CheatSpan)
start_cheat_signature_global
Changes the transaction signature.
signature
- transaction signature to be set
Fully qualified path: snforge_std::cheatcodes::execution_info::signature::start_cheat_signature_global
pub fn start_cheat_signature_global(signature: Span<felt252>)
stop_cheat_signature_global
Cancels the start_cheat_signature_global
.
Fully qualified path: snforge_std::cheatcodes::execution_info::signature::stop_cheat_signature_global
pub fn stop_cheat_signature_global()
start_cheat_signature
Changes the transaction signature for the given contract_address.
contract_address
- instance ofContractAddress
specifying which contract to cheatsignature
- transaction signature to be set
Fully qualified path: snforge_std::cheatcodes::execution_info::signature::start_cheat_signature
pub fn start_cheat_signature(contract_address: ContractAddress, signature: Span<felt252>)
stop_cheat_signature
Cancels the cheat_signature
/ start_cheat_signature
for the given contract_address.
contract_address
- instance ofContractAddress
specifying which contract to stop cheating
Fully qualified path: snforge_std::cheatcodes::execution_info::signature::stop_cheat_signature
pub fn stop_cheat_signature(contract_address: ContractAddress)
tip
Fully qualified path: snforge_std::cheatcodes::execution_info::tip
Free functions
cheat_tip | Changes the transaction tip for the given contract address and span.... |
start_cheat_tip_global | Changes the transaction tip.... |
stop_cheat_tip_global | Cancels the start_cheat_tip_global . |
start_cheat_tip | Changes the transaction tip for the given contract_address.... |
stop_cheat_tip | Cancels the cheat_tip / start_cheat_tip for the given contract_address.... |
Free functions
cheat_tip | Changes the transaction tip for the given contract address and span.... |
start_cheat_tip_global | Changes the transaction tip.... |
stop_cheat_tip_global | Cancels the start_cheat_tip_global . |
start_cheat_tip | Changes the transaction tip for the given contract_address.... |
stop_cheat_tip | Cancels the cheat_tip / start_cheat_tip for the given contract_address.... |
cheat_tip
Changes the transaction tip for the given contract address and span.
contract_address
- instance ofContractAddress
specifying which contract to cheattip
- transaction tip to be setspan
- instance ofCheatSpan
specifying the number of contract calls with the cheat applied
Fully qualified path: snforge_std::cheatcodes::execution_info::tip::cheat_tip
pub fn cheat_tip(contract_address: ContractAddress, tip: u128, span: CheatSpan)
start_cheat_tip_global
Changes the transaction tip.
tip
- transaction tip to be set
Fully qualified path: snforge_std::cheatcodes::execution_info::tip::start_cheat_tip_global
pub fn start_cheat_tip_global(tip: u128)
stop_cheat_tip_global
Cancels the start_cheat_tip_global
.
Fully qualified path: snforge_std::cheatcodes::execution_info::tip::stop_cheat_tip_global
pub fn stop_cheat_tip_global()
start_cheat_tip
Changes the transaction tip for the given contract_address.
contract_address
- instance ofContractAddress
specifying which contract to cheattip
- transaction tip to be set
Fully qualified path: snforge_std::cheatcodes::execution_info::tip::start_cheat_tip
pub fn start_cheat_tip(contract_address: ContractAddress, tip: u128)
stop_cheat_tip
Cancels the cheat_tip
/ start_cheat_tip
for the given contract_address.
contract_address
- instance ofContractAddress
specifying which contract to stop cheating
Fully qualified path: snforge_std::cheatcodes::execution_info::tip::stop_cheat_tip
pub fn stop_cheat_tip(contract_address: ContractAddress)
transaction_hash
Fully qualified path: snforge_std::cheatcodes::execution_info::transaction_hash
Free functions
cheat_transaction_hash | Changes the transaction hash for the given contract address and span.... |
start_cheat_transaction_hash_global | Changes the transaction hash.... |
stop_cheat_transaction_hash_global | Cancels the start_cheat_transaction_hash_global . |
start_cheat_transaction_hash | Changes the transaction hash for the given contract_address.... |
stop_cheat_transaction_hash | Cancels the cheat_transaction_hash / start_cheat_transaction_hash for the given contract_address.... |
Free functions
cheat_transaction_hash | Changes the transaction hash for the given contract address and span.... |
start_cheat_transaction_hash_global | Changes the transaction hash.... |
stop_cheat_transaction_hash_global | Cancels the start_cheat_transaction_hash_global . |
start_cheat_transaction_hash | Changes the transaction hash for the given contract_address.... |
stop_cheat_transaction_hash | Cancels the cheat_transaction_hash / start_cheat_transaction_hash for the given contract_address.... |
cheat_transaction_hash
Changes the transaction hash for the given contract address and span.
contract_address
- instance ofContractAddress
specifying which contract to cheattransaction_hash
- transaction hash to be setspan
- instance ofCheatSpan
specifying the number of contract calls with the cheat applied
Fully qualified path: snforge_std::cheatcodes::execution_info::transaction_hash::cheat_transaction_hash
pub fn cheat_transaction_hash(
contract_address: ContractAddress, transaction_hash: felt252, span: CheatSpan,
)
start_cheat_transaction_hash_global
Changes the transaction hash.
transaction_hash
- transaction hash to be set
Fully qualified path: snforge_std::cheatcodes::execution_info::transaction_hash::start_cheat_transaction_hash_global
pub fn start_cheat_transaction_hash_global(transaction_hash: felt252)
stop_cheat_transaction_hash_global
Cancels the start_cheat_transaction_hash_global
.
Fully qualified path: snforge_std::cheatcodes::execution_info::transaction_hash::stop_cheat_transaction_hash_global
pub fn stop_cheat_transaction_hash_global()
start_cheat_transaction_hash
Changes the transaction hash for the given contract_address.
contract_address
- instance ofContractAddress
specifying which contract to cheattransaction_hash
- transaction hash to be set
Fully qualified path: snforge_std::cheatcodes::execution_info::transaction_hash::start_cheat_transaction_hash
pub fn start_cheat_transaction_hash(contract_address: ContractAddress, transaction_hash: felt252)
stop_cheat_transaction_hash
Cancels the cheat_transaction_hash
/ start_cheat_transaction_hash
for the given
contract_address.
contract_address
- instance ofContractAddress
specifying which contract to stop cheating
Fully qualified path: snforge_std::cheatcodes::execution_info::transaction_hash::stop_cheat_transaction_hash
pub fn stop_cheat_transaction_hash(contract_address: ContractAddress)
version
Fully qualified path: snforge_std::cheatcodes::execution_info::version
Free functions
cheat_transaction_version | Changes the transaction version for the given contract address and span.... |
start_cheat_transaction_version_global | Changes the transaction version.... |
stop_cheat_transaction_version_global | Cancels the start_cheat_transaction_version_global . |
start_cheat_transaction_version | Changes the transaction version for the given contract_address.... |
stop_cheat_transaction_version | Cancels the cheat_transaction_version / start_cheat_transaction_version for the given contract_address.... |
Free functions
cheat_transaction_version | Changes the transaction version for the given contract address and span.... |
start_cheat_transaction_version_global | Changes the transaction version.... |
stop_cheat_transaction_version_global | Cancels the start_cheat_transaction_version_global . |
start_cheat_transaction_version | Changes the transaction version for the given contract_address.... |
stop_cheat_transaction_version | Cancels the cheat_transaction_version / start_cheat_transaction_version for the given contract_address.... |
cheat_transaction_version
Changes the transaction version for the given contract address and span.
contract_address
- instance ofContractAddress
specifying which contract to cheatversion
- transaction version to be setspan
- instance ofCheatSpan
specifying the number of contract calls with the cheat applied
Fully qualified path: snforge_std::cheatcodes::execution_info::version::cheat_transaction_version
pub fn cheat_transaction_version(
contract_address: ContractAddress, version: felt252, span: CheatSpan,
)
start_cheat_transaction_version_global
Changes the transaction version.
version
- transaction version to be set
Fully qualified path: snforge_std::cheatcodes::execution_info::version::start_cheat_transaction_version_global
pub fn start_cheat_transaction_version_global(version: felt252)
stop_cheat_transaction_version_global
Cancels the start_cheat_transaction_version_global
.
Fully qualified path: snforge_std::cheatcodes::execution_info::version::stop_cheat_transaction_version_global
pub fn stop_cheat_transaction_version_global()
start_cheat_transaction_version
Changes the transaction version for the given contract_address.
contract_address
- instance ofContractAddress
specifying which contract to cheatversion
- transaction version to be set
Fully qualified path: snforge_std::cheatcodes::execution_info::version::start_cheat_transaction_version
pub fn start_cheat_transaction_version(contract_address: ContractAddress, version: felt252)
stop_cheat_transaction_version
Cancels the cheat_transaction_version
/ start_cheat_transaction_version
for the given
contract_address.
contract_address
- instance ofContractAddress
specifying which contract to stop cheating
Fully qualified path: snforge_std::cheatcodes::execution_info::version::stop_cheat_transaction_version
pub fn stop_cheat_transaction_version(contract_address: ContractAddress)
generate_arg
Fully qualified path: snforge_std::cheatcodes::generate_arg
Free functions
Free functions
generate_arg
Fully qualified path: snforge_std::cheatcodes::generate_arg::generate_arg
pub fn generate_arg<T, +Serde<T>, +Drop<T>, +Into<T, felt252>>(min_value: T, max_value: T) -> T
generate_random_felt
Fully qualified path: snforge_std::cheatcodes::generate_random_felt
Free functions
generate_random_felt | Generates a random felt value Returns a random felt within the range of 0 and 2^252 - 1 |
Free functions
generate_random_felt | Generates a random felt value Returns a random felt within the range of 0 and 2^252 - 1 |
generate_random_felt
Generates a random felt value Returns a random felt within the range of 0 and 2^252 - 1
Fully qualified path: snforge_std::cheatcodes::generate_random_felt::generate_random_felt
pub fn generate_random_felt() -> felt252
l1_handler
Fully qualified path: snforge_std::cheatcodes::l1_handler
Structs
Traits
Structs
L1Handler
Fully qualified path: snforge_std::cheatcodes::l1_handler::L1Handler
[derive(Drop, Clone)]
pub struct L1Handler {
target: ContractAddress,
selector: felt252,
}
Traits
L1HandlerTrait
Fully qualified path: snforge_std::cheatcodes::l1_handler::L1HandlerTrait
pub trait L1HandlerTrait
Trait functions
new
Fully qualified path: snforge_std::cheatcodes::l1_handler::L1HandlerTrait::new
fn new(target: ContractAddress, selector: felt252) -> L1Handler
execute
Fully qualified path: snforge_std::cheatcodes::l1_handler::L1HandlerTrait::execute
fn execute(
self: L1Handler, from_address: felt252, payload: Span<felt252>,
) -> Result<(), Array<felt252>>
message_to_l1
Fully qualified path: snforge_std::cheatcodes::message_to_l1
Free functions
spy_messages_to_l1 | Creates MessageToL1Spy instance that spies on all messages sent to L1 |
Structs
MessageToL1 | Raw message to L1 format (as seen via the RPC-API), can be used for asserting the sent messages. |
MessageToL1Spy | A message spy structure allowing to get messages emitted only after its creation. |
MessagesToL1 | A wrapper structure on an array of messages to handle filtering smoothly. |
Traits
MessageToL1SpyTrait | — |
MessageToL1FilterTrait | — |
MessageToL1SpyAssertionsTrait | Allows to assert the expected sent messages (or lack thereof), in the scope of MessageToL1Spy structure. |
Free functions
spy_messages_to_l1 | Creates MessageToL1Spy instance that spies on all messages sent to L1 |
spy_messages_to_l1
Creates MessageToL1Spy
instance that spies on all messages sent to L1
Fully qualified path: snforge_std::cheatcodes::message_to_l1::spy_messages_to_l1
pub fn spy_messages_to_l1() -> MessageToL1Spy
Structs
MessageToL1 | Raw message to L1 format (as seen via the RPC-API), can be used for asserting the sent messages. |
MessageToL1Spy | A message spy structure allowing to get messages emitted only after its creation. |
MessagesToL1 | A wrapper structure on an array of messages to handle filtering smoothly. |
MessageToL1
Raw message to L1 format (as seen via the RPC-API), can be used for asserting the sent messages.
Fully qualified path: snforge_std::cheatcodes::message_to_l1::MessageToL1
[derive(Drop, Clone, Serde)]
pub struct MessageToL1 {
pub to_address: EthAddress,
pub payload: Array<felt252>,
}
Members
to_address
An ethereum address where the message is destined to go
Fully qualified path: snforge_std::cheatcodes::message_to_l1::MessageToL1::to_address
pub to_address: EthAddress
payload
Actual payload which will be delivered to L1 contract
Fully qualified path: snforge_std::cheatcodes::message_to_l1::MessageToL1::payload
pub payload: Array<felt252>
MessageToL1Spy
A message spy structure allowing to get messages emitted only after its creation.
Fully qualified path: snforge_std::cheatcodes::message_to_l1::MessageToL1Spy
[derive(Drop, Serde)]
pub struct MessageToL1Spy {
message_offset: u32,
}
MessagesToL1
A wrapper structure on an array of messages to handle filtering smoothly.
Fully qualified path: snforge_std::cheatcodes::message_to_l1::MessagesToL1
[derive(Drop, Serde)]
pub struct MessagesToL1 {
pub messages: Array<(ContractAddress, MessageToL1)>,
}
Members
messages
Fully qualified path: snforge_std::cheatcodes::message_to_l1::MessagesToL1::messages
pub messages: Array<(ContractAddress, MessageToL1)>
Traits
MessageToL1SpyTrait | — |
MessageToL1FilterTrait | — |
MessageToL1SpyAssertionsTrait | Allows to assert the expected sent messages (or lack thereof), in the scope of MessageToL1Spy structure. |
MessageToL1SpyTrait
Fully qualified path: snforge_std::cheatcodes::message_to_l1::MessageToL1SpyTrait
pub trait MessageToL1SpyTrait
Trait functions
get_messages
Gets all messages given MessageToL1Spy
spies for.
Fully qualified path: snforge_std::cheatcodes::message_to_l1::MessageToL1SpyTrait::get_messages
fn get_messages(ref self: MessageToL1Spy) -> MessagesToL1
MessageToL1FilterTrait
Fully qualified path: snforge_std::cheatcodes::message_to_l1::MessageToL1FilterTrait
pub trait MessageToL1FilterTrait
Trait functions
sent_by
Filter messages emitted by a sender of a given ContractAddress
Fully qualified path: snforge_std::cheatcodes::message_to_l1::MessageToL1FilterTrait::sent_by
fn sent_by(self: MessagesToL1, contract_address: ContractAddress) -> MessagesToL1
sent_to
Filter messages emitted by a receiver of a given ethereum address
Fully qualified path: snforge_std::cheatcodes::message_to_l1::MessageToL1FilterTrait::sent_to
fn sent_to(self: MessagesToL1, to_address: EthAddress) -> MessagesToL1
MessageToL1SpyAssertionsTrait
Allows to assert the expected sent messages (or lack thereof),
in the scope of MessageToL1Spy
structure.
Fully qualified path: snforge_std::cheatcodes::message_to_l1::MessageToL1SpyAssertionsTrait
pub trait MessageToL1SpyAssertionsTrait
Trait functions
assert_sent
Fully qualified path: snforge_std::cheatcodes::message_to_l1::MessageToL1SpyAssertionsTrait::assert_sent
fn assert_sent(ref self: MessageToL1Spy, messages: Array<(ContractAddress, MessageToL1)>)
assert_not_sent
Fully qualified path: snforge_std::cheatcodes::message_to_l1::MessageToL1SpyAssertionsTrait::assert_not_sent
fn assert_not_sent(ref self: MessageToL1Spy, messages: Array<(ContractAddress, MessageToL1)>)
storage
Fully qualified path: snforge_std::cheatcodes::storage
Free functions
store | Stores felts from serialized_value in target contract's storage, starting at storage_address .... |
load | Loads size felts from target contract's storage into an Array , starting at storage_address .... |
map_entry_address | — |
interact_with_state | — |
Free functions
store | Stores felts from serialized_value in target contract's storage, starting at storage_address .... |
load | Loads size felts from target contract's storage into an Array , starting at storage_address .... |
map_entry_address | — |
interact_with_state | — |
store
Stores felts from serialized_value
in target
contract's storage, starting at
storage_address
.
target
- address of the contract, which storage you want to modifystorage_address
- offset of the data in the contract's storageserialized_value
- a sequence of felts that will be inserted starting atstorage_address
Fully qualified path: snforge_std::cheatcodes::storage::store
pub fn store(target: ContractAddress, storage_address: felt252, serialized_value: Span<felt252>)
load
Loads size
felts from target
contract's storage into an Array
, starting at
storage_address
.
target
- address of the contract, which storage you want to modifystorage_address
- offset of the data in the contract's storagesize
- how many felts will be loaded into the resultArray
Fully qualified path: snforge_std::cheatcodes::storage::load
pub fn load(target: ContractAddress, storage_address: felt252, size: felt252) -> Array<felt252>
map_entry_address
Fully qualified path: snforge_std::cheatcodes::storage::map_entry_address
pub fn map_entry_address(map_selector: felt252, keys: Span<felt252>) -> felt252
interact_with_state
Fully qualified path: snforge_std::cheatcodes::storage::interact_with_state
pub fn interact_with_state<F, +Drop<F>, impl func: FnOnce<F, ()>, +Drop<func::Output>>(
contract_address: ContractAddress, f: F,
) -> Output
Free functions
test_selector | — |
test_address | — |
mock_call | Mocks 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 ... |
start_mock_call | Mocks 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_call | Cancels the mock_call / start_mock_call for the function with given name and contract address.... |
replace_bytecode | Replaces 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.... |
test_selector
Fully qualified path: snforge_std::cheatcodes::test_selector
pub fn test_selector() -> felt252
test_address
Fully qualified path: snforge_std::cheatcodes::test_address
pub fn test_address() -> ContractAddress
mock_call
Mocks 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
will return data provided in ret_data
argument.
An address with no contract can be mocked as well.
An entrypoint that is not present on the deployed contract is also possible to mock.
Note that the function is not meant for mocking internal calls - it works only for contract
entry points.
contract_address
- target contract addressfunction_selector
- hashed name of the target function (can be obtained withselector!
macro)ret_data
- data to return by the functionfunction_selector
n_times
- number of calls to mock the function for
Fully qualified path: snforge_std::cheatcodes::mock_call
pub fn mock_call<T, impl TSerde: Serde<T>, impl TDestruct: Destruct<T>>(
contract_address: ContractAddress, function_selector: felt252, ret_data: T, n_times: u32,
)
start_mock_call
Mocks 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.
contract_address
- targeted contracts' addressfunction_selector
- hashed name of the target function (can be obtained withselector!
macro)ret_data
- data to be returned by the function
Fully qualified path: snforge_std::cheatcodes::start_mock_call
pub fn start_mock_call<T, impl TSerde: Serde<T>, impl TDestruct: Destruct<T>>(
contract_address: ContractAddress, function_selector: felt252, ret_data: T,
)
stop_mock_call
Cancels the mock_call
/ start_mock_call
for the function with given name and contract
address.
contract_address
- targeted contracts' addressfunction_selector
- hashed name of the target function (can be obtained withselector!
macro)
Fully qualified path: snforge_std::cheatcodes::stop_mock_call
pub fn stop_mock_call(contract_address: ContractAddress, function_selector: felt252)
replace_bytecode
Replaces 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.
contract
- address specifying which address will be replacednew_class
- class hash, that will be used now for given address ReturnsResult::Ok
if the replacement succeeded, and aReplaceBytecodeError
with appropriate error type otherwise
Fully qualified path: snforge_std::cheatcodes::replace_bytecode
pub fn replace_bytecode(
contract: ContractAddress, new_class: ClassHash,
) -> Result<(), ReplaceBytecodeError>
Enums
CheatSpan | Enum used to specify how long the target should be cheated for. |
ReplaceBytecodeError | — |
CheatSpan
Enum used to specify how long the target should be cheated for.
Fully qualified path: snforge_std::cheatcodes::CheatSpan
pub enum CheatSpan {
Indefinite,
TargetCalls: NonZero<u32>,
}
Variants
Indefinite
Applies the cheatcode indefinitely, until the cheat is canceled manually (e.g. using
stop_cheat_block_timestamp
).
Fully qualified path: snforge_std::cheatcodes::CheatSpan::Indefinite
Indefinite
TargetCalls
Applies the cheatcode for a specified number of calls to the target, after which the cheat is canceled (or until the cheat is canceled manually).
Fully qualified path: snforge_std::cheatcodes::CheatSpan::TargetCalls
TargetCalls: NonZero<u32>
ReplaceBytecodeError
Fully qualified path: snforge_std::cheatcodes::ReplaceBytecodeError
pub enum ReplaceBytecodeError {
ContractNotDeployed,
UndeclaredClassHash,
}
Variants
ContractNotDeployed
Means that the contract does not exist, and thus bytecode cannot be replaced
Fully qualified path: snforge_std::cheatcodes::ReplaceBytecodeError::ContractNotDeployed
ContractNotDeployed
UndeclaredClassHash
Means that the given class for replacement is not declared
Fully qualified path: snforge_std::cheatcodes::ReplaceBytecodeError::UndeclaredClassHash
UndeclaredClassHash
byte_array
Fully qualified path: snforge_std::byte_array
Free functions
byte_array_as_felt_array | — |
try_deserialize_bytearray_error | This function is meant to transform a serialized output from a contract call into a ByteArray . x - Span of felt252 s returned from a contract call (panic data) Returns the parsed ByteArray ... |
Free functions
byte_array_as_felt_array | — |
try_deserialize_bytearray_error | This function is meant to transform a serialized output from a contract call into a ByteArray . x - Span of felt252 s returned from a contract call (panic data) Returns the parsed ByteArray ... |
byte_array_as_felt_array
Fully qualified path: snforge_std::byte_array::byte_array_as_felt_array
pub fn byte_array_as_felt_array(self: ByteArray) -> Array<felt252>
try_deserialize_bytearray_error
This function is meant to transform a serialized output from a contract call into a ByteArray
.
x
- Span of felt252
s returned from a contract call (panic data)
Returns the parsed ByteArray
, or an Err
if the parsing failed.
Fully qualified path: snforge_std::byte_array::try_deserialize_bytearray_error
pub fn try_deserialize_bytearray_error(x: Span<felt252>) -> Result<ByteArray, ByteArray>
env
Fully qualified path: snforge_std::env
Modules
Re-exports:
var | Reads an environment variable, without parsing it name - name of an environment variable Returns the read array of felts |
Modules
env_vars
Fully qualified path: snforge_std::env::env_vars
Free functions
var | Reads an environment variable, without parsing it name - name of an environment variable Returns the read array of felts |
Free functions
var | Reads an environment variable, without parsing it name - name of an environment variable Returns the read array of felts |
var
Reads an environment variable, without parsing it
name
- name of an environment variable
Returns the read array of felts
Fully qualified path: snforge_std::env::env_vars::var
pub fn var(name: ByteArray) -> Array<felt252>
fs
Fully qualified path: snforge_std::fs
Modules
Re-exports:
read_json | file - a File struct to read json data from Returns an array of felts read from the file, panics if read was not possible, or json was incorrect |
read_txt | file - a File struct to read text data from Returns an array of felts read from the file, panics if read was not possible |
File | — |
Modules
file_operations
Fully qualified path: snforge_std::fs::file_operations
Free functions
read_json | file - a File struct to read json data from Returns an array of felts read from the file, panics if read was not possible, or json was incorrect |
read_txt | file - a File struct to read text data from Returns an array of felts read from the file, panics if read was not possible |
Structs
File | — |
Traits
Free functions
read_json | file - a File struct to read json data from Returns an array of felts read from the file, panics if read was not possible, or json was incorrect |
read_txt | file - a File struct to read text data from Returns an array of felts read from the file, panics if read was not possible |
read_json
file
- a File
struct to read json data from
Returns an array of felts read from the file, panics if read was not possible, or json was
incorrect
Fully qualified path: snforge_std::fs::file_operations::read_json
pub fn read_json(file: File) -> Array<felt252>
read_txt
file
- a File
struct to read text data from
Returns an array of felts read from the file, panics if read was not possible
Fully qualified path: snforge_std::fs::file_operations::read_txt
pub fn read_txt(file: File) -> Array<felt252>
Structs
File | — |
File
Fully qualified path: snforge_std::fs::file_operations::File
[derive(Drop, Clone)]
pub struct File {
path: ByteArray,
}
Traits
FileParser
Fully qualified path: snforge_std::fs::file_operations::FileParser
pub trait FileParser<T, impl TSerde: Serde<T>>
Trait functions
parse_txt
Reads from the text file and tries to deserialize the result into given type with Serde
file
- File instance
Returns an instance of T
if deserialization was possible
Fully qualified path: snforge_std::fs::file_operations::FileParser::parse_txt
fn parse_txt<T, impl TSerde: Serde<T>, T, impl TSerde: Serde<T>>(file: File) -> Option<T>
parse_json
Reads from the json file and tries to deserialize the result into given type with Serde
file
- File instance
Returns an instance of T
if deserialization was possible
Fully qualified path: snforge_std::fs::file_operations::FileParser::parse_json
fn parse_json<T, impl TSerde: Serde<T>, T, impl TSerde: Serde<T>>(file: File) -> Option<T>
FileTrait
Fully qualified path: snforge_std::fs::file_operations::FileTrait
pub trait FileTrait
Trait functions
new
Creates a file struct used for reading json / text
path
- a path to file in ByteArray form, relative to the package root
Fully qualified path: snforge_std::fs::file_operations::FileTrait::new
fn new(path: ByteArray) -> File
fuzzable
Fully qualified path: snforge_std::fuzzable
Impl aliases
FuzzableU8 | — |
FuzzableU16 | — |
FuzzableU32 | — |
FuzzableU64 | — |
FuzzableU128 | — |
FuzzableI8 | — |
FuzzableI16 | — |
FuzzableI32 | — |
FuzzableI64 | — |
FuzzableI128 | — |
Traits
Impls
Re-exports:
Impl aliases
FuzzableU8 | — |
FuzzableU16 | — |
FuzzableU32 | — |
FuzzableU64 | — |
FuzzableU128 | — |
FuzzableI8 | — |
FuzzableI16 | — |
FuzzableI32 | — |
FuzzableI64 | — |
FuzzableI128 | — |
FuzzableU8
Fully qualified path: snforge_std::fuzzable::FuzzableU8
pub impl FuzzableU8 = nums::FuzzableNum<u8>;
FuzzableU16
Fully qualified path: snforge_std::fuzzable::FuzzableU16
pub impl FuzzableU16 = nums::FuzzableNum<u16>;
FuzzableU32
Fully qualified path: snforge_std::fuzzable::FuzzableU32
pub impl FuzzableU32 = nums::FuzzableNum<u32>;
FuzzableU64
Fully qualified path: snforge_std::fuzzable::FuzzableU64
pub impl FuzzableU64 = nums::FuzzableNum<u64>;
FuzzableU128
Fully qualified path: snforge_std::fuzzable::FuzzableU128
pub impl FuzzableU128 = nums::FuzzableNum<u128>;
FuzzableI8
Fully qualified path: snforge_std::fuzzable::FuzzableI8
pub impl FuzzableI8 = nums::FuzzableNum<i8>;
FuzzableI16
Fully qualified path: snforge_std::fuzzable::FuzzableI16
pub impl FuzzableI16 = nums::FuzzableNum<i16>;
FuzzableI32
Fully qualified path: snforge_std::fuzzable::FuzzableI32
pub impl FuzzableI32 = nums::FuzzableNum<i32>;
FuzzableI64
Fully qualified path: snforge_std::fuzzable::FuzzableI64
pub impl FuzzableI64 = nums::FuzzableNum<i64>;
FuzzableI128
Fully qualified path: snforge_std::fuzzable::FuzzableI128
pub impl FuzzableI128 = nums::FuzzableNum<i128>;
Traits
Fuzzable
Fully qualified path: snforge_std::fuzzable::Fuzzable
pub trait Fuzzable<T, +Debug<T>>
Trait functions
blank
Fully qualified path: snforge_std::fuzzable::Fuzzable::blank
fn blank<T, +Debug<T>, T, +Debug<T>>() -> T
generate
Fully qualified path: snforge_std::fuzzable::Fuzzable::generate
fn generate<T, +Debug<T>, T, +Debug<T>>() -> T
Impls
FuzzableU256
Fully qualified path: snforge_std::fuzzable::FuzzableU256
pub impl FuzzableU256 of Fuzzable<
u256, DebugInteger<u256, U256AppendFormattedToByteArray, U8IntoU256, U256TryIntoNonZero>,
>;
Impl functions
blank
Fully qualified path: snforge_std::fuzzable::FuzzableU256::blank
fn blank() -> u256
generate
Fully qualified path: snforge_std::fuzzable::FuzzableU256::generate
fn generate() -> u256
FuzzableByteArray1000ASCII
Fully qualified path: snforge_std::fuzzable::FuzzableByteArray1000ASCII
pub impl FuzzableByteArray1000ASCII of Fuzzable<ByteArray, DebugByteArray>;
Impl functions
blank
Fully qualified path: snforge_std::fuzzable::FuzzableByteArray1000ASCII::blank
fn blank() -> ByteArray
generate
Fully qualified path: snforge_std::fuzzable::FuzzableByteArray1000ASCII::generate
fn generate() -> ByteArray
signature
Fully qualified path: snforge_std::signature
Modules
Structs
Enums
Traits
Modules
secp256k1_curve
Fully qualified path: snforge_std::signature::secp256k1_curve
Impls
Impls
Secp256k1CurveKeyPairImpl
Fully qualified path: snforge_std::signature::secp256k1_curve::Secp256k1CurveKeyPairImpl
pub impl Secp256k1CurveKeyPairImpl of KeyPairTrait<u256, Secp256k1Point>;
Impl functions
generate
Fully qualified path: snforge_std::signature::secp256k1_curve::Secp256k1CurveKeyPairImpl::generate
fn generate() -> KeyPair<u256, Secp256k1Point>
from_secret_key
Fully qualified path: snforge_std::signature::secp256k1_curve::Secp256k1CurveKeyPairImpl::from_secret_key
fn from_secret_key(secret_key: u256) -> KeyPair<u256, Secp256k1Point>
Secp256k1CurveSignerImpl
Fully qualified path: snforge_std::signature::secp256k1_curve::Secp256k1CurveSignerImpl
pub impl Secp256k1CurveSignerImpl of SignerTrait<KeyPair<u256, Secp256k1Point>, u256, (u256, u256)>;
Impl functions
sign
Fully qualified path: snforge_std::signature::secp256k1_curve::Secp256k1CurveSignerImpl::sign
fn sign(self: KeyPair<u256, Secp256k1Point>, message_hash: u256) -> Result<(u256, u256), SignError>
Secp256k1CurveVerifierImpl
Fully qualified path: snforge_std::signature::secp256k1_curve::Secp256k1CurveVerifierImpl
pub impl Secp256k1CurveVerifierImpl of VerifierTrait<
KeyPair<u256, Secp256k1Point>, u256, (u256, u256),
>;
Impl functions
verify
Fully qualified path: snforge_std::signature::secp256k1_curve::Secp256k1CurveVerifierImpl::verify
fn verify(self: KeyPair<u256, Secp256k1Point>, message_hash: u256, signature: (u256, u256)) -> bool
secp256r1_curve
Fully qualified path: snforge_std::signature::secp256r1_curve
Impls
Impls
Secp256r1CurveKeyPairImpl
Fully qualified path: snforge_std::signature::secp256r1_curve::Secp256r1CurveKeyPairImpl
pub impl Secp256r1CurveKeyPairImpl of KeyPairTrait<u256, Secp256r1Point>;
Impl functions
generate
Fully qualified path: snforge_std::signature::secp256r1_curve::Secp256r1CurveKeyPairImpl::generate
fn generate() -> KeyPair<u256, Secp256r1Point>
from_secret_key
Fully qualified path: snforge_std::signature::secp256r1_curve::Secp256r1CurveKeyPairImpl::from_secret_key
fn from_secret_key(secret_key: u256) -> KeyPair<u256, Secp256r1Point>
Secp256r1CurveSignerImpl
Fully qualified path: snforge_std::signature::secp256r1_curve::Secp256r1CurveSignerImpl
pub impl Secp256r1CurveSignerImpl of SignerTrait<KeyPair<u256, Secp256r1Point>, u256, (u256, u256)>;
Impl functions
sign
Fully qualified path: snforge_std::signature::secp256r1_curve::Secp256r1CurveSignerImpl::sign
fn sign(self: KeyPair<u256, Secp256r1Point>, message_hash: u256) -> Result<(u256, u256), SignError>
Secp256r1CurveVerifierImpl
Fully qualified path: snforge_std::signature::secp256r1_curve::Secp256r1CurveVerifierImpl
pub impl Secp256r1CurveVerifierImpl of VerifierTrait<
KeyPair<u256, Secp256r1Point>, u256, (u256, u256),
>;
Impl functions
verify
Fully qualified path: snforge_std::signature::secp256r1_curve::Secp256r1CurveVerifierImpl::verify
fn verify(self: KeyPair<u256, Secp256r1Point>, message_hash: u256, signature: (u256, u256)) -> bool
stark_curve
Fully qualified path: snforge_std::signature::stark_curve
Impls
Impls
StarkCurveKeyPairImpl
Fully qualified path: snforge_std::signature::stark_curve::StarkCurveKeyPairImpl
pub impl StarkCurveKeyPairImpl of KeyPairTrait<felt252, felt252>;
Impl functions
generate
Fully qualified path: snforge_std::signature::stark_curve::StarkCurveKeyPairImpl::generate
fn generate() -> KeyPair<felt252, felt252>
from_secret_key
Fully qualified path: snforge_std::signature::stark_curve::StarkCurveKeyPairImpl::from_secret_key
fn from_secret_key(secret_key: felt252) -> KeyPair<felt252, felt252>
StarkCurveSignerImpl
Fully qualified path: snforge_std::signature::stark_curve::StarkCurveSignerImpl
pub impl StarkCurveSignerImpl of SignerTrait<
KeyPair<felt252, felt252>, felt252, (felt252, felt252),
>;
Impl functions
sign
Fully qualified path: snforge_std::signature::stark_curve::StarkCurveSignerImpl::sign
fn sign(
self: KeyPair<felt252, felt252>, message_hash: felt252,
) -> Result<(felt252, felt252), SignError>
StarkCurveVerifierImpl
Fully qualified path: snforge_std::signature::stark_curve::StarkCurveVerifierImpl
pub impl StarkCurveVerifierImpl of VerifierTrait<
KeyPair<felt252, felt252>, felt252, (felt252, felt252),
>;
Impl functions
verify
Fully qualified path: snforge_std::signature::stark_curve::StarkCurveVerifierImpl::verify
fn verify(
self: KeyPair<felt252, felt252>, message_hash: felt252, signature: (felt252, felt252),
) -> bool
Structs
KeyPair
Fully qualified path: snforge_std::signature::KeyPair
[derive(Copy, Drop)]
pub struct KeyPair<SK, PK> {
pub secret_key: SK,
pub public_key: PK,
}
Members
secret_key
A key that is used for signing the messages
Fully qualified path: snforge_std::signature::KeyPair::secret_key
pub secret_key: SK
public_key
A (x, y) point on the elliptic curve used for verification of the signature
Fully qualified path: snforge_std::signature::KeyPair::public_key
pub public_key: PK
Enums
SignError
Fully qualified path: snforge_std::signature::SignError
pub enum SignError {
InvalidSecretKey,
HashOutOfRange,
}
Variants
InvalidSecretKey
Fully qualified path: snforge_std::signature::SignError::InvalidSecretKey
InvalidSecretKey
HashOutOfRange
Fully qualified path: snforge_std::signature::SignError::HashOutOfRange
HashOutOfRange
Traits
KeyPairTrait
Fully qualified path: snforge_std::signature::KeyPairTrait
pub trait KeyPairTrait<SK, PK>
Trait functions
generate
Generates the private and public keys using the built-in random generator
Fully qualified path: snforge_std::signature::KeyPairTrait::generate
fn generate<SK, PK, SK, PK>() -> KeyPair<SK, PK>
from_secret_key
Derives the KeyPair (secret_key
+ public_key
) using secret_key
Fully qualified path: snforge_std::signature::KeyPairTrait::from_secret_key
fn from_secret_key<SK, PK, SK, PK>(secret_key: SK) -> KeyPair<SK, PK>
SignerTrait
Fully qualified path: snforge_std::signature::SignerTrait
pub trait SignerTrait<T, H, U>
Trait functions
sign
Signs given message hash
self
- KeyPair used for signing
message_hash
- input to sign bounded by the curve type (u256 for 256bit curves, felt252
for StarkCurve)
Returns the signature components (usually r,s tuple) or error
Fully qualified path: snforge_std::signature::SignerTrait::sign
fn sign<T, H, U, T, H, U>(self: T, message_hash: H) -> Result<U, SignError>
VerifierTrait
Fully qualified path: snforge_std::signature::VerifierTrait
pub trait VerifierTrait<T, H, U>
Trait functions
verify
self
- KeyPair used for verifying
message_hash
- input to verify bounded by the curve type (u256 for 256bit curves, felt252
for StarkCurve)
signature
- the signature components (usually r,s tuple)
Returns a boolean representing the validity of the signature
Fully qualified path: snforge_std::signature::VerifierTrait::verify
fn verify<T, H, U, T, H, U>(self: T, message_hash: H, signature: U) -> bool
trace
Fully qualified path: snforge_std::trace
Free functions
get_call_trace | Returns current call trace of the test, up to the last call made to a contract |
Structs
CallTrace | Tree-like structure which contains all of the starknet calls and sub-calls along with the results |
CallEntryPoint | A single function entry point summary |
Enums
EntryPointType | Type of the function being invoked |
CallType | Denotes type of the call |
CallResult | Result of a contract or a library call |
CallFailure | Represents a pre-processed failure of a call |
Free functions
get_call_trace | Returns current call trace of the test, up to the last call made to a contract |
get_call_trace
Returns current call trace of the test, up to the last call made to a contract
Fully qualified path: snforge_std::trace::get_call_trace
pub fn get_call_trace() -> CallTrace
Structs
CallTrace | Tree-like structure which contains all of the starknet calls and sub-calls along with the results |
CallEntryPoint | A single function entry point summary |
CallTrace
Tree-like structure which contains all of the starknet calls and sub-calls along with the results
Fully qualified path: snforge_std::trace::CallTrace
[derive(Drop, Serde, PartialEq, Clone, Debug)]
pub struct CallTrace {
pub entry_point: CallEntryPoint,
pub nested_calls: Array<CallTrace>,
pub result: CallResult,
}
Members
entry_point
Fully qualified path: snforge_std::trace::CallTrace::entry_point
pub entry_point: CallEntryPoint
nested_calls
All the calls that happened in the scope of entry_point
Fully qualified path: snforge_std::trace::CallTrace::nested_calls
pub nested_calls: Array<CallTrace>
result
Fully qualified path: snforge_std::trace::CallTrace::result
pub result: CallResult
CallEntryPoint
A single function entry point summary
Fully qualified path: snforge_std::trace::CallEntryPoint
[derive(Drop, Serde, PartialEq, Clone, Debug)]
pub struct CallEntryPoint {
pub entry_point_type: EntryPointType,
pub entry_point_selector: felt252,
pub calldata: Array<felt252>,
pub contract_address: ContractAddress,
pub caller_address: ContractAddress,
pub call_type: CallType,
}
Members
entry_point_type
Fully qualified path: snforge_std::trace::CallEntryPoint::entry_point_type
pub entry_point_type: EntryPointType
entry_point_selector
Hashed selector of the invoked function
Fully qualified path: snforge_std::trace::CallEntryPoint::entry_point_selector
pub entry_point_selector: felt252
calldata
Serialized arguments calldata
Fully qualified path: snforge_std::trace::CallEntryPoint::calldata
pub calldata: Array<felt252>
contract_address
Contract address targeted by the call
Fully qualified path: snforge_std::trace::CallEntryPoint::contract_address
pub contract_address: ContractAddress
caller_address
Address that the call originates from
Fully qualified path: snforge_std::trace::CallEntryPoint::caller_address
pub caller_address: ContractAddress
call_type
Fully qualified path: snforge_std::trace::CallEntryPoint::call_type
pub call_type: CallType
Enums
EntryPointType | Type of the function being invoked |
CallType | Denotes type of the call |
CallResult | Result of a contract or a library call |
CallFailure | Represents a pre-processed failure of a call |
EntryPointType
Type of the function being invoked
Fully qualified path: snforge_std::trace::EntryPointType
pub enum EntryPointType {
Constructor,
External,
L1Handler,
}
Variants
Constructor
Constructor of a contract
Fully qualified path: snforge_std::trace::EntryPointType::Constructor
Constructor
External
Contract interface entry point
Fully qualified path: snforge_std::trace::EntryPointType::External
External
L1Handler
An entrypoint for handling messages from L1
Fully qualified path: snforge_std::trace::EntryPointType::L1Handler
L1Handler
CallType
Denotes type of the call
Fully qualified path: snforge_std::trace::CallType
pub enum CallType {
Call,
Delegate,
}
Variants
Call
Regular call
Fully qualified path: snforge_std::trace::CallType::Call
Call
Delegate
Library call
Fully qualified path: snforge_std::trace::CallType::Delegate
Delegate
CallResult
Result of a contract or a library call
Fully qualified path: snforge_std::trace::CallResult
pub enum CallResult {
Success: Array<felt252>,
Failure: CallFailure,
}
Variants
Success
A successful call with it's result
Fully qualified path: snforge_std::trace::CallResult::Success
Success: Array<felt252>
Failure
A failed call along with it's panic data
Fully qualified path: snforge_std::trace::CallResult::Failure
Failure: CallFailure
CallFailure
Represents a pre-processed failure of a call
Fully qualified path: snforge_std::trace::CallFailure
pub enum CallFailure {
Panic: Array<felt252>,
Error: ByteArray,
}
Variants
Panic
Contains raw panic data
Fully qualified path: snforge_std::trace::CallFailure::Panic
Panic: Array<felt252>
Error
Contains panic data in parsed form, if parsing is applicable
Fully qualified path: snforge_std::trace::CallFailure::Error
Error: ByteArray