Issue: Cannot resolve @OpenZeppelin imports with certoraRun despite packages/packages_path parameters
Hi team,
I'm encountering an issue with certoraRun when trying to compile Solidity files that use OpenZeppelin imports with alias paths like @openzeppelin/....
Background:
In regular solc, I can use --include-path node_modules to tell the compiler to search in the node_modules directory when it encounters alias imports like @openzeppelin/contracts/....
Problem:
With certoraRun, I've tried using both the packages and packages_path parameters, but neither seems to achieve the same effect. I've also set $NODE_PATH to point to my node_modules directory, but the compilation still fails with:
solc had an error:
ParserError: Source "@openzeppelin/contracts-upgradeable/utils/ReentrancyGuardUpgradeable.sol" not found: File not found. Searched the following locations: "".
--> /mnt/c/Users/chenxi/PycharmProjects/PropertyAgent/zkContracts/1.btcd-stablecoins/btcd-stablecoins/contracts/btcdVault/BTCDVault.sol:4:1:
|
4 | import "@openzeppelin/contracts-upgradeable/utils/ReentrancyGuardUpgradeable.sol";
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Question:
What's the correct way to configure certoraRun to handle alias imports like @openzeppelin/... and make it search in the node_modules directory? Is there an equivalent to solc's --include-path parameter for certoraRun?
Setup:
- OpenZeppelin packages are properly installed in
node_modules
- Regular solc compilation works fine with
--include-path node_modules
- The issue only occurs when using certoraRun
Any guidance would be greatly appreciated!
Issue: Cannot resolve @OpenZeppelin imports with certoraRun despite packages/packages_path parameters
Hi team,
I'm encountering an issue with certoraRun when trying to compile Solidity files that use OpenZeppelin imports with alias paths like
@openzeppelin/....Background:
In regular
solc, I can use--include-path node_modulesto tell the compiler to search in thenode_modulesdirectory when it encounters alias imports like@openzeppelin/contracts/....Problem:
With certoraRun, I've tried using both the
packagesandpackages_pathparameters, but neither seems to achieve the same effect. I've also set$NODE_PATHto point to my node_modules directory, but the compilation still fails with:Question:
What's the correct way to configure certoraRun to handle alias imports like
@openzeppelin/...and make it search in thenode_modulesdirectory? Is there an equivalent to solc's--include-pathparameter for certoraRun?Setup:
node_modules--include-path node_modulesAny guidance would be greatly appreciated!