I get an error function call #1574
Answered
by
krakxn
Itoro-Brown
asked this question in
Q&A
-
Please what is wrong with this code I get an error anytime I try to run it. async function main() {
const SimpleStorageFactory = await ethers.getContractFactory("kucoin");
console.log("Deploying the contract....");
const SimpleStorage = await SimpleStorageFactory.deploy();
await SimpleStorage.deploy();
console.log(`Deployed contract to this address:${SimpleStorage.address}`);
}
|
Beta Was this translation helpful? Give feedback.
Answered by
krakxn
Aug 6, 2022
Replies: 2 comments 3 replies
-
You've deployed the contract factory twice const SimpleStorage = await SimpleStorageFactory.deploy();
await SimpleStorage.deploy(); The first deploy is enough and |
Beta Was this translation helpful? Give feedback.
0 replies
-
@othaime-en That is wrong, we need the following to wait till it is deployed; so, just deploy will not be enough. This should fix it: const SimpleStorage = await SimpleStorageFactory.deploy();
-await SimpleStorage.deploy();
+await SimpleStorage.deployed(); |
Beta Was this translation helpful? Give feedback.
3 replies
Answer selected by
alymurtazamemon
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@othaime-en That is wrong, we need the following to wait till it is deployed; so, just deploy will not be enough.
This should fix it: