Skip to content

'ArrayRef' has no attribute 'as_list' #9

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

Closed
RobinStaab opened this issue Jan 15, 2020 · 2 comments
Closed

'ArrayRef' has no attribute 'as_list' #9

RobinStaab opened this issue Jan 15, 2020 · 2 comments

Comments

@RobinStaab
Copy link

Hey,

I wanted to test your tool and tried to run the examples given in tests/data.
In particular, I installed teEther as explained and ran

python3 bin/gen_exploit.py tests/data/test1.contract.code 0x1234 0x1000 +1000

which gave me the following output (I think after it found an exploit):

python3 bin/gen_exploit.py tests/data/test1.contract.code 0x1234 0x1000 +1000
INFO:root:Finished all paths
INFO:root:Found 1 CALL instructions
INFO:root:Finished all paths
INFO:root:CALL: (  205)   cd:    f1    -7 +1 = -6    CALL
INFO:root:Path: 0->3d->47->85->9e->cd
WARNING: unknown parameter 'model_compress'
Legal parameters are:
  auto_config (bool) (default: true)
  debug_ref_count (bool) (default: false)
  dot_proof_file (string) (default: proof.dot)
  dump_models (bool) (default: false)
  memory_high_watermark (unsigned int) (default: 0)
  memory_max_alloc_count (unsigned int) (default: 0)
  memory_max_size (unsigned int) (default: 0)
  model (bool) (default: true)
  model_validate (bool) (default: false)
  proof (bool) (default: false)
  rlimit (unsigned int) (default: 0)
  smtlib2_compliant (bool) (default: false)
  stats (bool) (default: false)
  timeout (unsigned int) (default: 4294967295)
  trace (bool) (default: false)
  trace_file_name (string) (default: z3.log)
  type_check (bool) (default: true)
  unsat_core (bool) (default: false)
  verbose (unsigned int) (default: 0)
  warning (bool) (default: true)
  well_sorted_check (bool) (default: false)

Traceback (most recent call last):
  File "bin/gen_exploit.py", line 107, in <module>
    config['savefile'], config['initial-storage'], config['initial-balance'], config['flags'])
  File "bin/gen_exploit.py", line 47, in main
    initial_storage, initial_balance, flags=flags)
  File "/usr/local/lib/python3.6/dist-packages/teether-0.1.5-py3.6.egg/teether/exploit.py", line 201, in combined_exploit
  File "/usr/local/lib/python3.6/dist-packages/teether-0.1.5-py3.6.egg/teether/exploit.py", line 167, in attempt_exploit
  File "/usr/local/lib/python3.6/dist-packages/teether-0.1.5-py3.6.egg/teether/constraints.py", line 49, in model_to_calls
  File "/usr/local/lib/python3.6/dist-packages/teether-0.1.5-py3.6.egg/teether/constraints.py", line 21, in array_to_array
AttributeError: 'ArrayRef' object has no attribute 'as_list' 

I'm running on Ubuntu 18.04 with python 3.6.
Am I doing something wrong?

@nescio007
Copy link
Owner

Hi,
thanks for reporting, it seems that z3 has changed their interface slightly (I think it is related to Z3Prover/z3#2704).
As a quickfix you can downgrade z3 to version 4.8.0.0.post1 (pip install z3-solver==4.8.0.0.post1).

I'll update here if I can fix it to work with the newest version.

@nescio007
Copy link
Owner

Hi,
the latest comit (5999d7f) should fix this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants