Closed davoice-321 closed 2 weeks ago
What VSCode integration are you using? That error is most likely not coming from us.
The problem is the NomicFoundation integration is out dated. The repo to raise the bug with is here: https://github.com/NomicFoundation/hardhat-vscode I can possibly guide them into what to fix.
Environment information
ape
and plugin versions:Installed Plugins alchemy 0.8.0 ens 0.8.0 etherscan 0.8.2 foundry 0.8.4 hardhat 0.8.1 infura 0.8.0 solidity 0.8.3 template 0.8.0 tokens 0.8.0 vyper 0.8.4
What went wrong?
Ape is having trouble importing/finding multiple versions of OpenZepplin.
imports in solidity file separate versions of OZ based on version number, like so:
import {SafeMath} from "@openzeppelin-3.4.2/contracts/math/SafeMath.sol";
other versions of OZ are also present: import "@openzeppelin-4.3.0/contracts/access/Ownable.sol"; import "@openzeppelin-4.3.0/contracts/security/ReentrancyGuard.sol";
This is in a situation where certain contract dependency files need to use lower solidity versions and using pragma solidity >=0.6.0 <0.9.0 does not work in the OZ 3.4.2 SafeMath file (required for older .sol files in deployment) due to unchecked error.
different versions of OZ are in the ape.config file: dependencies:
however, when loading VS Code instance, env slows down due to package not being found in cache and this error appears Error: Dependency openzepplin-3.4.2 is declared on config file, but we could not find it inside [directory]. Try installing your dependencies ..
however, running ape compile sometimes shows the dependency is present Compiling using Solidity compiler '0.6.10+commit.00c0fcaf'. Input: contracts/.cache/openzeppelin-3.4.2/3.4.2
Screen shot of packages folder is included. Multiple OZ versions are present.
When commenting out that version of OZ (3.4.2) from the ape.config file, and running ape compile -f this error appears: Source "@openzeppelin-3.4.2/contracts/math/SafeMath.sol" not found: File not found. import {SafeMath} from "@openzeppelin-3.4.2/contracts/math/SafeMath.sol";
Please include information like:
How can it be fixed?
Resolving contracts/.cache file listing versus packages
Fill this in if you have ideas on how the bug could be fixed.