Skip to main content

Module script

Module script 

Source
Expand description

Implementations of Scripting cheatcodes.

Re-exportsยง

use crate::Cheatcode; ๐Ÿ”’
use crate::CheatcodesCore; ๐Ÿ”’
use crate::CheatsCtxt; ๐Ÿ”’
use crate::Result; ๐Ÿ”’
use crate::evm::journaled_account; ๐Ÿ”’
use alloy_consensus::SidecarBuilder; ๐Ÿ”’
use alloy_consensus::SimpleCoder; ๐Ÿ”’
use alloy_primitives::Address; ๐Ÿ”’
use alloy_primitives::B256; ๐Ÿ”’
use alloy_primitives::U256; ๐Ÿ”’
use alloy_rpc_types::Authorization; ๐Ÿ”’
use alloy_signer::SignerSync; ๐Ÿ”’
use alloy_signer_local::PrivateKeySigner; ๐Ÿ”’
use alloy_sol_types::SolValue; ๐Ÿ”’
use foundry_evm_core::evm::FoundryEvmNetwork; ๐Ÿ”’
use foundry_wallets::WalletSigner; ๐Ÿ”’
use foundry_wallets::wallet_multi::MultiWallet; ๐Ÿ”’
use parking_lot::Mutex; ๐Ÿ”’
use revm::bytecode::Bytecode; ๐Ÿ”’
use revm::context::ContextTr; ๐Ÿ”’
use revm::context::JournalTr; ๐Ÿ”’
use revm::context_interface::transaction::SignedAuthorization; ๐Ÿ”’
use revm::primitives::KECCAK_EMPTY; ๐Ÿ”’
use revm::primitives::hardfork::SpecId; ๐Ÿ”’
use std::sync::Arc; ๐Ÿ”’
use crate::Vm::*; ๐Ÿ”’

Structsยง

Broadcast
Wallets
Cloneable wrapper around WalletsInner.
WalletsInner
Contains context for wallet management.

Functionsยง

attach_delegation ๐Ÿ”’
Helper function to attach an EIP-7702 delegation.
broadcast ๐Ÿ”’
Sets up broadcasting from a script using new_origin as the sender.
broadcast_key ๐Ÿ”’
Sets up broadcasting from a script with the sender derived from private_key. Adds this private key to stateโ€™s wallets vector to later be used for signing if broadcast is successful.
next_delegation_nonce ๐Ÿ”’
Returns the next valid nonce for a delegation, considering existing active delegations.
sign_delegation ๐Ÿ”’
Helper function to sign and attach (if needed) an EIP-7702 delegation. Uses the provided nonce, otherwise retrieves and increments the nonce of the EOA.
write_delegation ๐Ÿ”’