Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 17 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,7 @@ solar-sema = { version = "=0.1.3", default-features = false }
alloy-consensus = { version = "1.0.5", default-features = false }
alloy-contract = { version = "1.0.5", default-features = false }
alloy-eips = { version = "1.0.5", default-features = false }
alloy-ens = { version = "1.0.5", default-features = false }
alloy-genesis = { version = "1.0.5", default-features = false }
alloy-json-rpc = { version = "1.0.5", default-features = false }
alloy-network = { version = "1.0.5", default-features = false }
Expand Down
1 change: 1 addition & 0 deletions crates/cast/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ alloy-signer-local = { workspace = true, features = ["mnemonic", "keystore"] }
alloy-signer.workspace = true
alloy-sol-types.workspace = true
alloy-transport.workspace = true
alloy-ens = { workspace = true, features = ["provider"] }

chrono.workspace = true
eyre.workspace = true
Expand Down
2 changes: 1 addition & 1 deletion crates/cast/src/args.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ use crate::{
};
use alloy_consensus::transaction::{Recovered, SignerRecoverable};
use alloy_dyn_abi::{DynSolValue, ErrorExt, EventExt};
use alloy_ens::{namehash, ProviderEnsExt};
use alloy_primitives::{eip191_hash_message, hex, keccak256, Address, B256};
use alloy_provider::Provider;
use alloy_rpc_types::{BlockId, BlockNumberOrTag::Latest};
Expand All @@ -14,7 +15,6 @@ use eyre::Result;
use foundry_cli::{handler, utils, utils::LoadConfig};
use foundry_common::{
abi::{get_error, get_event},
ens::{namehash, ProviderEnsExt},
fmt::{format_tokens, format_tokens_raw, format_uint_exp},
fs,
selectors::{
Expand Down
2 changes: 1 addition & 1 deletion crates/cast/src/cmd/access_list.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@ use crate::{
tx::{CastTxBuilder, SenderKind},
Cast,
};
use alloy_ens::NameOrAddress;
use alloy_rpc_types::BlockId;
use clap::Parser;
use eyre::Result;
use foundry_cli::{
opts::{EthereumOpts, TransactionOpts},
utils::{self, LoadConfig},
};
use foundry_common::ens::NameOrAddress;
use std::str::FromStr;

/// CLI arguments for `cast access-list`.
Expand Down
3 changes: 2 additions & 1 deletion crates/cast/src/cmd/call.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ use crate::{
tx::{CastTxBuilder, SenderKind},
Cast,
};
use alloy_ens::NameOrAddress;
use alloy_primitives::{Address, Bytes, TxKind, U256};
use alloy_rpc_types::{
state::{StateOverride, StateOverridesBuilder},
Expand All @@ -14,7 +15,7 @@ use foundry_cli::{
opts::{EthereumOpts, TransactionOpts},
utils::{self, handle_traces, parse_ether_value, TraceResult},
};
use foundry_common::{ens::NameOrAddress, shell};
use foundry_common::shell;
use foundry_compilers::artifacts::EvmVersion;
use foundry_config::{
figment::{
Expand Down
2 changes: 1 addition & 1 deletion crates/cast/src/cmd/estimate.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
use crate::tx::{CastTxBuilder, SenderKind};
use alloy_ens::NameOrAddress;
use alloy_primitives::U256;
use alloy_provider::Provider;
use alloy_rpc_types::BlockId;
Expand All @@ -8,7 +9,6 @@ use foundry_cli::{
opts::{EthereumOpts, TransactionOpts},
utils::{self, parse_ether_value, LoadConfig},
};
use foundry_common::ens::NameOrAddress;
use std::str::FromStr;

/// CLI arguments for `cast estimate`.
Expand Down
4 changes: 2 additions & 2 deletions crates/cast/src/cmd/logs.rs
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
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::{hex::FromHex, Address, B256};
use alloy_rpc_types::{BlockId, BlockNumberOrTag, Filter, FilterBlockOption, FilterSet, Topic};
use clap::Parser;
use eyre::Result;
use foundry_cli::{opts::EthereumOpts, utils, utils::LoadConfig};
use foundry_common::ens::NameOrAddress;
use itertools::Itertools;
use std::{io, str::FromStr};

Expand Down Expand Up @@ -77,7 +77,7 @@ impl LogsArgs {
if !subscribe {
let logs = cast.filter_logs(filter).await?;
sh_println!("{logs}")?;
return Ok(())
return Ok(());
}

// FIXME: this is a hotfix for <https://github.com/foundry-rs/foundry/issues/7682>
Expand Down
2 changes: 1 addition & 1 deletion crates/cast/src/cmd/mktx.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
use crate::tx::{self, CastTxBuilder};
use alloy_ens::NameOrAddress;
use alloy_network::{eip2718::Encodable2718, EthereumWallet, TransactionBuilder};
use alloy_primitives::hex;
use alloy_signer::Signer;
Expand All @@ -8,7 +9,6 @@ use foundry_cli::{
opts::{EthereumOpts, TransactionOpts},
utils::{get_provider, LoadConfig},
};
use foundry_common::ens::NameOrAddress;
use std::{path::PathBuf, str::FromStr};

/// CLI arguments for `cast mktx`.
Expand Down
2 changes: 1 addition & 1 deletion crates/cast/src/cmd/send.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ use crate::{
tx::{self, CastTxBuilder},
Cast,
};
use alloy_ens::NameOrAddress;
use alloy_network::{AnyNetwork, EthereumWallet};
use alloy_provider::{Provider, ProviderBuilder};
use alloy_rpc_types::TransactionRequest;
Expand All @@ -14,7 +15,6 @@ use foundry_cli::{
utils,
utils::LoadConfig,
};
use foundry_common::ens::NameOrAddress;
use std::{path::PathBuf, str::FromStr};

/// CLI arguments for `cast send`.
Expand Down
2 changes: 1 addition & 1 deletion crates/cast/src/cmd/storage.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
use crate::{opts::parse_slot, Cast};
use alloy_ens::NameOrAddress;
use alloy_network::AnyNetwork;
use alloy_primitives::{Address, B256, U256};
use alloy_provider::Provider;
Expand All @@ -15,7 +16,6 @@ use foundry_cli::{
use foundry_common::{
abi::find_source,
compile::{etherscan_project, ProjectCompiler},
ens::NameOrAddress,
shell,
};
use foundry_compilers::{
Expand Down
2 changes: 1 addition & 1 deletion crates/cast/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

use alloy_consensus::TxEnvelope;
use alloy_dyn_abi::{DynSolType, DynSolValue, FunctionExt};
use alloy_ens::NameOrAddress;
use alloy_json_abi::Function;
use alloy_network::{AnyNetwork, AnyRpcTransaction};
use alloy_primitives::{
Expand All @@ -28,7 +29,6 @@ use foundry_block_explorers::Client;
use foundry_common::{
abi::{encode_function_args, get_func},
compile::etherscan_project,
ens::NameOrAddress,
fmt::*,
fs, get_pretty_tx_receipt_attr, shell, TransactionReceiptWithRevertReason,
};
Expand Down
6 changes: 2 additions & 4 deletions crates/cast/src/opts.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,13 @@ use crate::cmd::{
mktx::MakeTxArgs, rpc::RpcArgs, run::RunArgs, send::SendTxArgs, storage::StorageArgs,
txpool::TxPoolSubcommands, wallet::WalletSubcommands,
};
use alloy_ens::NameOrAddress;
use alloy_primitives::{Address, Selector, B256, U256};
use alloy_rpc_types::BlockId;
use clap::{Parser, Subcommand, ValueHint};
use eyre::Result;
use foundry_cli::opts::{EtherscanOpts, GlobalArgs, RpcOpts};
use foundry_common::{
ens::NameOrAddress,
version::{LONG_VERSION, SHORT_VERSION},
};
use foundry_common::version::{LONG_VERSION, SHORT_VERSION};
use std::{path::PathBuf, str::FromStr};

/// A Swiss Army knife for interacting with Ethereum applications from the command line.
Expand Down
5 changes: 3 additions & 2 deletions crates/cast/src/tx.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
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, AnyTypedTransaction, TransactionBuilder, TransactionBuilder4844,
Expand All @@ -18,7 +19,7 @@ use foundry_cli::{
opts::{CliAuthorizationList, TransactionOpts},
utils::{self, parse_function_args},
};
use foundry_common::{ens::NameOrAddress, fmt::format_tokens};
use foundry_common::fmt::format_tokens;
use foundry_config::{Chain, Config};
use foundry_wallets::{WalletOpts, WalletSigner};
use itertools::Itertools;
Expand Down Expand Up @@ -477,7 +478,7 @@ async fn decode_execution_revert(data: &RawValue) -> Result<Option<String>> {
write!(decoded_error, "({})", format_tokens(&error.body).format(", "))?;
}
}
return Ok(Some(decoded_error))
return Ok(Some(decoded_error));
}
Ok(None)
}
1 change: 1 addition & 0 deletions crates/cheatcodes/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ alloy-consensus = { workspace = true, features = ["k256", "kzg"] }
alloy-network.workspace = true
alloy-rlp.workspace = true
alloy-chains.workspace = true
alloy-ens.workspace = true

base64.workspace = true
dialoguer = "0.11"
Expand Down
14 changes: 7 additions & 7 deletions crates/cheatcodes/src/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

use crate::{Cheatcode, Cheatcodes, CheatcodesExecutor, CheatsCtxt, Result, Vm::*};
use alloy_dyn_abi::{DynSolType, DynSolValue};
use alloy_ens::namehash;
use alloy_primitives::{aliases::B32, map::HashMap, B64, U256};
use alloy_sol_types::SolValue;
use foundry_common::ens::namehash;
use foundry_evm_core::constants::DEFAULT_CREATE2_DEPLOYER;
use proptest::prelude::Strategy;
use rand::{seq::SliceRandom, Rng, RngCore};
Expand Down Expand Up @@ -156,12 +156,12 @@ impl Cheatcode for pauseTracingCall {
) -> Result {
let Some(tracer) = executor.tracing_inspector().and_then(|t| t.as_ref()) else {
// No tracer -> nothing to pause
return Ok(Default::default())
return Ok(Default::default());
};

// If paused earlier, ignore the call
if ccx.state.ignored_traces.last_pause_call.is_some() {
return Ok(Default::default())
return Ok(Default::default());
}

let cur_node = &tracer.traces().nodes().last().expect("no trace nodes");
Expand All @@ -179,12 +179,12 @@ impl Cheatcode for resumeTracingCall {
) -> Result {
let Some(tracer) = executor.tracing_inspector().and_then(|t| t.as_ref()) else {
// No tracer -> nothing to unpause
return Ok(Default::default())
return Ok(Default::default());
};

let Some(start) = ccx.state.ignored_traces.last_pause_call.take() else {
// Nothing to unpause
return Ok(Default::default())
return Ok(Default::default());
};

let node = &tracer.traces().nodes().last().expect("no trace nodes");
Expand Down Expand Up @@ -280,7 +280,7 @@ fn random_uint(state: &mut Cheatcodes, bits: Option<U256>, bounds: Option<(U256,
.new_tree(state.test_runner())
.unwrap()
.current()
.abi_encode())
.abi_encode());
}

if let Some((min, max)) = bounds {
Expand All @@ -293,7 +293,7 @@ fn random_uint(state: &mut Cheatcodes, bits: Option<U256>, bounds: Option<(U256,
random_number %= inclusive_modulo;
}
random_number += min;
return Ok(random_number.abi_encode())
return Ok(random_number.abi_encode());
}

// Generate random `uint256` value.
Expand Down
1 change: 1 addition & 0 deletions crates/cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ alloy-primitives.workspace = true
alloy-provider.workspace = true
alloy-rlp.workspace = true
alloy-chains.workspace = true
alloy-ens.workspace = true

cfg-if = "1.0"
clap = { version = "4", features = ["derive", "env", "unicode", "wrap_help"] }
Expand Down
8 changes: 3 additions & 5 deletions crates/cli/src/utils/abi.rs
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
use alloy_chains::Chain;
use alloy_ens::NameOrAddress;
use alloy_json_abi::Function;
use alloy_primitives::{hex, Address};
use alloy_provider::{network::AnyNetwork, Provider};
use eyre::{OptionExt, Result};
use foundry_block_explorers::EtherscanApiVersion;
use foundry_common::{
abi::{encode_function_args, get_func, get_func_etherscan},
ens::NameOrAddress,
};
use foundry_common::abi::{encode_function_args, get_func, get_func_etherscan};
use futures::future::join_all;

async fn resolve_name_args<P: Provider<AnyNetwork>>(args: &[String], provider: &P) -> Vec<String> {
Expand Down Expand Up @@ -41,7 +39,7 @@ pub async fn parse_function_args<P: Provider<AnyNetwork>>(
let args = resolve_name_args(&args, provider).await;

if let Ok(data) = hex::decode(sig) {
return Ok((data, None))
return Ok((data, None));
}

let func = if sig.contains('(') {
Expand Down
2 changes: 0 additions & 2 deletions crates/common/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ foundry-common-fmt.workspace = true
foundry-compilers.workspace = true
foundry-config.workspace = true

alloy-contract.workspace = true
alloy-dyn-abi = { workspace = true, features = ["arbitrary", "eip712"] }
alloy-eips.workspace = true
alloy-json-abi.workspace = true
Expand Down Expand Up @@ -50,7 +49,6 @@ solar-sema.workspace = true

tower.workspace = true

async-trait.workspace = true
clap = { version = "4", features = ["derive", "env", "unicode", "wrap_help"] }
comfy-table.workspace = true
dunce.workspace = true
Expand Down
Loading
Loading