Skip to content

Commit

Permalink
Merge pull request #74 from 0xNezha/main
Browse files Browse the repository at this point in the history
add comment: risk warning and how to set up signer from private key
  • Loading branch information
Evalir authored May 5, 2024
2 parents 5193494 + 80d5550 commit 274269d
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions examples/wallets/examples/private_key_signer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ async fn main() -> Result<()> {

// Set up signer from the first default Anvil account (Alice).
let signer: LocalWallet = anvil.keys()[0].clone().into();
// [RISK WARNING! Writing a private key in the code file is insecure behavior.]
// The following code is for testing only. Set up signer from private key, be aware of danger.
// let signer: LocalWallet = "<THE_PRIVATE_KEY>".parse().unwrap();
let alice = signer.address();

// Create a provider with the signer.
Expand Down

0 comments on commit 274269d

Please sign in to comment.