Skip to content

Lesson 6: accounts task not available on Hardhat #825

Answered by krakxn
SebasAran16 asked this question in Q&A
Discussion options

You must be logged in to vote

@SebasAran16 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:

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: 5 comments 9 replies

Comment options

You must be logged in to vote
2 replies
@SebasAran16
Comment options

@alymurtazamemon
Comment options

Comment options

You must be logged in to vote
2 replies
@0xSanyam
Comment options

@SebasAran16
Comment options

Comment options

You must be logged in to vote
1 reply
@SebasAran16
Comment options

Comment options

You must be logged in to vote
3 replies
@SebasAran16
Comment options

@krakxn
Comment options

@SebasAran16
Comment options

Answer selected by SebasAran16
Comment options

You must be logged in to vote
1 reply
@SebasAran16
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
6 participants