@@ -19,10 +19,6 @@ async fn main() -> Result<()> {
1919 // Set up signer from the first default Anvil account (Alice).
2020 let signer: LocalWallet = anvil. keys ( ) [ 0 ] . clone ( ) . into ( ) ;
2121
22- // Create two users, Alice and Vitalik.
23- let alice = signer. address ( ) ;
24- let vitalik = address ! ( "d8dA6BF26964aF9D7eEd9e03E53415D37aA96045" ) ;
25-
2622 // Create a provider with the signer.
2723 let rpc_url = anvil. endpoint ( ) . parse ( ) ?;
2824 let provider = ProviderBuilder :: new ( )
@@ -31,12 +27,12 @@ async fn main() -> Result<()> {
3127 . signer ( EthereumSigner :: from ( signer) )
3228 . on_http ( rpc_url) ;
3329
34- // Build a EIP-1559 type transaction.
30+ // Build an EIP-1559 type transaction to send 100 wei to Vitalik .
3531 // Notice that the `nonce` field is set by the `NonceFiller`.
3632 // Notice that the gas related fields are set by the `GasFiller`.
3733 // Notice that the `chain_id` field is set by the `ChainIdFiller`.
38- let tx =
39- TransactionRequest :: default ( ) . with_from ( alice ) . with_to ( vitalik) . with_value ( U256 :: from ( 100 ) ) ;
34+ let vitalik = address ! ( "d8dA6BF26964aF9D7eEd9e03E53415D37aA96045" ) ;
35+ let tx = TransactionRequest :: default ( ) . with_to ( vitalik) . with_value ( U256 :: from ( 100 ) ) ;
4036
4137 // Send the transaction, the nonce (0) is automatically managed by the provider.
4238 let builder = provider. send_transaction ( tx. clone ( ) ) . await ?;
0 commit comments