AttributeError: 'BitVecRef' object has no attribute 'as_long'
See original GitHub issueDescription
How to Reproduce
$ myth -x Tokensale.sol
Traceback (most recent call last):
File "/home/pierce403/.local/lib/python3.6/site-packages/mythril/laser/ethereum/util.py", line 86, in get_concrete_int
return simplify(item).as_long()
AttributeError: 'BitVecRef' object has no attribute 'as_long'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/local/bin/myth", line 11, in <module>
sys.exit(main())
File "/home/pierce403/.local/lib/python3.6/site-packages/mythril/interfaces/cli.py", line 397, in main
max_transaction_count=args.max_transaction_count,
File "/home/pierce403/.local/lib/python3.6/site-packages/mythril/mythril.py", line 470, in fire_lasers
issues = fire_lasers(sym, modules)
File "/home/pierce403/.local/lib/python3.6/site-packages/mythril/analysis/security.py", line 20, in fire_lasers
issues += module.execute(statespace)
File "/home/pierce403/.local/lib/python3.6/site-packages/mythril/analysis/modules/transaction_order_independence.py", line 26, in execute
changing_sstores = list(_get_influencing_sstores(statespace, interesting_storages))
File "/home/pierce403/.local/lib/python3.6/site-packages/mythril/analysis/modules/transaction_order_independence.py", line 114, in _get_influencing_sstores
index = util.get_concrete_int(index)
File "/home/pierce403/.local/lib/python3.6/site-packages/mythril/laser/ethereum/util.py", line 88, in get_concrete_int
raise TypeError("Got a symbolic BitVecRef")
TypeError: Got a symbolic BitVecRef
From https://github.com/ConsenSys/devcon4-playground/blob/master/exercise2/contracts/Tokensale.sol
Expected behavior
Should output solidity bugs rather than python bugs.
Environment
pierce403@penguin:~$ myth --version
Mythril version v0.19.3
pierce403@penguin:~$ solc --version
solc, the solidity compiler commandline interface
Version: 0.4.24+commit.e67f0147.Linux.g++
pierce403@penguin:~$ python -V
Python 2.7.13
pierce403@penguin:~$ uname -a
Linux penguin 4.14.65-05969-g6f2926628697 #1 SMP PREEMPT Tue Sep 4 16:08:40 PDT 2018 x86_64 GNU/Linux
Issue Analytics
- State:
- Created 5 years ago
- Comments:7 (2 by maintainers)
Top Results From Across the Web
AttributeError: 'BitVecRef' object has no attribute 'as_long ...
AttributeError : 'BitVecRef' object has no attribute 'as_long' #661 ... a symbolic BitVecRef") TypeError: Got a symbolic BitVecRef.
Read more >z3py error when converting int to bitvec - Stack Overflow
but I always get an error saying " 'Ast' object has no attribute 'ref' ", it seems this function can only convert integer...
Read more >Why am I getting AttributeError: Object has no attribute?
PYTHON : Why am I getting AttributeError : Object has no attribute ? [ Gift : Animated Search Engine ...
Read more >Python AttributeError — What is it and how do you fix it?
AttributeError : '***' object has no attribute '***'What is an AttributeError in Python? What can you do to fix it? When does it...
Read more >AttributeError: 'module' object has no attribute and ImportError
This video covers the AttributeError : 'module' object has no attribute and ImportError: No module name errors in Python.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@elopio, Cool, When they become public can you raise a new issue in mythril?
I tried with that PR and it doesn’t crash with type error. Instead it takes a long time and eventually crashes with AssertionError:
I can’t share these contracts yet, but I think they will be public soon and then I can report a new issue.
Thanks!