-
Notifications
You must be signed in to change notification settings - Fork 970
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Bug-Candidate]: Slither python API contract with remappings file #2530
Comments
There should be a config file that is available if you run Note, this is likely necessary regardless of configuring remappings given Slither needs the AST of all of Router's dependencies and can't be run on just |
what is the config file of running slither 0x51bdbfcd7656e2c25ad1bc8037f70572b7142ecc. Is it the same as Setting.json in |
No, it is the |
As @0xalpharush mentioned, you can run Slither (or crytic-compile if you don't care about the analysis) directly on the etherscan copy of the contracts as well:
After that runs, you'll get a folder on |
I got the crytic_compile.config.json. But when I use it in my python3 code, It still went wrong. My code
The crytic_compile.config.json
How do I use this config file? |
I have downloaded all sol file in my local system. |
Describe the issue:
I use the slither by python API. If the contract use a mappings, Slither will go wrong. The reason is also "file not found, Searched the following locations: "".
The contract address is 0x51bdbfcd7656e2c25ad1bc8037f70572b7142ecc. In the Router.sol file,
import {Math} from "openzeppelin-math/Math.sol";
But the openzeppelin-math/Math.sol is remapped to lib/openzeppelin-contracts/contracts/utils/math/Math.sol
I use etherscan API to download the contract source code, the file system is like
https://etherscan.deth.net/address/0x51bdbfcd7656e2c25ad1bc8037f70572b7142ecc
My python3 code is
from slither.slither import Slither
ctsl = Slither('src/router/Router.sol')
How to solve this remappings problem in slither API?
Code example to reproduce the issue:
from slither.slither import Slither
ctsl = Slither('src/router/Router.sol')
Version:
0.10.3
Relevant log output:
The text was updated successfully, but these errors were encountered: