Initiating a transfer transaction
We will do our first transaction with Web3 now by initiating a transfer amount of 2 ETH from Account # 0
to Account # 1
. Remember we have to do this transfer only within the local network and you’ll use the test ETH to pay for gas or transaction fees:
- As the very first step, open the MetaMask wallet, switch to the local network, and make sure you are seeing the Hardhat Account # 0 details. The balance should show 1,000 ETH. There are two ways to initiate a transfer: Send or Receive. Here, we will use the Send option. Make sure you are using localhost as the network and the account points to Account # 0 to start the transaction.
- Click on the Send option and it will take you to the next step.
- Now, click on Transfer between my accounts; the following figure shows the list of accounts that you can choose from:
Figure 3.18 – Transferring between accounts
- Choose Account # 1. Enter the amount...