Skip to content

Lesson -7 getNamedAccount is on my nerves #1643

Answered by othaime-en
TimeKeyRoll asked this question in Q&A
Discussion options

You must be logged in to vote

The function getNamedAccounts() comes with hardhat-deploy. It allows us to access accounts and addresses from the namedAccounts object in hardhat.config.js. This namedAccounts functionality allows us to associate a single name with multiple addresses.

namedAccounts: {
    deployer: { 
        default: 0, 
        1: 0    // On Mainnet we use the first account
        4: 2    // On rinkeby we use the third account
    },
    
    users: { 
        default: 0 
        },
    },
}

In this example, we assign three accounts to the name deployer (just a name to represent the person deploying the contract) and we set the default account to 0 (the first account in the list of 10 accounts that ha…

Replies: 6 comments 20 replies

Comment options

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

Comment options

You must be logged in to vote
2 replies
@othaime-en
Comment options

@TimeKeyRoll
Comment options

Answer selected by TimeKeyRoll
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
8 replies
@TimeKeyRoll
Comment options

@othaime-en
Comment options

@othaime-en
Comment options

@pacelliv
Comment options

@othaime-en
Comment options

Comment options

You must be logged in to vote
5 replies
@othaime-en
Comment options

@TimeKeyRoll
Comment options

@othaime-en
Comment options

@TimeKeyRoll
Comment options

@othaime-en
Comment options

Comment options

You must be logged in to vote
4 replies
@othaime-en
Comment options

@othaime-en
Comment options

@mattaereal
Comment options

@TimeKeyRoll
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