Skip to content

Commit

Permalink
update anvil option to 'unsafe'
Browse files Browse the repository at this point in the history
  • Loading branch information
teddav committed Nov 2, 2023
1 parent c04381f commit b8c3497
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
6 changes: 4 additions & 2 deletions crates/anvil/src/cmd.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,11 @@ pub struct NodeArgs {
pub mnemonic_random: Option<usize>,

/// Generates a BIP39 mnemonic phrase from a given seed
/// CAREFUL: this is obviously NOT SAFE and should only be used for testing
/// Cannot be used with other `mnemonic` options
#[clap(long, conflicts_with_all = &["mnemonic", "mnemonic_random"])]
///
/// CAREFUL: this is NOT SAFE and should only be used for testing.
/// Never use the private keys generated in production.
#[clap(long = "mnemonic-seed-unsafe", conflicts_with_all = &["mnemonic", "mnemonic_random"])]
pub mnemonic_seed: Option<u64>,

/// Sets the derivation path of the child key to be derived.
Expand Down
7 changes: 4 additions & 3 deletions crates/cast/bin/cmd/wallet/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@ use ethers::{
coins_bip39::{English, Mnemonic},
LocalWallet, MnemonicBuilder, Signer,
},
types::{transaction::eip712::TypedData, Address, Signature},
types::{transaction::eip712::TypedData, Signature},
};
use ethers_core::utils::to_checksum;
use eyre::{Context, Result};
use foundry_cli::opts::{RawWallet, Wallet};
use foundry_common::fs;
Expand Down Expand Up @@ -181,12 +182,12 @@ impl WalletSubcommands {
})
.collect::<Vec<_>>();

println!("Successfully generated a new mnemonic.");
println!("{}", Paint::green("Successfully generated a new mnemonic."));
println!("Phrase:\n{phrase}");
println!("\nAccounts:");
for (i, wallet) in wallets.iter().enumerate() {
println!("- Account {i}:");
println!("Address: {}", SimpleCast::to_checksum_address(&wallet.address()));
println!("Address: {}", to_checksum(&wallet.address(), None));
println!("Private key: 0x{}\n", hex::encode(wallet.signer().to_bytes()));
}
}
Expand Down

0 comments on commit b8c3497

Please sign in to comment.