accounts.ts 525 B

123456789101112131415161718
  1. import { task } from "hardhat/config";
  2. // This is a sample Hardhat task. To learn how to create your own go to
  3. // https://hardhat.org/guides/create-task.html
  4. task("accounts", "Prints the list of accounts", async (args, hre) => {
  5. const accounts = await hre.ethers.getSigners();
  6. for (const account of accounts) {
  7. console.log(await account.address);
  8. }
  9. });
  10. // You need to export an object to set up your config
  11. // Go to https://hardhat.org/config/ to learn more
  12. export default {
  13. solidity: "0.8.4",
  14. };