Open alphastorm opened 5 months ago
Hi - thanks for your report.
I was able to reproduce the problem on my end.
It appears the problem comes from the {build_id}.json
file:
While the input sources map in the document is correct :
"input": {
"language": "Solidity",
"sources": {
"lib/euler-price-oracle/src/adapter/BaseAdapter.sol": ... ,
"lib/euler-price-oracle/src/interfaces/IPriceOracle.sol": ...,
"lib/euler-price-oracle/src/lib/Errors.sol": ... ,
"lib/forge-std/src/interfaces/IERC20.sol": ... ,
"src/Counter.sol": ...
},
The output/sources
contains two more files whose ast
are empty :
"output": {
"sources": {
"lib/euler-price-oracle/src/adapter/BaseAdapter.sol": ...,
"lib/euler-price-oracle/src/interfaces/IPriceOracle.sol": ...,
"lib/euler-price-oracle/src/lib/Errors.sol": ...,
"lib/forge-std/src/interfaces/IERC20.sol": ...,
"src/Counter.sol": ...,
"src/interfaces/IPriceOracle.sol": {
"id": 5,
"ast": {}
},
"src/lib/Errors.sol": {
"id": 6,
"ast": {}
}
Since those two files do not exist, slither
fails to perform its analysis.
Remaining questions :
slither
(or in crytic compile
).I believe this is the same issue as reported in https://github.com/crytic/slither/issues/1622 and blocked on an issue in Foundry https://github.com/foundry-rs/foundry/issues/7591
Describe the issue:
forge
is able to compile the contracts and run the test successfully, butslither
fails to resolve the imports in the dependency even when the--ignore-compile
flag is passed.Code example to reproduce the issue:
Repo: https://github.com/alphastorm/slither-import-breaking
Steps:
forge init
a new repoforge install euler-xyz/euler-price-oracle
euler-price-oracle/=lib/euler-price-oracle/
toremappings.txt
Counter.sol
:import { BaseAdapter, Errors, IPriceOracle } from "euler-price-oracle/src/adapter/BaseAdapter.sol";
Version:
0.10.3
Relevant log output: