-
Notifications
You must be signed in to change notification settings - Fork 983
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
AttributeError: 'NoneType' object has no attribute 'is_analyzed' #123
Comments
The issue is that the json you manually created is missing a part of the code. If you look at the inheritance of
Slither needs access to all the source code to work, so you need to add the definition of Out of curiosity, is there a particular reason from crafting the json manually? |
I used truffle to build the JSON as an external compile step. I need an older compiler for this contract than the one my own contracts are using.
Can you recommend a better way to build this JSON?
… On Jan 8, 2019, at 12:47 AM, Feist Josselin ***@***.***> wrote:
The issue is that the json you manually created is missing a part of the code.
If you look at the inheritance of GasToken2:
"linearizedBaseContracts": [
536,
722
],
536 is the id of GasToken2
722 is the id of Rlp, but the its definition is not present in the json
Slither needs access to all the source code to work, so you need to add the definition of Rlp.
If you compile both contracts separately, the id generated may differ (the AST of Rlp can give an id different than 722), so you will need to manually update them.
Out of curiosity, is there a particular reason from crafting the json manually?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or mute the thread.
|
So that error was happening with the output from this solc command:
I think compact is missing some things that are needed though and I added rlp.sol to the command.
Then I prepend the bin output with "0x" and rename it to *.truffle-bin. Truffle is building it with this config:
But now I get this error:
I feel like I am making this more complex than it should be. What's the right way to build the json for slither to parse? |
Could you share the code that your are trying to analyze? I am not sure to understand why you need a manual json editing. If your project is a truffle project, running |
My project is a truffle project. The problem is that I'm also including other projects (just https://github.com/projectchicago/gastoken for now) that aren't truffle projects and I need to build them for my test blockchain, too. It's likely that this is an issue with truffle's external compiler step or my use of it. I'm not manually editing JSON. Truffle is doing that part. I'm just passing output from solc to truffle like I thought I was supposed to. I'm able to deploy the contract, so I know that part of solc/truffle output is correct. More detail here: trufflesuite/truffle#1607 |
I see! I am not entirely sure about the error:
Is it possible that the generated json mixes the solc compact ast format with the legacy one? If it folows only the compact ast format, each node should have a If you have a minimal codebase that produces the same error, I can try to reproduce it |
Oh, so we do want Thanks for the help! |
Oh right. Switching to
|
Could you check that all the ids in the |
I'm pretty new to this, but I think the definition for rlp is missing. I guess adding rlp.sol to the end of my solc command isn't enough. https://gist.github.com/WyseNynja/e76a61f1564650ba34a037648d5fcc60 |
I am able to have slither working, but its a bit tricky:
by
Truffle should generate the |
That is certainly trickier than I was hoping for. Your directions pointed me to a typo that got what I have working though! A bad copy/paste had me using the same ast file for both GST2 and rlp. ./scripts/build-external.sh
truffle-config.js
I have a feeling that my truffle-config.js is going to get pretty long if I have to do this for all the upstream projects. Luckily 0x has a very helpful migrate script that I can use instead of manually compiling like I'm doing for gastoken. |
I created the contract json in a very non-standard way, so I'm sure that is at the heart of the issue. It is probably missing a section since I only include the abi, ast, and bytecode. What else does slither need?
The text was updated successfully, but these errors were encountered: