LESSON 5: address function for contract #5277
-
so this is my ether.js code const contract_factory = new ethers.ContractFactory(abi, binary, wallet);
console.log("Deploying please wait !!!");
const contract = await contract_factory.deploy();
// await can be used only inside async function
// await-key word makes sure that the function is completed before other code is runned
await contract.deploymentTransaction();
let address1 = contract.getAddress();
console.log(address1);` and the output I get is
I am running this on ganache local for local host and on polygon mumbai as my testnet |
Beta Was this translation helpful? Give feedback.
Answered by
alymurtazamemon
Apr 11, 2023
Replies: 2 comments
-
@NamanMohnani use -let address1 = contract.getAddress();
+let address1 = await contract.getAddress(); |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
naman1402
-
Thank you very much @alymurtazamemon , actual I am not yet fluent in JavaScript as I am still learning. Thanks for the help !! :) |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@NamanMohnani use
await
;