🗒️项目开发问题
type
status
date
slug
summary
tags
category
icon
password
Vscode中foundry.toml配置无法正确解析地址:
foundry.toml文件中,我已正确配置:
但使用Openzeppelin导入相关工具时,无法正确解析地址:

首先想到的是Openzeppelin版本更新后,ReentrancyGuard路径更换,ctrl+p搜索
ReentrancyGuard.sol
,发现路径正确,猜测是vscode的问题。然后在github中搜索
ReentrancyGuard not found
,找到了相同问题的老哥,他重启Vscode即可,尝试后无效。尝试
forge clean
清除缓存,仍然失败。将
@openzeppelin/contracts/
改为../lib/openzeppelin-contracts
,路径可以正常解析。
尝试使用chainlink工具,仍然无法使用foundry.toml的路径映射
在github上询问Cyfrin的技术人员,回复是:

所以大概率是vscode的bug。
后续解决方案:取消使用foundry.toml的remapping映射,导入时直接用绝对或相对路径。
上一篇
Foundry框架学习
下一篇
Web3概念
Loading...