repo
stringlengths
6
65
file_url
stringlengths
81
311
file_path
stringlengths
6
227
content
stringlengths
0
32.8k
language
stringclasses
1 value
license
stringclasses
7 values
commit_sha
stringlengths
40
40
retrieved_at
stringdate
2026-01-04 15:31:58
2026-01-04 20:25:31
truncated
bool
2 classes
foundry-rs/foundry
https://github.com/foundry-rs/foundry/blob/271c34d2550474a8ded7fbeedff398b920a96689/crates/cast/src/errors.rs
crates/cast/src/errors.rs
//! Errors for this crate use foundry_config::Chain; use std::fmt; /// An error thrown when resolving a function via signature failed #[derive(Clone, Debug)] pub enum FunctionSignatureError { MissingSignature, MissingEtherscan { sig: String }, UnknownChain(Chain), MissingToAddress, } impl fmt::Displa...
rust
Apache-2.0
271c34d2550474a8ded7fbeedff398b920a96689
2026-01-04T15:43:23.630446Z
false
foundry-rs/foundry
https://github.com/foundry-rs/foundry/blob/271c34d2550474a8ded7fbeedff398b920a96689/crates/cast/src/base.rs
crates/cast/src/base.rs
use alloy_primitives::{I256, Sign, U256, utils::ParseUnits}; use eyre::Result; use std::{ convert::Infallible, fmt::{Binary, Debug, Display, Formatter, LowerHex, Octal, Result as FmtResult, UpperHex}, num::IntErrorKind, str::FromStr, }; /* -------------------------------------------- Base -------------...
rust
Apache-2.0
271c34d2550474a8ded7fbeedff398b920a96689
2026-01-04T15:43:23.630446Z
false
foundry-rs/foundry
https://github.com/foundry-rs/foundry/blob/271c34d2550474a8ded7fbeedff398b920a96689/crates/cast/src/lib.rs
crates/cast/src/lib.rs
//! Cast is a Swiss Army knife for interacting with Ethereum applications from the command line. #![cfg_attr(not(test), warn(unused_crate_dependencies))] #![cfg_attr(docsrs, feature(doc_cfg))] #[macro_use] extern crate foundry_common; #[macro_use] extern crate tracing; use alloy_consensus::Header; use alloy_dyn_abi::...
rust
Apache-2.0
271c34d2550474a8ded7fbeedff398b920a96689
2026-01-04T15:43:23.630446Z
true
foundry-rs/foundry
https://github.com/foundry-rs/foundry/blob/271c34d2550474a8ded7fbeedff398b920a96689/crates/cast/src/args.rs
crates/cast/src/args.rs
use crate::{ Cast, SimpleCast, cmd::erc20::IERC20, opts::{Cast as CastArgs, CastSubcommand, ToBaseArgs}, traces::identifier::SignaturesIdentifier, tx::CastTxSender, }; use alloy_consensus::transaction::Recovered; use alloy_dyn_abi::{DynSolValue, ErrorExt, EventExt}; use alloy_eips::eip7702::SignedAu...
rust
Apache-2.0
271c34d2550474a8ded7fbeedff398b920a96689
2026-01-04T15:43:23.630446Z
true
foundry-rs/foundry
https://github.com/foundry-rs/foundry/blob/271c34d2550474a8ded7fbeedff398b920a96689/crates/cast/src/tx.rs
crates/cast/src/tx.rs
use crate::traces::identifier::SignaturesIdentifier; use alloy_consensus::{SidecarBuilder, SignableTransaction, SimpleCoder}; use alloy_dyn_abi::ErrorExt; use alloy_ens::NameOrAddress; use alloy_json_abi::Function; use alloy_network::{ AnyNetwork, TransactionBuilder, TransactionBuilder4844, TransactionBuilder7702, ...
rust
Apache-2.0
271c34d2550474a8ded7fbeedff398b920a96689
2026-01-04T15:43:23.630446Z
false
foundry-rs/foundry
https://github.com/foundry-rs/foundry/blob/271c34d2550474a8ded7fbeedff398b920a96689/crates/cast/src/debug.rs
crates/cast/src/debug.rs
use std::str::FromStr; use alloy_chains::Chain; use alloy_primitives::{Address, Bytes, map::HashMap}; use foundry_cli::utils::{TraceResult, print_traces}; use foundry_common::{ContractsByArtifact, compile::ProjectCompiler, shell}; use foundry_config::Config; use foundry_debugger::Debugger; use foundry_evm::traces::{ ...
rust
Apache-2.0
271c34d2550474a8ded7fbeedff398b920a96689
2026-01-04T15:43:23.630446Z
false
foundry-rs/foundry
https://github.com/foundry-rs/foundry/blob/271c34d2550474a8ded7fbeedff398b920a96689/crates/cast/src/opts.rs
crates/cast/src/opts.rs
use crate::cmd::{ access_list::AccessListArgs, artifact::ArtifactArgs, b2e_payload::B2EPayloadArgs, bind::BindArgs, call::CallArgs, constructor_args::ConstructorArgsArgs, create2::Create2Args, creation_code::CreationCodeArgs, da_estimate::DAEstimateArgs, erc20::Erc20Subcommand, estimate::EstimateArgs, f...
rust
Apache-2.0
271c34d2550474a8ded7fbeedff398b920a96689
2026-01-04T15:43:23.630446Z
true
foundry-rs/foundry
https://github.com/foundry-rs/foundry/blob/271c34d2550474a8ded7fbeedff398b920a96689/crates/cast/src/rlp_converter.rs
crates/cast/src/rlp_converter.rs
use alloy_primitives::{U256, hex}; use alloy_rlp::{Buf, Decodable, Encodable, Header}; use eyre::Context; use serde_json::Value; use std::fmt; /// Arbitrary nested data. /// /// - `Item::Array(vec![])` is equivalent to `[]`. /// - `Item::Array(vec![Item::Data(vec![])])` is equivalent to `[""]` or `[null]`. #[derive(Cl...
rust
Apache-2.0
271c34d2550474a8ded7fbeedff398b920a96689
2026-01-04T15:43:23.630446Z
false
foundry-rs/foundry
https://github.com/foundry-rs/foundry/blob/271c34d2550474a8ded7fbeedff398b920a96689/crates/cast/src/cmd/da_estimate.rs
crates/cast/src/cmd/da_estimate.rs
//! Estimates the data availability size of a block for opstack. use alloy_consensus::BlockHeader; use alloy_network::eip2718::Encodable2718; use alloy_provider::Provider; use alloy_rpc_types::BlockId; use clap::Parser; use foundry_cli::{ opts::RpcOpts, utils::{self, LoadConfig}, }; use foundry_primitives::Fou...
rust
Apache-2.0
271c34d2550474a8ded7fbeedff398b920a96689
2026-01-04T15:43:23.630446Z
false
foundry-rs/foundry
https://github.com/foundry-rs/foundry/blob/271c34d2550474a8ded7fbeedff398b920a96689/crates/cast/src/cmd/creation_code.rs
crates/cast/src/cmd/creation_code.rs
use super::interface::load_abi_from_file; use crate::SimpleCast; use alloy_consensus::Transaction; use alloy_primitives::{Address, Bytes}; use alloy_provider::{Provider, ext::TraceApi}; use alloy_rpc_types::trace::parity::{Action, CreateAction, CreateOutput, TraceOutput}; use clap::Parser; use eyre::{OptionExt, Result,...
rust
Apache-2.0
271c34d2550474a8ded7fbeedff398b920a96689
2026-01-04T15:43:23.630446Z
false
foundry-rs/foundry
https://github.com/foundry-rs/foundry/blob/271c34d2550474a8ded7fbeedff398b920a96689/crates/cast/src/cmd/bind.rs
crates/cast/src/cmd/bind.rs
use clap::{Parser, ValueHint}; use eyre::Result; use foundry_cli::opts::EtherscanOpts; use std::path::PathBuf; const DEFAULT_CRATE_NAME: &str = "foundry-contracts"; const DEFAULT_CRATE_VERSION: &str = "0.0.1"; /// CLI arguments for `cast bind`. #[derive(Clone, Debug, Parser)] pub struct BindArgs { /// The contrac...
rust
Apache-2.0
271c34d2550474a8ded7fbeedff398b920a96689
2026-01-04T15:43:23.630446Z
false
foundry-rs/foundry
https://github.com/foundry-rs/foundry/blob/271c34d2550474a8ded7fbeedff398b920a96689/crates/cast/src/cmd/estimate.rs
crates/cast/src/cmd/estimate.rs
use crate::tx::{CastTxBuilder, SenderKind}; use alloy_ens::NameOrAddress; use alloy_primitives::U256; use alloy_provider::Provider; use alloy_rpc_types::BlockId; use clap::Parser; use eyre::Result; use foundry_cli::{ opts::{RpcOpts, TransactionOpts}, utils::{self, LoadConfig, parse_ether_value}, }; use foundry_...
rust
Apache-2.0
271c34d2550474a8ded7fbeedff398b920a96689
2026-01-04T15:43:23.630446Z
false
foundry-rs/foundry
https://github.com/foundry-rs/foundry/blob/271c34d2550474a8ded7fbeedff398b920a96689/crates/cast/src/cmd/artifact.rs
crates/cast/src/cmd/artifact.rs
use super::{ creation_code::{fetch_creation_code_from_etherscan, parse_code_output}, interface::load_abi_from_file, }; use alloy_primitives::Address; use alloy_provider::Provider; use clap::Parser; use eyre::Result; use foundry_cli::{ opts::{EtherscanOpts, RpcOpts}, utils::{self, LoadConfig, fetch_abi_f...
rust
Apache-2.0
271c34d2550474a8ded7fbeedff398b920a96689
2026-01-04T15:43:23.630446Z
false
foundry-rs/foundry
https://github.com/foundry-rs/foundry/blob/271c34d2550474a8ded7fbeedff398b920a96689/crates/cast/src/cmd/call.rs
crates/cast/src/cmd/call.rs
use super::run::fetch_contracts_bytecode_from_trace; use crate::{ Cast, debug::handle_traces, traces::TraceKind, tx::{CastTxBuilder, SenderKind}, }; use alloy_ens::NameOrAddress; use alloy_primitives::{Address, B256, Bytes, TxKind, U256, map::HashMap}; use alloy_provider::Provider; use alloy_rpc_types::...
rust
Apache-2.0
271c34d2550474a8ded7fbeedff398b920a96689
2026-01-04T15:43:23.630446Z
false
foundry-rs/foundry
https://github.com/foundry-rs/foundry/blob/271c34d2550474a8ded7fbeedff398b920a96689/crates/cast/src/cmd/interface.rs
crates/cast/src/cmd/interface.rs
use alloy_json_abi::{ContractObject, JsonAbi}; use alloy_primitives::Address; use clap::Parser; use eyre::{Context, Result}; use forge_fmt::FormatterConfig; use foundry_cli::{ opts::EtherscanOpts, utils::{LoadConfig, fetch_abi_from_etherscan}, }; use foundry_common::{ ContractsByArtifact, compile::{Path...
rust
Apache-2.0
271c34d2550474a8ded7fbeedff398b920a96689
2026-01-04T15:43:23.630446Z
false
foundry-rs/foundry
https://github.com/foundry-rs/foundry/blob/271c34d2550474a8ded7fbeedff398b920a96689/crates/cast/src/cmd/send.rs
crates/cast/src/cmd/send.rs
use std::{path::PathBuf, str::FromStr, time::Duration}; use alloy_eips::Encodable2718; use alloy_ens::NameOrAddress; use alloy_network::{AnyNetwork, EthereumWallet, NetworkWallet}; use alloy_provider::{Provider, ProviderBuilder}; use alloy_rpc_types::TransactionRequest; use alloy_serde::WithOtherFields; use alloy_sign...
rust
Apache-2.0
271c34d2550474a8ded7fbeedff398b920a96689
2026-01-04T15:43:23.630446Z
false
foundry-rs/foundry
https://github.com/foundry-rs/foundry/blob/271c34d2550474a8ded7fbeedff398b920a96689/crates/cast/src/cmd/b2e_payload.rs
crates/cast/src/cmd/b2e_payload.rs
//! Command Line handler to convert Beacon block's execution payload to Execution format. use std::path::PathBuf; use alloy_rpc_types_beacon::payload::BeaconBlockData; use clap::{Parser, builder::ValueParser}; use eyre::{Result, eyre}; use foundry_common::{fs, sh_print}; /// CLI arguments for `cast b2e-payload`, con...
rust
Apache-2.0
271c34d2550474a8ded7fbeedff398b920a96689
2026-01-04T15:43:23.630446Z
false
foundry-rs/foundry
https://github.com/foundry-rs/foundry/blob/271c34d2550474a8ded7fbeedff398b920a96689/crates/cast/src/cmd/storage.rs
crates/cast/src/cmd/storage.rs
use crate::{Cast, opts::parse_slot}; use alloy_ens::NameOrAddress; use alloy_network::AnyNetwork; use alloy_primitives::{Address, B256, U256}; use alloy_provider::Provider; use alloy_rpc_types::BlockId; use clap::Parser; use comfy_table::{Cell, Table, modifiers::UTF8_ROUND_CORNERS, presets::ASCII_MARKDOWN}; use eyre::R...
rust
Apache-2.0
271c34d2550474a8ded7fbeedff398b920a96689
2026-01-04T15:43:23.630446Z
false
foundry-rs/foundry
https://github.com/foundry-rs/foundry/blob/271c34d2550474a8ded7fbeedff398b920a96689/crates/cast/src/cmd/access_list.rs
crates/cast/src/cmd/access_list.rs
use crate::{ Cast, tx::{CastTxBuilder, SenderKind}, }; use alloy_ens::NameOrAddress; use alloy_rpc_types::BlockId; use clap::Parser; use eyre::Result; use foundry_cli::{ opts::{RpcOpts, TransactionOpts}, utils::{self, LoadConfig}, }; use foundry_wallets::WalletOpts; use std::str::FromStr; /// CLI argum...
rust
Apache-2.0
271c34d2550474a8ded7fbeedff398b920a96689
2026-01-04T15:43:23.630446Z
false
foundry-rs/foundry
https://github.com/foundry-rs/foundry/blob/271c34d2550474a8ded7fbeedff398b920a96689/crates/cast/src/cmd/mod.rs
crates/cast/src/cmd/mod.rs
//! `cast` subcommands. //! //! All subcommands should respect the `foundry_config::Config`. //! If a subcommand accepts values that are supported by the `Config`, then the subcommand should //! implement `figment::Provider` which allows the subcommand to override the config's defaults, see //! [`foundry_config::Config...
rust
Apache-2.0
271c34d2550474a8ded7fbeedff398b920a96689
2026-01-04T15:43:23.630446Z
false
foundry-rs/foundry
https://github.com/foundry-rs/foundry/blob/271c34d2550474a8ded7fbeedff398b920a96689/crates/cast/src/cmd/run.rs
crates/cast/src/cmd/run.rs
use crate::{debug::handle_traces, utils::apply_chain_and_block_specific_env_changes}; use alloy_consensus::Transaction; use alloy_network::{AnyNetwork, TransactionResponse}; use alloy_primitives::{ Address, Bytes, U256, map::{AddressSet, HashMap}, }; use alloy_provider::Provider; use alloy_rpc_types::BlockTrans...
rust
Apache-2.0
271c34d2550474a8ded7fbeedff398b920a96689
2026-01-04T15:43:23.630446Z
false
foundry-rs/foundry
https://github.com/foundry-rs/foundry/blob/271c34d2550474a8ded7fbeedff398b920a96689/crates/cast/src/cmd/erc20.rs
crates/cast/src/cmd/erc20.rs
use std::str::FromStr; use crate::{ cmd::send::cast_send, format_uint_exp, tx::{SendTxOpts, signing_provider}, }; use alloy_eips::BlockId; use alloy_ens::NameOrAddress; use alloy_primitives::U256; use alloy_sol_types::sol; use clap::Parser; use foundry_cli::{ opts::RpcOpts, utils::{LoadConfig, get_...
rust
Apache-2.0
271c34d2550474a8ded7fbeedff398b920a96689
2026-01-04T15:43:23.630446Z
false
foundry-rs/foundry
https://github.com/foundry-rs/foundry/blob/271c34d2550474a8ded7fbeedff398b920a96689/crates/cast/src/cmd/find_block.rs
crates/cast/src/cmd/find_block.rs
use crate::Cast; use alloy_provider::Provider; use clap::Parser; use eyre::Result; use foundry_cli::{ opts::RpcOpts, utils::{self, LoadConfig}, }; use futures::join; /// CLI arguments for `cast find-block`. #[derive(Clone, Debug, Parser)] pub struct FindBlockArgs { /// The UNIX timestamp to search for, in ...
rust
Apache-2.0
271c34d2550474a8ded7fbeedff398b920a96689
2026-01-04T15:43:23.630446Z
false
foundry-rs/foundry
https://github.com/foundry-rs/foundry/blob/271c34d2550474a8ded7fbeedff398b920a96689/crates/cast/src/cmd/create2.rs
crates/cast/src/cmd/create2.rs
use alloy_primitives::{Address, B256, U256, hex, keccak256}; use clap::Parser; use eyre::{Result, WrapErr}; use rand::{RngCore, SeedableRng, rngs::StdRng}; use regex::RegexSetBuilder; use std::{ sync::{ Arc, atomic::{AtomicBool, Ordering}, }, time::Instant, }; // https://etherscan.io/addres...
rust
Apache-2.0
271c34d2550474a8ded7fbeedff398b920a96689
2026-01-04T15:43:23.630446Z
false
foundry-rs/foundry
https://github.com/foundry-rs/foundry/blob/271c34d2550474a8ded7fbeedff398b920a96689/crates/cast/src/cmd/rpc.rs
crates/cast/src/cmd/rpc.rs
use crate::Cast; use clap::Parser; use eyre::Result; use foundry_cli::{opts::RpcOpts, utils, utils::LoadConfig}; use foundry_common::shell; use itertools::Itertools; /// CLI arguments for `cast rpc`. #[derive(Clone, Debug, Parser)] pub struct RpcArgs { /// RPC method name method: String, /// RPC parameter...
rust
Apache-2.0
271c34d2550474a8ded7fbeedff398b920a96689
2026-01-04T15:43:23.630446Z
false
foundry-rs/foundry
https://github.com/foundry-rs/foundry/blob/271c34d2550474a8ded7fbeedff398b920a96689/crates/cast/src/cmd/constructor_args.rs
crates/cast/src/cmd/constructor_args.rs
use super::{creation_code::fetch_creation_code_from_etherscan, interface::load_abi_from_file}; use alloy_dyn_abi::DynSolType; use alloy_primitives::{Address, Bytes}; use alloy_provider::Provider; use clap::Parser; use eyre::{OptionExt, Result, eyre}; use foundry_cli::{ opts::{EtherscanOpts, RpcOpts}, utils::{se...
rust
Apache-2.0
271c34d2550474a8ded7fbeedff398b920a96689
2026-01-04T15:43:23.630446Z
false
foundry-rs/foundry
https://github.com/foundry-rs/foundry/blob/271c34d2550474a8ded7fbeedff398b920a96689/crates/cast/src/cmd/txpool.rs
crates/cast/src/cmd/txpool.rs
use alloy_primitives::Address; use alloy_provider::ext::TxPoolApi; use clap::Parser; use foundry_cli::{ opts::RpcOpts, utils::{self, LoadConfig}, }; /// CLI arguments for `cast tx-pool`. #[derive(Debug, Parser, Clone)] pub enum TxPoolSubcommands { /// Fetches the content of the transaction pool. Conten...
rust
Apache-2.0
271c34d2550474a8ded7fbeedff398b920a96689
2026-01-04T15:43:23.630446Z
false
foundry-rs/foundry
https://github.com/foundry-rs/foundry/blob/271c34d2550474a8ded7fbeedff398b920a96689/crates/cast/src/cmd/logs.rs
crates/cast/src/cmd/logs.rs
use crate::Cast; use alloy_dyn_abi::{DynSolType, DynSolValue, Specifier}; use alloy_ens::NameOrAddress; use alloy_json_abi::Event; use alloy_network::AnyNetwork; use alloy_primitives::{Address, B256, hex::FromHex}; use alloy_rpc_types::{BlockId, BlockNumberOrTag, Filter, FilterBlockOption, FilterSet, Topic}; use clap::...
rust
Apache-2.0
271c34d2550474a8ded7fbeedff398b920a96689
2026-01-04T15:43:23.630446Z
false
foundry-rs/foundry
https://github.com/foundry-rs/foundry/blob/271c34d2550474a8ded7fbeedff398b920a96689/crates/cast/src/cmd/mktx.rs
crates/cast/src/cmd/mktx.rs
use crate::tx::{self, CastTxBuilder}; use alloy_eips::Encodable2718; use alloy_ens::NameOrAddress; use alloy_network::{EthereumWallet, NetworkWallet, TransactionBuilder}; use alloy_primitives::{Address, hex}; use alloy_provider::Provider; use alloy_signer::Signer; use clap::Parser; use eyre::Result; use foundry_cli::{ ...
rust
Apache-2.0
271c34d2550474a8ded7fbeedff398b920a96689
2026-01-04T15:43:23.630446Z
false
foundry-rs/foundry
https://github.com/foundry-rs/foundry/blob/271c34d2550474a8ded7fbeedff398b920a96689/crates/cast/src/cmd/wallet/vanity.rs
crates/cast/src/cmd/wallet/vanity.rs
use alloy_primitives::{Address, hex}; use alloy_signer::{k256::ecdsa::SigningKey, utils::secret_key_to_address}; use alloy_signer_local::PrivateKeySigner; use clap::Parser; use eyre::Result; use foundry_common::sh_println; use itertools::Either; use rayon::iter::{self, ParallelIterator}; use regex::Regex; use serde::{D...
rust
Apache-2.0
271c34d2550474a8ded7fbeedff398b920a96689
2026-01-04T15:43:23.630446Z
false
foundry-rs/foundry
https://github.com/foundry-rs/foundry/blob/271c34d2550474a8ded7fbeedff398b920a96689/crates/cast/src/cmd/wallet/list.rs
crates/cast/src/cmd/wallet/list.rs
use clap::Parser; use eyre::Result; use std::env; use foundry_common::{fs, sh_err, sh_println}; use foundry_config::Config; use foundry_wallets::wallet_multi::MultiWalletOptsBuilder; /// CLI arguments for `cast wallet list`. #[derive(Clone, Debug, Parser)] pub struct ListArgs { /// List all the accounts in the ke...
rust
Apache-2.0
271c34d2550474a8ded7fbeedff398b920a96689
2026-01-04T15:43:23.630446Z
false
foundry-rs/foundry
https://github.com/foundry-rs/foundry/blob/271c34d2550474a8ded7fbeedff398b920a96689/crates/cast/src/cmd/wallet/mod.rs
crates/cast/src/cmd/wallet/mod.rs
use alloy_chains::Chain; use alloy_dyn_abi::TypedData; use alloy_primitives::{Address, B256, Signature, U256, hex}; use alloy_provider::Provider; use alloy_rpc_types::Authorization; use alloy_signer::Signer; use alloy_signer_local::{ MnemonicBuilder, PrivateKeySigner, coins_bip39::{English, Entropy, Mnemonic}, ...
rust
Apache-2.0
271c34d2550474a8ded7fbeedff398b920a96689
2026-01-04T15:43:23.630446Z
true
foundry-rs/foundry
https://github.com/foundry-rs/foundry/blob/271c34d2550474a8ded7fbeedff398b920a96689/crates/cast/tests/cli/selectors.rs
crates/cast/tests/cli/selectors.rs
use foundry_test_utils::util::OutputExt; use std::path::Path; casttest!(error_decode_with_openchain, |prj, cmd| { prj.clear_cache(); cmd.args(["decode-error", "0x7a0e198500000000000000000000000000000000000000000000000000000000000000650000000000000000000000000000000000000000000000000000000000000064"]).assert_su...
rust
Apache-2.0
271c34d2550474a8ded7fbeedff398b920a96689
2026-01-04T15:43:23.630446Z
false
foundry-rs/foundry
https://github.com/foundry-rs/foundry/blob/271c34d2550474a8ded7fbeedff398b920a96689/crates/cast/tests/cli/erc20.rs
crates/cast/tests/cli/erc20.rs
//! Contains various tests for checking cast erc20 subcommands use alloy_primitives::U256; use anvil::NodeConfig; use foundry_test_utils::util::OutputExt; mod anvil_const { /// First Anvil account pub const PK1: &str = "0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80"; pub const ADDR1: ...
rust
Apache-2.0
271c34d2550474a8ded7fbeedff398b920a96689
2026-01-04T15:43:23.630446Z
false
foundry-rs/foundry
https://github.com/foundry-rs/foundry/blob/271c34d2550474a8ded7fbeedff398b920a96689/crates/cast/tests/cli/main.rs
crates/cast/tests/cli/main.rs
//! Contains various tests for checking cast commands use alloy_chains::NamedChain; use alloy_hardforks::EthereumHardfork; use alloy_network::{TransactionBuilder, TransactionResponse}; use alloy_primitives::{B256, Bytes, U256, address, b256, hex}; use alloy_provider::{Provider, ProviderBuilder}; use alloy_rpc_types::{...
rust
Apache-2.0
271c34d2550474a8ded7fbeedff398b920a96689
2026-01-04T15:43:23.630446Z
true
foundry-rs/foundry
https://github.com/foundry-rs/foundry/blob/271c34d2550474a8ded7fbeedff398b920a96689/crates/cast/bin/main.rs
crates/cast/bin/main.rs
//! The `cast` CLI: a Swiss Army knife for interacting with EVM smart contracts, sending //! transactions and getting chain data. use cast::args::run; #[global_allocator] static ALLOC: foundry_cli::utils::Allocator = foundry_cli::utils::new_allocator(); fn main() { if let Err(err) = run() { let _ = found...
rust
Apache-2.0
271c34d2550474a8ded7fbeedff398b920a96689
2026-01-04T15:43:23.630446Z
false
foundry-rs/foundry
https://github.com/foundry-rs/foundry/blob/271c34d2550474a8ded7fbeedff398b920a96689/crates/wallets/src/signer.rs
crates/wallets/src/signer.rs
use crate::{error::WalletSignerError, wallet_browser::signer::BrowserSigner}; use alloy_consensus::{Sealed, SignableTransaction}; use alloy_dyn_abi::TypedData; use alloy_network::{NetworkWallet, TransactionBuilder, TxSigner}; use alloy_primitives::{Address, B256, ChainId, Signature, hex}; use alloy_signer::Signer; use ...
rust
Apache-2.0
271c34d2550474a8ded7fbeedff398b920a96689
2026-01-04T15:43:23.630446Z
false
foundry-rs/foundry
https://github.com/foundry-rs/foundry/blob/271c34d2550474a8ded7fbeedff398b920a96689/crates/wallets/src/lib.rs
crates/wallets/src/lib.rs
//! # foundry-wallets //! //! Utilities for working with multiple signers. #![cfg_attr(not(test), warn(unused_crate_dependencies))] #![cfg_attr(docsrs, feature(doc_cfg))] #[macro_use] extern crate foundry_common; #[macro_use] extern crate tracing; pub mod error; pub mod opts; pub mod signer; pub mod utils; pub mod ...
rust
Apache-2.0
271c34d2550474a8ded7fbeedff398b920a96689
2026-01-04T15:43:23.630446Z
false
foundry-rs/foundry
https://github.com/foundry-rs/foundry/blob/271c34d2550474a8ded7fbeedff398b920a96689/crates/wallets/src/error.rs
crates/wallets/src/error.rs
use alloy_primitives::hex::FromHexError; use alloy_signer::k256::ecdsa; use alloy_signer_ledger::LedgerError; use alloy_signer_local::LocalSignerError; use alloy_signer_trezor::TrezorError; #[cfg(feature = "aws-kms")] use alloy_signer_aws::AwsSignerError; #[cfg(feature = "gcp-kms")] use alloy_signer_gcp::GcpSignerErr...
rust
Apache-2.0
271c34d2550474a8ded7fbeedff398b920a96689
2026-01-04T15:43:23.630446Z
false
foundry-rs/foundry
https://github.com/foundry-rs/foundry/blob/271c34d2550474a8ded7fbeedff398b920a96689/crates/wallets/src/utils.rs
crates/wallets/src/utils.rs
use crate::{PendingSigner, WalletSigner, error::PrivateKeyError}; use alloy_primitives::{B256, hex::FromHex}; use alloy_signer_ledger::HDPath as LedgerHDPath; use alloy_signer_local::PrivateKeySigner; use alloy_signer_trezor::HDPath as TrezorHDPath; use eyre::{Context, Result}; use foundry_config::Config; use std::{ ...
rust
Apache-2.0
271c34d2550474a8ded7fbeedff398b920a96689
2026-01-04T15:43:23.630446Z
false
foundry-rs/foundry
https://github.com/foundry-rs/foundry/blob/271c34d2550474a8ded7fbeedff398b920a96689/crates/wallets/src/opts.rs
crates/wallets/src/opts.rs
use crate::{signer::WalletSigner, utils, wallet_raw::RawWalletOpts}; use alloy_primitives::Address; use clap::Parser; use eyre::Result; use serde::Serialize; /// The wallet options can either be: /// 1. Raw (via private key / mnemonic file, see `RawWallet`) /// 2. Keystore (via file path) /// 3. Ledger /// 4. Trezor /...
rust
Apache-2.0
271c34d2550474a8ded7fbeedff398b920a96689
2026-01-04T15:43:23.630446Z
false
foundry-rs/foundry
https://github.com/foundry-rs/foundry/blob/271c34d2550474a8ded7fbeedff398b920a96689/crates/wallets/src/wallet_browser/signer.rs
crates/wallets/src/wallet_browser/signer.rs
use std::{ sync::Arc, time::{Duration, Instant}, }; use alloy_consensus::SignableTransaction; use alloy_dyn_abi::TypedData; use alloy_network::TxSigner; use alloy_primitives::{Address, B256, ChainId, hex}; use alloy_rpc_types::TransactionRequest; use alloy_signer::{Result, Signature, Signer, SignerSync}; use a...
rust
Apache-2.0
271c34d2550474a8ded7fbeedff398b920a96689
2026-01-04T15:43:23.630446Z
false
foundry-rs/foundry
https://github.com/foundry-rs/foundry/blob/271c34d2550474a8ded7fbeedff398b920a96689/crates/wallets/src/wallet_browser/router.rs
crates/wallets/src/wallet_browser/router.rs
use std::sync::Arc; use axum::{ Router, extract::{Request, State}, http::{HeaderValue, Method, StatusCode, header}, middleware::{self, Next}, response::Response, routing::{get, post}, }; use tower::ServiceBuilder; use tower_http::{cors::CorsLayer, set_header::SetResponseHeaderLayer}; use crate...
rust
Apache-2.0
271c34d2550474a8ded7fbeedff398b920a96689
2026-01-04T15:43:23.630446Z
false
foundry-rs/foundry
https://github.com/foundry-rs/foundry/blob/271c34d2550474a8ded7fbeedff398b920a96689/crates/wallets/src/wallet_browser/handlers.rs
crates/wallets/src/wallet_browser/handlers.rs
use std::sync::Arc; use axum::{ Json, extract::State, http::{ HeaderMap, HeaderValue, header::{CACHE_CONTROL, CONTENT_TYPE, EXPIRES, PRAGMA}, }, response::Html, }; use crate::wallet_browser::{ app::contents, state::BrowserWalletState, types::{ BrowserApiResponse...
rust
Apache-2.0
271c34d2550474a8ded7fbeedff398b920a96689
2026-01-04T15:43:23.630446Z
false
foundry-rs/foundry
https://github.com/foundry-rs/foundry/blob/271c34d2550474a8ded7fbeedff398b920a96689/crates/wallets/src/wallet_browser/state.rs
crates/wallets/src/wallet_browser/state.rs
use std::sync::Arc; use tokio::sync::{Mutex, RwLock}; use uuid::Uuid; use crate::wallet_browser::{ queue::RequestQueue, types::{ BrowserSignRequest, BrowserSignResponse, BrowserTransactionRequest, BrowserTransactionResponse, Connection, }, }; #[derive(Debug, Clone)] pub(crate) struct Brow...
rust
Apache-2.0
271c34d2550474a8ded7fbeedff398b920a96689
2026-01-04T15:43:23.630446Z
false
foundry-rs/foundry
https://github.com/foundry-rs/foundry/blob/271c34d2550474a8ded7fbeedff398b920a96689/crates/wallets/src/wallet_browser/error.rs
crates/wallets/src/wallet_browser/error.rs
use alloy_signer::Error as SignerError; #[derive(Debug, thiserror::Error)] pub enum BrowserWalletError { #[error("{operation} request timed out")] Timeout { operation: &'static str }, #[error("{operation} rejected: {reason}")] Rejected { operation: &'static str, reason: String }, #[error("Wallet ...
rust
Apache-2.0
271c34d2550474a8ded7fbeedff398b920a96689
2026-01-04T15:43:23.630446Z
false
foundry-rs/foundry
https://github.com/foundry-rs/foundry/blob/271c34d2550474a8ded7fbeedff398b920a96689/crates/wallets/src/wallet_browser/types.rs
crates/wallets/src/wallet_browser/types.rs
use alloy_dyn_abi::TypedData; use alloy_primitives::{Address, Bytes, ChainId, TxHash}; use alloy_rpc_types::TransactionRequest; use serde::{Deserialize, Serialize}; use uuid::Uuid; /// Response format for API endpoints. /// - `Ok(T)` serializes as: {"status":"ok","data": ...} /// - `Ok(())` serializes as: {"status":"o...
rust
Apache-2.0
271c34d2550474a8ded7fbeedff398b920a96689
2026-01-04T15:43:23.630446Z
false
foundry-rs/foundry
https://github.com/foundry-rs/foundry/blob/271c34d2550474a8ded7fbeedff398b920a96689/crates/wallets/src/wallet_browser/mod.rs
crates/wallets/src/wallet_browser/mod.rs
pub mod error; pub mod server; pub mod signer; pub mod state; mod app; mod handlers; mod queue; mod router; mod types; #[cfg(test)] mod tests { use std::time::Duration; use alloy_primitives::{Address, Bytes, TxHash, TxKind, U256, address}; use alloy_rpc_types::TransactionRequest; use axum::http::{Hea...
rust
Apache-2.0
271c34d2550474a8ded7fbeedff398b920a96689
2026-01-04T15:43:23.630446Z
true
foundry-rs/foundry
https://github.com/foundry-rs/foundry/blob/271c34d2550474a8ded7fbeedff398b920a96689/crates/wallets/src/wallet_browser/server.rs
crates/wallets/src/wallet_browser/server.rs
use std::{ net::SocketAddr, sync::Arc, time::{Duration, Instant}, }; use alloy_dyn_abi::TypedData; use alloy_primitives::{Address, Bytes, TxHash}; use tokio::{ net::TcpListener, sync::{Mutex, oneshot}, }; use uuid::Uuid; use crate::wallet_browser::{ error::BrowserWalletError, router::build...
rust
Apache-2.0
271c34d2550474a8ded7fbeedff398b920a96689
2026-01-04T15:43:23.630446Z
false
foundry-rs/foundry
https://github.com/foundry-rs/foundry/blob/271c34d2550474a8ded7fbeedff398b920a96689/crates/wallets/src/wallet_browser/queue.rs
crates/wallets/src/wallet_browser/queue.rs
use std::collections::{HashMap, VecDeque}; use uuid::Uuid; use crate::wallet_browser::types::{BrowserSignRequest, BrowserTransactionRequest}; #[derive(Debug)] pub(crate) struct RequestQueue<Req, Res> { /// Pending requests from CLI to browser requests: VecDeque<Req>, /// Responses from browser indexed by...
rust
Apache-2.0
271c34d2550474a8ded7fbeedff398b920a96689
2026-01-04T15:43:23.630446Z
false
foundry-rs/foundry
https://github.com/foundry-rs/foundry/blob/271c34d2550474a8ded7fbeedff398b920a96689/crates/wallets/src/wallet_browser/app/mod.rs
crates/wallets/src/wallet_browser/app/mod.rs
pub(crate) mod contents { pub const INDEX_HTML: &str = include_str!("assets/index.html"); pub const STYLES_CSS: &str = include_str!("assets/styles.css"); pub const MAIN_JS: &str = include_str!("assets/main.js"); pub const BANNER_PNG: &[u8] = include_bytes!("assets/banner.png"); pub const LOGO_PNG: &...
rust
Apache-2.0
271c34d2550474a8ded7fbeedff398b920a96689
2026-01-04T15:43:23.630446Z
false
foundry-rs/foundry
https://github.com/foundry-rs/foundry/blob/271c34d2550474a8ded7fbeedff398b920a96689/crates/wallets/src/wallet_multi/mod.rs
crates/wallets/src/wallet_multi/mod.rs
use crate::{ signer::{PendingSigner, WalletSigner}, utils, }; use alloy_primitives::map::AddressHashMap; use alloy_signer::Signer; use clap::Parser; use derive_builder::Builder; use eyre::Result; use foundry_config::Config; use serde::Serialize; use std::path::PathBuf; /// Container for multiple wallets. #[der...
rust
Apache-2.0
271c34d2550474a8ded7fbeedff398b920a96689
2026-01-04T15:43:23.630446Z
false
foundry-rs/foundry
https://github.com/foundry-rs/foundry/blob/271c34d2550474a8ded7fbeedff398b920a96689/crates/wallets/src/wallet_raw/mod.rs
crates/wallets/src/wallet_raw/mod.rs
use crate::{PendingSigner, WalletSigner, utils}; use clap::Parser; use eyre::Result; use serde::Serialize; /// A wrapper for the raw data options for `Wallet`, extracted to also be used standalone. /// The raw wallet options can either be: /// 1. Private Key (cleartext in CLI) /// 2. Private Key (interactively via sec...
rust
Apache-2.0
271c34d2550474a8ded7fbeedff398b920a96689
2026-01-04T15:43:23.630446Z
false
foundry-rs/foundry
https://github.com/foundry-rs/foundry/blob/271c34d2550474a8ded7fbeedff398b920a96689/crates/lint/src/lib.rs
crates/lint/src/lib.rs
#![doc = include_str!("../README.md")] #![cfg_attr(not(test), warn(unused_crate_dependencies))] #![cfg_attr(docsrs, feature(doc_cfg))] #![allow(elided_lifetimes_in_paths)] pub mod linter; pub mod sol;
rust
Apache-2.0
271c34d2550474a8ded7fbeedff398b920a96689
2026-01-04T15:43:23.630446Z
false
foundry-rs/foundry
https://github.com/foundry-rs/foundry/blob/271c34d2550474a8ded7fbeedff398b920a96689/crates/lint/src/linter/early.rs
crates/lint/src/linter/early.rs
use super::LintContext; use solar::{ ast::{self as ast, visit::Visit}, interface::data_structures::Never, }; use std::ops::ControlFlow; /// Trait for lints that operate directly on the AST. /// Its methods mirror `ast::visit::Visit`, with the addition of `LintCotext`. pub trait EarlyLintPass<'ast>: Send + Sync...
rust
Apache-2.0
271c34d2550474a8ded7fbeedff398b920a96689
2026-01-04T15:43:23.630446Z
false
foundry-rs/foundry
https://github.com/foundry-rs/foundry/blob/271c34d2550474a8ded7fbeedff398b920a96689/crates/lint/src/linter/mod.rs
crates/lint/src/linter/mod.rs
mod early; mod late; pub use early::{EarlyLintPass, EarlyLintVisitor}; pub use late::{LateLintPass, LateLintVisitor}; use foundry_common::comments::inline_config::InlineConfig; use foundry_compilers::Language; use foundry_config::{DenyLevel, lint::Severity}; use solar::{ interface::{ Session, Span, ...
rust
Apache-2.0
271c34d2550474a8ded7fbeedff398b920a96689
2026-01-04T15:43:23.630446Z
false
foundry-rs/foundry
https://github.com/foundry-rs/foundry/blob/271c34d2550474a8ded7fbeedff398b920a96689/crates/lint/src/linter/late.rs
crates/lint/src/linter/late.rs
use solar::{interface::data_structures::Never, sema::hir}; use std::ops::ControlFlow; use super::LintContext; /// Trait for lints that operate on the HIR (High-level Intermediate Representation). /// Its methods mirror `hir::visit::Visit`, with the addition of `LintCotext`. pub trait LateLintPass<'hir>: Send + Sync {...
rust
Apache-2.0
271c34d2550474a8ded7fbeedff398b920a96689
2026-01-04T15:43:23.630446Z
false
foundry-rs/foundry
https://github.com/foundry-rs/foundry/blob/271c34d2550474a8ded7fbeedff398b920a96689/crates/lint/src/sol/macros.rs
crates/lint/src/sol/macros.rs
/// Macro for defining lints and relevant metadata for the Solidity linter. /// /// # Parameters /// /// Each lint requires the following input fields: /// - `$id`: Identifier of the generated `SolLint` constant. /// - `$severity`: The `Severity` of the lint (e.g. `High`, `Med`, `Low`, `Info`, `Gas`). /// - `$str_id`: ...
rust
Apache-2.0
271c34d2550474a8ded7fbeedff398b920a96689
2026-01-04T15:43:23.630446Z
false
foundry-rs/foundry
https://github.com/foundry-rs/foundry/blob/271c34d2550474a8ded7fbeedff398b920a96689/crates/lint/src/sol/mod.rs
crates/lint/src/sol/mod.rs
use crate::linter::{ EarlyLintPass, EarlyLintVisitor, LateLintPass, LateLintVisitor, Lint, LintContext, Linter, LinterConfig, }; use foundry_common::{ comments::{ Comments, inline_config::{InlineConfig, InlineConfigItem}, }, errors::convert_solar_errors, sh_warn, }; use foundry_c...
rust
Apache-2.0
271c34d2550474a8ded7fbeedff398b920a96689
2026-01-04T15:43:23.630446Z
false
foundry-rs/foundry
https://github.com/foundry-rs/foundry/blob/271c34d2550474a8ded7fbeedff398b920a96689/crates/lint/src/sol/med/unsafe_typecast.rs
crates/lint/src/sol/med/unsafe_typecast.rs
use super::UnsafeTypecast; use crate::{ linter::{LateLintPass, LintContext, Suggestion}, sol::{Severity, SolLint}, }; use solar::{ ast::{LitKind, StrKind}, sema::hir::{self, ElementaryType, ExprKind, ItemId, Res, TypeKind}, }; declare_forge_lint!( UNSAFE_TYPECAST, Severity::Med, "unsafe-typ...
rust
Apache-2.0
271c34d2550474a8ded7fbeedff398b920a96689
2026-01-04T15:43:23.630446Z
false
foundry-rs/foundry
https://github.com/foundry-rs/foundry/blob/271c34d2550474a8ded7fbeedff398b920a96689/crates/lint/src/sol/med/div_mul.rs
crates/lint/src/sol/med/div_mul.rs
use super::DivideBeforeMultiply; use crate::{ linter::{EarlyLintPass, LintContext}, sol::{Severity, SolLint}, }; use solar::{ ast::{BinOp, BinOpKind, Expr, ExprKind}, interface::SpannedOption, }; declare_forge_lint!( DIVIDE_BEFORE_MULTIPLY, Severity::Med, "divide-before-multiply", "mult...
rust
Apache-2.0
271c34d2550474a8ded7fbeedff398b920a96689
2026-01-04T15:43:23.630446Z
false
foundry-rs/foundry
https://github.com/foundry-rs/foundry/blob/271c34d2550474a8ded7fbeedff398b920a96689/crates/lint/src/sol/med/mod.rs
crates/lint/src/sol/med/mod.rs
use crate::sol::{EarlyLintPass, LateLintPass, SolLint}; mod div_mul; use div_mul::DIVIDE_BEFORE_MULTIPLY; mod unsafe_typecast; use unsafe_typecast::UNSAFE_TYPECAST; register_lints!( (DivideBeforeMultiply, early, (DIVIDE_BEFORE_MULTIPLY)), (UnsafeTypecast, late, (UNSAFE_TYPECAST)) );
rust
Apache-2.0
271c34d2550474a8ded7fbeedff398b920a96689
2026-01-04T15:43:23.630446Z
false
foundry-rs/foundry
https://github.com/foundry-rs/foundry/blob/271c34d2550474a8ded7fbeedff398b920a96689/crates/lint/src/sol/high/incorrect_shift.rs
crates/lint/src/sol/high/incorrect_shift.rs
use super::IncorrectShift; use crate::{ linter::{EarlyLintPass, LintContext}, sol::{Severity, SolLint}, }; use solar::ast::{BinOp, BinOpKind, Expr, ExprKind}; declare_forge_lint!( INCORRECT_SHIFT, Severity::High, "incorrect-shift", "the order of args in a shift operation is incorrect" ); impl<...
rust
Apache-2.0
271c34d2550474a8ded7fbeedff398b920a96689
2026-01-04T15:43:23.630446Z
false
foundry-rs/foundry
https://github.com/foundry-rs/foundry/blob/271c34d2550474a8ded7fbeedff398b920a96689/crates/lint/src/sol/high/mod.rs
crates/lint/src/sol/high/mod.rs
use crate::sol::{EarlyLintPass, LateLintPass, SolLint}; mod incorrect_shift; mod unchecked_calls; use incorrect_shift::INCORRECT_SHIFT; use unchecked_calls::{ERC20_UNCHECKED_TRANSFER, UNCHECKED_CALL}; register_lints!( (IncorrectShift, early, (INCORRECT_SHIFT)), (UncheckedCall, early, (UNCHECKED_CALL)), (...
rust
Apache-2.0
271c34d2550474a8ded7fbeedff398b920a96689
2026-01-04T15:43:23.630446Z
false
foundry-rs/foundry
https://github.com/foundry-rs/foundry/blob/271c34d2550474a8ded7fbeedff398b920a96689/crates/lint/src/sol/high/unchecked_calls.rs
crates/lint/src/sol/high/unchecked_calls.rs
use super::{UncheckedCall, UncheckedTransferERC20}; use crate::{ linter::{EarlyLintPass, LateLintPass, LintContext}, sol::{Severity, SolLint}, }; use solar::{ ast::{Expr, ExprKind, ItemFunction, Stmt, StmtKind, visit::Visit}, interface::kw, sema::hir::{self}, }; use std::ops::ControlFlow; declare_f...
rust
Apache-2.0
271c34d2550474a8ded7fbeedff398b920a96689
2026-01-04T15:43:23.630446Z
false
foundry-rs/foundry
https://github.com/foundry-rs/foundry/blob/271c34d2550474a8ded7fbeedff398b920a96689/crates/lint/src/sol/codesize/unwrapped_modifier_logic.rs
crates/lint/src/sol/codesize/unwrapped_modifier_logic.rs
use super::UnwrappedModifierLogic; use crate::{ linter::{LateLintPass, LintContext, Suggestion}, sol::{Severity, SolLint}, }; use solar::{ ast, sema::hir::{self, Res}, }; declare_forge_lint!( UNWRAPPED_MODIFIER_LOGIC, Severity::CodeSize, "unwrapped-modifier-logic", "wrap modifier logic ...
rust
Apache-2.0
271c34d2550474a8ded7fbeedff398b920a96689
2026-01-04T15:43:23.630446Z
false
foundry-rs/foundry
https://github.com/foundry-rs/foundry/blob/271c34d2550474a8ded7fbeedff398b920a96689/crates/lint/src/sol/codesize/mod.rs
crates/lint/src/sol/codesize/mod.rs
use crate::sol::{EarlyLintPass, LateLintPass, SolLint}; mod unwrapped_modifier_logic; use unwrapped_modifier_logic::UNWRAPPED_MODIFIER_LOGIC; register_lints!((UnwrappedModifierLogic, late, (UNWRAPPED_MODIFIER_LOGIC)));
rust
Apache-2.0
271c34d2550474a8ded7fbeedff398b920a96689
2026-01-04T15:43:23.630446Z
false
foundry-rs/foundry
https://github.com/foundry-rs/foundry/blob/271c34d2550474a8ded7fbeedff398b920a96689/crates/lint/src/sol/gas/keccak.rs
crates/lint/src/sol/gas/keccak.rs
use super::AsmKeccak256; use crate::{ linter::{LateLintPass, LintContext}, sol::{Severity, SolLint}, }; use solar::{ ast::{self as ast, Span}, interface::kw, sema::hir::{self}, }; declare_forge_lint!( ASM_KECCAK256, Severity::Gas, "asm-keccak256", "use of inefficient hashing mechani...
rust
Apache-2.0
271c34d2550474a8ded7fbeedff398b920a96689
2026-01-04T15:43:23.630446Z
false
foundry-rs/foundry
https://github.com/foundry-rs/foundry/blob/271c34d2550474a8ded7fbeedff398b920a96689/crates/lint/src/sol/gas/mod.rs
crates/lint/src/sol/gas/mod.rs
use crate::sol::{EarlyLintPass, LateLintPass, SolLint}; mod keccak; use keccak::ASM_KECCAK256; register_lints!((AsmKeccak256, late, (ASM_KECCAK256)),);
rust
Apache-2.0
271c34d2550474a8ded7fbeedff398b920a96689
2026-01-04T15:43:23.630446Z
false
foundry-rs/foundry
https://github.com/foundry-rs/foundry/blob/271c34d2550474a8ded7fbeedff398b920a96689/crates/lint/src/sol/info/unsafe_cheatcodes.rs
crates/lint/src/sol/info/unsafe_cheatcodes.rs
use super::UnsafeCheatcodes; use crate::{ linter::{EarlyLintPass, LintContext}, sol::{Severity, SolLint}, }; use solar::ast::{Expr, ExprKind}; declare_forge_lint!( UNSAFE_CHEATCODE_USAGE, Severity::Info, "unsafe-cheatcode", "usage of unsafe cheatcodes that can perform dangerous operations" ); ...
rust
Apache-2.0
271c34d2550474a8ded7fbeedff398b920a96689
2026-01-04T15:43:23.630446Z
false
foundry-rs/foundry
https://github.com/foundry-rs/foundry/blob/271c34d2550474a8ded7fbeedff398b920a96689/crates/lint/src/sol/info/named_struct_fields.rs
crates/lint/src/sol/info/named_struct_fields.rs
use solar::sema::hir::{CallArgs, CallArgsKind, Expr, ExprKind, ItemId, Res}; use crate::{ linter::{LateLintPass, LintContext, Suggestion}, sol::{Severity, SolLint, info::NamedStructFields}, }; declare_forge_lint!( NAMED_STRUCT_FIELDS, Severity::Info, "named-struct-fields", "prefer initializing...
rust
Apache-2.0
271c34d2550474a8ded7fbeedff398b920a96689
2026-01-04T15:43:23.630446Z
false
foundry-rs/foundry
https://github.com/foundry-rs/foundry/blob/271c34d2550474a8ded7fbeedff398b920a96689/crates/lint/src/sol/info/imports.rs
crates/lint/src/sol/info/imports.rs
use solar::{ ast::{self as ast, SourceUnit, Span, Symbol, visit::Visit}, data_structures::map::FxIndexSet, interface::SourceMap, }; use std::ops::ControlFlow; use super::Imports; use crate::{ linter::{EarlyLintPass, LintContext}, sol::{Severity, SolLint}, }; declare_forge_lint!( UNUSED_IMPORT,...
rust
Apache-2.0
271c34d2550474a8ded7fbeedff398b920a96689
2026-01-04T15:43:23.630446Z
false
foundry-rs/foundry
https://github.com/foundry-rs/foundry/blob/271c34d2550474a8ded7fbeedff398b920a96689/crates/lint/src/sol/info/pascal_case.rs
crates/lint/src/sol/info/pascal_case.rs
use super::PascalCaseStruct; use crate::{ linter::{EarlyLintPass, LintContext, Suggestion}, sol::{Severity, SolLint}, }; use solar::ast::ItemStruct; declare_forge_lint!( PASCAL_CASE_STRUCT, Severity::Info, "pascal-case-struct", "structs should use PascalCase" ); impl<'ast> EarlyLintPass<'ast> ...
rust
Apache-2.0
271c34d2550474a8ded7fbeedff398b920a96689
2026-01-04T15:43:23.630446Z
false
foundry-rs/foundry
https://github.com/foundry-rs/foundry/blob/271c34d2550474a8ded7fbeedff398b920a96689/crates/lint/src/sol/info/mod.rs
crates/lint/src/sol/info/mod.rs
use crate::sol::{EarlyLintPass, LateLintPass, SolLint}; mod mixed_case; use mixed_case::{MIXED_CASE_FUNCTION, MIXED_CASE_VARIABLE}; mod pascal_case; use pascal_case::PASCAL_CASE_STRUCT; mod screaming_snake_case; use screaming_snake_case::{SCREAMING_SNAKE_CASE_CONSTANT, SCREAMING_SNAKE_CASE_IMMUTABLE}; mod imports; ...
rust
Apache-2.0
271c34d2550474a8ded7fbeedff398b920a96689
2026-01-04T15:43:23.630446Z
false
foundry-rs/foundry
https://github.com/foundry-rs/foundry/blob/271c34d2550474a8ded7fbeedff398b920a96689/crates/lint/src/sol/info/mixed_case.rs
crates/lint/src/sol/info/mixed_case.rs
use super::{MixedCaseFunction, MixedCaseVariable}; use crate::{ linter::{EarlyLintPass, LintContext, Suggestion}, sol::{Severity, SolLint, info::screaming_snake_case::check_screaming_snake_case}, }; use solar::ast::{FunctionHeader, ItemFunction, VariableDefinition, Visibility}; declare_forge_lint!( MIXED_C...
rust
Apache-2.0
271c34d2550474a8ded7fbeedff398b920a96689
2026-01-04T15:43:23.630446Z
false
foundry-rs/foundry
https://github.com/foundry-rs/foundry/blob/271c34d2550474a8ded7fbeedff398b920a96689/crates/lint/src/sol/info/screaming_snake_case.rs
crates/lint/src/sol/info/screaming_snake_case.rs
use super::ScreamingSnakeCase; use crate::{ linter::{EarlyLintPass, LintContext, Suggestion}, sol::{Severity, SolLint}, }; use solar::ast::{VarMut, VariableDefinition}; declare_forge_lint!( SCREAMING_SNAKE_CASE_CONSTANT, Severity::Info, "screaming-snake-case-const", "constants should use SCREAM...
rust
Apache-2.0
271c34d2550474a8ded7fbeedff398b920a96689
2026-01-04T15:43:23.630446Z
false
foundry-rs/foundry
https://github.com/foundry-rs/foundry/blob/271c34d2550474a8ded7fbeedff398b920a96689/crates/macros/src/lib.rs
crates/macros/src/lib.rs
//! # foundry-macros //! //! Internal Foundry proc-macros. #![cfg_attr(not(test), warn(unused_crate_dependencies))] #![cfg_attr(docsrs, feature(doc_cfg))] #[macro_use] extern crate proc_macro_error2; use proc_macro::TokenStream; use syn::{DeriveInput, Error, parse_macro_input}; mod cheatcodes; mod console_fmt; #[p...
rust
Apache-2.0
271c34d2550474a8ded7fbeedff398b920a96689
2026-01-04T15:43:23.630446Z
false
foundry-rs/foundry
https://github.com/foundry-rs/foundry/blob/271c34d2550474a8ded7fbeedff398b920a96689/crates/macros/src/console_fmt.rs
crates/macros/src/console_fmt.rs
use proc_macro2::{Delimiter, Group, Ident, TokenStream}; use quote::{format_ident, quote}; use syn::{ Data, DataEnum, DataStruct, DeriveInput, Fields, Member, Token, Type, punctuated::Punctuated, }; pub fn console_fmt(input: &DeriveInput) -> TokenStream { let name = &input.ident; let tokens = match &input....
rust
Apache-2.0
271c34d2550474a8ded7fbeedff398b920a96689
2026-01-04T15:43:23.630446Z
false
foundry-rs/foundry
https://github.com/foundry-rs/foundry/blob/271c34d2550474a8ded7fbeedff398b920a96689/crates/macros/src/cheatcodes.rs
crates/macros/src/cheatcodes.rs
use proc_macro2::{Ident, Span, TokenStream}; use quote::quote; use syn::{Attribute, Data, DataStruct, DeriveInput, Error, Result}; // TODO: `proc_macro_error2` only emits warnings when feature "nightly" is enabled, which we can't // practically enable. macro_rules! emit_warning { ($($t:tt)*) => { proc_macr...
rust
Apache-2.0
271c34d2550474a8ded7fbeedff398b920a96689
2026-01-04T15:43:23.630446Z
false
foundry-rs/foundry
https://github.com/foundry-rs/foundry/blob/271c34d2550474a8ded7fbeedff398b920a96689/crates/script-sequence/src/reader.rs
crates/script-sequence/src/reader.rs
use crate::{ScriptSequence, TransactionWithMetadata}; use alloy_network::AnyTransactionReceipt; use eyre::{Result, bail}; use foundry_common::fs; use revm_inspectors::tracing::types::CallKind; use std::path::{Component, Path, PathBuf}; /// This type reads broadcast files in the /// `project_root/broadcast/{contract_na...
rust
Apache-2.0
271c34d2550474a8ded7fbeedff398b920a96689
2026-01-04T15:43:23.630446Z
false
foundry-rs/foundry
https://github.com/foundry-rs/foundry/blob/271c34d2550474a8ded7fbeedff398b920a96689/crates/script-sequence/src/sequence.rs
crates/script-sequence/src/sequence.rs
use crate::transaction::TransactionWithMetadata; use alloy_network::AnyTransactionReceipt; use alloy_primitives::{TxHash, hex, map::HashMap}; use eyre::{ContextCompat, Result, WrapErr}; use foundry_common::{SELECTOR_LEN, TransactionMaybeSigned, fs, shell}; use foundry_compilers::ArtifactId; use foundry_config::Config; ...
rust
Apache-2.0
271c34d2550474a8ded7fbeedff398b920a96689
2026-01-04T15:43:23.630446Z
false
foundry-rs/foundry
https://github.com/foundry-rs/foundry/blob/271c34d2550474a8ded7fbeedff398b920a96689/crates/script-sequence/src/lib.rs
crates/script-sequence/src/lib.rs
//! Script Sequence and related types. #![cfg_attr(not(test), warn(unused_crate_dependencies))] #[macro_use] extern crate foundry_common; pub mod reader; pub mod sequence; pub mod transaction; pub use reader::*; pub use sequence::*; pub use transaction::*;
rust
Apache-2.0
271c34d2550474a8ded7fbeedff398b920a96689
2026-01-04T15:43:23.630446Z
false
foundry-rs/foundry
https://github.com/foundry-rs/foundry/blob/271c34d2550474a8ded7fbeedff398b920a96689/crates/script-sequence/src/transaction.rs
crates/script-sequence/src/transaction.rs
use alloy_primitives::{Address, B256, Bytes}; use foundry_common::TransactionMaybeSigned; use revm_inspectors::tracing::types::CallKind; use serde::{Deserialize, Serialize}; #[derive(Clone, Debug, Default, Serialize, Deserialize)] #[serde(rename_all = "camelCase")] pub struct AdditionalContract { #[serde(rename = ...
rust
Apache-2.0
271c34d2550474a8ded7fbeedff398b920a96689
2026-01-04T15:43:23.630446Z
false
foundry-rs/foundry
https://github.com/foundry-rs/foundry/blob/271c34d2550474a8ded7fbeedff398b920a96689/crates/forge/src/lockfile.rs
crates/forge/src/lockfile.rs
//! foundry.lock handler type. use alloy_primitives::map::HashMap; use eyre::{OptionExt, Result}; use foundry_cli::utils::Git; use serde::{Deserialize, Serialize}; use std::{ collections::{BTreeMap, hash_map::Entry}, path::{Path, PathBuf}, }; pub const FOUNDRY_LOCK: &str = "foundry.lock"; /// A type alias fo...
rust
Apache-2.0
271c34d2550474a8ded7fbeedff398b920a96689
2026-01-04T15:43:23.630446Z
false
foundry-rs/foundry
https://github.com/foundry-rs/foundry/blob/271c34d2550474a8ded7fbeedff398b920a96689/crates/forge/src/coverage.rs
crates/forge/src/coverage.rs
//! Coverage reports. use alloy_primitives::map::{HashMap, HashSet}; use comfy_table::{ Attribute, Cell, Color, Row, Table, modifiers::UTF8_ROUND_CORNERS, presets::ASCII_MARKDOWN, }; use evm_disassembler::disassemble_bytes; use foundry_common::{fs, shell}; use semver::Version; use std::{ collections::hash_map,...
rust
Apache-2.0
271c34d2550474a8ded7fbeedff398b920a96689
2026-01-04T15:43:23.630446Z
false
foundry-rs/foundry
https://github.com/foundry-rs/foundry/blob/271c34d2550474a8ded7fbeedff398b920a96689/crates/forge/src/lib.rs
crates/forge/src/lib.rs
//! Forge is a fast and flexible Ethereum testing framework. #![cfg_attr(not(test), warn(unused_crate_dependencies))] #![cfg_attr(docsrs, feature(doc_cfg))] #[macro_use] extern crate foundry_common; #[macro_use] extern crate tracing; // Required for optional features (aws-kms, gcp-kms, turnkey) #[cfg(any(feature = ...
rust
Apache-2.0
271c34d2550474a8ded7fbeedff398b920a96689
2026-01-04T15:43:23.630446Z
false
foundry-rs/foundry
https://github.com/foundry-rs/foundry/blob/271c34d2550474a8ded7fbeedff398b920a96689/crates/forge/src/runner.rs
crates/forge/src/runner.rs
//! The Forge test runner. use crate::{ MultiContractRunner, TestFilter, coverage::HitMaps, fuzz::{BaseCounterExample, FuzzTestResult}, multi_runner::{TestContract, TestRunnerConfig}, progress::{TestsProgress, start_fuzz_progress}, result::{SuiteResult, TestResult, TestSetup}, }; use alloy_dyn_...
rust
Apache-2.0
271c34d2550474a8ded7fbeedff398b920a96689
2026-01-04T15:43:23.630446Z
true
foundry-rs/foundry
https://github.com/foundry-rs/foundry/blob/271c34d2550474a8ded7fbeedff398b920a96689/crates/forge/src/args.rs
crates/forge/src/args.rs
use crate::{ cmd::{cache::CacheSubcommands, generate::GenerateSubcommands, watch}, opts::{Forge, ForgeSubcommand}, }; use clap::{CommandFactory, Parser}; use clap_complete::generate; use eyre::Result; use foundry_cli::utils; use foundry_common::shell; use foundry_evm::inspectors::cheatcodes::{ForgeContext, set_...
rust
Apache-2.0
271c34d2550474a8ded7fbeedff398b920a96689
2026-01-04T15:43:23.630446Z
false
foundry-rs/foundry
https://github.com/foundry-rs/foundry/blob/271c34d2550474a8ded7fbeedff398b920a96689/crates/forge/src/result.rs
crates/forge/src/result.rs
//! Test outcomes. use crate::{ MultiContractRunner, fuzz::{BaseCounterExample, FuzzedCases}, gas_report::GasReport, }; use alloy_primitives::{ Address, Log, map::{AddressHashMap, HashMap}, }; use eyre::Report; use foundry_common::{get_contract_name, get_file_name, shell}; use foundry_evm::{ co...
rust
Apache-2.0
271c34d2550474a8ded7fbeedff398b920a96689
2026-01-04T15:43:23.630446Z
false
foundry-rs/foundry
https://github.com/foundry-rs/foundry/blob/271c34d2550474a8ded7fbeedff398b920a96689/crates/forge/src/progress.rs
crates/forge/src/progress.rs
use alloy_primitives::map::HashMap; use chrono::Utc; use indicatif::{MultiProgress, ProgressBar}; use parking_lot::Mutex; use std::{sync::Arc, time::Duration}; /// State of [ProgressBar]s displayed for the given test run. /// Shows progress of all test suites matching filter. /// For each test within the test suite an...
rust
Apache-2.0
271c34d2550474a8ded7fbeedff398b920a96689
2026-01-04T15:43:23.630446Z
false
foundry-rs/foundry
https://github.com/foundry-rs/foundry/blob/271c34d2550474a8ded7fbeedff398b920a96689/crates/forge/src/multi_runner.rs
crates/forge/src/multi_runner.rs
//! Forge test runner for multiple contracts. use crate::{ ContractRunner, TestFilter, progress::TestsProgress, result::SuiteResult, runner::LIBRARY_DEPLOYER, }; use alloy_json_abi::{Function, JsonAbi}; use alloy_primitives::{Address, Bytes, U256}; use eyre::Result; use foundry_cli::opts::configure_pcx_from_co...
rust
Apache-2.0
271c34d2550474a8ded7fbeedff398b920a96689
2026-01-04T15:43:23.630446Z
false
foundry-rs/foundry
https://github.com/foundry-rs/foundry/blob/271c34d2550474a8ded7fbeedff398b920a96689/crates/forge/src/gas_report.rs
crates/forge/src/gas_report.rs
//! Gas reports. use crate::{ constants::{CHEATCODE_ADDRESS, HARDHAT_CONSOLE_ADDRESS}, traces::{CallTraceArena, CallTraceDecoder, CallTraceNode, DecodedCallData}, }; use alloy_primitives::map::HashSet; use comfy_table::{Cell, Color, Table, modifiers::UTF8_ROUND_CORNERS, presets::ASCII_MARKDOWN}; use foundry_co...
rust
Apache-2.0
271c34d2550474a8ded7fbeedff398b920a96689
2026-01-04T15:43:23.630446Z
false
foundry-rs/foundry
https://github.com/foundry-rs/foundry/blob/271c34d2550474a8ded7fbeedff398b920a96689/crates/forge/src/opts.rs
crates/forge/src/opts.rs
use crate::cmd::{ bind::BindArgs, bind_json, build::BuildArgs, cache::CacheArgs, clone::CloneArgs, compiler::CompilerArgs, config, coverage, create::CreateArgs, doc::DocArgs, eip712, flatten, fmt::FmtArgs, geiger, generate, init::InitArgs, inspect, install::InstallArgs, lint::LintArgs, remappings::Remap...
rust
Apache-2.0
271c34d2550474a8ded7fbeedff398b920a96689
2026-01-04T15:43:23.630446Z
false
foundry-rs/foundry
https://github.com/foundry-rs/foundry/blob/271c34d2550474a8ded7fbeedff398b920a96689/crates/forge/src/cmd/config.rs
crates/forge/src/cmd/config.rs
use super::build::BuildArgs; use clap::Parser; use eyre::Result; use foundry_cli::{opts::EvmArgs, utils::LoadConfig}; use foundry_common::shell; use foundry_config::fix::fix_tomls; foundry_config::impl_figment_convert!(ConfigArgs, build, evm); /// CLI arguments for `forge config`. #[derive(Clone, Debug, Parser)] pub ...
rust
Apache-2.0
271c34d2550474a8ded7fbeedff398b920a96689
2026-01-04T15:43:23.630446Z
false
foundry-rs/foundry
https://github.com/foundry-rs/foundry/blob/271c34d2550474a8ded7fbeedff398b920a96689/crates/forge/src/cmd/bind.rs
crates/forge/src/cmd/bind.rs
use alloy_primitives::map::HashSet; use clap::{Parser, ValueHint}; use eyre::Result; use forge_sol_macro_gen::{MultiSolMacroGen, SolMacroGen}; use foundry_cli::{opts::BuildOpts, utils::LoadConfig}; use foundry_common::{compile::ProjectCompiler, fs::json_files}; use foundry_config::impl_figment_convert; use regex::Regex...
rust
Apache-2.0
271c34d2550474a8ded7fbeedff398b920a96689
2026-01-04T15:43:23.630446Z
false
foundry-rs/foundry
https://github.com/foundry-rs/foundry/blob/271c34d2550474a8ded7fbeedff398b920a96689/crates/forge/src/cmd/coverage.rs
crates/forge/src/cmd/coverage.rs
use super::{install, test::TestArgs, watch::WatchArgs}; use crate::coverage::{ BytecodeReporter, ContractId, CoverageReport, CoverageReporter, CoverageSummaryReporter, DebugReporter, ItemAnchor, LcovReporter, analysis::{SourceAnalysis, SourceFiles}, anchors::find_anchors, }; use alloy_primitives::{Addre...
rust
Apache-2.0
271c34d2550474a8ded7fbeedff398b920a96689
2026-01-04T15:43:23.630446Z
false
foundry-rs/foundry
https://github.com/foundry-rs/foundry/blob/271c34d2550474a8ded7fbeedff398b920a96689/crates/forge/src/cmd/soldeer.rs
crates/forge/src/cmd/soldeer.rs
use clap::Parser; use eyre::Result; use foundry_common::shell; use soldeer_commands::{Command, Verbosity}; /// Available subcommands for Soldeer, see <https://github.com/mario-eth/soldeer/blob/main/crates/commands/src/lib.rs> /// for more information #[derive(Clone, Debug, Parser)] #[command( override_usage = "Nat...
rust
Apache-2.0
271c34d2550474a8ded7fbeedff398b920a96689
2026-01-04T15:43:23.630446Z
false
foundry-rs/foundry
https://github.com/foundry-rs/foundry/blob/271c34d2550474a8ded7fbeedff398b920a96689/crates/forge/src/cmd/update.rs
crates/forge/src/cmd/update.rs
use crate::{DepIdentifier, DepMap, Lockfile}; use alloy_primitives::map::HashMap; use clap::{Parser, ValueHint}; use eyre::{Context, Result}; use foundry_cli::{ opts::Dependency, utils::{CommandUtils, Git, LoadConfig}, }; use foundry_config::{Config, impl_figment_convert_basic}; use std::path::{Path, PathBuf}; ...
rust
Apache-2.0
271c34d2550474a8ded7fbeedff398b920a96689
2026-01-04T15:43:23.630446Z
false
foundry-rs/foundry
https://github.com/foundry-rs/foundry/blob/271c34d2550474a8ded7fbeedff398b920a96689/crates/forge/src/cmd/flatten.rs
crates/forge/src/cmd/flatten.rs
use clap::{Parser, ValueHint}; use eyre::Result; use foundry_cli::{ opts::{BuildOpts, ProjectPathOpts}, utils::LoadConfig, }; use foundry_common::{flatten, fs}; use std::path::PathBuf; /// CLI arguments for `forge flatten`. #[derive(Clone, Debug, Parser)] pub struct FlattenArgs { /// The path to the contra...
rust
Apache-2.0
271c34d2550474a8ded7fbeedff398b920a96689
2026-01-04T15:43:23.630446Z
false
foundry-rs/foundry
https://github.com/foundry-rs/foundry/blob/271c34d2550474a8ded7fbeedff398b920a96689/crates/forge/src/cmd/lint.rs
crates/forge/src/cmd/lint.rs
use clap::{Parser, ValueHint}; use eyre::{Result, eyre}; use forge_lint::{ linter::Linter, sol::{SolLint, SolLintError, SolidityLinter}, }; use foundry_cli::{ opts::{BuildOpts, configure_pcx_from_solc, get_solar_sources_from_compile_output}, utils::{FoundryPathExt, LoadConfig}, }; use foundry_common::{c...
rust
Apache-2.0
271c34d2550474a8ded7fbeedff398b920a96689
2026-01-04T15:43:23.630446Z
false