Skip to content

Lesson 6 TypeError: (0 , ethers_1.getAddress) is not a function #6194

Discussion options

You must be logged in to vote

I figured it out!!!
we are using the latest version of hardhat and ethers so we have to make a couple of changes in our code to make it work! I'm attaching my code and the link of hardhat docs on how to deploy your contract

const { ether } = require("hardhat");

async function main() {
  const SimpleStorageFactory = await ethers.getContractFactory("SimpleStorage");
  console.log("deploying contract...");
  const simpleStorage = await SimpleStorageFactory.deploy();
  await simpleStorage.waitForDeployment();
  // no private key
  // no rpc url
  console.log(`Deployed contract to: ${simpleStorage.target}`);
  //hardhat comes with local network that's why we don't need private key and rpc url…

Replies: 1 comment

Comment options

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