Skip to content

Lesson 6 : yarn hardhat accounts #1312

Answered by krakxn
mazen-sleem asked this question in Q&A
Discussion options

You must be logged in to vote

The problem is that they removed it as a pre-defined sample task in the new Hardhat update, I have still listed it below if you want to use that sample task:

Put this in your hardhat.config.js file to be able to use it:

task("accounts", "Prints the list of accounts", async (taskArgs, hre) => {
    const accounts = await hre.ethers.getSigners()
    for (const account of accounts) {
        console.log(account.address)
    }
})

Hope this helped!

Replies: 1 comment 4 replies

Comment options

You must be logged in to vote
4 replies
@mazen-sleem
Comment options

@krakxn
Comment options

@Joanfa7
Comment options

@krakxn
Comment options

Answer selected by mazen-sleem
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants