ivicanikolicsg / MAIAN

MAIAN: automatic tool for finding trace vulnerabilities in Ethereum smart contracts
MIT License
555 stars 157 forks source link

ImportError: cannot import name 'KeepAliveRPCProvider' from 'web3' (/usr/local/lib/python3.7/site-packages/web3/__init__.py) #26

Open sunbeomso opened 5 years ago

sunbeomso commented 5 years ago

I failed to run MAIAN on both Mac and Ubuntu with an error message in the title. Is there anyone who resolved the similar issue?

The answers in #16 are unclear to me.

Ashwaryakr commented 5 years ago

I am also getting same error, any help would be appreciated.

devcoinfet commented 5 years ago

the best luck i have had is using a docker container that had MAIAN on it

https://hub.docker.com/r/cryptomental/maian-augur-ci

do a docker pull

docker pull cryptomental/maian-augur-ci

get that bad boy running and drop into a bash shell using it and under tools You can get to maian

enderphan94 commented 5 years ago

@devcoinfet I ran this command after pulling them out sudo docker run -i cryptomental/maian-augur-ci .It just hanged and did nothing. Any ideas?

devcoinfet commented 5 years ago

all I can suggest is to go to docker directly grab cryptomental maian tool and just docker run it MAIAN etc and it will work if you would like I can help you install it I wouldn't mind helping if You have an issue

enderphan94 commented 5 years ago

Tks for that, but I've already pulled them onto my local machine, how can I fire it up? The above command line I mentioned didn't work.

devcoinfet commented 5 years ago

run the following commands on a fresh kali vps I am using onehostcloud.hosting

They offer 16 dollar a month vps with kali linux and they work great.

1.)curl -fsSL https://download.docker.com/linux/debian/gpg | apt-key add - 2.)echo 'deb [arch=amd64] https://download.docker.com/linux/debian buster stable' > /etc/apt/sources.list.d/docker.list

3.)apt-get update

4.)apt-get remove docker docker-engine docker.io

5.)apt-get install docker-ce

now test that all that went ok, use the exact command below

docker run hello-world

output of above command should look as follows

docker run hello-world Unable to find image 'hello-world:latest' locally latest: Pulling from library/hello-world 1b930d010525: Pull complete Digest: sha256:6540fc08ee6e6b7b63468dc3317e3303aae178cb8a45ed3123180328bcc1d20f Status: Downloaded newer image for hello-world:latest

Hello from Docker! This message shows that your installation appears to be working correctly.

To generate this message, Docker took the following steps:

  1. The Docker client contacted the Docker daemon.
  2. The Docker daemon pulled the "hello-world" image from the Docker Hub. (amd64)
  3. The Docker daemon created a new container from that image which runs the executable that produces the output you are currently reading.
  4. The Docker daemon streamed that output to the Docker client, which sent it to your terminal.

To try something more ambitious, you can run an Ubuntu container with: $ docker run -it ubuntu bash

Share images, automate workflows, and more with a free Docker ID: https://hub.docker.com/

For more examples and ideas, visit: https://docs.docker.com/get-started/

Now that this is out of the way and we have a functional proper install of docker lets install MAIAN

1.)docker pull cryptomental/maian-augur-ci

let the pull complete and all that

docker pull cryptomental/maian-augur-ci Using default tag: latest latest: Pulling from cryptomental/maian-augur-ci 297061f60c36: Pull complete e9ccef17b516: Pull complete dbc33716854d: Pull complete 8fe36b178d25: Pull complete 686596545a94: Pull complete d9e4fa657851: Pull complete 3d2ddddda059: Pull complete 33634fb74dc7: Pull complete 29360afad3e1: Pull complete ea3cad5aab8a: Pull complete b3af110e007a: Pull complete 91f81720004e: Pull complete b4e47447f95c: Pull complete 64c7eb0de898: Pull complete Digest: sha256:e838a693f05fded4d8c57758307632090d48d1d0b097057cebaf182479a95aa0 Status: Downloaded newer image for cryptomental/maian-augur-ci:latest docker.io/cryptomental/maian-augur-ci:latest

Now we want to run this thing so lets load a contract we need one so we go find one https://etherscan.io/address/0xf3586684107ce0859c44aa2b2e0fb8cd8731a15a#code

The above is just example of one I grab off etherscan for example I know this is a bit confusing now run these commands

1.)docker image ls -> this shows us the names of images we pulled

2.)docker run -i -t cryptomental/maian-augur-ci:latest /bin/bash -> this is mine should be similar bash root@e1141a8cf62f:/#


so we are actually in the MAIAN Tool bash shell now in that docker container in an isolated test env So lets load that Contract. the below should be your command to run MAIAN 1.)root@e1141a8cf62f:/MAIAN/tool# python maian.py -c 2 --soliditycode test.sol KaratBankCoin

You need to look into MAIAN help section for individual arguments etc but that is how you do it pass it the contract code and the contract name I am very new to this and had to figure this out again to help you but now we have the steps to make this work 100%

==================================================================================================== [ ] Compiling Solidity contract from the file test.sol ... Done /usr/local/lib/python2.7/dist-packages/web3/main.py:130: DeprecationWarning: Python 2 support is ending! Please upgrade to Python 3 promptly. Support will end at the beginning of 2018. category=DeprecationWarning, /usr/local/lib/python2.7/dist-packages/web3/main.py:130: DeprecationWarning: Python 2 support is ending! Please upgrade to Python 3 promptly. Support will end at the beginning of 2018. category=DeprecationWarning, [ ] Connecting to PRIVATE blockchain emptychain ..............................................................................................

enderphan94 commented 5 years ago

docker run -i -t cryptomental/maian-augur-ci:latest /bin/bash. This is what I needed. Thanks!

devcoinfet commented 5 years ago

no problem this took me a few weeks before to get right I actually just learned docker I figured as much but posted that mostly for myself when i need help again or others I was assuming You had gotten that far per your comments glad I could help sorry I took so long Long day at work

enderphan94 commented 5 years ago

Really appreciate it man!. Seems MAIAN no longer be developed. A year since already!

zak100 commented 3 years ago

Hi @devcoinfet, I am working ubuntu 20.04 virtual created on ubuntu 18.04. I am getting error on deb[arch=amd64]..... command,

sboxes@osboxes:~$ sudo su root@osboxes:/home/osboxes# curl -fsSL https://download.docker.com/linux/debian/gpg | apt-key add - OK root@osboxes:/home/osboxes# echo 'deb[arch=amd64] https://download.docker.com/linux/debian buster stable'>/etc/apt/sources.list.d/docker.list root@osboxes:/home/osboxes# apt-get update E: Type 'deb[arch=amd64]' is not known on line 1 in source list /etc/apt/sources.list.d/docker.list E: The list of sources could not be read. root@osboxes:/home/osboxes# echo 'deb[arch=amd64] https://download.docker.com/linux/debian buster stable'>/etc/apt/sources.list.d/docker.list root@osboxes:/home/osboxes# apt-get update E: Type 'deb[arch=amd64]' is not known on line 1 in source list /etc/apt/sources.list.d/docker.list E: The list of sources could not be read. root@osboxes:/home/osboxes# zulfi6000@yahoo.com

zak100 commented 3 years ago

Hi @devcoinfet, I am able to execute all the above commands on my ubuntu 18.04 real machine. But now I can't understand where to find test.sol and where to store karatBankCoin contract. I am getting following error:

[ ] Compiling Solidity contract from the file test.sol ... [-] Contract file test.sol does NOT exist [-] Contract KaratBankCoin does NOT exist root@aeab033cf281:/MAIAN/tool#

Please guide me: zulfi6000@yahoo.com

gsalzer commented 2 years ago

Try the fork at https://github.com/smartbugs/MAIAN, which updates Maian to current versions of Python3, web3 and z3.

wwulftange commented 2 years ago

Hi @devcoinfet, I am able to execute all the above commands on my ubuntu 18.04 real machine. But now I can't understand where to find test.sol and where to store karatBankCoin contract. I am getting following error:

[ ] Compiling Solidity contract from the file test.sol ... [-] Contract file test.sol does NOT exist [-] Contract KaratBankCoin does NOT exist root@aeab033cf281:/MAIAN/tool#

Please guide me: zulfi6000@yahoo.com

What you need to do is copy the contract into the MAIAN container. Use this code in your terminal to copy your contract into your container. docker cp /yourpath/contract.sol container_id:/MAIAN/tool

gsalzer commented 2 years ago

Alternatively, you might want to try Smartbugs, a framework for executing analysis tools on contracts. Among the supported tools, there is also Maian.