Files
bandada/contracts/tasks/accounts.ts
2022-10-31 22:10:08 +09:00

17 lines
518 B
TypeScript

import { Signer } from "@ethersproject/abstract-signer"
import { task, types } from "hardhat/config"
task("accounts", "Prints the list of accounts")
.addOptionalParam<boolean>("logs", "Print the logs", true, types.boolean)
.setAction(async ({ logs }, { ethers }) => {
const accounts: Signer[] = await ethers.getSigners()
if (logs) {
for (const account of accounts) {
console.info(await account.getAddress())
}
}
return accounts
})