Skip to content

curly braces? #4588

Answered by Koowah
h0leee asked this question in Q&A
Jan 24, 2023 · 1 comments · 9 replies
Discussion options

You must be logged in to vote

Hi @h0leee ,

await ethers.getContract("FundMe", deployer) returns a javascript object (something like this {"property1":"value1", "property2":value2}).
We're therefore storing that whole object in the constant fundMe with const fundMe.

Similarly, await getNamedAccounts() returns a javascript object that looks like {"user":userAddress, "deployer":deployerAddress, ...}. However, we are not interested in storing the whole object this time. All we want is a single account, the deployer.
So what this syntax const { deployer } does is store the value of the property named deployer in a variable called deployer. This means that now, deployer = deployerAddress. We could also do const {user} = awa…

Replies: 1 comment 9 replies

Comment options

You must be logged in to vote
9 replies
@h0leee
Comment options

@Nlferu
Comment options

@Koowah
Comment options

@Nlferu
Comment options

@Nlferu
Comment options

Answer selected by h0leee
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