Contract Address : Undefined #5980
-
Somehow, I can't receive the contract address with console.log. Here's the code :
The result is :
The contract address result is 'undefined' |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 3 replies
-
Instead of console.log("Contract Address : " + contract.target) |
Beta Was this translation helpful? Give feedback.
-
It would seem you are using version ^6 of ethers, I can tell by your use of So, instead of using console.log("Contract Address : " + contract.address) Use this const address = await contract.getAddress();
console.log("Contract Address : " + address) |
Beta Was this translation helpful? Give feedback.
Instead of
address
usetarget
orawait ... getAddress()
like this