【发布时间】:2022-12-10 06:12:40
【问题描述】:
所以当我想部署我的合同并在我的终端中写入“npx hardhat run scripts/deploy.js --network goerli”时,它给出了一个错误:
HardhatError:HH700:未找到合同“HelloWorld”的工件。 在 Artifacts._handleWrongArtifactForContractName (/Users//hello- world/node_modules/hardhat/src/internal/artifacts.ts:702:11) at Artifacts._getArtifactPathFromFiles (/Users//hello- world/node_modules/hardhat/src/internal/artifacts.ts:827:19) at Artifacts._getArtifactPath (/Users//hello-world/node_modules/hardhat /src/internal/artifacts.ts:507:21) at Artifacts.readArtifact (/Users//hello-world/node_modules/hardhat /src/internal/artifacts.ts:71:26) at getContractFactory (/Users/**/hello-world/node_modules/@nomiclabs /hardhat-ethers/src/internal/helpers.ts:99:22)
这是我的
deploy.js代码:async function main() { const HelloWorld = await ethers.getContractFactory("HelloWorld"); const hello_world = await HelloWorld.deploy("Hello World!"); console.log("Contract deployed to address:", hello_world.address); }我什至试图把:
const HelloWorld = await ethers.getContractFactory("HelloWorld.sol");它通常应该显示:
合约部署地址:0x ...
有人能帮助我吗?谢谢 !
【问题讨论】:
标签: javascript terminal solidity smartcontracts hardhat