![](/img/trans.png)
[英]How to monitor events on an Solidity Smart Contract using hardhat and ethers?
[英]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.