Replies: 2 comments
-
|
I have this with ethers v6: import { getAddress } from "ethers"
import { ethers, run, network } from "hardhat"
async function main() {
const SimpleStorageFactory = await ethers.getContractFactory(
"SimpleStorage"
)
console.log("Deploying contract...")
const simpleStorage = await SimpleStorageFactory.deploy()
await simpleStorage.waitForDeployment()
console.log(`Deployed contract to: ${await simpleStorage.getAddress()}`) |
Beta Was this translation helpful? Give feedback.
0 replies
-
async function main() {
const SimpleStorageFactory = await ethers.getContractFactory("SimpleStorage");
console.log("Deploying SimpleStorage...");
const simpleStorage = await SimpleStorageFactory.deploy();
await simpleStorage.waitForDeployment();
console.log("Contract deployed to address: ", await simpleStorage.getAddress());
}I changed |
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
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
When I try to deploy the contact I get an error. Below is the main function in the
deploy.tsfile.The error:
TypeError: (0 , ethers_1.getAddress) is not a functionI have tried the following:
ethersto5.7.2- the error persists@nomicfoundation/hardhat-etherswith@nomiclabs/hardhat-ethers- all files importingethersfromhardhatwere flagged as ethers not existing in the package@nomicfoundation/hardhat-ethersand@nomiclabs/hardhat-ethersand removingethers- the error persistsdeploy()- same errorHere is my package.json:
{ "name": "hardhat-simple-storage", "version": "1.0.0", "license": "MIT", "devDependencies": { "@nomicfoundation/hardhat-chai-matchers": "^2.0.0", "@nomicfoundation/hardhat-ethers": "^3.0.3", "@nomicfoundation/hardhat-network-helpers": "^1.0.0", "@nomicfoundation/hardhat-toolbox": "^3.0.0", "@nomicfoundation/hardhat-verify": "^1.0.3", "@nomiclabs/hardhat-ethers": "^2.2.3", "@typechain/ethers-v6": "^0.4.0", "@typechain/hardhat": "^8.0.0", "@types/chai": "^4.2.0", "@types/mocha": ">=9.1.0", "@types/node": ">=12.0.0", "chai": "^4.2.0", "hardhat": "^2.16.1", "hardhat-gas-reporter": "^1.0.9", "solidity-coverage": "^0.8.4", "ts-node": ">=8.0.0", "typechain": "^8.1.0", "typescript": ">=4.5.0" }, "dependencies": { "dotenv": "^16.3.1" } }Beta Was this translation helpful? Give feedback.
All reactions