Skip to content
This repository has been archived by the owner on Nov 5, 2023. It is now read-only.

Commit

Permalink
Move send eth script to hardhat task
Browse files Browse the repository at this point in the history
  • Loading branch information
jacque006 committed Oct 27, 2022
1 parent 097174b commit e4ab6b5
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 35 deletions.
17 changes: 17 additions & 0 deletions contracts/hardhat.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,23 @@ task("fundDeployer", "Sends ETH to create2Deployer contract from first signer")
await txnRes.wait();
});

task("sendEth", "Sends ETH to an address")
.addParam("address", "Address to send ETH to", undefined, types.string)
.addOptionalParam("amount", "Amount of ETH to send", "1.0")
.setAction(
async ({ address, amount }: { address: string; amount: string }, hre) => {
const [account0] = await hre.ethers.getSigners();

console.log(`${account0.address} -> ${address} ${amount} ETH`);

const txnRes = await account0.sendTransaction({
to: address,
value: hre.ethers.utils.parseEther(amount),
});
await txnRes.wait();
},
);

// Do any needed pre-test setup here.
task("test").setAction(async (_taskArgs, _hre, runSuper) => {
chai.use(chaiAsPromised);
Expand Down
35 changes: 0 additions & 35 deletions contracts/scripts/test/send_eth.ts

This file was deleted.

0 comments on commit e4ab6b5

Please sign in to comment.