ucsb-seclab / sailfish

Data and code for the IEEE S&P'22 paper SAILFISH: Vetting Smart Contract State-Inconsistency Bugs in Seconds
47 stars 11 forks source link

when one contract import others, the tool will fail #4

Open smartcontract-detect-yzu opened 1 year ago

smartcontract-detect-yzu commented 1 year ago

INFO] | 2023-02-21 05:19:38 AM | analyzer.UnipilotActiveVault | Version constraints: ['0.7.6'] [INFO] | 2023-02-21 05:19:38 AM | analyzer.UnipilotActiveVault | solc version: v0.7.6 [INFO] | 2023-02-21 05:19:40 AM | analyzer.UnipilotActiveVault | Callgraph generation started! [INFO] | 2023-02-21 05:19:40 AM | analyzer.UnipilotActiveVault | Callgraph generation finished! [INFO] | 2023-02-21 05:19:40 AM | analyzer.UnipilotActiveVault | Interprocedural CFG generation started! [#] Interprocedural CFG generation started for modifier onlyGovernance Traceback (most recent call last): File "contractlint.py", line 77, in analyze_contracts generated_icfg, icfg_objects = generate_icfg(slither_obj, callgraph, graph_dir, dump_graph, log) File "/home/cj/Work/work3/AST/docker_share/sailfish-master/code/static_analysis/analysis/main_helper.py", line 394, in generate_icfg modifier_cfg = ICFG(slither_obj, contract, modifier, callgraph, graph_dir, dump_graph, log) File "/home/cj/Work/work3/AST/docker_share/sailfish-master/code/static_analysis/analysis/icfg.py", line 54, in init self.setup() File "/home/cj/Work/work3/AST/docker_share/sailfish-master/code/static_analysis/analysis/icfg.py", line 69, in setup self.visit_nodes() File "/home/cj/Work/work3/AST/docker_share/sailfish-master/code/static_analysis/analysis/icfg.py", line 159, in visit_nodes vars_used = instr.used AttributeError: 'Node' object has no attribute 'used' cj@cj-YangTianM4000e-17:~/Work/work3/AST/docker_share/s

dipanjan commented 1 year ago

Which contract did you try to analyze? What command line did you use?

smartcontract-detect-yzu commented 1 year ago

like the contract at the address “0x6DEa6e642f7854575eBf6a6c23E43f905d3A2f29” it contains 15 sol files, and i copy all sol files into sailfish-master/code/static_analysis/analysis as: image

if i comile the contract utilize solc, it will be fine: image

then utilize the cmd python contractlint.py -c ShadowLoot.sol -o . -r range -p DAO,TOD -oo -sv cvc4 the whole output looks like: cj@cj-YangTianM4000e-17:~/Work/work3/AST/docker_share/sailfish-master/code/static_analysis/analysis$ python contractlint.py -c ShadowLoot.so l -o . -r range -p DAO,TOD -oo -sv cvc4 [#] Analysing started: ShadowLoot.sol [INFO] | 2023-02-22 01:41:40 AM | analyzer.ShadowLoot | Analysis started at: 2023-02-22 01:41:40 AM /home/cj/.solc-select/artifacts/solc-0.5.1 /home/cj/.solc-select/artifacts/solc-0.4.23 /home/cj/.solc-select/artifacts/solc-0.7.4 /home/cj/.solc-select/artifacts/solc-0.5.3 /home/cj/.solc-select/artifacts/solc-0.8.13 /home/cj/.solc-select/artifacts/solc-0.8.1 /home/cj/.solc-select/artifacts/solc-0.7.1 /home/cj/.solc-select/artifacts/solc-0.8.4 /home/cj/.solc-select/artifacts/solc-0.8.3 /home/cj/.solc-select/artifacts/solc-0.6.1 /home/cj/.solc-select/artifacts/solc-0.5.9 /home/cj/.solc-select/artifacts/solc-0.5.16 /home/cj/.solc-select/artifacts/solc-0.8.5 /home/cj/.solc-select/artifacts/solc-0.5.0 /home/cj/.solc-select/artifacts/solc-0.5.4 /home/cj/.solc-select/artifacts/solc-0.4.24 /home/cj/.solc-select/artifacts/solc-0.4.18 /home/cj/.solc-select/artifacts/solc-0.5.7 /home/cj/.solc-select/artifacts/solc-0.6.10 /home/cj/.solc-select/artifacts/solc-0.5.13 /home/cj/.solc-select/artifacts/solc-0.7.3 /home/cj/.solc-select/artifacts/solc-0.6.12 /home/cj/.solc-select/artifacts/solc-0.8.2 /home/cj/.solc-select/artifacts/solc-0.5.5 /home/cj/.solc-select/artifacts/solc-0.5.12 /home/cj/.solc-select/artifacts/solc-0.7.2 /home/cj/.solc-select/artifacts/solc-0.6.2 /home/cj/.solc-select/artifacts/solc-0.5.2 /home/cj/.solc-select/artifacts/solc-0.8.9 /home/cj/.solc-select/artifacts/solc-0.4.25 /home/cj/.solc-select/artifacts/solc-0.7.0 /home/cj/.solc-select/artifacts/solc-0.4.17 /home/cj/.solc-select/artifacts/solc-0.4.13 /home/cj/.solc-select/artifacts/solc-0.8.14 /home/cj/.solc-select/artifacts/solc-0.8.0 /home/cj/.solc-select/artifacts/solc-0.7.6 /home/cj/.solc-select/artifacts/solc-0.8.6 /home/cj/.solc-select/artifacts/solc-0.6.9 /home/cj/.solc-select/artifacts/solc-0.7.5 /home/cj/.solc-select/artifacts/solc-0.8.15 /home/cj/.solc-select/artifacts/solc-0.5.6 /home/cj/.solc-select/artifacts/solc-0.6.6 /home/cj/.solc-select/artifacts/solc-0.4.16 /home/cj/.solc-select/artifacts/solc-0.5.15 /home/cj/.solc-select/artifacts/solc-0.4.14 /home/cj/.solc-select/artifacts/solc-0.8.11 /home/cj/.solc-select/artifacts/solc-0.4.15 /home/cj/.solc-select/artifacts/solc-0.4.10 /home/cj/.solc-select/artifacts/solc-0.4.12 /home/cj/.solc-select/artifacts/solc-0.4.22 /home/cj/.solc-select/artifacts/solc-0.6.3 /home/cj/.solc-select/artifacts/solc-0.8.7 /home/cj/.solc-select/artifacts/solc-0.5.11 /home/cj/.solc-select/artifacts/solc-0.8.12 /home/cj/.solc-select/artifacts/solc-0.6.4 /home/cj/.solc-select/artifacts/solc-0.8.8 /home/cj/.solc-select/artifacts/solc-0.6.8 /home/cj/.solc-select/artifacts/solc-0.5.14 /home/cj/.solc-select/artifacts/solc-0.4.19 /home/cj/.solc-select/artifacts/solc-0.6.0 /home/cj/.solc-select/artifacts/solc-0.6.5 /home/cj/.solc-select/artifacts/solc-0.8.10 /home/cj/.solc-select/artifacts/solc-0.4.11 /home/cj/.solc-select/artifacts/solc-0.6.7 /home/cj/.solc-select/artifacts/solc-0.4.20 /home/cj/.solc-select/artifacts/solc-0.6.11 /home/cj/.solc-select/artifacts/solc-0.5.8 /home/cj/.solc-select/artifacts/solc-0.5.17 /home/cj/.solc-select/artifacts/solc-0.4.21 /home/cj/.solc-select/artifacts/solc-0.4.26 /home/cj/.solc-select/artifacts/solc-0.5.10 ANTLR runtime and generated code versions disagree: 4.9.2!=4.7.2 ANTLR runtime and generated code versions disagree: 4.9.2!=4.7.2 line 42:8 extraneous input 'payable' expecting {'~', 'from', '{', '}', '(', 'for', 'function', '[', 'address', 'mapping', 'calldata', 'if', 'while', 'assembly', 'do', 'return', 'throw', 'emit', 'var', 'bool', 'string', 'byte', '++', '--', 'new', '+', '-', 'after', 'delete', '!', Int, Uint, Byte, Fixed, Ufixed, BooleanLiteral, DecimalNumber, HexNumber, HexLiteral, 'break', 'continue', Identifier, StringLiteral} [INFO] | 2023-02-22 01:41:40 AM | analyzer.ShadowLoot | Version constraints: ['>=0.8.4'] [INFO] | 2023-02-22 01:41:40 AM | analyzer.ShadowLoot | solc version: v0.8.4 [INFO] | 2023-02-22 01:41:41 AM | analyzer.ShadowLoot | Callgraph generation started! [INFO] | 2023-02-22 01:41:41 AM | analyzer.ShadowLoot | Callgraph generation finished! [INFO] | 2023-02-22 01:41:41 AM | analyzer.ShadowLoot | Interprocedural CFG generation started! [#] Interprocedural CFG generation started for modifier onlyOwner Traceback (most recent call last): File "contractlint.py", line 77, in analyze_contracts generated_icfg, icfg_objects = generate_icfg(slither_obj, callgraph, graph_dir, dump_graph, log) File "/home/cj/Work/work3/AST/docker_share/sailfish-master/code/static_analysis/analysis/main_helper.py", line 394, in generate_icfg modifier_cfg = ICFG(slither_obj, contract, modifier, callgraph, graph_dir, dump_graph, log) File "/home/cj/Work/work3/AST/docker_share/sailfish-master/code/static_analysis/analysis/icfg.py", line 54, in init self.setup() File "/home/cj/Work/work3/AST/docker_share/sailfish-master/code/static_analysis/analysis/icfg.py", line 69, in setup self.visit_nodes() File "/home/cj/Work/work3/AST/docker_share/sailfish-master/code/static_analysis/analysis/icfg.py", line 159, in visit_nodes vars_used = instr.used AttributeError: 'Node' object has no attribute 'used' cj@cj-YangTianM4000e-17:~/Work/work3/AST/docker_share/sailfish-master/code/static_analysis/analysis$