last time, in truffle with ganache-cli, I fork the mainnet with the following command and tutorial...
ganache-cli -f https://mainnet.infura.io/v3/my_infura_project_id -u 0x742d35Cc6634C0532925a3b844Bc454e4438f44e
0x742d35Cc6634C0532925a3b844Bc454e4438f44e
, was the account from where I was borrowing the test ethers to my metamask localhost wallet. After typing the above command, I run a script that has the following code...
const Web3 = require('web3'); const web3 = new Web3('http://127.0.0.1:8545');
const myAccount = "0x6d5e2C47c58B5DF79164B0E618f74BA542E5aEd3";
const ethBorrowAccount = "0x742d35Cc6634C0532925a3b844Bc454e4438f44e";
web3.eth.sendTransaction({from: ethBorrowAccount, to: myAccount, value: web3.utils.toWei('100', 'ether')}, (err, hash) => {
console.log(hash);
});
by doing this I was able to get 100 ethers in my metamask wallet. Like below...
My question is, how can I do the same with Hardhat???