GithubHelp home page GithubHelp logo

Mythril Installation Issue about mythril HOT 4 OPEN

ASD-Are avatar ASD-Are commented on June 14, 2024
Mythril Installation Issue

from mythril.

Comments (4)

norhh avatar norhh commented on June 14, 2024

Many of the libraries break when using Windows. Can you try installing docker and using the docker container? I've never had issues when using Mythril with docker.
You can use:
docker pull mythril/myth
And for running a solidity file:
docker run -v $(pwd):/tmp mythril/myth analyze /tmp/contract.sol
You have to use the -v arg to mount your current directory onto the container's \tmp, so the container will have access to your current directory, which has the solidity file. Although I think the syntax for $(pwd) is slightly different for different Windows shells.

I think its equivalent syntax for Powershell is this:
docker run -v ${PWD}:/tmp mythril/myth analyze /tmp/contract.sol

from mythril.

Alleysira avatar Alleysira commented on June 14, 2024

Actually I still find problems, I write a small contract named contract.sol in E:\codespace\smartcontract, when I use your listed commands in powershell, like
PS E:\CodeSpace\SmartContract> docker run -v ${PWD}:/tmp mythril/myth analyze /tmp/contract.sol
I got this error:
mythril.interfaces.cli [ERROR]: Solc experienced a fatal error.
Cannot import url ("/tmp/contract.sol"): File outside of allowed directories.
I also tried this command after reading the file structure:
docker run mythril/myth a /opt/mythril/solidity_examples
/calls.sol
got this error, seems that the tool can't get access to mount file or /opt sol files?
mythril.interfaces.cli [ERROR]: Solc experienced a fatal error.
Cannot import url ("/opt/mythril/solidity_examples/calls.sol"): File outside of allowed directories.

from mythril.

norhh avatar norhh commented on June 14, 2024

PS E:\CodeSpace\SmartContract> docker run -v ${PWD}:/tmp mythril/myth analyze /tmp/contract.sol can you check if the file contract.sol is in the current directory when you run this command?

from mythril.

Alleysira avatar Alleysira commented on June 14, 2024

Thanks for your reply. I ensured that the .sol file is in the current directory. This is the full log of the administrator powershell.

PS E:\CodeSpace\SmartContract> ls
Directory: E:\CodeSpace\SmartContract
Mode                 LastWriteTime         Length Name
d-----         2023/7/25     11:12                ConFuzzius
d-----         2023/7/18     18:29                ContractFuzzer
d-----          2023/8/8     17:34                mythril
d-----         2023/7/19     19:07                smartbugs
-a----          2023/8/8     17:30           9012 BECToken.sol
PS E:\CodeSpace\SmartContract> docker run -v ${PWD}:/tmp mythril/myth analyze /tmp/BECToken.sol
mythril.interfaces.cli [ERROR]: Solc experienced a fatal error.

Cannot import url ("/tmp/BECToken.sol"): File outside of allowed directories. 

By the way, I found it works in my Ubuntu VM, but it will be more convenient if it can directly work on my windows, thanks.

PS E:\CodeSpace\SmartContract> docker run -v ${PWD}:/tmp mythril/myth analyze /tmp/contract.sol can you check if the file contract.sol is in the current directory when you run this command?

from mythril.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.