diff --git a/README.md b/README.md index 030092a7..cbbcd37c 100644 --- a/README.md +++ b/README.md @@ -66,8 +66,10 @@ This repository contains the following examples: - [x] [Transfer ERC20 token](./examples/transactions/examples/transfer_erc20.rs) - [x] [Transfer ETH](./examples/transactions/examples/transfer_eth.rs) - [x] [Sign and send a raw transaction](./examples/transactions/examples/sign_transaction.rs) + - [x] [Send EIP-1559 transaction](./examples/transactions/examples/send_eip1559_tx.rs) + - [x] [Send legacy transaction](./examples/transactions/examples/send_legacy_tx.rs) + - [x] [Send EIP-4844 transaction](./examples/transactions/examples/send_eip4844_tx.rs) - [x] [Send transaction with access list](./examples/transactions/examples/with_access_list.rs) - - [x] [Send 4844 transaction](./examples/transactions/examples/send_4844.rs) - [x] Wallets - [x] [AWS signer](./examples/wallets/examples/aws_signer.rs) - [x] [Ledger signer](./examples/wallets/examples/ledger_signer.rs) diff --git a/examples/anvil/examples/deploy_contract_anvil.rs b/examples/anvil/examples/deploy_contract_anvil.rs index 26f005e9..13d77a0e 100644 --- a/examples/anvil/examples/deploy_contract_anvil.rs +++ b/examples/anvil/examples/deploy_contract_anvil.rs @@ -45,24 +45,24 @@ async fn main() -> Result<()> { // Deploy the contract. let contract = Counter::deploy(&provider).await?; - println!("Deployed contract at address: {:?}", contract.address()); + println!("Deployed contract at address: {}", contract.address()); // Set the number to 42. let builder = contract.setNumber(U256::from(42)); let receipt = builder.send().await?.get_receipt().await?; - println!("Set number to 42: {:?}", receipt.transaction_hash); + println!("Set number to 42: {}", receipt.transaction_hash); // Increment the number to 43. let builder = contract.increment(); let receipt = builder.send().await?.get_receipt().await?; - println!("Incremented number: {:?}", receipt.transaction_hash); + println!("Incremented number: {}", receipt.transaction_hash); // Retrieve the number, which should be 43. let Counter::numberReturn { _0 } = contract.number().call().await?; - println!("Retrieved number: {:?}", _0.to_string()); + println!("Retrieved number: {_0}"); Ok(()) } diff --git a/examples/contracts/examples/deploy_from_artifact.rs b/examples/contracts/examples/deploy_from_artifact.rs index 73879b8a..2773563b 100644 --- a/examples/contracts/examples/deploy_from_artifact.rs +++ b/examples/contracts/examples/deploy_from_artifact.rs @@ -35,23 +35,23 @@ async fn main() -> Result<()> { // Deploy the contract. let contract = Counter::deploy(&provider).await?; - println!("Deployed contract at address: {:?}", contract.address()); + println!("Deployed contract at address: {}", contract.address()); let builder = contract.setNumber(U256::from(42)); let receipt = builder.send().await?.get_receipt().await?; - println!("Set number to 42: {:?}", receipt.transaction_hash); + println!("Set number to 42: {}", receipt.transaction_hash); // Increment the number to 43. let builder = contract.increment(); let receipt = builder.send().await?.get_receipt().await?; - println!("Incremented number: {:?}", receipt.transaction_hash); + println!("Incremented number: {}", receipt.transaction_hash); // Retrieve the number, which should be 43. let Counter::numberReturn { _0 } = contract.number().call().await?; - println!("Retrieved number: {:?}", _0.to_string()); + println!("Retrieved number: {_0}"); Ok(()) } diff --git a/examples/contracts/examples/deploy_from_contract.rs b/examples/contracts/examples/deploy_from_contract.rs index 203f73f9..8f36ff69 100644 --- a/examples/contracts/examples/deploy_from_contract.rs +++ b/examples/contracts/examples/deploy_from_contract.rs @@ -47,23 +47,23 @@ async fn main() -> Result<()> { // Deploy the contract. let contract = Counter::deploy(&provider).await?; - println!("Deployed contract at address: {:?}", contract.address()); + println!("Deployed contract at address: {}", contract.address()); let builder = contract.setNumber(U256::from(42)); let receipt = builder.send().await?.get_receipt().await?; - println!("Set number to 42: {:?}", receipt.transaction_hash); + println!("Set number to 42: {}", receipt.transaction_hash); // Increment the number to 43. let builder = contract.increment(); let receipt = builder.send().await?.get_receipt().await?; - println!("Incremented number: {:?}", receipt.transaction_hash); + println!("Incremented number: {}", receipt.transaction_hash); // Retrieve the number, which should be 43. let Counter::numberReturn { _0 } = contract.number().call().await?; - println!("Retrieved number: {:?}", _0.to_string()); + println!("Retrieved number: {_0}"); Ok(()) } diff --git a/examples/providers/examples/builder.rs b/examples/providers/examples/builder.rs index 3756a8d7..d355a242 100644 --- a/examples/providers/examples/builder.rs +++ b/examples/providers/examples/builder.rs @@ -37,14 +37,14 @@ async fn main() -> Result<()> { // Send the transaction and wait for the receipt. let pending_tx = provider.send_transaction(tx).await?; - println!("Pending transaction...{:?}", pending_tx.tx_hash()); + println!("Pending transaction... {}", pending_tx.tx_hash()); // Wait for the transaction to be included. let receipt = pending_tx.get_receipt().await?; println!( - "Transaction included in block: {:?}", - receipt.block_number.expect("Failed to get block number").to_string() + "Transaction included in block {}", + receipt.block_number.expect("Failed to get block number") ); assert_eq!(receipt.from, alice); diff --git a/examples/providers/examples/builtin.rs b/examples/providers/examples/builtin.rs index a3829e71..7ead8e72 100644 --- a/examples/providers/examples/builtin.rs +++ b/examples/providers/examples/builtin.rs @@ -32,7 +32,7 @@ async fn main() -> Result<()> { let handle = tokio::spawn(async move { while let Some(block) = stream.next().await { - println!("{:?}", block.header.number); + println!("{}", block.header.number.unwrap()); } }); diff --git a/examples/providers/examples/ws.rs b/examples/providers/examples/ws.rs index 86f5e8a3..52c3268c 100644 --- a/examples/providers/examples/ws.rs +++ b/examples/providers/examples/ws.rs @@ -27,7 +27,7 @@ async fn main() -> Result<()> { // Take the stream and print the block number upon receiving a new block. let handle = tokio::spawn(async move { while let Some(block) = stream.next().await { - println!("Latest block number: {:?}", block.header.number.unwrap().to_string()); + println!("Latest block number: {}", block.header.number.unwrap()); } }); diff --git a/examples/providers/examples/ws_with_auth.rs b/examples/providers/examples/ws_with_auth.rs index fcffa349..96f17c38 100644 --- a/examples/providers/examples/ws_with_auth.rs +++ b/examples/providers/examples/ws_with_auth.rs @@ -38,17 +38,14 @@ async fn main() -> Result<()> { // Take the basic stream and print the block number upon receiving a new block. let basic_handle = tokio::spawn(async move { while let Some(block) = stream_basic.next().await { - println!("Latest block number (basic): {:?}", block.header.number.unwrap().to_string()); + println!("Latest block number (basic): {}", block.header.number.unwrap()); } }); // Take the bearer stream and print the block number upon receiving a new block. let bearer_handle = tokio::spawn(async move { while let Some(block) = stream_bearer.next().await { - println!( - "Latest block number (bearer): {:?}", - block.header.number.unwrap().to_string() - ); + println!("Latest block number (bearer): {}", block.header.number.unwrap()); } }); diff --git a/examples/subscriptions/examples/event_multiplexer.rs b/examples/subscriptions/examples/event_multiplexer.rs index abd4e67b..a43e2cf8 100644 --- a/examples/subscriptions/examples/event_multiplexer.rs +++ b/examples/subscriptions/examples/event_multiplexer.rs @@ -50,7 +50,7 @@ async fn main() -> Result<()> { // Deploy the `EventExample` contract. let contract = EventMultiplexer::deploy(provider).await?; - println!("Deployed contract at: {:?}", contract.address()); + println!("Deployed contract at: {}", contract.address()); // Create filters for each event. let add_filter = contract.Add_filter().watch().await?; diff --git a/examples/subscriptions/examples/poll_logs.rs b/examples/subscriptions/examples/poll_logs.rs index 0d0bda91..11848f25 100644 --- a/examples/subscriptions/examples/poll_logs.rs +++ b/examples/subscriptions/examples/poll_logs.rs @@ -40,7 +40,7 @@ async fn main() -> Result<()> { // Deploy the `Counter` contract. let contract = Counter::deploy(provider.clone()).await?; - println!("Deployed contract at: {:?}", contract.address()); + println!("Deployed contract at: {}", contract.address()); // Create filters for each event. let increment_filter = contract.Increment_filter().watch().await?; diff --git a/examples/subscriptions/examples/subscribe_blocks.rs b/examples/subscriptions/examples/subscribe_blocks.rs index 1d5ce871..623a05f6 100644 --- a/examples/subscriptions/examples/subscribe_blocks.rs +++ b/examples/subscriptions/examples/subscribe_blocks.rs @@ -23,7 +23,7 @@ async fn main() -> Result<()> { let mut stream = subscription.into_stream().take(2); while let Some(block) = stream.next().await { - println!("Received block number: {:?}", block.header.number.unwrap().to_string()); + println!("Received block number: {}", block.header.number.unwrap()); } // Poll for block headers. diff --git a/examples/transactions/examples/send_4844.rs b/examples/transactions/examples/send_4844.rs deleted file mode 100644 index 80f08c24..00000000 --- a/examples/transactions/examples/send_4844.rs +++ /dev/null @@ -1,42 +0,0 @@ -//! Example showing how to send a 4844 tx. - -use alloy::{ - consensus::{SidecarBuilder, SimpleCoder}, - eips::eip4844::DATA_GAS_PER_BLOB, - network::TransactionBuilder, - node_bindings::Anvil, - providers::{Provider, ProviderBuilder}, - rpc::types::eth::TransactionRequest, -}; -use eyre::Result; - -#[tokio::main] -async fn main() -> Result<()> { - let anvil = Anvil::new().args(["--hardfork", "cancun"]).spawn(); - let provider = ProviderBuilder::new().on_builtin(&anvil.endpoint()).await?; - - let from = anvil.addresses()[0]; - let to = anvil.addresses()[1]; - - let sidecar: SidecarBuilder = - SidecarBuilder::from_slice("Blobs are fun!".as_bytes()); - - let sidecar = sidecar.build()?; - - let gas_price = provider.get_gas_price().await?; - let eip1559_est = provider.estimate_eip1559_fees(None).await?; - let tx = TransactionRequest::default() - .with_from(from) - .with_to(to) - .with_nonce(0) - .with_max_fee_per_blob_gas(gas_price) - .with_max_fee_per_gas(eip1559_est.max_fee_per_gas) - .with_max_priority_fee_per_gas(eip1559_est.max_priority_fee_per_gas) - .with_blob_sidecar(sidecar); - - let receipt = provider.send_transaction(tx).await?.get_receipt().await?; - - assert_eq!(receipt.blob_gas_used.unwrap(), DATA_GAS_PER_BLOB as u128); - - Ok(()) -} diff --git a/examples/transactions/examples/send_eip1559_tx.rs b/examples/transactions/examples/send_eip1559_tx.rs new file mode 100644 index 00000000..61ded3a1 --- /dev/null +++ b/examples/transactions/examples/send_eip1559_tx.rs @@ -0,0 +1,54 @@ +//! Example showing how to send an [EIP-1559](https://eips.ethereum.org/EIPS/eip-1559) transaction. + +use alloy::{ + network::TransactionBuilder, + node_bindings::Anvil, + primitives::U256, + providers::{Provider, ProviderBuilder}, + rpc::types::eth::TransactionRequest, +}; +use eyre::Result; + +#[tokio::main] +async fn main() -> Result<()> { + // Spin up a local Anvil node. + // Ensure `anvil` is available in $PATH. + let anvil = Anvil::new().try_spawn()?; + + // Create a provider. + let rpc_url = anvil.endpoint().parse()?; + let provider = ProviderBuilder::new().on_http(rpc_url); + + // Create two users, Alice and Bob. + let alice = anvil.addresses()[0]; + let bob = anvil.addresses()[1]; + + // Build a transaction to send 100 wei from Alice to Bob. + let tx = TransactionRequest::default() + .with_from(alice) + .with_to(bob) + .with_nonce(0) + .with_chain_id(anvil.chain_id()) + .with_value(U256::from(100)) + .with_gas_limit(21_000) + .with_max_priority_fee_per_gas(1_000_000_000) + .with_max_fee_per_gas(20_000_000_000); + + // Send the transaction and wait for the receipt. + let pending_tx = provider.send_transaction(tx).await?; + + println!("Pending transaction... {}", pending_tx.tx_hash()); + + // Wait for the transaction to be included. + let receipt = pending_tx.get_receipt().await?; + + println!( + "Transaction included in block {}", + receipt.block_number.expect("Failed to get block number") + ); + + assert_eq!(receipt.from, alice); + assert_eq!(receipt.to, Some(bob)); + + Ok(()) +} diff --git a/examples/transactions/examples/send_eip4844_tx.rs b/examples/transactions/examples/send_eip4844_tx.rs new file mode 100644 index 00000000..e52f858f --- /dev/null +++ b/examples/transactions/examples/send_eip4844_tx.rs @@ -0,0 +1,61 @@ +//! Example showing how to send an [EIP-4844](https://github.com/ethereum/EIPs/blob/master/EIPS/eip-4844.md) transaction. + +use alloy::{ + consensus::{SidecarBuilder, SimpleCoder}, + eips::eip4844::DATA_GAS_PER_BLOB, + network::TransactionBuilder, + node_bindings::Anvil, + providers::{Provider, ProviderBuilder}, + rpc::types::eth::TransactionRequest, +}; +use eyre::Result; + +#[tokio::main] +async fn main() -> Result<()> { + // Spin up a local Anvil node with the Cancun hardfork enabled. + // Ensure `anvil` is available in $PATH. + let anvil = Anvil::new().args(["--hardfork", "cancun"]).try_spawn()?; + + // Create a provider. + let provider = ProviderBuilder::new().on_builtin(&anvil.endpoint()).await?; + + // Create two users, Alice and Bob. + let alice = anvil.addresses()[0]; + let bob = anvil.addresses()[1]; + + // Create a sidecar with some data. + let sidecar: SidecarBuilder = + SidecarBuilder::from_slice("Blobs are fun!".as_bytes()); + let sidecar = sidecar.build()?; + + // Build a transaction to send the sidecar from Alice to Bob. + let gas_price = provider.get_gas_price().await?; + let eip1559_est = provider.estimate_eip1559_fees(None).await?; + let tx = TransactionRequest::default() + .with_from(alice) + .with_to(bob) + .with_nonce(0) + .with_max_fee_per_blob_gas(gas_price) + .with_max_fee_per_gas(eip1559_est.max_fee_per_gas) + .with_max_priority_fee_per_gas(eip1559_est.max_priority_fee_per_gas) + .with_blob_sidecar(sidecar); + + // Send the transaction and wait for the receipt. + let pending_tx = provider.send_transaction(tx).await?; + + println!("Pending transaction... {}", pending_tx.tx_hash()); + + // Wait for the transaction to be included. + let receipt = pending_tx.get_receipt().await?; + + println!( + "Transaction included in block {}", + receipt.block_number.expect("Failed to get block number") + ); + + assert_eq!(receipt.from, alice); + assert_eq!(receipt.to, Some(bob)); + assert_eq!(receipt.blob_gas_used.unwrap(), DATA_GAS_PER_BLOB as u128); + + Ok(()) +} diff --git a/examples/transactions/examples/send_legacy_tx.rs b/examples/transactions/examples/send_legacy_tx.rs new file mode 100644 index 00000000..bbce272b --- /dev/null +++ b/examples/transactions/examples/send_legacy_tx.rs @@ -0,0 +1,52 @@ +//! Example showing how to send a legacy transaction. + +use alloy::{ + network::TransactionBuilder, + node_bindings::Anvil, + primitives::U256, + providers::{Provider, ProviderBuilder}, + rpc::types::eth::TransactionRequest, +}; +use eyre::Result; + +#[tokio::main] +async fn main() -> Result<()> { + // Spin up a local Anvil node. + // Ensure `anvil` is available in $PATH. + let anvil = Anvil::new().try_spawn()?; + + // Create a provider. + let rpc_url = anvil.endpoint().parse()?; + let provider = ProviderBuilder::new().on_http(rpc_url); + + // Create two users, Alice and Bob. + let alice = anvil.addresses()[0]; + let bob = anvil.addresses()[1]; + + // Build a transaction to send 100 wei from Alice to Bob. + let tx = TransactionRequest::default() + .with_from(alice) + .with_to(bob) + .with_nonce(0) + .with_value(U256::from(100)) + .with_gas_price(20_000_000_000) + .with_gas_limit(21_000); + + // Send the transaction and wait for the receipt. + let pending_tx = provider.send_transaction(tx).await?; + + println!("Pending transaction... {}", pending_tx.tx_hash()); + + // Wait for the transaction to be included. + let receipt = pending_tx.get_receipt().await?; + + println!( + "Transaction included in block {}", + receipt.block_number.expect("Failed to get block number") + ); + + assert_eq!(receipt.from, alice); + assert_eq!(receipt.to, Some(bob)); + + Ok(()) +} diff --git a/examples/transactions/examples/sign_transaction.rs b/examples/transactions/examples/sign_transaction.rs index ffa62106..fadf76f6 100644 --- a/examples/transactions/examples/sign_transaction.rs +++ b/examples/transactions/examples/sign_transaction.rs @@ -48,7 +48,7 @@ async fn main() -> Result<()> { // Send the raw transaction and retrieve the transaction receipt. let receipt = provider.send_raw_transaction(&tx_encoded).await?.get_receipt().await?; - println!("Send transaction: {:?}", receipt.transaction_hash); + println!("Send transaction: {}", receipt.transaction_hash); assert_eq!(receipt.from, alice); assert_eq!(receipt.to, Some(bob)); diff --git a/examples/transactions/examples/transfer_erc20.rs b/examples/transactions/examples/transfer_erc20.rs index 66d9c8c3..6d0cf059 100644 --- a/examples/transactions/examples/transfer_erc20.rs +++ b/examples/transactions/examples/transfer_erc20.rs @@ -36,7 +36,7 @@ async fn main() -> Result<()> { let amount = U256::from(100); let receipt = contract.transfer(bob, amount).send().await?.get_receipt().await?; - println!("Send transaction: {:?}", receipt.transaction_hash); + println!("Send transaction: {}", receipt.transaction_hash); // Register the balances of Alice and Bob after the transfer. let alice_after_balance = contract.balanceOf(alice).call().await?._0; diff --git a/examples/transactions/examples/transfer_eth.rs b/examples/transactions/examples/transfer_eth.rs index 6c710731..aaa4255b 100644 --- a/examples/transactions/examples/transfer_eth.rs +++ b/examples/transactions/examples/transfer_eth.rs @@ -30,14 +30,14 @@ async fn main() -> Result<()> { // Send the transaction and wait for the receipt. let pending_tx = provider.send_transaction(tx).await?; - println!("Pending transaction...{:?}", pending_tx.tx_hash()); + println!("Pending transaction... {}", pending_tx.tx_hash()); // Wait for the transaction to be included. let receipt = pending_tx.get_receipt().await?; println!( - "Transaction included in block: {:?}", - receipt.block_number.expect("Failed to get block number").to_string() + "Transaction included in block {}", + receipt.block_number.expect("Failed to get block number") ); assert_eq!(receipt.from, alice); diff --git a/examples/wallets/examples/create_keystore.rs b/examples/wallets/examples/create_keystore.rs index e65370ba..81928d9b 100644 --- a/examples/wallets/examples/create_keystore.rs +++ b/examples/wallets/examples/create_keystore.rs @@ -23,13 +23,13 @@ async fn main() -> Result<()> { let keystore_file_path = dir.path().join(file_path); - println!("Wrote keystore for {:?} to {:?}", wallet.address(), keystore_file_path); + println!("Wrote keystore for {} to {:?}", wallet.address(), keystore_file_path); // Read the keystore file back. let recovered_wallet = Wallet::decrypt_keystore(keystore_file_path.clone(), password)?; println!( - "Read keystore from {:?}, recovered address: {:?}", + "Read keystore from {:?}, recovered address: {}", keystore_file_path, recovered_wallet.address() ); diff --git a/examples/wallets/examples/keystore_signer.rs b/examples/wallets/examples/keystore_signer.rs index 41634685..63ef3f15 100644 --- a/examples/wallets/examples/keystore_signer.rs +++ b/examples/wallets/examples/keystore_signer.rs @@ -43,7 +43,7 @@ async fn main() -> Result<()> { // Send the transaction and wait for the receipt. let receipt = provider.send_transaction(tx).await?.get_receipt().await?; - println!("Send transaction: {:?}", receipt.transaction_hash); + println!("Send transaction: {}", receipt.transaction_hash); Ok(()) } diff --git a/examples/wallets/examples/ledger_signer.rs b/examples/wallets/examples/ledger_signer.rs index 85702cc6..2a7fc234 100644 --- a/examples/wallets/examples/ledger_signer.rs +++ b/examples/wallets/examples/ledger_signer.rs @@ -35,7 +35,7 @@ async fn main() -> Result<()> { let receipt = provider.send_transaction(tx).await?.with_required_confirmations(3).get_receipt().await?; - println!("Send transaction: {:?}", receipt.transaction_hash); + println!("Send transaction: {}", receipt.transaction_hash); Ok(()) } diff --git a/examples/wallets/examples/mnemonic_signer.rs b/examples/wallets/examples/mnemonic_signer.rs index ba5d6eb2..bd237cc7 100644 --- a/examples/wallets/examples/mnemonic_signer.rs +++ b/examples/wallets/examples/mnemonic_signer.rs @@ -18,7 +18,7 @@ async fn main() -> Result<()> { .password(password) .build()?; - println!("Wallet: {:?}", wallet.address()); + println!("Wallet: {}", wallet.address()); // Generate a random wallet (24 word phrase) at custom derivation path let wallet = MnemonicBuilder::::default() @@ -29,7 +29,7 @@ async fn main() -> Result<()> { // .write_to(path) .build_random()?; - println!("Random wallet: {:?}", wallet.address()); + println!("Random wallet: {}", wallet.address()); Ok(()) } diff --git a/examples/wallets/examples/private_key_signer.rs b/examples/wallets/examples/private_key_signer.rs index d5bef7b6..28341e99 100644 --- a/examples/wallets/examples/private_key_signer.rs +++ b/examples/wallets/examples/private_key_signer.rs @@ -39,7 +39,7 @@ async fn main() -> Result<()> { // Send the transaction and wait for the receipt. let receipt = provider.send_transaction(tx).await?.get_receipt().await?; - println!("Send transaction: {:?}", receipt.transaction_hash); + println!("Send transaction: {}", receipt.transaction_hash); Ok(()) } diff --git a/examples/wallets/examples/sign_message.rs b/examples/wallets/examples/sign_message.rs index 8f830a69..a84dee8f 100644 --- a/examples/wallets/examples/sign_message.rs +++ b/examples/wallets/examples/sign_message.rs @@ -18,11 +18,8 @@ async fn main() -> Result<()> { // Sign the message asynchronously with the signer. let signature = signer.sign_message(message).await?; - println!("Signature produced by {:?}: {:?}", signer.address(), signature); - println!( - "Signature recovered address: {:?}", - signature.recover_address_from_msg(&message[..])? - ); + println!("Signature produced by {}: {:?}", signer.address(), signature); + println!("Signature recovered address: {}", signature.recover_address_from_msg(&message[..])?); Ok(()) } diff --git a/examples/wallets/examples/sign_permit_hash.rs b/examples/wallets/examples/sign_permit_hash.rs index 1896e002..931eb158 100644 --- a/examples/wallets/examples/sign_permit_hash.rs +++ b/examples/wallets/examples/sign_permit_hash.rs @@ -49,11 +49,11 @@ async fn main() -> Result<()> { let signature = signer.sign_hash(&hash).await?; println!( - "Recovered address matches wallet address: {:?}", + "Recovered address matches wallet address: {}", signature.recover_address_from_prehash(&hash)? == signer.address() ); - println!("Wallet signature matches: {:?}", signer.sign_hash(&hash).await? == signature); + println!("Wallet signature matches: {}", signer.sign_hash(&hash).await? == signature); Ok(()) } diff --git a/examples/wallets/examples/trezor_signer.rs b/examples/wallets/examples/trezor_signer.rs index 753714da..62499e72 100644 --- a/examples/wallets/examples/trezor_signer.rs +++ b/examples/wallets/examples/trezor_signer.rs @@ -35,7 +35,7 @@ async fn main() -> Result<()> { let receipt = provider.send_transaction(tx).await?.with_required_confirmations(3).get_receipt().await?; - println!("Send transaction: {:?}", receipt.transaction_hash); + println!("Send transaction: {}", receipt.transaction_hash); Ok(()) } diff --git a/examples/wallets/examples/yubi_signer.rs b/examples/wallets/examples/yubi_signer.rs index f2e3cf3e..5758320d 100644 --- a/examples/wallets/examples/yubi_signer.rs +++ b/examples/wallets/examples/yubi_signer.rs @@ -41,7 +41,7 @@ async fn main() -> Result<()> { let receipt = provider.send_transaction(tx).await?.with_required_confirmations(3).get_receipt().await?; - println!("Send transaction: {:?}", receipt.transaction_hash); + println!("Send transaction: {}", receipt.transaction_hash); Ok(()) }