Skip to content

LESSON 12: What is user1 & why do we need to use it? #2005

Answered by RoboCrypter
DorianDaSilva asked this question in Q&A
Discussion options

You must be logged in to vote

@DorianDaSilva : In your hardhat.config.js file, There will be user1 declared in your namedAccounts, Thats why it is working,
while user isn't.
You can add other users in there aswell means :
default : 0 is deployer, means account "0" in hardhat node is deployer,
default : 1 is user1 means account "1" in hardhat node is user1.

So, the point is you can add as many users as you like, But you have to add them in your namedAccounts in your hardhat.config.js file.

We make different users just for the helping purposes in our testing.

Hopefully it will clear your doubt!

Replies: 3 comments 2 replies

Comment options

You must be logged in to vote
0 replies
Comment options

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

Answer selected by DorianDaSilva
Comment options

You must be logged in to vote
1 reply
@RoboCrypter
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
4 participants