繁体   English   中英

使用安全帽编译智能合约时出错

[英]Errror compiling smart contract using hardhat

我正在尝试使用安全帽编译此智能合约,但出现此错误

npx 安全帽编译

contracts/FlashSwap.sol:7:1: ParserError: Source "node_modules/hardhat/console.sol" not 
found: File outside of allowed directories.
import "../node_modules/hardhat/console.sol";
^-------------------------------------------^
Error HH600: Compilation failed

The thing is I already have this in first line of my code and still getting the error
 

//SPDX-License-Identifier: Unlicense
pragma solidity >=0.6.6;

import "../node_modules/hardhat/console.sol";

您不应该在 import 语句中添加node_modules

更改以下行:

import "../node_modules/hardhat/console.sol";

进入以下行:

import "hardhat/console.sol";

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM