我试图在VScode中运行一个简单的代码。
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.0;
import "hardhat/console.sol";
contract WavePortal {
constructor() {
console.log("Yo yo, I am a contract and I am smart");
}
}当我试图编译代码时,它显示了以下错误
这是我的launch.json
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"type": "solidityMeadow",
"request": "launch",
"name": "Debug Solidity (via unit test run)"
},
{
"type": "solidity",
"request": "launch",
"name": "Debug Solidity (via contract entry point)"
},
{
"type": "solidity",
"request": "launch",
"name": "Debug Solidity"
}
]
}发布于 2022-03-15 07:44:26
试着重新安装你的分机。这是一个已知的错误。发生在上一次VSCode升级之后。
发布于 2022-04-06 20:42:59
不知道是否还需要帮助。但万一有人发现了这个帖子。我也有同样的问题。但后来我帮自己修好了。我所做的就是在VSCode中安装扩展“”。然后使用CTRL+SHIFT+P创建一个新项目并输入"Blockchain:“。选择“创建一个坚实的项目”选项。应该修复此错误。
https://stackoverflow.com/questions/71477536
复制相似问题