Skip to content

Lesson 6: TypeError: simpleStorage.deployed is not a function #793

Answered by alymurtazamemon
hamednasr asked this question in Q&A
Discussion options

You must be logged in to vote

@hamednasr

 // * hardhat gets contract from artifacts folder that is the reason it knows contract with name and we can get this way.
  const SimpleStorageFactory = await ethers.getContractFactory("SimpleStorage");
  console.log("Deploying contract...");
  const simpleStorage = await SimpleStorageFactory.deploy();
  console.log("Waiting for contract to deployed...");
  await simpleStorage.deployed();
  console.log("Contract address");
  console.log(simpleStorage.address);

factory instance has a function deploy() on the other hand after deploying the instance we receive that has a function deployed()

Replies: 6 comments 11 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
6 replies
@highHumann
Comment options

@mokhles95
Comment options

@KingSorbon
Comment options

@Jundullah125
Comment options

@shariqazeem
Comment options

Answer selected by alymurtazamemon
Comment options

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

Comment options

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

Comment options

You must be logged in to vote
3 replies
@zey9991
Comment options

@nirajnil2
Comment options

@Emillystev
Comment options

Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet