GithubHelp home page GithubHelp logo

Comments (8)

norhh avatar norhh commented on June 14, 2024 1

can you try reducing collisions in remappings and retry? You can remap @openzeppelin directly to ../node_modules/@openzeppelin/ or remap @openzeppelin/contracts to ../node_modules/@openzeppelin/contracts

from mythril.

jasmeenPedalsup avatar jasmeenPedalsup commented on June 14, 2024

@norhh I reduce collision in remappings and retry and it's working but now I am getting other error

{
  "remappings": [ 
    "@openzeppelin/=../node_modules/@openzeppelin/",
    "@uniswap/v2-periphery/contracts/interfaces/=../node_modules/@uniswap/v2-periphery/contracts/interfaces/",
    "@uniswap/v2-core/contracts/interfaces/=../node_modules/@uniswap/v2-core/contracts/interfaces/"
  ],
  "optimizer": {
    "enabled": true
 
  }
}
mythril.mythril.mythril_analyzer [CRITICAL]: Exception occurred, aborting analysis. Please report this issue to the Mythril GitHub page.
Traceback (most recent call last):
  File "/home/pedalsup/.local/lib/python3.10/site-packages/mythril/mythril/mythril_analyzer.py", line 151, in fire_lasers
    sym = SymExecWrapper(
  File "/home/pedalsup/.local/lib/python3.10/site-packages/mythril/analysis/symbolic.py", line 182, in __init__
    self.laser.sym_exec(
  File "/home/pedalsup/.local/lib/python3.10/site-packages/mythril/laser/ethereum/svm.py", line 206, in sym_exec
    self.execute_transactions(created_account.address)
  File "/home/pedalsup/.local/lib/python3.10/site-packages/mythril/laser/ethereum/svm.py", line 232, in execute_transactions
    self._execute_transactions_incremental(
  File "/home/pedalsup/.local/lib/python3.10/site-packages/mythril/laser/ethereum/svm.py", line 302, in _execute_transactions_incremental
    execute_message_call(self, address, func_hashes=func_hashes)
  File "/home/pedalsup/.local/lib/python3.10/site-packages/mythril/laser/ethereum/transaction/symbolic.py", line 151, in execute_message_call
    laser_evm.exec()
  File "/home/pedalsup/.local/lib/python3.10/site-packages/mythril/laser/ethereum/svm.py", line 344, in exec
    new_states, op_code = self.execute_state(global_state)
  File "/home/pedalsup/.local/lib/python3.10/site-packages/mythril/laser/ethereum/svm.py", line 445, in execute_state
    ).evaluate(global_state)
  File "/home/pedalsup/.local/lib/python3.10/site-packages/mythril/laser/ethereum/instructions.py", line 265, in evaluate
    result = instruction_mutator(global_state)
  File "/home/pedalsup/.local/lib/python3.10/site-packages/mythril/laser/ethereum/instructions.py", line 196, in wrapper
    new_global_states = self.call_on_state_copy(func, func_obj, global_state)
  File "/home/pedalsup/.local/lib/python3.10/site-packages/mythril/laser/ethereum/instructions.py", line 131, in call_on_state_copy
    return func(func_obj, global_state_copy)
  File "/home/pedalsup/.local/lib/python3.10/site-packages/mythril/laser/ethereum/instructions.py", line 1090, in codecopy_
    if code.startswith("0x"):
AttributeError: 'tuple' object has no attribute 'startswith'

from mythril.

norhh avatar norhh commented on June 14, 2024

can you run it with the develop version? You can install develop version by cloning it and doing either:
python setup.py install
or
pip install .

from mythril.

jasmeenPedalsup avatar jasmeenPedalsup commented on June 14, 2024

I am getitng below error while running python setup.py install

Installed /usr/local/lib/python3.10/dist-packages/mythril-0.24.1-py3.10.egg
Processing dependencies for mythril==0.24.1
error: eth-utils 2.3.0 is installed but eth-utils<2,>=1.3.0 is required by {'py-ecc'}

from mythril.

norhh avatar norhh commented on June 14, 2024

I'll look into the conflicts.
To temporarily circumvent this, can you try directly executing the mythril script, use ./myth (or whatever path the cloned repo is e.g: /path/myth) over directly running the myth command

from mythril.

norhh avatar norhh commented on June 14, 2024

Alternatively, you can try v0.24.2

from mythril.

jasmeenPedalsup avatar jasmeenPedalsup commented on June 14, 2024

@norhh Thanks for the help me.
now I am using bytecode to analyze contracts
myth a --bin -f test.asm >> outpuy2.json

it will generate below output

==== State access after external call ====
SWC ID: 107
Severity: Low
Contract: MAIN
Function name: _function_0x92a13eda
PC address: 1167
Estimated Gas Usage: 24901 - 140223
Write to persistent state following external call
The contract account state is accessed after an external call to a fixed address. To prevent reentrancy issues, consider accessing the state only before the call, especially if the callee is untrusted. Alternatively, a reentrancy lock can be used to prevent untrusted callees from re-entering the contract in an intermediate state.
--------------------
Initial State:

Account: [ATTACKER], balance: 0x0, nonce:0, storage:{}
Account: [SOMEGUY], balance: 0x0, nonce:0, storage:{}

Transaction Sequence:

Caller: [CREATOR], function: unknown, txdata: 0x92a13ed 

can i get real function name from _function_0x92a13eda?

another question is Is mythril use slither internally or it is independent from slither?

from mythril.

norhh avatar norhh commented on June 14, 2024

It's independent of slither.
Bytecode does not have function information, you can get function-hash list by running solc --hashes file.sol <a bunch of args for handling imports for remappings>
does v0.24.2 crash throw this crash? since I pushed some changes yesterday which shouldn't result in this crash

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.